ami icon indicating copy to clipboard operation
ami copied to clipboard

[bug] Shifted segmentation and image

Open domidemps opened this issue 6 years ago • 2 comments

Description

The aim is to display a brain segmentation overlapped on a T1 MRI image (both Nifti) using AMI. The problem is that the brain segmentation appears shifted from the T1. However, when I load these images with Papaya web viewer, FreeView or MRView, everything is properly registered.

Live Demo

You can find a minimal live example here (a modified version of the example viewers_labelmap): https://codesandbox.io/s/mqx57mwzlp

Steps to Reproduce

Please load the example with Google Chrome, I think its not working with Mozilla Firefox. Just wait for the images to be loaded and displayed.

Expected Results

Image properly registered, loaded with the Papaya web viewer. papaya_viewer

Actual Results

Image badly registered, loaded with AMI.js (code example given just above) amijs_viewer

Browsers Affected

  • [ ] All
  • [X] Chrome
  • [X] Firefox
  • [ ] Edge
  • [ ] Safari 9
  • [ ] Safari 8
  • [ ] IE 11

Versions

  • AMI: v0.22.0
  • THREEJS: v0.92.23

domidemps avatar Jan 25 '19 09:01 domidemps

I had the same issue using segmentations and a T1 processed by Freesurfer. I addressed it by moving each individual frame in the stack. stack._frame.forEach(frame => { frame._imagePosition = [-128, 128, 128] })

TheBrainChain avatar Dec 10 '19 20:12 TheBrainChain

This seems a good fix, @TheBrainChain! Thank you for the suggestion :+1: Nevertheless, it would be awesome to find a better fix, I mean, correcting the Nifti parsing that does not seem correct for now.

domidemps avatar Dec 16 '19 09:12 domidemps