[Insight-users] help:How to get the gray value of a special point based ITK or VTK

Luis Ibanez luis.ibanez at kitware.com
Sun Nov 28 23:10:32 EST 2004


Hi D.J.J.

You will find detailed information on how to read the
pixel values from an image in the ITK Software Guide

      http://www.itk.org/ItkSoftwareGuide.pdf

please look at the section 4.1.3 "Accessing Pixel Data",
in pdf-page 64.

The method to use is "GetPixel()" as explained in the Doxygen
documentation of the itk::Image class:
http://www.itk.org/Insight/Doxygen/html/classitk_1_1Image.html

Note that the GetPixel() method is only recommended for reading
sporadic pixels. If you are planning to access all the pixel of
the image, you should use ImageIterators, that are explained in
detail in Chapter 11, pdf-page 481-520.

Note also that the pixels values of the reader will *only* be
valid *after* you invoke "Update()" on the reader.



   Regards,



      Luis



--------------------
杜 建军 wrote:
> friends:
>     I am developping a project based on ITK,VTK and VC6. Now,I want to get the grey value of some points on png/bmp/dicom/jepg images.
>     In ITK, defined ReaderType::Pointer reader = ReaderType::New();,  then reader->SetFileName( csFilePath ); ,so "reader" has had all information about the image. Now, how to get the gray value of a seed point.
>     In VTK, defined vtkImageData *m_vtkImageData; ,when the valuable has the data of image. I meet the same question.
>     give me some advices,please.
> 
> sincerely
>                                                    D.J.J
> 
> 
> ------------------------------------------------------------------------
> 
> _______________________________________________
> Insight-users mailing list
> Insight-users at itk.org
> http://www.itk.org/mailman/listinfo/insight-users





More information about the Insight-users mailing list