Repository: InsightSoftwareConsortium/ITK (language: python)

Issue:
STYLE: Improve `SpatialObjectToImageFilter::PrintSelf` ivar printing
Improve `itk::SpatialObjectToImageFilter::PrintSelf` ivar printing:
- Print the member variable names verbatim to conform to the ITK SW Guide style guidelines.
- Do not add an extra white space after the variable name to conform to the ITK SW Guide style guidelines.
- Use the `itkPrintSelfBooleanMacro` macro to print boolean objects.

## PR Checklist
- [X] No [API changes](https://github.com/InsightSoftwareConsortium/ITK/blob/master/CONTRIBUTING.md#breaking-changes) were made (or the changes have been approved)
- [X] No [major design changes]


Discussion / hints:
Depends on #3908.
/azp run ITK.Linux
/azp run ITK.Linux
It looks like something needs updating. @thewtex do you know? `ITK.Linux` keeps running into:
```log
+ sudo python3 -m pip install --upgrade setuptools
Collecting setuptools
  Downloading setuptools-71.0.2-py3-none-any.whl (2.3 MB)
ERROR: launchpadlib 1.10.13 requires testresources, which is not installed.
Installing collected packages: setuptools
  Attempting uninstall: setuptools
    Found existing installation: setuptools 45.2.0
    Not uninstalling setuptools at /usr/lib/python3/dist-packages, outside environment /usr
    Can't uninstall 'setuptools'. No files were found to uninstall.
Successfully installed setuptools-71.0.2
+ sudo python3 -m pip install lxml scikit-ci-addons
Collecting lxml
  Downloading lxml-5.2.2-cp38-cp38-manylinux_2_17_x86_64.manylinux2014_x86_64.whl (5.0 MB)
Collecting scikit-ci-addons
  Downloading scikit_ci_addons-0.25.0-py2.py3-none-any.whl (45 kB)
Collecting githubrelease>=1.5.7
  Downloading githubrelease-1.5.9-py2.py3-none-any.whl (20 kB)
Collecting linkheader
  Downloading LinkHeader-0.4.3.tar.gz (4.2 kB)
    ERROR: Command errored out with exit status 1:
     command: /usr/bin/python3 -c 'import sys, setuptools, tokenize; sys.argv[0] = '"'"'/tmp/pip-install-8khfh1kb/linkheader/setup.py'"'"'; __file__='"'"'/tmp/pip-install-8khfh1kb/linkheader/setup.py'"'"';f=getattr(tokenize, '"'"'open'"'"', open)(__file__);code=f.read().replace('"'"'\r\n'"'"', '"'"'\n'"'"');f.close();exec(compile(code, __file__, '"'"'exec'"'"'))' egg_info --egg-base /tmp/pip-install-8khfh1kb/linkheader/pip-egg-info
         cwd: /tmp/pip-install-8khfh1kb/linkheader/
    Complete output (9 lines):
    Traceback (most recent call last):
      File "<string>", line 1, in <module>
      File "/usr/local/lib/python3.8/dist-packages/setuptools/__init__.py", line 19, in <module>
        from .dist import Distribution
      File "/usr/local/lib/python3.8/dist-packages/setuptools/dist.py", line 30, in <module>
        from . import _entry_points
      File "/usr/local/lib/python3.8/dist-packages/setuptools/_entry_points.py", line 44, in <module>
        def validate(eps: metadata.EntryPoints):
    AttributeError: module 'importlib_metadata' has no attribute 'EntryPoints'
    ----------------------------------------
ERROR: Command errored out with exit status 1: python setup.py egg_info Check the logs for full command output.
```
`importlib_metadata` has thrown some breaking changes recently.

I think we could remove the setuptools upgrade step, #4783 

Fix patch:
diff --git a/Examples/DataRepresentation/Image/Image4.cxx b/Examples/DataRepresentation/Image/Image4.cxx
index 1c2b86b362a..cdf0bdf8506 100644
--- a/Examples/DataRepresentation/Image/Image4.cxx
+++ b/Examples/DataRepresentation/Image/Image4.cxx
@@ -441,7 +441,8 @@ main(int, char *[])
   // SoftwareGuide : EndLatex
 
   // Software Guide : BeginCodeSnippet
-  using MatrixType = itk::Matrix<double, Dimension, Dimension>;
+  using MatrixType =
+    itk::Matrix<itk::SpacePrecisionType, Dimension, Dimension>;
   MatrixType SpacingMatrix;
   SpacingMatrix.Fill(0.0F);
 
diff --git a/Modules/Core/ImageFunction/include/itkGaussianDerivativeImageFunction.h b/Modules/Core/ImageFunction/include/itkGaussianDerivativeImageFunction.h
index 1ee316906f4..b42bbfc4792 100644
--- a/Modules/Core/ImageFunction/include/itkGaussianDerivativeImageFunction.h
+++ b/Modules/Core/ImageFunction/include/itkGaussianDerivativeImageFunction.h
@@ -77,7 +77,7 @@ class ITK_TEMPLATE_EXPORT GaussianDerivativeImageFunction
   static constexpr unsigned int ImageDimension2 = ImageDimension;
 #endif
 
-  using ContinuousIndexType = ContinuousIndex<SpacePrecisionType, Self::ImageDimension>;
+  using ContinuousIndexType = typename Superclass::ContinuousIndexType;
 
   using NeighborhoodType = Neighborhood<InputPixelType, Self::ImageDimension>;
   using OperatorNeighborhoodType = Neighborhood<TOutput, Self::ImageDimension>;
@@ -96,7 +96,7 @@ class ITK_TEMPLATE_EXPORT GaussianDerivativeImageFunction
 
   /** Point type alias support */
   // using PointType = Point< TOutput, Self::ImageDimension >;
-  using PointType = typename InputImageType::PointType;
+  using PointType = typename Superclass::PointType;
 
   /** Evaluate the function at the specified point. */
   OutputType
diff --git a/Modules/Core/ImageFunction/include/itkImageFunction.h b/Modules/Core/ImageFunction/include/itkImageFunction.h
index 9fb92052079..df6e2d49473 100644
--- a/Modules/Core/ImageFunction/include/itkImageFunction.h
+++ b/Modules/Core/ImageFunction/include/itkImageFunction.h
@@ -112,7 +112,7 @@ class ITK_TEMPLATE_EXPORT ImageFunction : public FunctionBase<Point<TCoordRep, T
 
   /** Evaluate the function at specified Point position.
    * Subclasses must provide this method. */
-  TOutput
+  OutputType
   Evaluate(const PointType & point) const override = 0;
 
   /** Evaluate the function at specified Index position.
diff --git a/Modules/Filtering/LabelMap/include/itkShapeLabelMapFilter.hxx b/Modules/Filtering/LabelMap/include/itkShapeLabelMapFilter.hxx
index 5346e64fb51..0643018c80e 100644
--- a/Modules/Filtering/LabelMap/include/itkShapeLabelMapFilter.hxx
+++ b/Modules/Filtering/LabelMap/include/itkShapeLabelMapFilter.hxx
@@ -847,7 +847,7 @@ ShapeLabelMapFilter<TImage, TLabelImage>::ComputeOrientedBoundingBox(LabelObject
   // iterate over all corners (2^D) of the pixel
   for (unsigned int p = 0; p < 1u << ImageDimension; ++p)
   {
-    Vector<double, ImageDimension> spacingAxis(0.5 * spacing);
+    Vector<double, ImageDimension> spacingAxis(spacing * 0.5);
 
     // permute signs of spacing vector components, based on a bit of p
     // to component of spacingAxis mapping
diff --git a/Modules/Filtering/Path/include/itkExtractOrthogonalSwath2DImageFilter.hxx b/Modules/Filtering/Path/include/itkExtractOrthogonalSwath2DImageFilter.hxx
index 9b31eb84c7c..eecbf29b527 100644
--- a/Modules/Filtering/Path/include/itkExtractOrthogonalSwath2DImageFilter.hxx
+++ b/Modules/Filtering/Path/include/itkExtractOrthogonalSwath2DImageFilter.hxx
@@ -163,7 +163,7 @@ ExtractOrthogonalSwath2DImageFilter<TImage>::GenerateData()
   ProgressReporter progress(this, 0, outputRegion.GetNumberOfPixels());
 
   using OutputIterator = ImageRegionIteratorWithIndex<ImageType>;
-  using InterpolatorType = LinearInterpolateImageFunction<ImageType, double>;
+  using InterpolatorType = LinearInterpolateImageFunction<ImageType, itk::SpacePrecisionType>;
 
   ImageIndexType                      index;
   double                              orthogonalOffset;
diff --git a/Testing/ContinuousIntegration/AzurePipelinesLinux.yml b/Testing/ContinuousIntegration/AzurePipelinesLinux.yml
index 290812aff0c..bf1ebe533d1 100644
--- a/Testing/ContinuousIntegration/AzurePipelinesLinux.yml
+++ b/Testing/ContinuousIntegration/AzurePipelinesLinux.yml
@@ -53,7 +53,6 @@ jobs:
         sudo pip3 install ninja
         sudo apt-get update
         sudo apt-get install -y python3-venv
-        sudo python3 -m pip install --upgrade setuptools
         sudo python3 -m pip install lxml scikit-ci-addons
       displayName: 'Install dependencies'
 
@@ -126,7 +125,6 @@ jobs:
         sudo pip3 install ninja
         sudo apt-get update
         sudo apt-get install -y python3-venv
-        sudo python3 -m pip install --upgrade setuptools
         sudo python3 -m pip install lxml scikit-ci-addons
       displayName: 'Install dependencies'
 
diff --git a/Testing/ContinuousIntegration/AzurePipelinesLinuxPython.yml b/Testing/ContinuousIntegration/AzurePipelinesLinuxPython.yml
index a2b7d7d20bf..e18a5c6833f 100644
--- a/Testing/ContinuousIntegration/AzurePipelinesLinuxPython.yml
+++ b/Testing/ContinuousIntegration/AzurePipelinesLinuxPython.yml
@@ -51,7 +51,6 @@ jobs:
     - bash: |
         set -x
         python3 -m pip install ninja numpy>=1.20 typing-extensions
-        python3 -m pip install --upgrade setuptools
         python3 -m pip install lxml scikit-ci-addons dask distributed
       displayName: 'Install dependencies'
 


Test patch:
diff --git a/Modules/Core/Common/test/itkSpatialOrientationAdaptorGTest.cxx b/Modules/Core/Common/test/itkSpatialOrientationAdaptorGTest.cxx
index 638da456419..3d519a71053 100644
--- a/Modules/Core/Common/test/itkSpatialOrientationAdaptorGTest.cxx
+++ b/Modules/Core/Common/test/itkSpatialOrientationAdaptorGTest.cxx
@@ -34,10 +34,10 @@ TEST(SpatialOrientationAdaptor, test1)
   EXPECT_EQ(itk::SpatialOrientationEnums::ValidCoordinateOrientations::ITK_COORDINATE_ORIENTATION_RAI,
             adapter.FromDirectionCosines(d1));
 
-  const double  data[] = { 0.5986634407395047, 0.22716302314740483, -0.768113953548866,
-                          0.5627936241740271, 0.563067040943212,   0.6051601804419384,
-                          0.5699696670095713, -0.794576911518317,  0.20924175102261847 };
-  DirectionType d2{ DirectionType::InternalMatrixType{ data } };
+  const itk::SpacePrecisionType data[] = { 0.5986634407395047, 0.22716302314740483, -0.768113953548866,
+                                           0.5627936241740271, 0.563067040943212,   0.6051601804419384,
+                                           0.5699696670095713, -0.794576911518317,  0.20924175102261847 };
+  DirectionType                 d2{ DirectionType::InternalMatrixType{ data } };
   EXPECT_EQ(itk::SpatialOrientationEnums::ValidCoordinateOrientations::ITK_COORDINATE_ORIENTATION_ASL,
             adapter.FromDirectionCosines(d2));
 }
diff --git a/Modules/Core/ImageFunction/test/itkBSplineInterpolateImageFunctionTest.cxx b/Modules/Core/ImageFunction/test/itkBSplineInterpolateImageFunctionTest.cxx
index 2eb46b82f29..cb3ec497dd1 100644
--- a/Modules/Core/ImageFunction/test/itkBSplineInterpolateImageFunctionTest.cxx
+++ b/Modules/Core/ImageFunction/test/itkBSplineInterpolateImageFunctionTest.cxx
@@ -35,7 +35,7 @@
 
 
 using InputPixelType = double;
-using CoordRepType = double;
+using CoordRepType = itk::SpacePrecisionType;
 
 // Set up for 1D Images
 enum
diff --git a/Modules/Core/ImageFunction/test/itkImageAdaptorInterpolateImageFunctionTest.cxx b/Modules/Core/ImageFunction/test/itkImageAdaptorInterpolateImageFunctionTest.cxx
index ba273c63ad5..d2514baf978 100644
--- a/Modules/Core/ImageFunction/test/itkImageAdaptorInterpolateImageFunctionTest.cxx
+++ b/Modules/Core/ImageFunction/test/itkImageAdaptorInterpolateImageFunctionTest.cxx
@@ -49,7 +49,7 @@ enum
 using ImageType = itk::Image<InputPixelType, ImageDimension>;
 using ImageAdaptorType = itk::ImageAdaptor<ImageType, RedChannelPixelAccessor>;
 
-using CoordRepType = double;
+using CoordRepType = itk::SpacePrecisionType;
 
 using InterpolatorType = itk::LinearInterpolateImageFunction<ImageAdaptorType, CoordRepType>;
 using IndexType = InterpolatorType::IndexType;
diff --git a/Modules/Core/ImageFunction/test/itkInterpolateTest.cxx b/Modules/Core/ImageFunction/test/itkInterpolateTest.cxx
index 61b8ac77d45..2c7fbda065a 100644
--- a/Modules/Core/ImageFunction/test/itkInterpolateTest.cxx
+++ b/Modules/Core/ImageFunction/test/itkInterpolateTest.cxx
@@ -25,7 +25,7 @@
 
 using SizeType = itk::Size<3>;
 using ImageType = itk::Image<unsigned short, 3>;
-using CoordRepType = double;
+using CoordRepType = itk::SpacePrecisionType;
 using InterpolatorType = itk::LinearInterpolateImageFunction<ImageType, CoordRepType>;
 using IndexType = InterpolatorType::IndexType;
 using PointType = InterpolatorType::PointType;
diff --git a/Modules/Core/ImageFunction/test/itkRGBInterpolateImageFunctionTest.cxx b/Modules/Core/ImageFunction/test/itkRGBInterpolateImageFunctionTest.cxx
index 4fc452e0667..f76dbc7a17b 100644
--- a/Modules/Core/ImageFunction/test/itkRGBInterpolateImageFunctionTest.cxx
+++ b/Modules/Core/ImageFunction/test/itkRGBInterpolateImageFunctionTest.cxx
@@ -34,7 +34,7 @@ enum
 }; // RGB is a vector of dimension 3
 using PixelType = itk::RGBPixel<unsigned short>;
 using ImageType = itk::Image<PixelType, ImageDimension>;
-using CoordRepType = double;
+using CoordRepType = itk::SpacePrecisionType;
 using InterpolatorType = itk::VectorLinearInterpolateImageFunction<ImageType, CoordRepType>;
 using IndexType = InterpolatorType::IndexType;
 using PointType = InterpolatorType::PointType;
diff --git a/Modules/Core/ImageFunction/test/itkVectorInterpolateImageFunctionTest.cxx b/Modules/Core/ImageFunction/test/itkVectorInterpolateImageFunctionTest.cxx
index 1b728092c75..b4ddee38ac6 100644
--- a/Modules/Core/ImageFunction/test/itkVectorInterpolateImageFunctionTest.cxx
+++ b/Modules/Core/ImageFunction/test/itkVectorInterpolateImageFunctionTest.cxx
@@ -30,7 +30,7 @@ enum
 };
 using PixelType = itk::Vector<unsigned short, VectorDimension>;
 using ImageType = itk::Image<PixelType, ImageDimension>;
-using CoordRepType = double;
+using CoordRepType = itk::SpacePrecisionType;
 using InterpolatorType = itk::VectorLinearInterpolateImageFunction<ImageType, CoordRepType>;
 using IndexType = InterpolatorType::IndexType;
 using PointType = InterpolatorType::PointType;
diff --git a/Modules/Core/ImageFunction/test/itkVectorLinearInterpolateNearestNeighborExtrapolateImageFunctionTest.cxx b/Modules/Core/ImageFunction/test/itkVectorLinearInterpolateNearestNeighborExtrapolateImageFunctionTest.cxx
index 2cbee091e6f..20fe3c14e81 100644
--- a/Modules/Core/ImageFunction/test/itkVectorLinearInterpolateNearestNeighborExtrapolateImageFunctionTest.cxx
+++ b/Modules/Core/ImageFunction/test/itkVectorLinearInterpolateNearestNeighborExtrapolateImageFunctionTest.cxx
@@ -31,7 +31,7 @@ enum
 };
 using PixelType = itk::Vector<unsigned short, VectorDimension>;
 using ImageType = itk::Image<PixelType, ImageDimension>;
-using CoordRepType = double;
+using CoordRepType = itk::SpacePrecisionType;
 
 using InterpolatorType = itk::VectorLinearInterpolateNearestNeighborExtrapolateImageFunction<ImageType, CoordRepType>;
 
diff --git a/Modules/Core/SpatialObjects/test/itkImageMaskSpatialObjectTest2.cxx b/Modules/Core/SpatialObjects/test/itkImageMaskSpatialObjectTest2.cxx
index 705ccd8bd4e..51aac5d9233 100644
--- a/Modules/Core/SpatialObjects/test/itkImageMaskSpatialObjectTest2.cxx
+++ b/Modules/Core/SpatialObjects/test/itkImageMaskSpatialObjectTest2.cxx
@@ -56,7 +56,7 @@ itkImageMaskSpatialObjectTest2(int, char *[])
   // Set the direction for a non-oriented image
   // to better test the frequently encountered case
   // Use non axis aligned image directions
-  itk::Euler3DTransform<double>::Pointer tfm = itk::Euler3DTransform<double>::New();
+  auto tfm = itk::Euler3DTransform<itk::SpacePrecisionType>::New();
   tfm->SetRotation(30.0 * itk::Math::pi_over_180, 15.0 * itk::Math::pi_over_180, 10.0 * itk::Math::pi_over_180);
   const ImageType::DirectionType direction = tfm->GetMatrix();
   image->SetDirection(direction);
diff --git a/Modules/Core/TestKernel/test/itkRandomImageSourceAttributesTest.cxx b/Modules/Core/TestKernel/test/itkRandomImageSourceAttributesTest.cxx
index 59541fd17ba..61d7c025ed3 100644
--- a/Modules/Core/TestKernel/test/itkRandomImageSourceAttributesTest.cxx
+++ b/Modules/Core/TestKernel/test/itkRandomImageSourceAttributesTest.cxx
@@ -76,7 +76,7 @@ itkRandomImageSourceAttributesTest(int, char *[])
     const ImageType2D::SizeType      size{ { 25, 25 } };
     const ImageType2D::SpacingType   spacing{ { { 0.7, 2.1 } } };
     const ImageType2D::PointType     origin{ { { -1.7, 5.2 } } };
-    const double                     d[4] = { 0, 1.0, 1.0, 0 };
+    const itk::SpacePrecisionType    d[4] = { 0, 1.0, 1.0, 0 };
     const ImageType2D::DirectionType direction = ImageType2D::DirectionType::InternalMatrixType(d);
     const ImageType2D::ValueType     min{ 0.0 };
     const ImageType2D::ValueType     max{ 1000.0 };
@@ -90,7 +90,7 @@ itkRandomImageSourceAttributesTest(int, char *[])
     const ImageType3D::SizeType      size{ { 14, 17, 36 } };
     const ImageType3D::SpacingType   spacing{ { { 0.7, 0.4, 1.2 } } };
     const ImageType3D::PointType     origin{ { { -1.7, 5.2, 3.4 } } };
-    const double                     d[9] = { 0, 1.0, 0, 1.0, 0, 0, 0, 1.0, 0 };
+    const itk::SpacePrecisionType    d[9] = { 0, 1.0, 0, 1.0, 0, 0, 0, 1.0, 0 };
     const ImageType3D::DirectionType direction = ImageType3D::DirectionType::InternalMatrixType(d);
     const ImageType3D::ValueType     min{ 0.0 };
     const ImageType3D::ValueType     max{ 10.0 };
diff --git a/Modules/Filtering/ImageGrid/test/itkBinShrinkImageFilterTest2.cxx b/Modules/Filtering/ImageGrid/test/itkBinShrinkImageFilterTest2.cxx
index df0d090acff..d350a58ac5d 100644
--- a/Modules/Filtering/ImageGrid/test/itkBinShrinkImageFilterTest2.cxx
+++ b/Modules/Filtering/ImageGrid/test/itkBinShrinkImageFilterTest2.cxx
@@ -42,7 +42,7 @@ CheckValueIsPhysicalPoint(const TImageType * img)
     for (unsigned int i = 0; i < TImageType::ImageDimension; ++i)
     {
       img->TransformIndexToPhysicalPoint(it.GetIndex(), pt);
-      if (!itk::Math::FloatAlmostEqual(pt[i], it.Get()[i]))
+      if (!itk::Math::FloatAlmostEqual<itk::SpacePrecisionType>(pt[i], it.Get()[i]))
       {
         typename TImageType::PointType::VectorType diff;
         for (unsigned int j = 0; j < TImageType::ImageDimension; ++j)
diff --git a/Modules/Filtering/LabelMap/test/itkShapeLabelMapFilterGTest.cxx b/Modules/Filtering/LabelMap/test/itkShapeLabelMapFilterGTest.cxx
index 432c18b0aaa..9efa32050bc 100644
--- a/Modules/Filtering/LabelMap/test/itkShapeLabelMapFilterGTest.cxx
+++ b/Modules/Filtering/LabelMap/test/itkShapeLabelMapFilterGTest.cxx
@@ -238,9 +238,9 @@ TEST_F(ShapeLabelMapFixture, 3D_T3x2x1_Direction)
 
   DirectionType direction;
 
-  const double d[9] = { 0.7950707161543119,     -0.44533237368675166, 0.41175433605536305,
-                        -0.6065167008084678,    -0.5840224148057925,  0.5394954222649374,
-                        0.00021898465942798317, -0.6786728931900383,  -0.7344406416415056 };
+  const itk::SpacePrecisionType d[9] = { 0.7950707161543119,     -0.44533237368675166, 0.41175433605536305,
+                                         -0.6065167008084678,    -0.5840224148057925,  0.5394954222649374,
+                                         0.00021898465942798317, -0.6786728931900383,  -0.7344406416415056 };
 
   direction = DirectionType::InternalMatrixType(d);
 
@@ -342,9 +342,9 @@ TEST_F(ShapeLabelMapFixture, 3D_T2x2x2_Spacing_Direction)
 
   DirectionType direction;
 
-  const double d[9] = { 0.7950707161543119,     -0.44533237368675166, 0.41175433605536305,
-                        -0.6065167008084678,    -0.5840224148057925,  0.5394954222649374,
-                        0.00021898465942798317, -0.6786728931900383,  -0.7344406416415056 };
+  const itk::SpacePrecisionType d[9] = { 0.7950707161543119,     -0.44533237368675166, 0.41175433605536305,
+                                         -0.6065167008084678,    -0.5840224148057925,  0.5394954222649374,
+                                         0.00021898465942798317, -0.6786728931900383,  -0.7344406416415056 };
 
   direction = DirectionType::InternalMatrixType(d);
 
@@ -455,7 +455,7 @@ TEST_F(ShapeLabelMapFixture, 2D_T1_1_FlipDirection)
 
   DirectionType direction;
 
-  const double d[4] = { 0, 1.0, 1.0, 0 };
+  const itk::SpacePrecisionType d[4] = { 0, 1.0, 1.0, 0 };
 
   direction = DirectionType::InternalMatrixType(d);
 
@@ -489,7 +489,7 @@ TEST_F(ShapeLabelMapFixture, 2D_T1_2_Direction)
 
   DirectionType direction;
 
-  const double d[4] = { 0, 1.0, 1.0, 0 };
+  const itk::SpacePrecisionType d[4] = { 0, 1.0, 1.0, 0 };
 
   direction = DirectionType::InternalMatrixType(d);
 
diff --git a/Modules/IO/NIFTI/test/itkNiftiImageIOTest12.cxx b/Modules/IO/NIFTI/test/itkNiftiImageIOTest12.cxx
index 237ef156fa7..a377ff7f8af 100644
--- a/Modules/IO/NIFTI/test/itkNiftiImageIOTest12.cxx
+++ b/Modules/IO/NIFTI/test/itkNiftiImageIOTest12.cxx
@@ -103,9 +103,9 @@ itkNiftiImageIOTest12(int argc, char * argv[])
 
     ImageType::IndexType threeIndex = { { 3, 3, 3 } };
     ImageType::PointType origPhysLocationIndexThree;
-    image->TransformIndexToPhysicalPoint<double>(threeIndex, origPhysLocationIndexThree);
+    image->TransformIndexToPhysicalPoint<itk::SpacePrecisionType>(threeIndex, origPhysLocationIndexThree);
     ImageType::PointType readPhysLocationIndexThree;
-    readImage->TransformIndexToPhysicalPoint<double>(threeIndex, readPhysLocationIndexThree);
+    readImage->TransformIndexToPhysicalPoint<itk::SpacePrecisionType>(threeIndex, readPhysLocationIndexThree);
 
     // If the origins, and the spacings, and the direction cosines are the smae,
     // then index locations should all represent the same physical locations as well.
diff --git a/Modules/IO/NIFTI/test/itkNiftiImageIOTest14.cxx b/Modules/IO/NIFTI/test/itkNiftiImageIOTest14.cxx
index c9336dbb2c1..84695ce3951 100644
--- a/Modules/IO/NIFTI/test/itkNiftiImageIOTest14.cxx
+++ b/Modules/IO/NIFTI/test/itkNiftiImageIOTest14.cxx
@@ -128,7 +128,7 @@ itkNiftiImageIOTest14(int argc, char * argv[])
 
     auto read_origin = test_image->GetOrigin();
 
-    if (itk::Math::FloatAlmostEqual(read_origin[3], 2.0, 4, 1e-6))
+    if (itk::Math::FloatAlmostEqual<itk::SpacePrecisionType>(read_origin[3], 2.0, 4, 1e-6))
     {
       imageHasCorrectTimeOrigin = true;
     }
diff --git a/Modules/IO/NIFTI/test/itkNiftiReadWriteDirectionTest.cxx b/Modules/IO/NIFTI/test/itkNiftiReadWriteDirectionTest.cxx
index 66e6df5e9e0..7c7d1f377de 100644
--- a/Modules/IO/NIFTI/test/itkNiftiReadWriteDirectionTest.cxx
+++ b/Modules/IO/NIFTI/test/itkNiftiReadWriteDirectionTest.cxx
@@ -67,8 +67,8 @@ template <typename TImage>
 bool
 CheckRotation(typename TImage::Pointer img)
 {
-  vnl_matrix_fixed<double, 3, 3>       rotation = img->GetDirection().GetVnlMatrix().extract(3, 3, 0, 0);
-  const vnl_matrix_fixed<double, 3, 3> candidate_identity = rotation * rotation.transpose();
+  vnl_matrix_fixed<itk::SpacePrecisionType, 3, 3> rotation = img->GetDirection().GetVnlMatrix().extract(3, 3, 0, 0);
+  const vnl_matrix_fixed<itk::SpacePrecisionType, 3, 3> candidate_identity = rotation * rotation.transpose();
   return candidate_identity.is_identity(1.0e-4);
 }