Accessing pixel values

Charles Law charles.law at kitware.com
Thu Sep 2 07:28:21 EDT 1999


<x-flowed>At 05:44 PM 9/1/99 -0400, Anthony Sacramone wrote:
>I am using vtkImageReader to read in an entire
>volume from a series of 2-D slices (1byte/pixel).
>
>How would I access the raw pixel data ???


from C++ in VTK version 3.0 :

reader->Update();
reader->GetOutput()->GetScalarPointer(x, y, z);

It is also possible to access the raw data from Tcl.  I believe the method is:
vtkImageData::GetScalarComponentAsFloat(x, y, z, component);


>It is segmented into one "blob" or region per slice.
>I would like to find the center of mass of each blob.

I don't think there is a filter that can do this.  vtkMassProperties is the 
closeset, but I believe it only works on triangular meshes, and I don't 
think it computes center of mass.  A vtkImageMassProperties filter that 
computes center of mass would be easy to write.

Charles.






>Thanks in advance.
>
>-ANTHony
>_____________________________________________________
>Anthony Sacramone     Image Recognition Systems Group
>C.S. Draper Labs      Phone: 617-258-4206
>555 Technology Sq     FAX:   617-258-2555
>Cambridge, MA 02139   email: asacramone at draper.com
>
>
>-----------------------------------------------------------------------------
>This is the private VTK discussion list.  Please keep messages on-topic.
>Check the FAQ at: <http://www.automatrix.com/cgi-bin/vtkfaq>
>To UNSUBSCRIBE, send message body containing "unsubscribe vtkusers" to
><majordomo at gsao.med.ge.com>.  For help, send message body containing
>"info vtkusers" to the same address.     Live long and prosper.
>-----------------------------------------------------------------------------



-----------------------------------------------------------------------------
This is the private VTK discussion list.  Please keep messages on-topic.
Check the FAQ at: <http://www.automatrix.com/cgi-bin/vtkfaq>
To UNSUBSCRIBE, send message body containing "unsubscribe vtkusers" to
<majordomo at gsao.med.ge.com>.  For help, send message body containing
"info vtkusers" to the same address.     Live long and prosper.
-----------------------------------------------------------------------------


</x-flowed>



More information about the vtkusers mailing list