Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Synchronizing crosshairs tool position between multiple Nifti images? #13

Open
jussimattila opened this issue Feb 5, 2020 · 1 comment

Comments

@jussimattila
Copy link

Hi. I have successfully integrated Nifti loader in our application but one feature is not working as I though it would: reference lines/crosshairs across different images.

When I view a single image, reference lines and crosshairs work wonderfully. But if I enable a viewport showing a different image, then the mapping between views is somewhat broken.

In this image, I have a synchronizer applied to all viewports. Bottom right viewport shows an image with 5 mm slices, all the other viewports show another 1 mm resolution image. I have moved crosshairs in the middle of an eye, but bottom right viewport has clearly not moved to the correct slice.
image

In this image, I moved the crosshairs to the top of the ventricles, and the bottom right viewport has moved to the top of the skull already.
image

The raw Nifti data I have loaded in the application is fine, in mricron the images sync up perfectly. Clicking on an eye in either image syncs the other image to the same position:
image

An additional problem is that reference lines are not visible in the bottom right viewport (see the example screenshots above). If I add another viewport for the second image (axial image in bottom left), reference lines sharing an image show up:
image

And as can be seen above, synchronization between images is not working here either. Setting the crosshairs in the bottom right viewport causes the top row (with different image) reference lines to be drawn in an incorrect position and incorrect slice to be shown in the top left viewport.

The question is: Is there a bug in the nifti loader where the scaling of the images is not handled correctly (metadata issue between 1 mm and 5 mm slices)? Or is there something with the reference lines tool or crosshairs tool that causes these issues in synchronization between images?

@jussimattila
Copy link
Author

jussimattila commented Feb 5, 2020

I figured out why the reference lines do not show up between different images. Nifti loader sets const frameOfReferenceUID = imageIdObject.filePath;, meaning that images from different paths have different frameOfReferenceUID and the reference lines tool ignores them for that.

const frameOfReferenceUID = imageIdObject.filePath;

I managed to get the reference lines showing by setting a constant wherever frameOfReferenceUID is mentioned in the Nifti loader codes. I think it would be nice if setting a common frameOfReferenceUID for several Nifti images in code was supported.

The primary problem of this issue (incorrect mapping of coordinates between images) is still unclear to me. Is the metadataprovider providing wrong metadata? Or is the crosshairs tool using it wrongly?

@jussimattila jussimattila changed the title Synchronizer between multiple Niftis? Synchronizing crosshairs tool position between multiple Nifti images? Feb 5, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant