OHIF x Nucleus Code change sync-up
This commit is contained in:
parent
d22094bbe1
commit
541891d2ee
@ -11,3 +11,7 @@ Template.registerHelper('sum', (...values) => {
|
|||||||
_.each(_.initial(values, 1), value => (result += (value | 0)));
|
_.each(_.initial(values, 1), value => (result += (value | 0)));
|
||||||
return result;
|
return result;
|
||||||
});
|
});
|
||||||
|
|
||||||
|
Template.registerHelper('isValidNumber', value => {
|
||||||
|
return typeof value === 'number' && !isNaN(value);
|
||||||
|
});
|
||||||
|
|||||||
@ -21,7 +21,7 @@
|
|||||||
<div>{{#if frameRate}}{{formatNumberPrecision frameRate 2}} FPS{{/if}}</div>
|
<div>{{#if frameRate}}{{formatNumberPrecision frameRate 2}} FPS{{/if}}</div>
|
||||||
<div>{{imageDimensions}}</div>
|
<div>{{imageDimensions}}</div>
|
||||||
<div>
|
<div>
|
||||||
<span>{{#if location}}Loc: {{formatNumberPrecision location 2}} mm{{/if}}</span>
|
<span>{{#if isValidNumber location}}Loc: {{formatNumberPrecision location 2}} mm{{/if}}</span>
|
||||||
<span>{{#if thickness}}Thick: {{formatNumberPrecision thickness 2}} mm{{/if}}</span>
|
<span>{{#if thickness}}Thick: {{formatNumberPrecision thickness 2}} mm{{/if}}</span>
|
||||||
<span>{{#if spacingBetweenSlices}}Spacing: {{formatNumberPrecision spacingBetweenSlices 2}} mm{{/if}}</span>
|
<span>{{#if spacingBetweenSlices}}Spacing: {{formatNumberPrecision spacingBetweenSlices 2}} mm{{/if}}</span>
|
||||||
</div>
|
</div>
|
||||||
|
|||||||
@ -1,6 +1,6 @@
|
|||||||
import { Session } from 'meteor/session';
|
import { Session } from 'meteor/session';
|
||||||
import { OHIF } from 'meteor/ohif:core';
|
import { OHIF } from 'meteor/ohif:core';
|
||||||
// @TODO: import symbols into local scope: Studies and ViewerData
|
// @TODO: import symbols into local scope: ViewerData
|
||||||
|
|
||||||
const getStudyFromStudyInstanceUid = studyInstanceUid => {
|
const getStudyFromStudyInstanceUid = studyInstanceUid => {
|
||||||
// @TypeSafeStudies
|
// @TypeSafeStudies
|
||||||
@ -11,11 +11,11 @@ const getNumberOfStacks = studyInstanceUid => {
|
|||||||
// May not work if the Study contains non-image series?
|
// May not work if the Study contains non-image series?
|
||||||
const study = getStudyFromStudyInstanceUid(studyInstanceUid);
|
const study = getStudyFromStudyInstanceUid(studyInstanceUid);
|
||||||
|
|
||||||
if (!study || !study.series || !study.series.length) {
|
if (!study || !study.displaySets || !study.displaySets.length) {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
return study.series.length;
|
return study.displaySets.length;
|
||||||
};
|
};
|
||||||
|
|
||||||
const getActiveViewportIndex = () => {
|
const getActiveViewportIndex = () => {
|
||||||
@ -48,8 +48,8 @@ const loadSeries = indexCalculator => {
|
|||||||
|
|
||||||
const study = getStudyFromStudyInstanceUid(studyInstanceUid);
|
const study = getStudyFromStudyInstanceUid(studyInstanceUid);
|
||||||
|
|
||||||
const displaySetInstanceUids = study.series.map(series => {
|
const displaySetInstanceUids = study.displaySets.map(displaySet => {
|
||||||
return series.displaySetInstanceUid;
|
return displaySet.displaySetInstanceUid;
|
||||||
});
|
});
|
||||||
|
|
||||||
const currentLoadedStackIndex = displaySetInstanceUids.indexOf(displaySetInstanceUid);
|
const currentLoadedStackIndex = displaySetInstanceUids.indexOf(displaySetInstanceUid);
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user