[Insight-developers] removing GetOptimizer method

Jean-Christophe Fillion-Robin jchris.fillionr at kitware.com
Fri Sep 2 16:13:43 EDT 2011


FYI - Doing a simple grep in both Slicer3 and Slicer4 return the following
result .. I didn't check if the optimizer specifically listed above were
involved.

Slicer4:

//--------------------------------------
Applications/CLI/RegisterImagesModule/itkOptimizedImageToImageRegistrationMethod.txx

[...]
typedef ImageRegistrationMethod<TImage, TImage> RegType;
[...]
typename RegType::Pointer reg = RegType::New();
[...]

557:    m_FinalMetricValue = reg->GetOptimizer()->GetValue(
658:    m_FinalMetricValue = reg->GetOptimizer()->GetValue(
666:    m_FinalMetricValue = reg->GetOptimizer()->GetValue(

Applications/CLI/RegisterImagesModule/itkBSplineImageToImageRegistrationMethod.txx
436:    this->SetFinalMetricValue( reg->GetOptimizer()
445:    this->SetFinalMetricValue( reg->GetOptimizer()


//--------------------------------------
Slicer3:
jchris at karakoram:~/Projects/Slicer3 [⚡ master] $ ack "GetOptimizer"
Modules/EMSegment/Registration/vtkBSplineRegistrator.cxx
152:      (registration->GetOptimizer());

Modules/EMSegment/Registration/vtkRigidRegistrator.cxx
122:              << registration->GetOptimizer()->GetCurrentPosition()
151:      (registration->GetOptimizer());

Modules/Pharmacokinetics/PkSolver/PkSolver.cxx
266:  itk::LevenbergMarquardtOptimizer::InternalOptimizerType * vnlOptimizer
= optimizer->GetOptimizer();

Applications/CLI/RegisterImagesModule/itkOptimizedImageToImageRegistrationMethod.txx
564:    m_FinalMetricValue = reg->GetOptimizer()->GetValue(
665:    m_FinalMetricValue = reg->GetOptimizer()->GetValue(
673:    m_FinalMetricValue = reg->GetOptimizer()->GetValue(

Applications/CLI/RegisterImagesModule/itkBSplineImageToImageRegistrationMethod.txx
430:    this->SetFinalMetricValue( reg->GetOptimizer()
439:    this->SetFinalMetricValue( reg->GetOptimizer()

Applications/CLI/BRAINSTools/BRAINSCommonLib/genericRegistrationHelper.txx
380:      dynamic_cast< OptimizerPointer >( m_Registration->GetOptimizer()
);


Hth
Jc


On Fri, Sep 2, 2011 at 4:00 PM, Bill Lorensen <bill.lorensen at gmail.com>wrote:

> If none of our customers use this then we can probably remove it. Of
> course, we don't know if any of our customers use this.
>
> What is the impact if we keep it?
>
> Bill
>
>
> On Fri, Sep 2, 2011 at 2:14 PM, Ziv Yaniv <zyaniv at childrensnational.org>wrote:
>
>> Hello all,
>>
>> I would like to remove the GetOptimizer method from the following
>> optimizers: itkAmoebaOptimizer, itkConjugateGradientOptimizer,
>> itkLBFGSOptimizer, itkLevenbergMarquardtOptimizer . All of these wrap vnl
>> optimizers.
>>
>> The GetOptimizer method is problematic as it exposes the underlying vnl
>> class . Such a method should never have made it into ITK as it is a back
>> door, removing any sanity checks ITK may have put in place when wrapping the
>> vnl optimizer.
>>
>> Please let me know if there is a reason not to do this. If no one has a
>> reason then I will do this next week.
>>
>>                    thanks
>>                        Ziv
>>
>> --
>> Ziv Yaniv, PhD.,
>> Principal Investigator,
>> The Sheikh Zayed Institute for Pediatric Surgical Innovation
>> Children's National Medical Center
>> 6th Floor Main Hospital, Room M7740
>> 111 Michigan Ave., N.W
>> Washington, D.C 20010
>>
>> Phone: 202-476-1288
>> email: zyaniv at childrensnational.org
>> web: http://isiswiki.georgetown.**edu/zivy/<http://isiswiki.georgetown.edu/zivy/>
>>
>> ______________________________**_________________
>> Powered by www.kitware.com
>>
>> Visit other Kitware open-source projects at
>> http://www.kitware.com/**opensource/opensource.html<http://www.kitware.com/opensource/opensource.html>
>>
>> Kitware offers ITK Training Courses, for more information visit:
>> http://kitware.com/products/**protraining.html<http://kitware.com/products/protraining.html>
>>
>> Please keep messages on-topic and check the ITK FAQ at:
>> http://www.itk.org/Wiki/ITK_**FAQ <http://www.itk.org/Wiki/ITK_FAQ>
>>
>> Follow this link to subscribe/unsubscribe:
>> http://www.itk.org/mailman/**listinfo/insight-developers<http://www.itk.org/mailman/listinfo/insight-developers>
>>
>
>
> _______________________________________________
> 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://kitware.com/products/protraining.html
>
> 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://www.itk.org/mailman/listinfo/insight-developers
>
>


-- 
+1 919 869 8849
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://www.itk.org/mailman/private/insight-developers/attachments/20110902/c8ee388c/attachment.htm>


More information about the Insight-developers mailing list