[Insight-users] how to get the size of a DICOM image

Yao, Weiguang wyao at hrsrh.on.ca
Wed Aug 24 15:22:33 EDT 2005


Hi, itkPeople:

After successfully reading a 2-dimensional DICOM image by using
ImageFileReader, I want to get the size of the image, say, 512 by 512.
Please tell me how to do this. Thanks a lot!

Weiguang
=== my file ===
typedef short  InputPixelType;

typedef itk::Image< InputPixelType, 2 > InputImageType;
typedef itk::ImageFileReader< InputImageType > ReaderType;

ReaderType::Pointer reader = ReaderType::New( );

reader -> SetFileName(filename);
reader -> Update( );

InputImageType::Pointer image = reader -> GetOutput( );
/*--------------------------------------------------------------------------
--------------
then how to get the size of the image from the object "image"?

Also I use MinimumMaximumImageCalculator to get the min and max intensity in
the image like
----------------------------------------------------------------------------
--------------------------------------------------------------*/
typedef itk::MinimumMaximumImageCalculator< InputImageType >
MinMaxCalculatorType;
MinMaxCalculatorType::Pointer calculator = MinMaxCalculator::New( );

calculator -> SetImage( image );
calculator -> compute( );
InputImageType::PixelType minIntensity = calculator -> GetMinimum( );
InputImageType::PixelType maxIntensity = calculator -> GetMaximum( );
/*--------------------------------------------------------------------------
--------------------------------
 Is this the direct way to get min and max intensity?
----------------------------------------------------------------------------
-------------------------------*/



***************************************************************
The information contained in this email and document(s) attached are for the
exclusive use of the addressee and may contain confidential, privileged and
non-disclosable information. If the recipient of this e-mail is not the
addressee, such recipient is strictly prohibited from reading, photocopying,
distributing or otherwise using this e-mail or its content in any way.


More information about the Insight-users mailing list