How to get the desired voxel index for region growing algorithms by using VTK voxel index?

Hi everyone!
I’m a beginner of ITK and VTK.Now I want to use the 3D region growing algorithms to segment specific tissues.But I’m confused how to get the voxel index.
I have finished the vulume rendering and could get the voxel index in VTK.But somebody said the voxel index of VTK could not be used in ITK because they have different origins.So how can I convert the index of VTK to the index in ITK?

P.S. My dicom files’ physical distance between volxels are not 1, 1, 1(mm).

Thanks, Yangfan

Get the world coordinates from VTK, then pass them to itk::Image's method TransformPhysicalPointToIndex(). That method will compute an itk::Index of the voxel in question.

Significant difference between itk::Image and vtkImageData: VTK’s image does not have orientation, whereas ITK’s does.

A bit deeper discussion is in [SOLVED]TransformIndexToPhysicalPoint manually.

1 Like

Thank you very much

vtkImageData supports orientation since this commit of vtk9.0

2 Likes

I stand corrected. VTK now does support oriented images, but most filters ignore that and the hard work is updating them.

I also forgot to mention that ITK’s voxel coordinates are that of the center, and VTK’s are that of a corner. The above suggested couple of transformations should take care of that difference.

Thanks

It would be good to know that list of filters that ignore orientation. I remember reading in VTK forums or in a git commit, saying there were not too many, but I cannot find the source :frowning: