[vtkusers] Get pixel intensity

Andres Munarriz munarriz.a at gmail.com
Fri Jul 21 20:35:07 EDT 2006


Hi Chase,

Thanks for your prompt reply.  I'm not quite sure I follow why the  
'z' coordinate should be multiplied by the y-dimension and the 'y'  
coordinate added to the 'x' coordinate and then multiplied by the x- 
dimension.

Could you please elaborate?


Regards,
Andres E. Munarriz Soto


On 21/07/2006, at 7:22PM, Chase Yarbrough wrote:

> 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