This is a simple code I've gathered to load volumetric NIFTI data into VTK using ITK.
Notice that it should load a bunch of volume formats supported by ITK too.
It is a minimal adaptation of code from here, and here, but it's handy in case you're wondering how to get there ;)
Just follow the instructions:
-
Build VTK and ITK from their git repositories.
cd && mkdir VTK-ITK && cd VTK-ITK git clone git://vtk.org/VTK.git && git clone git://vtk.org/VTKData.git git clone git://itk.org/ITK.git && git clone git://itk.org/ITKData.git
-
Run respective CMAKE configuration. Remember to set ITK with Module_ITKVtkGlue = TRUE ❗
-
Run respective
make && make install
-
After that, the following command should work :P
cmake && make && ./nifti-vtk <Path_to_you_nifti_file>
-
Enjoy!