Skip to content

Commit

Permalink
ENH: Remove duplicate class VersorRigid3DTransformOptimizer
Browse files Browse the repository at this point in the history
The class VersorRigid3DTransformOptimizer is an exact duplicate
of the VersorTransformOptimizer, with one value unnecessarily
hard-coded.

The performance benefits of the hard coding have no benefit
in this application.
  • Loading branch information
hjmjohnson committed Oct 20, 2022
1 parent c461bdd commit c5dafc7
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 144 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -18,67 +18,16 @@
#ifndef itkVersorRigid3DTransformOptimizer_h
#define itkVersorRigid3DTransformOptimizer_h

#include "itkRegularStepGradientDescentOptimizer.h"
#include "itkVersor.h"
#include "ITKOptimizersExport.h"
#include "itkVersorTransformOptimizer.h"

// At some point in the distant future, remove support for VersorRigid3DTransformOptimizer
// #if defined(ITK_FUTURE_LEGACY_REMOVE)
// #warning "itkVersorRigid3DTransformOptimizer is identical to itkVersorTransformOptimizer, please replace"
// #else
namespace itk
{
/** \class VersorRigid3DTransformOptimizer
* \brief Implement a gradient descent optimizer for the VersorRigid3DTransform
* parameter space.
*
* VersorRigid3DTransformOptimizer is a variant of the
* gradient descent optimizer implemented in
* RegularStepGradientDescentOptimizer.
*
* Versors are not in a vector space, for that reason,
* the classical gradient descent algorithm has to be
* modified in order to be applicable to Versors (unit
* quaternions) that form the group SO(3).
*
* The Versor space has only three degrees of freedom,
* even though Versors are represented using four values.
*
* This optimizer assumes that the CostFunction to be
* optimized has an itk::Versor as parameters.
*
* \sa RegularStepGradientDescentOptimizer
* \sa Versor
* \sa VersorRigid3DTransform
*
* \ingroup Numerics Optimizers
* \ingroup ITKOptimizers
*/
class ITKOptimizers_EXPORT VersorRigid3DTransformOptimizer : public RegularStepGradientDescentBaseOptimizer
{
public:
ITK_DISALLOW_COPY_AND_MOVE(VersorRigid3DTransformOptimizer);

/** Standard class type aliases. */
using Self = VersorRigid3DTransformOptimizer;
using Superclass = RegularStepGradientDescentBaseOptimizer;
using Pointer = SmartPointer<Self>;
using ConstPointer = SmartPointer<const Self>;

/** Method for creation through the object factory. */
itkNewMacro(Self);

/** Run-time type information (and related methods). */
itkTypeMacro(VersorRigid3DTransformOptimizer, RegularStepGradientDescentBaseOptimizer);

/** Versor Type */
using VersorType = Versor<double>;
using VectorType = VersorType::VectorType;

/** Advance one step following the gradient direction. */
void
StepAlongGradient(double factor, const DerivativeType & transformedGradient) override;

protected:
VersorRigid3DTransformOptimizer() = default;
~VersorRigid3DTransformOptimizer() override = default;
};
using VersorRigid3DTransformOptimizer = VersorTransformOptimizer;
} // end namespace itk
// #endif

#endif
1 change: 0 additions & 1 deletion Modules/Numerics/Optimizers/src/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,6 @@ set(ITKOptimizers_SRCS
itkSingleValuedVnlCostFunctionAdaptor.cxx
itkMultipleValuedNonLinearVnlOptimizer.cxx
itkPowellOptimizer.cxx
itkVersorRigid3DTransformOptimizer.cxx
itkVersorTransformOptimizer.cxx
itkOnePlusOneEvolutionaryOptimizer.cxx
itkMultipleValuedNonLinearOptimizer.cxx
Expand Down

This file was deleted.

0 comments on commit c5dafc7

Please sign in to comment.