[vtkusers] Get pixel intensity

Chase Yarbrough vergil at gmail.com
Fri Jul 21 20:22:24 EDT 2006


Hi Andres,

Here is one way to do it:

vtkImageData *foo;
int *dimensions = foo->GetDimensions();
pixelValue = 
foo->GetPointData()->GetScalars()->GetTuple1(x+y*dimensions[0]+z*dimensions[0]*dimensions[1]);

Anyone have a better way?

Chase Yarbrough

Andres Munarriz wrote:
> Hi everyone,
>
> I'm pretty sure someone has already posted a similar question if not 
> the same (for this I apologize), but I haven't been able to find such 
> post.  Is there a way to retrieve the pixel intensity at a particular 
> index from a vtkImageData object?  Under ITK one can " make" the index 
> then get the pixelData from it.
>
>
> Thanks in advance,
>
> Andres E. Munarriz Soto
> _______________________________________________
> This is the private VTK discussion list.Please keep messages on-topic. 
> Check the FAQ at: http://www.vtk.org/Wiki/VTK_FAQ
> Follow this link to subscribe/unsubscribe:
> http://www.vtk.org/mailman/listinfo/vtkusers
>




More information about the vtkusers mailing list