[Insight-users] DIMENSIONALITY

Luis Ibanez luis.ibanez at kitware.com
Thu Jun 18 12:06:29 EDT 2009


Hi Aaron,

The dimension of an image (2D, 3D, 4D....) can be queried with

                 image->GetImageDimension();

The size of the image (number of pixels along each dimension)
can be queried with

      SizeType size =   image->GetBufferedRegion().GetSize()

  size[0] --> number of pixels along X
  size[1] --> number of pixels along Y
  size[2] --> number of pixels along Z


You seem to be looking at the requested region, which is
something, that normally you shouldn't have to deal with.
The requested region is computed at the convenience of
the subsequent filters in the pipeline.

You will get a more complete set of information by using

      image->Print( std::cout )

You may want to pay special attention to the regions

    LargestPossibleRegion   and
    BufferedRegion


Let us know if you still have any questions,


Regards,


      Luis


---------------------------------------------------------------------------------
On Thu, Jun 18, 2009 at 11:39 AM, Arun Vishwanathan <
arun.vishwanathan at bioquant.uni-heidelberg.de> wrote:

> Dear Luis
>
> in the following code could you please let me know as to why the
> dimensionality of the resultant image seems to be 5 when i check its
> size?the image used is 2d
> //the filter regiongrower operates on 2d slice//
>
>
> mitk::Image::Pointer resultImage = mitk::ImportItkImage(
> regionGrower->GetOutput() )
> cout<<"size
> of...."<<resultImage->GetRequestedRegion().GetSize()<<std::endl;
>
> Regards
> Aaron
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://www.itk.org/pipermail/insight-users/attachments/20090618/a245f480/attachment.htm>


More information about the Insight-users mailing list