[Insight-users] Set LBFGSB bounds by GetOptimizer()

Seth Gilchrist seth at mech.ubc.ca
Thu Oct 13 11:55:24 EDT 2011


Hello,
I'm trying to set the bounds of my optmiziation using:

this->m_Registration->GetOptimizer()->SetBoundSelection( boundSelection );
this->m_Registration->GetOptimizer()->SetUpperBound( upperBound );
this->m_Registration->GetOptimizer()->SetLowerBound( lowerBound );

The compiler returns:
error: ‘class itk::SingleValuedNonLinearOptimizer’ has no member named
‘SetBoundSelection’
error: ‘class itk::SingleValuedNonLinearOptimizer’ has no member named
‘SetUpperBound’
error: ‘class itk::SingleValuedNonLinearOptimizer’ has no member named
‘SetLowerBound’

m_Registration is a private image registration method to my class and
boundSelction, upperBound and lowerBound are all of type itk::Array< long >
because I couldn't use:

typename ImageRegistrationType::OptimizerType::BoundSelectionType
boundSelect, etc without getting the compiler error:

error: no type named ‘BoundsSelectionType’ in ‘class
itk::SingleValuedNonLinearOptimizer’

I see that OptimizerType in the ImageRegistrationMethod
is itk::SingleValuedNonLinearOptimizer, but is there a way I can do this
without having to explicitly define each optimizer that my class might need?
 I would like to keep the class simple, and just have switching of
registration setup using detection of the optimizer and metric types (I plan
to use a strcmp of GetNameOfClass() and the optimizer class name to do
this).

Thanks for your help,
Seth
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://www.itk.org/pipermail/insight-users/attachments/20111013/aff7337f/attachment.htm>


More information about the Insight-users mailing list