[ITK] [ITK-users] Check if an image is 2D or 3D

Dženan Zukić dzenanz at gmail.com
Sun May 15 12:13:00 EDT 2016


Hi Javier,

you can also access image dimension with the other signature too, like this:
ImageType::ImageDimension

Regards,
Dženan

On Sun, May 15, 2016 at 10:41 AM, Javier Juan Albarracín <javij1 at gmail.com>
wrote:

>
> Hello, I have an algorithm than can only be applied to 3D volumes, not 2D
> images.
>
> I plann to implement the function as:
>
> bool Algorithm<ImageType>::run(ImagePointer image)
>
> Is there any form to know through the ImageType or ImagePointer whether is
> a 3D or a 2D volume?? Or should I change the header of the function to
> something like:
>
> bool Algorithm<itk::Image<TPixel, VImageDimension>run(ImagePointer image)
>
> With this function header I have direct access to the image dimension, but
> in the other header, there is no form to know the image dimension through
> the typedef ImageType??
>
> Thank you
>
> _____________________________________
> 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://public.kitware.com/mailman/listinfo/insight-users
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://public.kitware.com/pipermail/community/attachments/20160515/83e4da76/attachment.html>
-------------- next part --------------
_____________________________________
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://public.kitware.com/mailman/listinfo/insight-users


More information about the Community mailing list