[Insight-users] Please help on python mapping.
Luis Ibanez
luis.ibanez@kitware.com
Wed May 12 01:35:12 EDT 2004
Hi Tuhin and Yang
Thanks for pointing this out.
Your are right the wrapping is missing for images
of pixel type = Vector<> and CovariantVector<>.
We will be adding those types in the following days.
They will be for types float/double and 2D/3D.
--
About the methods that may be missing in the wrapped
classes: This usually happens when the method is
provided by a superclass and that superclass is not
being wrapped.
Please let us know what methods you are not finding.
That will help us to find the superclass that must
be added to the wrapping.
Thanks,
Luis
-------------------
Tuhin Sinha wrote:
> Casper,
>
> You will have to typdef new vector image types in
> Wrapping/CSwig/Common/wrap_itkImage_2D.cxx and
> Wrapping/CSwig/itkCSwigImages.h. This may give you a start:
>
> Wrapping/CSwig/itkCSwigImages.h --
> typedef itk::Vector<float , 2> vF2;
> typedef itk::Image<vF2 , 2> dF2;
>
> Wrapping/CSwig/Common/wrap_itkImage_2D.cxx --
> ITK_WRAP_OBJECT2(Image, image::vF2, 2, itkImagedF2);
>
> Now you will have access to vector images in python.
>
> You will have to wrap some additional classes, using the newly defined
> vector image types, into python to get Demons' registration up and
> running, i.e.:
>
> itkPDEDeformableRegistrationFilter
> itkPDEDeformableRegistrationFunction
> itkDemonsRegistrationFilter
> itkDemonsRegistrationFunction
> itkVectorNeighborhoodOperatorImageFilter
>
> I am also trying to translate this script (DeformableRegistration2.cxx)
> to python also. I have gotten all the additional classes wrapped into
> python, but some of the member functions are missing. Do you have any
> experience with this or any indication as to how to fix this problem?
> Thanks.
>
> Tuhin Sinha
>
>
>
> type
>
> On Fri, 2004-05-07 at 13:19, Yang Wang wrote:
>
>>Hi, all
>>
>>I am trying to map the DeformableRegistration2.cxx into Python.
>>However, don't know how to do the following two parts:
>>(1) typedef itk::Vector< float, Dimension > VectorPixelType;
>> typedef itk::Image< VectorPixelType, Dimension > DeformationFieldType;
>> typedef itk::DemonsRegistrationFilter<
>> InternalImageType,
>> InternalImageType,
>> DeformationFieldType>
>>RegistrationFilterType;
>> RegistrationFilterType::Pointer filter = RegistrationFilterType::New();
>>
>>(2)
>>class CommandIterationUpdate : public itk::Command
>> {
>> public:
>> typedef CommandIterationUpdate Self;
>> typedef itk::Command Superclass;
>> typedef itk::SmartPointer<CommandIterationUpdate> Pointer;
>> itkNewMacro( CommandIterationUpdate );
>> protected:
>> CommandIterationUpdate() {};
>>
>> typedef itk::Image< float, 2 > InternalImageType;
>> typedef itk::Vector< float, 2 > VectorPixelType;
>> typedef itk::Image< VectorPixelType, 2 > DeformationFieldType;
>>
>> typedef itk::DemonsRegistrationFilter<
>> InternalImageType,
>> InternalImageType,
>> DeformationFieldType>
>>RegistrationFilterType;
>>
>> public:
>>
>> void Execute(itk::Object *caller, const itk::EventObject & event)
>> {
>> Execute( (const itk::Object *)caller, event);
>> }
>>
>> void Execute(const itk::Object * object, const itk::EventObject & event)
>> {
>> const RegistrationFilterType * filter =
>> dynamic_cast< const RegistrationFilterType * >( object );
>> if( typeid( event ) != typeid( itk::IterationEvent ) )
>> {
>> return;
>> }
>> std::cout << filter->GetMetric() << std::endl;
>> }
>> };
>>
>>
>>CommandIterationUpdate::Pointer observer = CommandIterationUpdate::New();
>> filter->AddObserver( itk::IterationEvent(), observer );
>>
>>**************************************
>>
>>Thanks in advance for any hint or help!!
>>
>>
>>Yours,
>>Casper
>>
>>_______________________________________________
>>Insight-users mailing list
>>Insight-users@itk.org
>>http://www.itk.org/mailman/listinfo/insight-users
>
>
> _______________________________________________
> Insight-users mailing list
> Insight-users@itk.org
> http://www.itk.org/mailman/listinfo/insight-users
>
More information about the Insight-users
mailing list