[Insight-users] get dimensions of image volume
Kishore Mosaliganti
kishoreraom at gmail.com
Fri Feb 5 20:09:13 EST 2010
Hi Michael,
You can do it directly as:
std::cout << image->GetLargestPossibleRegion().GetNumberOfPixels( ) <<
std::endl;
Kishore
On Tue, Feb 2, 2010 at 8:58 AM, michiel mentink <
michael.mentink at st-hughs.ox.ac.uk> wrote:
>
> Thank you both, for future reference:
>
> const ImageType::SizeType sizeOfImage =
> image->GetLargestPossibleRegion().GetSize();
>
> std::cout << "Size ";
> std::cout << sizeOfImage[0] << ", " << sizeOfImage[1] << ", " <<
> sizeOfImage[2] << std::endl;
>
>
> cheers, Michael
>
>
>
>
> On Tue, Feb 2, 2010 at 1:53 PM, <M.Staring at lumc.nl> wrote:
>
>> Hi Michael,
>>
>> > Is there some way of getting the number of pixels in X,Y,Z
>> > from an ITK image?
>> >
>> > There's methods in ITKImage for spacing, origin and
>> > direction, but not for the amount of pixels.
>> > Why is that?
>> >
>>
>> There actually is, but it is somewhat hidden in the region:
>>
>> SizeType size = image->GetLargestPossibleRegion().GetSize();
>>
>> Cheers,
>>
>> Marius
>>
>
>
> _____________________________________
> 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.html
>
> 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
>
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://www.itk.org/pipermail/insight-users/attachments/20100205/a04f9ffd/attachment.htm>
More information about the Insight-users
mailing list