[ITK-users] PCA with ITK in Python

Matt McCormick matt.mccormick at kitware.com
Wed Apr 6 10:01:20 EDT 2016


Hi Robert,

That is excellent!  Could you please push them to Gerrit?  They can
then be integrated into ITK so others can benefit from them and so it
is easier for you to build from and maintain the changes in the
future.  Instructions can be found here:

  http://itk.org/ITKSoftwareGuide/html/Book1/ITKSoftwareGuide-Book1ch10.html#x51-15500010

  http://www.itk.org/Wiki/ITK/Git/Develop

  https://insightsoftwareconsortium.github.io/ITKBarCamp-doc/CommunitySoftwareProcess/index.html

Thanks,
Matt



On Wed, Apr 6, 2016 at 9:57 AM, Robert <scorpiuni at gmail.com> wrote:
> Hi Matt,
>
> I can now call all needed functions so far in Python, I wrote 2 or 3 more
> wrappers. Next step will be implementing them as soon as my dataset is
> ready.
> I will have a look into putting my .wrap up on GitHub for other users that
> may need PCA functions as well.
>
> Thanks for your help so far,
>
> Best Regards,
>
> Robert
>
>
> On Mon, Apr 4, 2016 at 6:01 PM, Matt McCormick-2 [via ITK Insight Users] <
> ml-node+s2283740n7588697h79 at n2.nabble.com> wrote:
>
>> 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 <[hidden email]
>> <http:///user/SendEmail.jtp?type=node&node=7588697&i=0>> 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
>> _____________________________________
>> 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
>>
>>
>> ------------------------------
>> If you reply to this email, your message will be added to the discussion
>> below:
>>
>> http://itk-insight-users.2283740.n2.nabble.com/ITK-users-PCA-with-ITK-in-Python-tp7588682p7588697.html
>> To unsubscribe from [ITK-users] PCA with ITK in Python, click here
>> <http://itk-insight-users.2283740.n2.nabble.com/template/NamlServlet.jtp?macro=unsubscribe_by_code&node=7588682&code=c2NvcnBpdW5pQGdtYWlsLmNvbXw3NTg4NjgyfC00NzM2MTQzMw==>
>> .
>> NAML
>> <http://itk-insight-users.2283740.n2.nabble.com/template/NamlServlet.jtp?macro=macro_viewer&id=instant_html%21nabble%3Aemail.naml&base=nabble.naml.namespaces.BasicNamespace-nabble.view.web.template.NabbleNamespace-nabble.view.web.template.NodeNamespace&breadcrumbs=notify_subscribers%21nabble%3Aemail.naml-instant_emails%21nabble%3Aemail.naml-send_instant_email%21nabble%3Aemail.naml>
>>
>
>
>
>
> --
> View this message in context: http://itk-insight-users.2283740.n2.nabble.com/ITK-users-PCA-with-ITK-in-Python-tp7588682p7588701.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