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

**URL:** <https://discourse.itk.org/t/how-to-get-the-desired-voxel-index-for-region-growing-algorithms-by-using-vtk-voxel-index/4016>\
**Category:** Algorithms\
**Created:** [April 7, 2021, 7:59am UTC](https://discourse.itk.org/t/how-to-get-the-desired-voxel-index-for-region-growing-algorithms-by-using-vtk-voxel-index/4016 "2021-04-07T07:59:36Z")\
**Posts on this page:** 1\
**Showing post:** 2

<div class="post-metadata">

**Author:** ![dzenanz](https://discourse.itk.org/user_avatar/discourse.itk.org/dzenanz/32/1093_2.png) [@dzenanz](https://discourse.itk.org/u/dzenanz)\
**Post date:** [April 7, 2021, 1:44pm UTC](https://discourse.itk.org/t/how-to-get-the-desired-voxel-index-for-region-growing-algorithms-by-using-vtk-voxel-index/4016/2 "2021-04-07T13:44:28Z")

</div>

Get the [world coordinates from VTK](https://discourse.vtk.org/t/mapping-between-coordinate-position-x-y-z-and-voxel-index/5357/4?u=dzenanz), then pass them to `itk::Image`'s method [`TransformPhysicalPointToIndex()`](https://itk.org/Doxygen/html/classitk_1_1ImageBase.html#ae46118e0a604c11e6f1170da7c478f81). 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](https://discourse.itk.org/t/solved-transformindextophysicalpoint-manually/1031).

---

_[View the full topic](https://discourse.itk.org/t/how-to-get-the-desired-voxel-index-for-region-growing-algorithms-by-using-vtk-voxel-index/4016)._
