[ITK-users] PCA with ITK in Python

Matt McCormick matt.mccormick at kitware.com
Mon Apr 4 12:00:38 EDT 2016


Hi Robert,

Great to hear it is working for you!


You are very close with the wrapping for PCAShapSignedDistanceFunction.

To review the template args:

  http://www.itk.org/Doxygen/html/classitk_1_1PCAShapeSignedDistanceFunction.html

  template<typename TCoordRep, unsigned int VSpaceDimension, typename
TImage = Image< double, VSpaceDimension >>
  class itk::PCAShapeSignedDistanceFunction< TCoordRep,
VSpaceDimension, TImage >

I think it is sufficient for now to always use "double" for TCoordRep.
This is the type to represent positions in space. It has to be a
floating point number, and the increased precision of "double" is
often useful. In the wrapping variables, the variable for the double
mangling is ${ITKM_D} (which expands to "D"), and the template
parameters is ${ITKT_D} (which expands to "double").

VSpaceDimension should be the dimension. This is just a number that
can be used directly as its mangled value and as its template
parameter.

The image type should be a real-valued pixel type -- base it off of
WRAP_ITK_REAL.  How about

  itk_wrap_class("itk::PCAShapeSignedDistanceFunction" POINTER)
    foreach(d ${ITK_WRAP_IMAGE_DIMS})
      foreach(t ${WRAP_ITK_REAL})
         itk_wrap_template("${ITKM_D}${d}${ITKM_I${t}${d}}"
> "${ITKT_D}, ${d}, ${ITKT_I${t}${d}}")
      endforeach()
    endforeach()
  itk_end_wrap_class()

?

HTH,
Matt

On Mon, Apr 4, 2016 at 11:26 AM, Robert <scorpiuni at gmail.com> wrote:
> What is wrong with this approach?
> As .wrap file, I wrote:
>
>
>
>
> Robert wrote
>> itk_wrap_class("itk::PCAShapeSignedDistanceFunction" POINTER)
>>   foreach(d ${ITK_WRAP_IMAGE_DIMS})
>>    foreach(i ${ITK_WRAP_double})
>>     foreach(t2 ${WRAP_ITK_REAL})
>>      itk_wrap_template("${ITKM_D${t2}}${ITKM_UI${d}}${ITKM_I${i}${d}}"
>> "${ITKT_D${t2}}, ${ITKT_UI${d}}, ${ITKT_I${i}${d}}")
>>     endforeach()
>>    endforeach()
>>   endforeach()
>> itk_end_wrap_class()
>
>
> It does not work, what is wrong here'?
>
>
>
>
> --
> View this message in context: http://itk-insight-users.2283740.n2.nabble.com/ITK-users-PCA-with-ITK-in-Python-tp7588682p7588696.html
> Sent from the ITK Insight Users mailing list archive at Nabble.com.
> _____________________________________
> 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 Insight-users mailing list