[ITK Community] [Insight-users] ITK Wrapping commands

Sami Koho sami.koho at gmail.com
Thu Feb 6 06:57:25 EST 2014


Hello again,

the Transform Read/Write works in Python now with the small additions to
the wrapping code. I have a question regarding the transform reading. In
the C++ example the transform is set-up as follows:

typedef itk::TransformFileReader::TransformListType * TransformListType;

TransformListType transforms = reader->GetTransformList();



*itk::TransformFileReader::TransformListType::const_iterator it     =
transforms->begin();*
if(!strcmp((*it)->GetNameOfClass(),"AffineTransform"))
{
    AffineTransformType::Pointer affine_read
      = *static_cast<AffineTransformType*>((*it).GetPointer());*
    affine_read->Print(std::cout);
}

In Python I am able to read the file and I can get the transform list as
well, but I don't know how to make a transform out of that. It seems to
involve accessing the (std::list) TransformList and doing a
static_cast<....>. Is there a way for doing this?

The file format is quite simple, so I can of course parse it quickly in
Python, but using the existing function would be nice...

Best,

Sami


On Wed, Feb 5, 2014 at 10:58 PM, Matt McCormick
<matt.mccormick at kitware.com>wrote:

> Hi Sami,
>
> WRAPPER_AUTO_INCLUDE_HEADERS is a variable instead of a macro.  Here
> is a patch [1] to review [2].
>
> Thanks,
> Matt
>
> [1] http://review.source.kitware.com/#/c/14293/
> [2]
> http://insightsoftwareconsortium.github.io/ITKBarCamp-doc/CommunitySoftwareProcess/PerformAGerritReview/index.html
>
> On Wed, Feb 5, 2014 at 4:30 AM, Sami Koho <sami.koho at gmail.com> wrote:
> > Hello,
> >
> > I have been trying to get ITKTransformFileWriter/ITKTransformFileReader
> > classes wrapped, as I would need them in my Python code. Everything
> seems to
> > work nicely, if I use the non-templated class only,  as follows:
> >
> > itk_wrap_class("itk::TransformFileReader" POINTER)
> >
> > However, the wrapping file that is included in ITK 4.5.0 includes the
> > following:
> >
> > itk_wrap_class("itk::TransformFileReaderTemplate" POINTER)
> >     foreach(t ${WRAP_ITK_REAL})
> >     itk_wrap_template("${ITKM_${t}}" "${ITKT_${t}}")
> >     endforeach(t)
> > itk_end_wrap_class()
> >
> > and this does not work, as there is no header file called
> > itkTransformFileReaderTemplate.h. How could I make this work? Is the a
> way
> > to force the header file name to itkTransformFileReader.h?
> >
> > In the WrapITK publication there's a mention of WRAP_INCLUDE and
> > WRAPPER_AUTO_INCLUDE_HEADERS macros; the prior seems to work as
> > itk_wrap_include("itkTransformFileReader.h"), but I could not figure  out
> > how to disable the auto-include.
> >
> > Best,
> >
> > Sami
> >
> >
> > _____________________________________
> > 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
> >
> > _______________________________________________
> > Community mailing list
> > Community at itk.org
> > http://public.kitware.com/cgi-bin/mailman/listinfo/community
> >
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://public.kitware.com/pipermail/community/attachments/20140206/869fc916/attachment-0002.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://www.itk.org/mailman/listinfo/insight-users


More information about the Community mailing list