Skip to content

Commit

Permalink
STYLE: Replace "CoordRep" with "Coordinate"
Browse files Browse the repository at this point in the history
Following ITK pull request InsightSoftwareConsortium/ITK#4997 "Deprecate `CoordRepType` and replace it with `CoordinateType`"
  • Loading branch information
N-Dekker committed Jan 8, 2025
1 parent 08644b5 commit 24c54ee
Show file tree
Hide file tree
Showing 73 changed files with 254 additions and 249 deletions.
6 changes: 3 additions & 3 deletions Common/ImageSamplers/itkImageRandomCoordinateSampler.h
Original file line number Diff line number Diff line change
Expand Up @@ -79,10 +79,10 @@ class ITK_TEMPLATE_EXPORT ImageRandomCoordinateSampler : public ImageRandomSampl

/** This image sampler samples the image on physical coordinates and thus
* needs an interpolator. */
using CoordRepType = double;
using InterpolatorType = InterpolateImageFunction<InputImageType, CoordRepType>;
using CoordinateType = double;
using InterpolatorType = InterpolateImageFunction<InputImageType, CoordinateType>;
using InterpolatorPointer = typename InterpolatorType::Pointer;
using DefaultInterpolatorType = BSplineInterpolateImageFunction<InputImageType, CoordRepType, double>;
using DefaultInterpolatorType = BSplineInterpolateImageFunction<InputImageType, CoordinateType, double>;

/** The random number generator used to generate random coordinates. */
using RandomGeneratorType = itk::Statistics::MersenneTwisterRandomVariateGenerator;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -79,10 +79,10 @@ class ITK_TEMPLATE_EXPORT MultiInputImageRandomCoordinateSampler : public ImageR
/** This image sampler samples the image on physical coordinates and thus
* needs an interpolator.
*/
using CoordRepType = double;
using InterpolatorType = InterpolateImageFunction<InputImageType, CoordRepType>;
using CoordinateType = double;
using InterpolatorType = InterpolateImageFunction<InputImageType, CoordinateType>;
using InterpolatorPointer = typename InterpolatorType::Pointer;
using DefaultInterpolatorType = BSplineInterpolateImageFunction<InputImageType, CoordRepType, double>;
using DefaultInterpolatorType = BSplineInterpolateImageFunction<InputImageType, CoordinateType, double>;

/** The random number generator used to generate random coordinates. */
using RandomGeneratorType = itk::Statistics::MersenneTwisterRandomVariateGenerator;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -198,8 +198,9 @@ MultiInputImageRandomCoordinateSampler<TInputImage>::GenerateSampleRegion(
/** Convert to continuous index in input image 0. */
smallestPoint = dir0 * smallestPoint;
largestPoint = dir0 * largestPoint;
smallestContIndex = this->GetInput(0)->template TransformPhysicalPointToContinuousIndex<CoordRepType>(smallestPoint);
largestContIndex = this->GetInput(0)->template TransformPhysicalPointToContinuousIndex<CoordRepType>(largestPoint);
smallestContIndex =
this->GetInput(0)->template TransformPhysicalPointToContinuousIndex<CoordinateType>(smallestPoint);
largestContIndex = this->GetInput(0)->template TransformPhysicalPointToContinuousIndex<CoordinateType>(largestPoint);

/** Support for localised mutual information. */
if (this->GetUseRandomSampleRegion())
Expand Down
2 changes: 1 addition & 1 deletion Common/OpenCL/Filters/itkGPUInterpolateImageFunction.h
Original file line number Diff line number Diff line change
Expand Up @@ -60,7 +60,7 @@ class ITK_TEMPLATE_EXPORT GPUInterpolateImageFunction
/** Superclass typedef support. */
using InputImageType = typename CPUSuperclass::InputImageType;
using ContinuousIndexType = typename CPUSuperclass::ContinuousIndexType;
using CoordRepType = typename CPUSuperclass::CoordRepType;
using CoordinateType = typename CPUSuperclass::CoordinateType;

protected:
GPUInterpolateImageFunction();
Expand Down
12 changes: 6 additions & 6 deletions Common/OpenCL/Filters/itkGPUInterpolatorCopier.h
Original file line number Diff line number Diff line change
Expand Up @@ -61,7 +61,7 @@ namespace itk
*
* \ingroup GPUCommon
*/
template <typename TTypeList, typename NDimensions, typename TInterpolator, typename TOutputCoordRep>
template <typename TTypeList, typename NDimensions, typename TInterpolator, typename TOutputCoordinate>
class ITK_TEMPLATE_EXPORT GPUInterpolatorCopier : public Object
{
public:
Expand All @@ -83,18 +83,18 @@ class ITK_TEMPLATE_EXPORT GPUInterpolatorCopier : public Object
using CPUInterpolatorType = TInterpolator;
using CPUInterpolatorConstPointer = typename CPUInterpolatorType::ConstPointer;
using CPUInputImageType = typename CPUInterpolatorType::InputImageType;
using CPUCoordRepType = typename CPUInterpolatorType::CoordRepType;
using GPUCoordRepType = TOutputCoordRep;
using CPUCoordinateType = typename CPUInterpolatorType::CoordinateType;
using GPUCoordinateType = TOutputCoordinate;

/** Typedef's for non explicit GPU interpolator definitions. */
using GPUInterpolatorType = InterpolateImageFunction<CPUInputImageType, GPUCoordRepType>;
using GPUInterpolatorType = InterpolateImageFunction<CPUInputImageType, GPUCoordinateType>;
using GPUInterpolatorPointer = typename GPUInterpolatorType::Pointer;
using GPUInterpolatorConstPointer = typename GPUInterpolatorType::ConstPointer;

/** Typedef's for explicit GPU interpolator definitions. */
using CPUInputImagePixelType = typename CPUInputImageType::PixelType;
using GPUInputImageType = itk::GPUImage<CPUInputImagePixelType, CPUInputImageType::ImageDimension>;
using GPUExplicitInterpolatorType = InterpolateImageFunction<GPUInputImageType, GPUCoordRepType>;
using GPUExplicitInterpolatorType = InterpolateImageFunction<GPUInputImageType, GPUCoordinateType>;
using GPUExplicitInterpolatorPointer = typename GPUExplicitInterpolatorType::Pointer;
using GPUExplicitInterpolatorConstPointer = typename GPUExplicitInterpolatorType::ConstPointer;

Expand Down Expand Up @@ -123,7 +123,7 @@ class ITK_TEMPLATE_EXPORT GPUInterpolatorCopier : public Object

#ifdef ITK_USE_CONCEPT_CHECKING
// Begin concept checking
itkConceptMacro(OutputCoordRepIsFloatingPointCheck, (Concept::IsFloatingPoint<TOutputCoordRep>));
itkConceptMacro(OutputCoordinateIsFloatingPointCheck, (Concept::IsFloatingPoint<TOutputCoordinate>));
// End concept checking
#endif

Expand Down
35 changes: 18 additions & 17 deletions Common/OpenCL/Filters/itkGPUInterpolatorCopier.hxx
Original file line number Diff line number Diff line change
Expand Up @@ -37,8 +37,8 @@
namespace itk
{
//------------------------------------------------------------------------------
template <typename TTypeList, typename NDimensions, typename TInterpolator, typename TOutputCoordRep>
GPUInterpolatorCopier<TTypeList, NDimensions, TInterpolator, TOutputCoordRep>::GPUInterpolatorCopier()
template <typename TTypeList, typename NDimensions, typename TInterpolator, typename TOutputCoordinate>
GPUInterpolatorCopier<TTypeList, NDimensions, TInterpolator, TOutputCoordinate>::GPUInterpolatorCopier()
{
this->m_InputInterpolator = nullptr;
this->m_Output = nullptr;
Expand All @@ -49,9 +49,9 @@ GPUInterpolatorCopier<TTypeList, NDimensions, TInterpolator, TOutputCoordRep>::G


//------------------------------------------------------------------------------
template <typename TTypeList, typename NDimensions, typename TInterpolator, typename TOutputCoordRep>
template <typename TTypeList, typename NDimensions, typename TInterpolator, typename TOutputCoordinate>
void
GPUInterpolatorCopier<TTypeList, NDimensions, TInterpolator, TOutputCoordRep>::Update()
GPUInterpolatorCopier<TTypeList, NDimensions, TInterpolator, TOutputCoordinate>::Update()
{
if (!this->m_InputInterpolator)
{
Expand All @@ -71,7 +71,8 @@ GPUInterpolatorCopier<TTypeList, NDimensions, TInterpolator, TOutputCoordRep>::U
this->m_InternalTransformTime = t;

// Try Nearest
using NearestNeighborInterpolatorType = NearestNeighborInterpolateImageFunction<CPUInputImageType, CPUCoordRepType>;
using NearestNeighborInterpolatorType =
NearestNeighborInterpolateImageFunction<CPUInputImageType, CPUCoordinateType>;
const auto nearest = dynamic_cast<const NearestNeighborInterpolatorType *>(m_InputInterpolator.GetPointer());

if (nearest)
Expand All @@ -80,45 +81,45 @@ GPUInterpolatorCopier<TTypeList, NDimensions, TInterpolator, TOutputCoordRep>::U
{
// Create GPU NearestNeighbor interpolator in explicit mode
using GPUNearestNeighborInterpolatorType =
GPUNearestNeighborInterpolateImageFunction<GPUInputImageType, GPUCoordRepType>;
GPUNearestNeighborInterpolateImageFunction<GPUInputImageType, GPUCoordinateType>;
this->m_ExplicitOutput = GPUNearestNeighborInterpolatorType::New();
}
else
{
// Create GPU NearestNeighbor interpolator in implicit mode
using GPUNearestNeighborInterpolatorType =
NearestNeighborInterpolateImageFunction<CPUInputImageType, GPUCoordRepType>;
NearestNeighborInterpolateImageFunction<CPUInputImageType, GPUCoordinateType>;
this->m_Output = GPUNearestNeighborInterpolatorType::New();
}
return;
}

// Try Linear
using LinearInterpolatorType = LinearInterpolateImageFunction<CPUInputImageType, CPUCoordRepType>;
using LinearInterpolatorType = LinearInterpolateImageFunction<CPUInputImageType, CPUCoordinateType>;
const auto linear = dynamic_cast<const LinearInterpolatorType *>(m_InputInterpolator.GetPointer());

if (linear)
{
if (this->m_ExplicitMode)
{
// Create GPU Linear interpolator in explicit mode
using GPULinearInterpolatorType = GPULinearInterpolateImageFunction<GPUInputImageType, GPUCoordRepType>;
using GPULinearInterpolatorType = GPULinearInterpolateImageFunction<GPUInputImageType, GPUCoordinateType>;
this->m_ExplicitOutput = GPULinearInterpolatorType::New();
}
else
{
// Create GPU Linear interpolator in implicit mode
using GPULinearInterpolatorType = LinearInterpolateImageFunction<CPUInputImageType, GPUCoordRepType>;
using GPULinearInterpolatorType = LinearInterpolateImageFunction<CPUInputImageType, GPUCoordinateType>;
this->m_Output = GPULinearInterpolatorType::New();
}
return;
}

// Try BSpline
using BSplineInterpolatorType = BSplineInterpolateImageFunction<CPUInputImageType, CPUCoordRepType, double>;
using BSplineInterpolatorType = BSplineInterpolateImageFunction<CPUInputImageType, CPUCoordinateType, double>;
const auto bspline = dynamic_cast<const BSplineInterpolatorType *>(m_InputInterpolator.GetPointer());

using BSplineInterpolatorFloatType = BSplineInterpolateImageFunction<CPUInputImageType, CPUCoordRepType, float>;
using BSplineInterpolatorFloatType = BSplineInterpolateImageFunction<CPUInputImageType, CPUCoordinateType, float>;
const auto bsplineFloat = dynamic_cast<const BSplineInterpolatorFloatType *>(m_InputInterpolator.GetPointer());

if (bspline || bsplineFloat)
Expand All @@ -141,7 +142,7 @@ GPUInterpolatorCopier<TTypeList, NDimensions, TInterpolator, TOutputCoordRep>::U

// Create GPU BSpline interpolator in explicit mode
using GPUBSplineInterpolatorType =
GPUBSplineInterpolateImageFunction<GPUInputImageType, GPUCoordRepType, GPUCoordRepType>;
GPUBSplineInterpolateImageFunction<GPUInputImageType, GPUCoordinateType, GPUCoordinateType>;
auto bsplineInterpolator = GPUBSplineInterpolatorType::New();
bsplineInterpolator->SetSplineOrder(splineOrder);

Expand All @@ -155,7 +156,7 @@ GPUInterpolatorCopier<TTypeList, NDimensions, TInterpolator, TOutputCoordRep>::U
{
// Create GPU BSpline interpolator in implicit mode
using GPUBSplineInterpolatorType =
BSplineInterpolateImageFunction<CPUInputImageType, GPUCoordRepType, GPUCoordRepType>;
BSplineInterpolateImageFunction<CPUInputImageType, GPUCoordinateType, GPUCoordinateType>;
auto bsplineInterpolator = GPUBSplineInterpolatorType::New();
bsplineInterpolator->SetSplineOrder(splineOrder);
this->m_Output = bsplineInterpolator;
Expand All @@ -172,10 +173,10 @@ GPUInterpolatorCopier<TTypeList, NDimensions, TInterpolator, TOutputCoordRep>::U


//------------------------------------------------------------------------------
template <typename TTypeList, typename NDimensions, typename TInterpolator, typename TOutputCoordRep>
template <typename TTypeList, typename NDimensions, typename TInterpolator, typename TOutputCoordinate>
void
GPUInterpolatorCopier<TTypeList, NDimensions, TInterpolator, TOutputCoordRep>::PrintSelf(std::ostream & os,
Indent indent) const
GPUInterpolatorCopier<TTypeList, NDimensions, TInterpolator, TOutputCoordinate>::PrintSelf(std::ostream & os,
Indent indent) const
{
Superclass::PrintSelf(os, indent);
os << indent << "Input Interpolator: " << this->m_InputInterpolator << std::endl;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -562,7 +562,7 @@ AdvancedBSplineDeformableTransformBase<TScalarType, NDimensions>::TransformPoint

for (unsigned int j = 0; j < SpaceDimension; ++j)
{
cindex[j] = static_cast<typename ContinuousIndexType::CoordRepType>(cvector[j]);
cindex[j] = static_cast<typename ContinuousIndexType::CoordinateType>(cvector[j]);
}
return cindex;
}
Expand Down
6 changes: 3 additions & 3 deletions Common/itkMultiResolutionImageRegistrationMethod2.hxx
Original file line number Diff line number Diff line change
Expand Up @@ -217,7 +217,7 @@ MultiResolutionImageRegistrationMethod2<TFixedImage, TMovingImage>::PreparePyram
// Instead of copying the shrinking code, we compute image regions from
// the result of the fixed image pyramid.
using PointType = typename FixedImageType::PointType;
using CoordRepType = typename PointType::CoordRepType;
using CoordinateType = typename PointType::CoordinateType;

PointType inputStartPoint;
PointType inputEndPoint;
Expand All @@ -234,9 +234,9 @@ MultiResolutionImageRegistrationMethod2<TFixedImage, TMovingImage>::PreparePyram
* To be on the safe side, the start point is ceiled, and the end point is
* floored. To see why, consider an image of 4 by 4, and its downsampled version of 2 by 2. */
const auto startcindex =
fixedImageAtLevel->template TransformPhysicalPointToContinuousIndex<CoordRepType>(inputStartPoint);
fixedImageAtLevel->template TransformPhysicalPointToContinuousIndex<CoordinateType>(inputStartPoint);
const auto endcindex =
fixedImageAtLevel->template TransformPhysicalPointToContinuousIndex<CoordRepType>(inputEndPoint);
fixedImageAtLevel->template TransformPhysicalPointToContinuousIndex<CoordinateType>(inputEndPoint);
for (unsigned int dim = 0; dim < TFixedImage::ImageDimension; ++dim)
{
start[dim] = static_cast<IndexValueType>(std::ceil(startcindex[dim]));
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -129,7 +129,7 @@ class ITK_TEMPLATE_EXPORT MultiInputRandomCoordinateSampler

/** This image sampler samples the image on physical coordinates and thus
* needs an interpolator. */
using typename Superclass1::CoordRepType;
using typename Superclass1::CoordinateType;
using typename Superclass1::InterpolatorType;
using typename Superclass1::DefaultInterpolatorType;

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -122,7 +122,7 @@ class ITK_TEMPLATE_EXPORT RandomCoordinateSampler

/** This image sampler samples the image on physical coordinates and thus
* needs an interpolator. */
using typename Superclass1::CoordRepType;
using typename Superclass1::CoordinateType;
using typename Superclass1::InterpolatorType;
using typename Superclass1::DefaultInterpolatorType;

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,7 @@ RandomCoordinateSampler<TElastix>::BeforeEachResolution()
configuration.ReadParameter(splineOrder, "FixedImageBSplineInterpolationOrder", this->GetComponentLabel(), level, 0);
if (splineOrder == 1)
{
using LinearInterpolatorType = itk::LinearInterpolateImageFunction<InputImageType, CoordRepType>;
using LinearInterpolatorType = itk::LinearInterpolateImageFunction<InputImageType, CoordinateType>;
auto fixedImageLinearInterpolator = LinearInterpolatorType::New();
this->SetInterpolator(fixedImageLinearInterpolator);
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,7 @@ namespace elastix
template <typename TElastix>
class ITK_TEMPLATE_EXPORT BSplineInterpolator
: public itk::BSplineInterpolateImageFunction<typename InterpolatorBase<TElastix>::InputImageType,
typename InterpolatorBase<TElastix>::CoordRepType,
typename InterpolatorBase<TElastix>::CoordinateType,
double>
, // CoefficientType
public InterpolatorBase<TElastix>
Expand All @@ -60,7 +60,7 @@ class ITK_TEMPLATE_EXPORT BSplineInterpolator
/** Standard ITK-stuff. */
using Self = BSplineInterpolator;
using Superclass1 = itk::BSplineInterpolateImageFunction<typename InterpolatorBase<TElastix>::InputImageType,
typename InterpolatorBase<TElastix>::CoordRepType,
typename InterpolatorBase<TElastix>::CoordinateType,
double>;
using Superclass2 = InterpolatorBase<TElastix>;
using Pointer = itk::SmartPointer<Self>;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,7 @@ namespace elastix
template <typename TElastix>
class ITK_TEMPLATE_EXPORT BSplineInterpolatorFloat
: public itk::BSplineInterpolateImageFunction<typename InterpolatorBase<TElastix>::InputImageType,
typename InterpolatorBase<TElastix>::CoordRepType,
typename InterpolatorBase<TElastix>::CoordinateType,
float>
, // CoefficientType
public InterpolatorBase<TElastix>
Expand All @@ -60,7 +60,7 @@ class ITK_TEMPLATE_EXPORT BSplineInterpolatorFloat
/** Standard ITK-stuff. */
using Self = BSplineInterpolatorFloat;
using Superclass1 = itk::BSplineInterpolateImageFunction<typename InterpolatorBase<TElastix>::InputImageType,
typename InterpolatorBase<TElastix>::CoordRepType,
typename InterpolatorBase<TElastix>::CoordinateType,
float>;
using Superclass2 = InterpolatorBase<TElastix>;
using Pointer = itk::SmartPointer<Self>;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@ namespace elastix
template <typename TElastix>
class ITK_TEMPLATE_EXPORT LinearInterpolator
: public itk::AdvancedLinearInterpolateImageFunction<typename InterpolatorBase<TElastix>::InputImageType,
typename InterpolatorBase<TElastix>::CoordRepType>
typename InterpolatorBase<TElastix>::CoordinateType>
, public InterpolatorBase<TElastix>
{
public:
Expand All @@ -52,7 +52,7 @@ class ITK_TEMPLATE_EXPORT LinearInterpolator
/** Standard ITK-stuff. */
using Self = LinearInterpolator;
using Superclass1 = itk::AdvancedLinearInterpolateImageFunction<typename InterpolatorBase<TElastix>::InputImageType,
typename InterpolatorBase<TElastix>::CoordRepType>;
typename InterpolatorBase<TElastix>::CoordinateType>;
using Superclass2 = InterpolatorBase<TElastix>;
using Pointer = itk::SmartPointer<Self>;
using ConstPointer = itk::SmartPointer<const Self>;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@ namespace elastix
template <typename TElastix>
class ITK_TEMPLATE_EXPORT NearestNeighborInterpolator
: public itk::NearestNeighborInterpolateImageFunction<typename InterpolatorBase<TElastix>::InputImageType,
typename InterpolatorBase<TElastix>::CoordRepType>
typename InterpolatorBase<TElastix>::CoordinateType>
, public InterpolatorBase<TElastix>
{
public:
Expand All @@ -50,7 +50,7 @@ class ITK_TEMPLATE_EXPORT NearestNeighborInterpolator
/** Standard ITK-stuff. */
using Self = NearestNeighborInterpolator;
using Superclass1 = itk::NearestNeighborInterpolateImageFunction<typename InterpolatorBase<TElastix>::InputImageType,
typename InterpolatorBase<TElastix>::CoordRepType>;
typename InterpolatorBase<TElastix>::CoordinateType>;
using Superclass2 = InterpolatorBase<TElastix>;
using Pointer = itk::SmartPointer<Self>;
using ConstPointer = itk::SmartPointer<const Self>;
Expand Down
Loading

0 comments on commit 24c54ee

Please sign in to comment.