Removing trailing 'frame' query string and allowing usage of first series' instance as thumbnail
This commit is contained in:
parent
335c3526cc
commit
ae39f1841d
@ -180,6 +180,11 @@ export const UISettings = new SimpleSchema({
|
||||
type: Boolean,
|
||||
label: 'Define if the series\' images shall be sorted by incoming order. Sort by Instance Number by default.',
|
||||
defaultValue: false
|
||||
},
|
||||
useMiddleSeriesInstanceAsThumbnail: {
|
||||
type: Boolean,
|
||||
label: 'Define if the middle instance of a series will be used as thumbnail. If not, the first instance will be used.',
|
||||
defaultValue: true
|
||||
}
|
||||
});
|
||||
|
||||
|
||||
@ -1,3 +1,4 @@
|
||||
import { Meteor } from 'meteor/meteor';
|
||||
import { Template } from 'meteor/templating';
|
||||
import { Tracker } from 'meteor/tracker';
|
||||
import { Session } from 'meteor/session';
|
||||
@ -8,16 +9,18 @@ Template.imageThumbnail.onCreated(() => {
|
||||
|
||||
// Get the image ID for current thumbnail
|
||||
instance.getThumbnailImageId = () => {
|
||||
const settingPath = 'public.ui.useMiddleSeriesInstanceAsThumbnail';
|
||||
const useMiddleFrame = OHIF.utils.ObjectPath.get(Meteor.settings, settingPath);
|
||||
const stack = instance.data.thumbnail.stack;
|
||||
const lastIndex = (stack.numImageFrames || stack.images.length || 1) - 1;
|
||||
let imageIndex = Math.floor(lastIndex / 2);
|
||||
let imageIndex = useMiddleFrame ? Math.floor(lastIndex / 2) : 0;
|
||||
let imageInstance;
|
||||
|
||||
if (stack.isMultiFrame) {
|
||||
imageInstance = stack.images[0];
|
||||
} else {
|
||||
imageInstance = stack.images[imageIndex];
|
||||
imageIndex = 0;
|
||||
imageIndex = undefined;
|
||||
}
|
||||
|
||||
return imageInstance.getImageId(imageIndex, true);
|
||||
|
||||
Loading…
Reference in New Issue
Block a user