Removing trailing 'frame' query string and allowing usage of first series' instance as thumbnail
This commit is contained in:
1 parent
335c3526cc
commit
ae39f1841d
2 files changed
+10
-2
No files matched your search
+5
-2
@@ -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);
|
||||
|
||||
Reference in new issue
Block a user