Hello all,<div>I got this code to compile and run using a reinterpret_cast</div><div><div><br></div><div>reinterpret_cast<itk::LBFGSBOptimizer *>(this->m_Registration->GetOptimizer())->SetBoundSelection( boundSelect );</div>
<div>reinterpret_cast<itk::LBFGSBOptimizer *>(this->m_Registration->GetOptimizer())->SetUpperBound( upperBound );</div><div>reinterpret_cast<itk::LBFGSBOptimizer *>(this->m_Registration->GetOptimizer())->SetLowerBound( lowerBound );</div>
</div><div><br></div><div>If there is a better way, I'm open to suggestions!</div><div><br></div><div>Thanks,</div><div>Seth<br><br>
<br><br><div class="gmail_quote">On Thu, Oct 13, 2011 at 8:55 AM, Seth Gilchrist <span dir="ltr"><<a href="mailto:seth@mech.ubc.ca">seth@mech.ubc.ca</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex;">
<div>Hello,</div><div>I'm trying to set the bounds of my optmiziation using:</div><div><br></div><div>this->m_Registration->GetOptimizer()->SetBoundSelection( boundSelection );</div><div><div>this->m_Registration->GetOptimizer()->SetUpperBound( upperBound );</div>
<div>this->m_Registration->GetOptimizer()->SetLowerBound( lowerBound );</div></div><div><br></div><div>The compiler returns:</div><div><div>error: ‘class itk::SingleValuedNonLinearOptimizer’ has no member named ‘SetBoundSelection’</div>
<div>error: ‘class itk::SingleValuedNonLinearOptimizer’ has no member named ‘SetUpperBound’</div><div>error: ‘class itk::SingleValuedNonLinearOptimizer’ has no member named ‘SetLowerBound’</div></div><div><br></div><div>
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:</div>
<div><br></div><div>typename ImageRegistrationType::OptimizerType::BoundSelectionType boundSelect, etc without getting the compiler error:</div><div><br></div><div>error: no type named ‘BoundsSelectionType’ in ‘class itk::SingleValuedNonLinearOptimizer’</div>
<div><br></div><div>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).</div>
<div><br></div>Thanks for your help,<br clear="all"><font color="#888888">Seth<br><br>
<br>
</font></blockquote></div><br></div>