Skip to content

Commit

Permalink
ENH: Add nested CoordinateType aliases as alternative to CoordRepType
Browse files Browse the repository at this point in the history
Redid pull request InsightSoftwareConsortium#4997
commit 5ea1a9a on release-5.4
  • Loading branch information
N-Dekker authored and hjmjohnson committed Dec 5, 2024
1 parent 49413c3 commit bdfd0c2
Show file tree
Hide file tree
Showing 43 changed files with 88 additions and 44 deletions.
3 changes: 2 additions & 1 deletion Modules/Core/Common/include/itkBoundingBox.h
Original file line number Diff line number Diff line change
Expand Up @@ -89,7 +89,8 @@ class ITK_TEMPLATE_EXPORT BoundingBox : public Object

/** Hold on to the type information specified by the template parameters. */
using PointIdentifier = TPointIdentifier;
using CoordRepType = TCoordRep;
using CoordinateType = TCoordRep;
using CoordRepType = CoordinateType;
using PointsContainer = TPointsContainer;
using PointsContainerPointer = typename PointsContainer::Pointer;
using PointsContainerConstPointer = typename PointsContainer::ConstPointer;
Expand Down
6 changes: 4 additions & 2 deletions Modules/Core/Common/include/itkCellInterface.h
Original file line number Diff line number Diff line change
Expand Up @@ -108,7 +108,8 @@ class ITK_TEMPLATE_EXPORT CellInterface
using CellTraits = TCellTraits;

/** Save type information for this cell. */
using CoordRepType = typename CellTraits::CoordRepType;
using CoordinateType = typename CellTraits::CoordRepType;
using CoordRepType = CoordinateType;
using InterpolationWeightType = typename CellTraits::InterpolationWeightType;
using PointIdentifier = typename CellTraits::PointIdentifier;
using PointIdIterator = typename CellTraits::PointIdIterator;
Expand Down Expand Up @@ -524,7 +525,8 @@ class ITK_TEMPLATE_EXPORT CellTraitsInfo
{
public:
static constexpr unsigned int PointDimension = VPointDimension;
using CoordRepType = TCoordRep;
using CoordinateType = TCoordRep;
using CoordRepType = CoordinateType;
using InterpolationWeightType = TInterpolationWeight;
using PointIdentifier = TPointIdentifier;
using CellIdentifier = TCellIdentifier;
Expand Down
3 changes: 2 additions & 1 deletion Modules/Core/Common/include/itkContinuousIndex.h
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,8 @@ class ITK_TEMPLATE_EXPORT ContinuousIndex : public Point<TCoordRep, VIndexDimens
/** ValueType can be used to declare a variable that is the same type
* as a data element held in an Point. */
using ValueType = TCoordRep;
using CoordRepType = TCoordRep;
using CoordinateType = TCoordRep;
using CoordRepType = CoordinateType;

/** Dimension of the Space */
static constexpr unsigned int IndexDimension = VIndexDimension;
Expand Down
3 changes: 2 additions & 1 deletion Modules/Core/Common/include/itkDefaultDynamicMeshTraits.h
Original file line number Diff line number Diff line change
Expand Up @@ -69,7 +69,8 @@ class DefaultDynamicMeshTraits
/** Just save all the template parameters. */
using PixelType = TPixelType;
using CellPixelType = TCellPixelType;
using CoordRepType = TCoordRep;
using CoordinateType = TCoordRep;
using CoordRepType = CoordinateType;
using InterpolationWeightType = TInterpolationWeight;

/** Just save all the template parameters. */
Expand Down
3 changes: 2 additions & 1 deletion Modules/Core/Common/include/itkDefaultStaticMeshTraits.h
Original file line number Diff line number Diff line change
Expand Up @@ -67,7 +67,8 @@ class ITK_TEMPLATE_EXPORT DefaultStaticMeshTraits
/** Just save all the template parameters. */
using PixelType = TPixelType;
using CellPixelType = TCellPixelType;
using CoordRepType = TCoordRep;
using CoordinateType = TCoordRep;
using CoordRepType = CoordinateType;
using InterpolationWeightType = TInterpolationWeight;

/** Just save all the template parameters. */
Expand Down
3 changes: 2 additions & 1 deletion Modules/Core/Common/include/itkPoint.h
Original file line number Diff line number Diff line change
Expand Up @@ -60,7 +60,8 @@ class ITK_TEMPLATE_EXPORT Point : public FixedArray<TCoordRep, VPointDimension>
/** ValueType can be used to declare a variable that is the same type
* as a data element held in an Point. */
using ValueType = TCoordRep;
using CoordRepType = TCoordRep;
using CoordinateType = TCoordRep;
using CoordRepType = CoordinateType;

using RealType = typename NumericTraits<ValueType>::RealType;

Expand Down
3 changes: 2 additions & 1 deletion Modules/Core/Common/include/itkPointSet.h
Original file line number Diff line number Diff line change
Expand Up @@ -101,7 +101,8 @@ class ITK_TEMPLATE_EXPORT PointSet : public DataObject
using PixelType = typename MeshTraits::PixelType;

/** Convenient type alias obtained from TMeshTraits template parameter. */
using CoordRepType = typename MeshTraits::CoordRepType;
using CoordinateType = typename MeshTraits::CoordRepType;
using CoordRepType = CoordinateType;
using PointIdentifier = typename MeshTraits::PointIdentifier;
using PointType = typename MeshTraits::PointType;
using PointsContainer = typename MeshTraits::PointsContainer;
Expand Down
3 changes: 2 additions & 1 deletion Modules/Core/Common/include/itkTriangleHelper.h
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,8 @@ class ITK_TEMPLATE_EXPORT TriangleHelper
public:
using Self = TriangleHelper;
using PointType = TPoint;
using CoordRepType = typename PointType::CoordRepType;
using CoordinateType = typename PointType::CoordRepType;
using CoordRepType = CoordinateType;
using VectorType = typename PointType::VectorType;
using CrossVectorType = CrossHelper<VectorType>;

Expand Down
3 changes: 2 additions & 1 deletion Modules/Core/ImageFunction/include/itkImageFunction.h
Original file line number Diff line number Diff line change
Expand Up @@ -84,7 +84,8 @@ class ITK_TEMPLATE_EXPORT ImageFunction : public FunctionBase<Point<TCoordRep, T
using OutputType = TOutput;

/** CoordRepType type alias support */
using CoordRepType = TCoordRep;
using CoordinateType = TCoordRep;
using CoordRepType = CoordinateType;

/** Index Type. */
using IndexType = typename InputImageType::IndexType;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -86,7 +86,8 @@ class ITK_TEMPLATE_EXPORT VectorInterpolateImageFunction
using typename Superclass::OutputType;

/** CoordRep type alias support */
using CoordRepType = TCoordRep;
using CoordinateType = TCoordRep;
using CoordRepType = CoordinateType;

/** Returns the interpolated image intensity at a
* specified point position. No bounds checking is done.
Expand Down
3 changes: 2 additions & 1 deletion Modules/Core/Mesh/include/itkInteriorExteriorMeshFilter.h
Original file line number Diff line number Diff line change
Expand Up @@ -62,7 +62,8 @@ class ITK_TEMPLATE_EXPORT InteriorExteriorMeshFilter : public MeshToMeshFilter<T
using OutputMeshPointer = typename OutputMeshType::Pointer;

/** Type for representing coordinates. */
using CoordRepType = typename TInputMesh::CoordRepType;
using CoordinateType = typename TInputMesh::CoordRepType;
using CoordRepType = CoordinateType;

/** Type of the transform. */
using SpatialFunctionType = TSpatialFunction;
Expand Down
3 changes: 2 additions & 1 deletion Modules/Core/Mesh/include/itkMesh.h
Original file line number Diff line number Diff line change
Expand Up @@ -168,7 +168,8 @@ class ITK_TEMPLATE_EXPORT Mesh : public PointSet<TPixelType, VDimension, TMeshTr
#endif

/** Convenient type alias obtained from TMeshTraits template parameter. */
using CoordRepType = typename MeshTraits::CoordRepType;
using CoordinateType = typename MeshTraits::CoordRepType;
using CoordRepType = CoordinateType;
using InterpolationWeightType = typename MeshTraits::InterpolationWeightType;
using PointIdentifier = typename MeshTraits::PointIdentifier;
using CellIdentifier = typename MeshTraits::CellIdentifier;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,8 @@ class ITK_TEMPLATE_EXPORT ParametricSpaceToImageSpaceMeshFilter : public MeshToM
using ConstPointer = SmartPointer<const Self>;

/** Type for representing coordinates. */
using CoordRepType = typename TInputMesh::CoordRepType;
using CoordinateType = typename TInputMesh::CoordRepType;
using CoordRepType = CoordinateType;

using InputMeshType = TInputMesh;
using OutputMeshType = TOutputMesh;
Expand Down
3 changes: 2 additions & 1 deletion Modules/Core/Mesh/include/itkTransformMeshFilter.h
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,8 @@ class ITK_TEMPLATE_EXPORT TransformMeshFilter : public MeshToMeshFilter<TInputMe
using OutputMeshPointer = typename OutputMeshType::Pointer;

/** Type for representing coordinates. */
using CoordRepType = typename TInputMesh::CoordRepType;
using CoordinateType = typename TInputMesh::CoordRepType;
using CoordRepType = CoordinateType;

/** Type of the transform. */
using TransformType = TTransform;
Expand Down
3 changes: 2 additions & 1 deletion Modules/Core/Mesh/include/itkWarpMeshFilter.h
Original file line number Diff line number Diff line change
Expand Up @@ -57,7 +57,8 @@ class ITK_TEMPLATE_EXPORT WarpMeshFilter : public MeshToMeshFilter<TInputMesh, T
using OutputMeshPointer = typename OutputMeshType::Pointer;

/** Type for representing coordinates. */
using CoordRepType = typename TInputMesh::CoordRepType;
using CoordinateType = typename TInputMesh::CoordRepType;
using CoordRepType = CoordinateType;

/** Deformation field type alias support */
using DisplacementFieldType = TDisplacementField;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,8 @@ class QuadEdgeMeshCellTraitsInfo
{
public:
static constexpr unsigned int PointDimension = VPointDimension;
using CoordRepType = TCoordRep;
using CoordinateType = TCoordRep;
using CoordRepType = CoordinateType;
using InterpolationWeightType = TInterpolationWeight;
using PointIdentifier = TPointIdentifier;
using CellIdentifier = TCellIdentifier;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,8 @@ class ITK_TEMPLATE_EXPORT QuadEdgeMeshEulerOperatorCreateCenterVertexFunction

using PointIdentifier = typename MeshType::PointIdentifier;
using PointType = typename MeshType::PointType;
using CoordRepType = typename MeshType::CoordRepType;
using CoordinateType = typename MeshType::CoordRepType;
using CoordRepType = CoordinateType;
using VectorType = typename MeshType::VectorType;

/** Evaluate at the specified input position */
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -70,7 +70,8 @@ class QuadEdgeMeshExtendedTraits
public:
using Self = QuadEdgeMeshExtendedTraits;
/** Save the template parameters. */
using CoordRepType = TCoordRep;
using CoordinateType = TCoordRep;
using CoordRepType = CoordinateType;
using PixelType = TPixelType;
using PrimalDataType = TPData;
using DualDataType = TDData;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -85,7 +85,8 @@ class ITK_TEMPLATE_EXPORT QuadEdgeMeshFrontBaseIterator

protected:
// Mesh types
using CoordRepType = typename MeshType::CoordRepType;
using CoordinateType = typename MeshType::CoordRepType;
using CoordRepType = CoordinateType;
// QE types
using QEOriginType = typename QEType::OriginRefType;

Expand Down
3 changes: 2 additions & 1 deletion Modules/Core/QuadEdgeMesh/include/itkQuadEdgeMeshTraits.h
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,8 @@ class QuadEdgeMeshTraits
using Self = QuadEdgeMeshTraits;
using PixelType = TPixel;
using CellPixelType = TPixel;
using CoordRepType = TCoordRep;
using CoordinateType = TCoordRep;
using CoordRepType = CoordinateType;
using InterpolationWeightType = TInterpolationWeight;

static constexpr unsigned int PointDimension = VPointDimension;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -78,7 +78,8 @@ class ITK_TEMPLATE_EXPORT BSplineControlPointImageFunction
/** Image type alias support */
using ControlPointLatticeType = TInputImage;
using InputImageType = TInputImage;
using CoordRepType = TCoordRep;
using CoordinateType = TCoordRep;
using CoordRepType = CoordinateType;
using PixelType = typename InputImageType::PixelType;
using RegionType = typename InputImageType::RegionType;
using IndexType = typename InputImageType::IndexType;
Expand Down
3 changes: 2 additions & 1 deletion Modules/Filtering/ImageGrid/include/itkExpandImageFilter.h
Original file line number Diff line number Diff line change
Expand Up @@ -92,7 +92,8 @@ class ITK_TEMPLATE_EXPORT ExpandImageFilter : public ImageToImageFilter<TInputIm
using OutputImagePointer = typename OutputImageType::Pointer;

/** Typedef support for the interpolation function. */
using CoordRepType = double;
using CoordinateType = double;
using CoordRepType = CoordinateType;
using InterpolatorType = InterpolateImageFunction<InputImageType, CoordRepType>;
using InterpolatorPointer = typename InterpolatorType::Pointer;
using DefaultInterpolatorType = LinearInterpolateImageFunction<InputImageType, CoordRepType>;
Expand Down
3 changes: 2 additions & 1 deletion Modules/Filtering/ImageGrid/include/itkWarpImageFilter.h
Original file line number Diff line number Diff line change
Expand Up @@ -128,7 +128,8 @@ class ITK_TEMPLATE_EXPORT WarpImageFilter : public ImageToImageFilter<TInputImag
using DisplacementType = typename DisplacementFieldType::PixelType;

/** Interpolator type alias support */
using CoordRepType = double;
using CoordinateType = double;
using CoordRepType = CoordinateType;
using InterpolatorType = InterpolateImageFunction<InputImageType, CoordRepType>;
using InterpolatorPointer = typename InterpolatorType::Pointer;
using DefaultInterpolatorType = LinearInterpolateImageFunction<InputImageType, CoordRepType>;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -131,7 +131,8 @@ class ITK_TEMPLATE_EXPORT WarpVectorImageFilter : public ImageToImageFilter<TInp
using DisplacementType = typename DisplacementFieldType::PixelType;

/** Interpolator type alias support */
using CoordRepType = double;
using CoordinateType = double;
using CoordRepType = CoordinateType;
using InterpolatorType = VectorInterpolateImageFunction<InputImageType, CoordRepType>;
using InterpolatorPointer = typename InterpolatorType::Pointer;
using DefaultInterpolatorType = VectorLinearInterpolateImageFunction<InputImageType, CoordRepType>;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -117,7 +117,8 @@ class ITK_TEMPLATE_EXPORT VectorExpandImageFilter : public ImageToImageFilter<TI
using ExpandFactorsArrayType = FixedArray<ExpandFactorsType, ImageDimension>;

/** Typedef support for the interpolation function */
using CoordRepType = double;
using CoordinateType = double;
using CoordRepType = CoordinateType;
using InterpolatorType = VectorInterpolateImageFunction<InputImageType, CoordRepType>;
using InterpolatorPointer = typename InterpolatorType::Pointer;
using DefaultInterpolatorType = VectorLinearInterpolateImageFunction<InputImageType, CoordRepType>;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -67,7 +67,8 @@ class ITK_TEMPLATE_EXPORT ConformalFlatteningMeshFilter : public MeshToMeshFilte

/** Type for representing coordinates. */
// using CoordRepType = typename TInputMesh::CoordRepType;
using CoordRepType = double;
using CoordinateType = double;
using CoordRepType = CoordinateType;

/** Method for creation through the object factory. */
itkNewMacro(Self);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -95,7 +95,8 @@ class ITK_TEMPLATE_EXPORT MeanSquareRegistrationFunction
using typename Superclass::TimeStepType;

/** Interpolator type. */
using CoordRepType = double;
using CoordinateType = double;
using CoordRepType = CoordinateType;
using InterpolatorType = InterpolateImageFunction<MovingImageType, CoordRepType>;
using InterpolatorPointer = typename InterpolatorType::Pointer;
using PointType = typename InterpolatorType::PointType;
Expand Down
3 changes: 2 additions & 1 deletion Modules/Registration/FEM/include/itkFEMRegistrationFilter.h
Original file line number Diff line number Diff line change
Expand Up @@ -190,7 +190,8 @@ class ITK_TEMPLATE_EXPORT FEMRegistrationFilter : public ImageToImageFilter<TMov
using IndexSelectCasterType = itk::VectorIndexSelectionCastImageFilter<FieldType, FloatImageType>;

/** Typedef support for the interpolation function */
using CoordRepType = double;
using CoordinateType = double;
using CoordRepType = CoordinateType;
using InterpolatorType = VectorInterpolateImageFunction<FieldType, CoordRepType>;
using InterpolatorPointer = typename InterpolatorType::Pointer;

Expand Down
3 changes: 2 additions & 1 deletion Modules/Registration/FEM/include/itkMIRegistrationFunction.h
Original file line number Diff line number Diff line change
Expand Up @@ -94,7 +94,8 @@ class ITK_TEMPLATE_EXPORT MIRegistrationFunction
using typename Superclass::TimeStepType;

/** Interpolator type. */
using CoordRepType = double;
using CoordinateType = double;
using CoordRepType = CoordinateType;
using InterpolatorType = InterpolateImageFunction<MovingImageType, CoordRepType>;
using InterpolatorPointer = typename InterpolatorType::Pointer;
using PointType = typename InterpolatorType::PointType;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -95,7 +95,8 @@ class ITK_TEMPLATE_EXPORT NCCRegistrationFunction
using typename Superclass::TimeStepType;

/** Interpolator type. */
using CoordRepType = double;
using CoordinateType = double;
using CoordRepType = CoordinateType;
using InterpolatorType = InterpolateImageFunction<MovingImageType, CoordRepType>;

using InterpolatorPointer = typename InterpolatorType::Pointer;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -98,7 +98,8 @@ class ITK_TEMPLATE_EXPORT GPUDemonsRegistrationFunction
using typename Superclass::TimeStepType;

/** Interpolator type. */
using CoordRepType = double;
using CoordinateType = double;
using CoordRepType = CoordinateType;
using InterpolatorType = InterpolateImageFunction<MovingImageType, CoordRepType>;
using InterpolatorPointer = typename InterpolatorType::Pointer;
using PointType = typename InterpolatorType::PointType;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -71,7 +71,8 @@ class ITK_TEMPLATE_EXPORT ManifoldParzenWindowsPointSetFunction : public PointSe
/** Other type alias */
using RealType = TOutput;
using OutputType = TOutput;
using CoordRepType = TCoordRep;
using CoordinateType = TCoordRep;
using CoordRepType = CoordinateType;

/** Typedef for points locator class to speed up finding neighboring points */
using PointsLocatorType = PointsLocator<PointsContainer>;
Expand Down
3 changes: 2 additions & 1 deletion Modules/Registration/Metricsv4/include/itkPointSetFunction.h
Original file line number Diff line number Diff line change
Expand Up @@ -84,7 +84,8 @@ class ITK_TEMPLATE_EXPORT PointSetFunction : public FunctionBase<typename TInput
using OutputType = TOutput;

/** CoordRepType type alias support */
using CoordRepType = TCoordRep;
using CoordinateType = TCoordRep;
using CoordRepType = CoordinateType;

/** Set the input point set.
* \warning this method caches BufferedRegion information.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -151,7 +151,8 @@ class ITK_TEMPLATE_EXPORT PointSetToPointSetMetricWithIndexv4

using PointType = FixedPointType;
using PixelType = FixedPixelType;
using CoordRepType = typename PointType::CoordRepType;
using CoordinateType = typename PointType::CoordRepType;
using CoordRepType = CoordinateType;
using PointsContainer = FixedPointsContainer;
using PointsConstIterator = typename PointsContainer::ConstIterator;
using PointIdentifier = typename PointsContainer::ElementIdentifier;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -140,7 +140,8 @@ class ITK_TEMPLATE_EXPORT PointSetToPointSetMetricv4

using typename Superclass::PointType;
using typename Superclass::PixelType;
using CoordRepType = typename PointType::CoordRepType;
using CoordinateType = typename PointType::CoordRepType;
using CoordRepType = CoordinateType;
using PointsContainer = FixedPointsContainer;
using PointsConstIterator = typename PointsContainer::ConstIterator;
using typename Superclass::PointIdentifier;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -95,7 +95,8 @@ class ITK_TEMPLATE_EXPORT DemonsRegistrationFunction
using typename Superclass::TimeStepType;

/** Interpolator type. */
using CoordRepType = double;
using CoordinateType = double;
using CoordRepType = CoordinateType;
using InterpolatorType = InterpolateImageFunction<MovingImageType, CoordRepType>;
using InterpolatorPointer = typename InterpolatorType::Pointer;
using PointType = typename InterpolatorType::PointType;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -128,7 +128,8 @@ class ITK_TEMPLATE_EXPORT ESMDemonsRegistrationFunction
using typename Superclass::TimeStepType;

/** Interpolator type. */
using CoordRepType = double;
using CoordinateType = double;
using CoordRepType = CoordinateType;
using InterpolatorType = InterpolateImageFunction<MovingImageType, CoordRepType>;
using InterpolatorPointer = typename InterpolatorType::Pointer;
using PointType = typename InterpolatorType::PointType;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -88,7 +88,8 @@ class ITK_TEMPLATE_EXPORT FastSymmetricForcesDemonsRegistrationFunction
using typename Superclass::TimeStepType;

/** Interpolator type. */
using CoordRepType = double;
using CoordinateType = double;
using CoordRepType = CoordinateType;
using InterpolatorType = InterpolateImageFunction<MovingImageType, CoordRepType>;
using InterpolatorPointer = typename InterpolatorType::Pointer;
using PointType = typename InterpolatorType::PointType;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -98,7 +98,8 @@ class ITK_TEMPLATE_EXPORT LevelSetMotionRegistrationFunction
using typename Superclass::TimeStepType;

/** Interpolator type. */
using CoordRepType = double;
using CoordinateType = double;
using CoordRepType = CoordinateType;
using InterpolatorType = InterpolateImageFunction<MovingImageType, CoordRepType>;
using InterpolatorPointer = typename InterpolatorType::Pointer;
using PointType = typename InterpolatorType::PointType;
Expand Down
Loading

0 comments on commit bdfd0c2

Please sign in to comment.