My question is how can I extract points from vtkImageData. For example, considering 3D image(labelMap), if in
voxels there are 3 voxel values, I would get the coordinates of those voxels.
vtkImageData->getPoint() return the point coordiantes in physical space. However I want the point coordinates in ijk space then convert them to RAS space.
Thank’s in advance
To get the coordinates in index space [ijk], You would use
Thank’s for the response. What about if I takes I,J,K voxel coordinates directly? where
i in range (kmin, kmax)
j in range (jMin,Jmax)
k in range (iMin,Imax)
Thank’s for your responses.
I will try to clarify more my issue.
I have a label Map (vtkImage Data) on which I have applied “vtkImageLabelOutlines” filter to keep only labelMap boundries.
What I want is to recover the 3D points corresponding to labelMap boundries labelMapBoundry) and store them in vtkPoints array
I am trying athe following test, but I don’t know if it can resolve the issue:
vtkVariant variant = labelMapBoundry->GetPointData()->GetScalars()->GetVariantValue(labelMapBoundry->computePointId(ijk_coords);
then store (i,j,k).
I don’t understand this. You can convert between voxel and physical coordinates as described in the script repository examples I linked above.