<br>Thank you both, for future reference:<br><br> const ImageType::SizeType sizeOfImage = image->GetLargestPossibleRegion().GetSize();<br><br> std::cout << "Size ";<br> std::cout << sizeOfImage[0] << ", " << sizeOfImage[1] << ", " << sizeOfImage[2] << std::endl;<br>
<br><br>cheers, Michael<br><br><br><br><div class="gmail_quote">On Tue, Feb 2, 2010 at 1:53 PM, <span dir="ltr"><<a href="mailto:M.Staring@lumc.nl">M.Staring@lumc.nl</a>></span> wrote:<br><blockquote class="gmail_quote" style="border-left: 1px solid rgb(204, 204, 204); margin: 0pt 0pt 0pt 0.8ex; padding-left: 1ex;">
Hi Michael,<br>
<div><div></div><div class="h5"><br>
> Is there some way of getting the number of pixels in X,Y,Z<br>
> from an ITK image?<br>
><br>
> There's methods in ITKImage for spacing, origin and<br>
> direction, but not for the amount of pixels.<br>
> Why is that?<br>
><br>
<br>
</div></div>There actually is, but it is somewhat hidden in the region:<br>
<br>
SizeType size = image->GetLargestPossibleRegion().GetSize();<br>
<br>
Cheers,<br>
<br>
Marius<br>
</blockquote></div><br>