[Insight-users] Help on image size

Robert Tamburo robert.tamburo at gmail.com
Wed Aug 23 11:42:37 EDT 2006


The image base class has the functionality to return image regions as well as the size of these regions. To retrieve the size of the image, you can use the following:

itkSize<imageDimension> imageSize = image->GetLargestPossibleRegion().GetSize()

or you can just get each dimension individually, i.e., for 3D: 

unsigned long x = image->GetLargestPossibleRegion().GetSize()[0]
unsigned long y = image->GetLargestPossibleRegion().GetSize()[1]
unsigned long z = image->GetLargestPossibleRegion().GetSize()[2]

-Rob
  ----- Original Message ----- 
  From: Xuejun 
  To: insight-users at itk.org 
  Sent: Wednesday, August 23, 2006 10:46 AM
  Subject: [Insight-users] Help on image size


  Can anybody tell me how to get the image size, including the height and the width of an image? Your kind help is greatly appreciated.

   

  Sam



------------------------------------------------------------------------------


  _______________________________________________
  Insight-users mailing list
  Insight-users at itk.org
  http://www.itk.org/mailman/listinfo/insight-users
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://public.kitware.com/pipermail/insight-users/attachments/20060823/d7d283a9/attachment.htm


More information about the Insight-users mailing list