[Insight-users] Get number of elements of a 3D image

Mr Francesco Grussu francesco.grussu at eecs.qmul.ac.uk
Fri Jun 15 11:41:12 EDT 2012


Oh yes, it is what I was looking for...
I am new to ITK and I get stuck even with such a basilar task...

Thanks a lot,
my regards

Francesco

> On Fri, Jun 15, 2012 at 11:15 AM, Mr Francesco Grussu <
> francesco.grussu at eecs.qmul.ac.uk> wrote:
>
>> Dear all,
>> could anybody suggest how to get the number of elements along the three
>> directions of a 3D image?
>>
>
> If I understood your question correctly, I think you're looking for:
>
> ImageType::SizeType imageSize =
> image->GetLargestPossibleRegion().GetSize();
>
> for(unsigned int i = 0; i < imageSize.GetSizeDimension(); ++i)
>   cout << imageSize[i] << " ";
> _____________________________________
> Powered by www.kitware.com
>
> Visit other Kitware open-source projects at
> http://www.kitware.com/opensource/opensource.html
>
> Kitware offers ITK Training Courses, for more information visit:
> http://www.kitware.com/products/protraining.php
>
> Please keep messages on-topic and check the ITK FAQ at:
> http://www.itk.org/Wiki/ITK_FAQ
>
> Follow this link to subscribe/unsubscribe:
> http://www.itk.org/mailman/listinfo/insight-users
>




More information about the Insight-users mailing list