Mapping between coordinate position (x,y,z) and voxel index

Hello, Luis,

You can use vtkCellPicker to perform the picking. This class has a method called GetCellId() which returns the run-length cell (or voxel) index. If you need the grid address (I, J, K), you can do:

    uint nI = /* grid's number of columns */
    uint nJ = /* grid's number of rows */
	uint val = index_value;
	uint nynx = nJ * nI;
	uint k = val / nynx;
	val -= (k*nynx);
	uint j = val / nI;
	uint i = val % nI;
    std::cout << "grid address: " << i << ", " << j << ", " << k << std::endl; 

cheers,

Paulo