[Insight-developers] Templates and preprocessor macros

Benoit Scherrer benoitscherrer at gmail.com
Wed Jul 13 09:00:25 EDT 2011


On Mon, Jul 11, 2011 at 1:28 PM, Williams, Norman K <
norman-k-williams at uiowa.edu> wrote:

> The only way to solve this is with template metaprogramming.  This makes
> for some extra work getting the syntax right, but you can write the code
> so that it only uses a filter on 3D.
>
>
ok thanks a lot!


>
> On the other hand, as one of the people who worked on OrientImageFilter
> back in the day, I don't think anyone should be using OrientImageFilter
> and it should be deprecated, because it destroys information. It only does
> the right thing if all of the direction cosines are aligned with one of
> the world coordinate axes.
>
>
I don't really understand this point, why it destroys information.
With file format such as nii or nrrd, which supports the orientation pretty
well, it should be ok, isn't it?
Or is there a problem for double oblique images?

Thanks
Benoit


>
> On 7/11/11 11:10 AM, "Benoit Scherrer" <benoitscherrer at gmail.com> wrote:
>
> > Hi,
> >
> >Is there a way to use the C++ preprocessor macros that test the value of
> >a template parameter?
> >For example i want to do a generic image filter ( using itk::Image<type,
> >VImageDimension> ) that
> >will use itk::OrientImageFilter only for VImageDimension==3
> >
> >However, it seems that the preprocessor tool does not 'expand' the
> >templates and
> >just don't know when VImageDimension==3 or not.
> >
> >Is there any trick to do that, or is it a lost cause ?
> >
> >Thanks a lot!
> >
> >Benoit
> >_______________________________________________
> >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://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-developers
>
>
>
> ________________________________
> Notice: This UI Health Care e-mail (including attachments) is covered by
> the Electronic Communications Privacy Act, 18 U.S.C. 2510-2521, is
> confidential and may be legally privileged.  If you are not the intended
> recipient, you are hereby notified that any retention, dissemination,
> distribution, or copying of this communication is strictly prohibited.
>  Please reply to the sender that you have received the message in error,
> then delete it.  Thank you.
> ________________________________
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://www.itk.org/mailman/private/insight-developers/attachments/20110713/500c7b9c/attachment.htm>


More information about the Insight-developers mailing list