Skip to content

Commit 371994f

Browse files
committed
STYLE: CoordRepType -> CoordinateType code readability
For the sake of code readability, a new 'CoordinateType' alias is added for each nested 'CoordRepType' alias. The old 'CoordRepType' aliases will still be available with ITK 6.0, but it is recommended to use 'CoordinateType' instead. The 'CoordRepType' aliases will be removed when 'ITK_FUTURE_LEGACY_REMOVE' is enabled. Similarly, 'InputCoordinateType', 'OutputCoordinateType', and 'ImagePointCoordinateType' replace 'InputCoordRepType', 'OutputCoordRepType', and 'ImagePointCoordRepType', respectively.
1 parent b3a8296 commit 371994f

File tree

3 files changed

+18
-18
lines changed

3 files changed

+18
-18
lines changed

examples/example.cxx

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,7 @@ example_gradientdescent(int argc, char * argv[])
3030
using WriterType = itk::ImageFileWriter<OutputImageType>;
3131
using PathType = itk::PolyLineParametricPath<Dimension>;
3232
using PathFilterType = itk::SpeedFunctionToPathFilter<ImageType, PathType>;
33-
using CoordRepType = PathFilterType::CostFunctionType::CoordRepType;
33+
using CoordinateType = PathFilterType::CostFunctionType::CoordinateType;
3434
using PathIteratorType = itk::PathIterator<OutputImageType, PathType>;
3535

3636
// Get filename arguments
@@ -46,7 +46,7 @@ example_gradientdescent(int argc, char * argv[])
4646
speed->DisconnectPipeline();
4747

4848
// Create interpolator
49-
using InterpolatorType = itk::LinearInterpolateImageFunction<ImageType, CoordRepType>;
49+
using InterpolatorType = itk::LinearInterpolateImageFunction<ImageType, CoordinateType>;
5050
InterpolatorType::Pointer interp = InterpolatorType::New();
5151

5252
// Create cost function
@@ -137,7 +137,7 @@ example_regularstepgradientdescent(int argc, char * argv[])
137137
using WriterType = itk::ImageFileWriter<OutputImageType>;
138138
using PathType = itk::PolyLineParametricPath<Dimension>;
139139
using PathFilterType = itk::SpeedFunctionToPathFilter<ImageType, PathType>;
140-
using CoordRepType = PathFilterType::CostFunctionType::CoordRepType;
140+
using CoordinateType = PathFilterType::CostFunctionType::CoordinateType;
141141
using PathIteratorType = itk::PathIterator<OutputImageType, PathType>;
142142

143143
// Get filename arguments
@@ -153,7 +153,7 @@ example_regularstepgradientdescent(int argc, char * argv[])
153153
speed->DisconnectPipeline();
154154

155155
// Create interpolator
156-
using InterpolatorType = itk::LinearInterpolateImageFunction<ImageType, CoordRepType>;
156+
using InterpolatorType = itk::LinearInterpolateImageFunction<ImageType, CoordinateType>;
157157
InterpolatorType::Pointer interp = InterpolatorType::New();
158158

159159
// Create cost function

include/itkSingleImageCostFunction.h

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -88,19 +88,19 @@ class ITK_TEMPLATE_EXPORT SingleImageCostFunction : public SingleValuedCostFunct
8888
static constexpr unsigned int ImageDimension = ImageType::ImageDimension;
8989

9090
/** Type used for representing point components */
91-
using CoordRepType = Superclass::ParametersValueType;
91+
using CoordinateType = Superclass::ParametersValueType;
9292

9393
/** Type for locations */
9494
using IndexType = Index<ImageDimension>;
95-
using PointType = Point<CoordRepType, ImageDimension>;
96-
using ContinuousIndexType = ContinuousIndex<CoordRepType, ImageDimension>;
95+
using PointType = Point<CoordinateType, ImageDimension>;
96+
using ContinuousIndexType = ContinuousIndex<CoordinateType, ImageDimension>;
9797

9898
/** Type of the Interpolator class */
99-
using InterpolatorType = InterpolateImageFunction<ImageType, CoordRepType>;
100-
using DefaultInterpolatorType = LinearInterpolateImageFunction<ImageType, CoordRepType>;
99+
using InterpolatorType = InterpolateImageFunction<ImageType, CoordinateType>;
100+
using DefaultInterpolatorType = LinearInterpolateImageFunction<ImageType, CoordinateType>;
101101

102102
/** Type of the GradientImageFunction class */
103-
using GradientImageFunctionType = PhysicalCentralDifferenceImageFunction<ImageType, CoordRepType>;
103+
using GradientImageFunctionType = PhysicalCentralDifferenceImageFunction<ImageType, CoordinateType>;
104104

105105
/** Get/set the Interpolator. */
106106
itkSetObjectMacro(Interpolator, InterpolatorType);

test/MinimalPathTest.h

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -195,7 +195,7 @@ Test_SpeedToPath_GradientDescent_ND(int argc, char * argv[])
195195
using WriterType = itk::ImageFileWriter<OutputImageType>;
196196
using PathType = itk::PolyLineParametricPath<Dimension>;
197197
using PathFilterType = itk::SpeedFunctionToPathFilter<ImageType, PathType>;
198-
using CoordRepType = typename PathFilterType::CostFunctionType::CoordRepType;
198+
using CoordinateType = typename PathFilterType::CostFunctionType::CoordinateType;
199199
using PathIteratorType = itk::PathIterator<OutputImageType, PathType>;
200200

201201
try
@@ -232,7 +232,7 @@ Test_SpeedToPath_GradientDescent_ND(int argc, char * argv[])
232232
speed->DisconnectPipeline();
233233

234234
// Create Interpolator
235-
using InterpolatorType = itk::LinearInterpolateImageFunction<ImageType, CoordRepType>;
235+
using InterpolatorType = itk::LinearInterpolateImageFunction<ImageType, CoordinateType>;
236236
typename InterpolatorType::Pointer interp = InterpolatorType::New();
237237

238238
// Create Cost Function
@@ -329,7 +329,7 @@ Test_SpeedToPath_RegularStepGradientDescent_ND(int argc, char * argv[])
329329
using WriterType = itk::ImageFileWriter<OutputImageType>;
330330
using PathType = itk::PolyLineParametricPath<Dimension>;
331331
using PathFilterType = itk::SpeedFunctionToPathFilter<ImageType, PathType>;
332-
using CoordRepType = typename PathFilterType::CostFunctionType::CoordRepType;
332+
using CoordinateType = typename PathFilterType::CostFunctionType::CoordinateType;
333333
using PathIteratorType = itk::PathIterator<OutputImageType, PathType>;
334334

335335
try
@@ -377,7 +377,7 @@ Test_SpeedToPath_RegularStepGradientDescent_ND(int argc, char * argv[])
377377
minspacing = spacing[dim];
378378

379379
// Create Interpolator
380-
using InterpolatorType = itk::LinearInterpolateImageFunction<ImageType, CoordRepType>;
380+
using InterpolatorType = itk::LinearInterpolateImageFunction<ImageType, CoordinateType>;
381381
typename InterpolatorType::Pointer interp = InterpolatorType::New();
382382

383383
// Create Cost Function
@@ -479,7 +479,7 @@ Test_SpeedToPath_IterateNeighborhood_ND(int argc, char * argv[])
479479
using WriterType = itk::ImageFileWriter<OutputImageType>;
480480
using PathType = itk::PolyLineParametricPath<Dimension>;
481481
using PathFilterType = itk::SpeedFunctionToPathFilter<ImageType, PathType>;
482-
using CoordRepType = typename PathFilterType::CostFunctionType::CoordRepType;
482+
using CoordinateType = typename PathFilterType::CostFunctionType::CoordinateType;
483483
using PathIteratorType = itk::PathIterator<OutputImageType, PathType>;
484484

485485
try
@@ -516,7 +516,7 @@ Test_SpeedToPath_IterateNeighborhood_ND(int argc, char * argv[])
516516
speed->DisconnectPipeline();
517517

518518
// Create Interpolator
519-
using InterpolatorType = itk::LinearInterpolateImageFunction<ImageType, CoordRepType>;
519+
using InterpolatorType = itk::LinearInterpolateImageFunction<ImageType, CoordinateType>;
520520
typename InterpolatorType::Pointer interp = InterpolatorType::New();
521521

522522
// Create Cost Function
@@ -616,7 +616,7 @@ Test_SpeedToPath_IterateNeighborhood_ExtendedSeed_ND(int argc, char * argv[])
616616
using WriterType = itk::ImageFileWriter<OutputImageType>;
617617
using PathType = itk::PolyLineParametricPath<Dimension>;
618618
using PathFilterType = itk::SpeedFunctionToPathFilter<ImageType, PathType>;
619-
using CoordRepType = typename PathFilterType::CostFunctionType::CoordRepType;
619+
using CoordinateType = typename PathFilterType::CostFunctionType::CoordinateType;
620620
using PathIteratorType = itk::PathIterator<OutputImageType, PathType>;
621621

622622
try
@@ -653,7 +653,7 @@ Test_SpeedToPath_IterateNeighborhood_ExtendedSeed_ND(int argc, char * argv[])
653653
speed->DisconnectPipeline();
654654

655655
// Create Interpolator
656-
using InterpolatorType = itk::LinearInterpolateImageFunction<ImageType, CoordRepType>;
656+
using InterpolatorType = itk::LinearInterpolateImageFunction<ImageType, CoordinateType>;
657657
typename InterpolatorType::Pointer interp = InterpolatorType::New();
658658

659659
// Create Cost Function

0 commit comments

Comments
 (0)