1

I am loading CT scan nifti (.nii) images using XTK. I want to modify the default orientation of images and flip them, for example up/down or left/right before rendering (onShowtime). So, how can I get the default orientation and then how can I change it?

enter image description here

Currently, I am using xtk.js since there is a bug in xtk_edge.js possibly in .nii parser. (Uncaught RangeError: Invalid array length)

Adil
  • 28
  • 6
  • can u share ur code which u wrote for edge.js? – Newton Sheikh Nov 06 '13 at 09:26
  • Well I didn’t do any changes in xtk_edge.js; you can download it from http://get.goxtk.com/xtk_edge.js. – Adil Nov 06 '13 at 09:33
  • okay, that's fine. what I am asking is the code u wrote to rotate the image using the edge library. – Newton Sheikh Nov 06 '13 at 09:40
  • I rotate the image simply by calling rendrer.rotate() two times in onShowtime event. But this approach is manual I want to make it dynamic. – Adil Nov 06 '13 at 10:36
  • what do you mean dynamic? can you share the data with us? I want to try it in xtk edge, it should be easy to fix. – Nicolas Nov 06 '13 at 16:32
  • Nicolas, Actually In above image I already know about the direction of image (eyes and nose are downward) So, I can judge that, by rotating it two times clockwise can render it in upward direction. So, by dynamic I mean if I don’t know the initial direction which could be left/right or up/down etc. how would I estimate that how many times I have to call rotate or rotateCounter(). You can access the above (.nii) file from the following link. https://drive.google.com/file/d/0B0P1-NXk0_9PREhmSnZkZExpMGs/edit?usp=sharing – Adil Nov 07 '13 at 06:13
  • The latest XTK should always orient the volume in the right way, I'll have a look at the data – Nicolas Nov 07 '13 at 13:41

1 Answers1

1

The lastest version of XTK should now be working fine. https://github.com/xtk/X/commit/3a28de0294a94b41c44007545ab3a37df556d315

How did you generate this data? If you look at it in Slicer4 or Freeview, it looks the same way as in XTK. We want to look at the data in the Radiological convention. (http://www.grahamwideman.com/gw/brain/orientation/orientterms.htm)

The rotate method do not exist anymore but we might have to put it back at some point... We also want to add the possibility to switch between radiological/neurological conventions easily.

Thanks

Nicolas
  • 2,191
  • 3
  • 29
  • 49
  • Thanks Nicolas! for the fix and explanation. The latest version is now working fine. It will be very helpful if XTK supports both radiological and neurological conventions. – Adil Nov 08 '13 at 06:50