AXIAL, CORONAL, SAGITAL, Slice Views - VTK model alignment Issue


Trying to load test.nrrd which consists of 3 slice views and 3d model test.vtk in 3d view which is developed using threejs. Issue when I am loading nrrd( 3 slices) file bone structure is not matching with vtk model(Extracted Bone part , Threshold is 187) . Both NRRD and VTK model generated from Slicer python script . I am using the viewer(threejs) from this link Referer link :

Let me know is there I am doing anything wrong while loading or any other parameters I have to capture from slicer to make the both nrrd and vtk alignment perfect. How the nrrd slice bone structure alignment exactly matches with vtk model when we enable slice view in 3d View in Slicer? How to check this what parameters are required?

I am new to this coordinate system and orientation part of the slicer. Please suggest any solution for this I will go through that .


Hi -

Did you read this info:

Slicer saves vtk files in RAS patient space in mm. The nrrd header has information about how the voxels are mapped to patient space.


Hi Pieper,

I have gone through that link but I am unable to do that while loading nrrd
and vtk in 3d view. I understood but unable to implement . Can you help on
this topic?

Hi Pieper,

I observed one more thing. Even I create both nrrd and vtk files from
slicer then these 2 files orientations bone structure matches when I save
these files and load in another viewer then it is not matching.

Hi -

Not sure what your other viewer is doing, but probably it ignores the index to physical transform of the nrrd files.

You could have a look at which is able to correctly load a nrrd file and an stl file generated from Slicer.

Hope that helps,

Hi Pieper,

Thankyou for suggesting the different viewer. Tried this but unable to view
the 3d model , it is loading only nrrd but not vtk file.

Can you please explain me in detail about physical tranform index in nrrd
file?So that I can try out some modifications in current viewer.

I am using teem library to check the nrrd details. Using this command :
unu head nrrdfile. But this command gives basic details like (Space, Size,
type, space directions, space origin, endian, encoding, ).

Is it possible to capture the position of bone structure on nrrd file? If
not let me know is there any other way to get the details while generating
nrrd file from python so that I can use these details to generate VTK file.

Let me know if it is not clear.

Hi Kitlu -

The site accepts stl files, so if you save your model in that format from Slicer 3D along with the nrrd file. You can look open the stl file in a text editor and see the coordinate values in patient space.

The nrrd documentation explains how to go from pixel coordinates into physical space.

This should give you everything you need, together with the Slicer coordinate systems wiki page linked above. Also using the DataProbe in Slicer to interactively see the pixel (IJK) and physical (RAS) coordinates of various structures in your data can help you understand what is going on.

Hope that helps,