Standalone Viewer and Reference Lines

362 views
Skip to first unread message

Dave Nascene

unread,
Aug 7, 2017, 12:41:18 PM8/7/17
to cornerstone platform
I can't for the life of me figure out why the reference lines aren't working on the Standalone viewer out of the box.

It appears to me that all the requisite parts are in place, with a metadataProvider seemingly set up properly(?) and refLinesEnabled == true.  
When I log out the contents of OHIF.viewer, it seems like the images all have the imagePlane object set up OK.



I'm not seeing any other obvious differences between the two viewers that would explain why it would work on the main viewer and not the other.
I'd wager I'm missing something important.

Would anyone be willing to help me work out the kinks?

Thanks,
Dave Nascene
Message has been deleted

Rob Lewis

unread,
Aug 16, 2017, 9:13:33 PM8/16/17
to cornerstone platform
Hi Dave,

A fix for this is coming.  In the meantime, check your metadata to see if you're setting something wrong, like rows or columns.  I've seen this before in cases where the API example wasn't extended properly (e.g. always setting rows = 1).  

- Rob

Dave Nascene

unread,
Aug 16, 2017, 10:38:39 PM8/16/17
to cornerstone platform
That does seem to be the case. columns reports the same value for each image in the stack (which I presume is number of pixels in a certain direction), and rows is always set to 1 for all images in all stacks.

This is the vanilla setup, which I have no idea how to fix.

// Create the synchronizer used to update reference lines
OHIF.viewer.updateImageSynchronizer = new cornerstoneTools.Synchronizer('CornerstoneNewImage', cornerstoneTools.updateImageSynchronizer);
OHIF.viewer.metadataProvider = OHIF.cornerstone.metadataProvider;

// Metadata configuration
const metadataProvider = OHIF.viewer.metadataProvider;
cornerstoneTools.metaData.addProvider(metadataProvider.provider.bind(metadataProvider));



Thanks for taking a look,
Dave

Dave Nascene

unread,
Aug 17, 2017, 12:16:42 AM8/17/17
to cornerstone platform
Doh!
I had been using 
RequestStudies.insert({})
in collections.js that requires a hard-coded rows: key/value.  There is even a comment stating:
rows: 1, // TODO: Remove all requirement for this

As images won't load without rows being set, I had left it as a 1 for all images in my laziness, thinking that it would be taken care of down the line, which it wasn't.

And I figured out why rows : 1 wasn't being overwritten by the Metadataprovider. It is due to the order of the ||

updateMetadata(image) { ...
        imageMetadata
.instance.rows = imageMetadata.instance.rows || image.rows;
//Should be:
        imageMetadata
.instance.rows = image.rows || imageMetadata.instance.rows;

And beautiful scout lines descended from the heavens! Hopefully that switch to fix the Standalone viewer doesn't break anything else.

Sincerely,
Dave
Reply all
Reply to author
Forward
0 new messages