Skip to content

Commit

Permalink
COMP: removing hardcoded double parameter type in itkGridTransform.h
Browse files Browse the repository at this point in the history
  • Loading branch information
dzenanz committed Aug 29, 2024
1 parent c16b67f commit cfe73f6
Showing 1 changed file with 10 additions and 10 deletions.
20 changes: 10 additions & 10 deletions include/itkGridTransform.h
Original file line number Diff line number Diff line change
Expand Up @@ -54,15 +54,15 @@
//
namespace itk
{
class GridTransform : public Transform<double, 2, 2>
class GridTransform : public Transform<SpacePrecisionType, 2, 2>
{
public:
// standard typedefs:
typedef GridTransform Self;
typedef SmartPointer<Self> Pointer;
typedef SmartPointer<const Self> ConstPointer;

typedef Transform<double, 2, 2> Superclass;
typedef Transform<SpacePrecisionType, 2, 2> Superclass;

// Base inverse transform type:
typedef Superclass InverseTransformType;
Expand All @@ -75,7 +75,7 @@ class GridTransform : public Transform<double, 2, 2>
itkNewMacro(Self);

/** Standard scalar type for this class. */
typedef double ScalarType;
typedef SpacePrecisionType ScalarType;

/** Dimension of the domain space. */
itkStaticConstMacro(InputSpaceDimension, unsigned int, 2);
Expand Down Expand Up @@ -112,7 +112,7 @@ class GridTransform : public Transform<double, 2, 2>
// ITK does not handle NaN numbers:
if (y[0] != y[0])
{
y[0] = std::numeric_limits<double>::max();
y[0] = std::numeric_limits<OutputPointType::ValueType>::max();
y[1] = y[0];
}

Expand Down Expand Up @@ -145,7 +145,7 @@ class GridTransform : public Transform<double, 2, 2>
// ITK does not handle NaN numbers:
if (x[0] != x[0])
{
x[0] = std::numeric_limits<double>::max();
x[0] = std::numeric_limits<InputPointType::ValueType>::max();
x[1] = x[0];
}

Expand Down Expand Up @@ -295,11 +295,11 @@ class GridTransform : public Transform<double, 2, 2>
// the_grid_transform_t expects uv in the [0,1]x[0,1] range,
// where as we remap it into the image tile physical coordinates
// according to tile_min_ and tile_ext_:
double Su = transform_.tile_ext_[0];
double Sv = transform_.tile_ext_[1];
FixedParametersValueType Su = transform_.tile_ext_[0];
FixedParametersValueType Sv = transform_.tile_ext_[1];

unsigned int idx[3];
double jac[12];
unsigned int idx[3];
FixedParametersValueType jac[12];
jacobian.SetSize(2, GetNumberOfParameters());
jacobian.Fill(0.0);
if (transform_.jacobian(point, idx, jac))
Expand Down Expand Up @@ -328,7 +328,7 @@ class GridTransform : public Transform<double, 2, 2>
this->m_FixedParameters[2] = 0.0;

// tile bbox:
this->m_FixedParameters[3] = std::numeric_limits<double>::max();
this->m_FixedParameters[3] = std::numeric_limits<FixedParametersValueType>::max();
this->m_FixedParameters[4] = this->m_FixedParameters[3];
this->m_FixedParameters[5] = -(this->m_FixedParameters[3]);
this->m_FixedParameters[6] = -(this->m_FixedParameters[3]);
Expand Down

0 comments on commit cfe73f6

Please sign in to comment.