[Insight-users] Dimensions of an image

Samuel Rodríguez Bescos srodrigu at gbt . tfo . upm . es
Wed, 7 Aug 2002 16:22:59 +0200


Thanks Luis and Julien,

The truth is that I am learning a lot , Really thank you,

Samuel
----- Original Message -----
From: "Luis Ibanez" <luis.ibanez@kitware.com>
To: "Samuel Rodríguez Bescos" <srodrigu@gbt.tfo.upm.es>
Cc: <insight-users@public.kitware.com>
Sent: Wednesday, August 07, 2002 4:12 PM
Subject: Re: [Insight-users] Dimensions of an image


>
> Hi Samuel,
>
> ITK images use three types of regions that are size related.
>
> This is done in order to support streaming (processing very
> large image by passing small pieces through the pipeline).
>
> Please keep in mind also that ITK images are N-Dimensional,
> so sizes and positions are managed in generic N-D arrays.
>
> The three regions in question are:
>
> 1) LargestPossibleRegion (the actual total size of the image)
> 2) BufferedRegion (the size of the image currently in memory)
> 3) RequestedRegion (the size of the image to be processed by
>             a filter - this represent one of the small pieces)
>
>
> Regions are a class in itself that holds the size of an image
> region in N-D:
> http://www.itk.org/Insight/Doxygen/html/classitk_1_1ImageRegion.html
>
>
> For example, you can do for a 3D image:
>
> typedef  itk::Image<char,3>   myImagerType;
>
> myImageType::Pointer image = GetImageSomeHow();
>
> typedef myImageType::RegionType  RegionType;
>
> RegionType  region1 = image->GetLargestPossibleRegion();
> RegionType  region2 = image->GetBufferedRegion();
> RegionType  region3 = image->GetRequestedRegion();
>
> const int width  = region2[0]; // first dimension
> const int height = region2[1]; // second dimension
> const int dept   = region2[2]; // third dimension
>
> For small images, the values of region1, region2 and region3
> will probably be the same.
>
> This is mostly a matter of concern if you are writing an
> ImageFilter but if you are just using an image that you
> instantiated and allocated by yourself, GetBufferedRegion()
> is probably the safest way to go.
>
> A nice description of the Streaming concepts can be seen in:
> http://www.itk.org/Insight/Doxygen/html/StreamingPage.html
>
> Further description of the ImageRegions is available in the
> InsightDocuments checkout under:
>
>       InsightDocuments/Developer/General/itkImage.ppt
>
>
>
> Please let us know if this helps to answer your question.
>
>
>    Thanks
>
>      Luis
>
>
>
> =================================================================
>
>
> Samuel Rodríguez Bescos wrote:
> > Hello everybody,
> >
> >
> >
> > does anybody know a way to get the size of  an image (width,height,
etc..)?
> >
> >
> >
> > Thanks in advance,
> >
> >
> >
> > Samuel
> >
> >
> >
>
>
>
>
> _______________________________________________
> Insight-users mailing list
> Insight-users@public.kitware.com
> http://public.kitware.com/mailman/listinfo/insight-users