[ITK-users] [ITK] Geodesic Shape Guidance in Python

Timothee Evain tevain at telecom-paristech.fr
Wed Apr 27 03:48:52 EDT 2016


Hi Robert,

Remember that "::*****Type" are just aliases (typedef). You could always replace by the true type. Just search into the sources (e.g. GitHub).
Here are the examples you needed:
ShapeFunctionType::ParametersType is an itk OptimizerParameters< double > (defined in itkShapeSignedDistanceFunction.h) 
CostFunctionType::ArrayType is an itk Array < double >  (defined in itkShapePriorMAPCostFunction.h)
OptimizerType::ScalesType is an itk Array < double > (defined in itkOptimizer.h) 

Given that, you should be able to translate into Python.

As for setting the principal component images, the method needs a std::vector<ImageType> input, so I think Matt's solution will work.

HTH,

Tim


----- Mail original -----
De: "Robert" <scorpiuni at gmail.com>
À: insight-users at itk.org
Envoyé: Mardi 26 Avril 2016 22:03:11
Objet: Re: [ITK] [ITK-users] Geodesic Shape Guidance in Python

Hello, thanks for the reply.
I actually wrapped it myself/with help from the forum. I can publish my
.wrap files if it's helpful, I have a few more, all related to PCA stuff.
I will have a go at the itk Vector tomorrow morning, I hope it works, I
already tried around a  bit with itk vectors after posting my question.

What about the other problem? Is there a solution for it as well? It is
currently slowing down my work significantly.

This 
    > CostFunctionType::ArrayType mean(  
shape->GetNumberOfShapeParameters() );
    >   CostFunctionType::ArrayType stddev(
shape->GetNumberOfShapeParameters() ); 
should be solvable with something along the lines of itk.ArrayType.New(),
right? I think that ArrayType is available as wrapping.
But for the rest, like,
    > OptimizerType::ScalesType scales( shape->GetNumberOfParameters() );
    >   scales.Fill( 1.0 );
    >   for( unsigned int k = 0; k < numberOfPCAModes; k++ )
    >     {
    >     scales[k] = 20.0;  // scales for the pca mode multiplier
    >     } 
I could not come up with anything in my mind. Basically, I'm trying to
recreate the GeodesicActiveContourWithShapeGuidance example from the
Handbook, and the last few lines where stuff like described above appears
give me some trouble....

Thanks for any input, and have a nice evening,
Robert



--
View this message in context: http://itk-insight-users.2283740.n2.nabble.com/Geodesic-Shape-Guidance-in-Python-tp7588780p7588783.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
_______________________________________________
Community mailing list
Community at itk.org
http://public.kitware.com/mailman/listinfo/community


More information about the Insight-users mailing list