Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Deprecate ...CoordRepType and replace them with ...CoordinateType #5006

Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -31,10 +31,10 @@ itkConicShellInteriorExteriorSpatialFunctionTest(int, char *[])
constexpr unsigned int PointDimension = 3;

// Define the point coordinate representation type
using PointCoordRepType = float;
using PointCoordinateType = float;

// Define the point type
using PointType = itk::Point<PointCoordRepType, PointDimension>;
using PointType = itk::Point<PointCoordinateType, PointDimension>;

// Define the type for the conic spatial function
using ConicShellInteriorExteriorSpatialFunctionType =
Expand Down
4 changes: 2 additions & 2 deletions Modules/Core/Common/test/itkFrustumSpatialFunctionTest.cxx
Original file line number Diff line number Diff line change
Expand Up @@ -29,10 +29,10 @@ itkFrustumSpatialFunctionTest(int, char *[])
constexpr unsigned int PointDimension = 3;

// Define the point coordinate representation type
using PointCoordRepType = float;
using PointCoordinateType = float;

// Define the point type
using PointType = itk::Point<PointCoordRepType, PointDimension>;
using PointType = itk::Point<PointCoordinateType, PointDimension>;

// Define the type for the frustum spatial function
using FrustumSpatialFunctionType = itk::FrustumSpatialFunction<PointDimension, PointType>;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -28,10 +28,10 @@ itkTorusInteriorExteriorSpatialFunctionTest(int, char *[])
constexpr unsigned int PointDimension = 3;

// Define the point coordinate representation type
using PointCoordRepType = float;
using PointCoordinateType = float;

// Define the point type
using PointType = itk::Point<PointCoordRepType, PointDimension>;
using PointType = itk::Point<PointCoordinateType, PointDimension>;

// Define the type for the torus spatial function
using TorusInteriorExteriorSpatialFunctionType = itk::TorusInteriorExteriorSpatialFunction<PointDimension, PointType>;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,11 @@ class ITK_TEMPLATE_EXPORT QuadEdgeMeshToQuadEdgeMeshFilter : public MeshToMeshFi
using InputMeshType = TInputMesh;
using InputMeshPointer = typename InputMeshType::Pointer;
using InputMeshConstPointer = typename InputMeshType::ConstPointer;
using InputCoordRepType = typename InputMeshType::CoordinateType;
using InputCoordinateType = typename InputMeshType::CoordinateType;
#ifndef ITK_FUTURE_LEGACY_REMOVE
using InputCoordRepType ITK_FUTURE_DEPRECATED(
"ITK 6 discourages using `InputCoordRepType`. Please use `InputCoordinateType` instead!") = InputCoordinateType;
#endif
using InputPointType = typename InputMeshType::PointType;
using InputPointIdentifier = typename InputMeshType::PointIdentifier;
using InputQEPrimal = typename InputMeshType::QEPrimal;
Expand All @@ -76,7 +80,11 @@ class ITK_TEMPLATE_EXPORT QuadEdgeMeshToQuadEdgeMeshFilter : public MeshToMeshFi
using OutputMeshType = TOutputMesh;
using OutputMeshPointer = typename OutputMeshType::Pointer;
using OutputMeshConstPointer = typename OutputMeshType::ConstPointer;
using OutputCoordRepType = typename OutputMeshType::CoordinateType;
using OutputCoordinateType = typename OutputMeshType::CoordinateType;
#ifndef ITK_FUTURE_LEGACY_REMOVE
using OutputCoordRepType ITK_FUTURE_DEPRECATED(
"ITK 6 discourages using `OutputCoordRepType`. Please use `OutputCoordinateType` instead!") = OutputCoordinateType;
#endif
using OutputPointType = typename OutputMeshType::PointType;
using OutputPointIdentifier = typename OutputMeshType::PointIdentifier;
using OutputQEPrimal = typename OutputMeshType::QEPrimal;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -63,7 +63,12 @@ class ITK_TEMPLATE_EXPORT BSplineTransformInitializer : public Object
using ImagePointer = typename ImageType::ConstPointer;
using IndexType = typename ImageType::IndexType;
using ImagePointType = typename ImageType::PointType;
using ImagePointCoordRepType = typename ImagePointType::CoordinateType;
using ImagePointCoordinateType = typename ImagePointType::CoordinateType;
#ifndef ITK_FUTURE_LEGACY_REMOVE
using ImagePointCoordRepType ITK_FUTURE_DEPRECATED(
"ITK 6 discourages using `ImagePointCoordRepType`. Please use `ImagePointCoordinateType` instead!") =
ImagePointCoordinateType;
#endif

/** Types defined from transform traits. */
using TransformPointer = typename TransformType::Pointer;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -92,7 +92,11 @@ class ITK_TEMPLATE_EXPORT BorderQuadEdgeMeshFilter : public QuadEdgeMeshToQuadEd

using InputMeshType = TInputMesh;
using InputMeshConstPointer = typename InputMeshType::ConstPointer;
using InputCoordRepType = typename InputMeshType::CoordinateType;
using InputCoordinateType = typename InputMeshType::CoordinateType;
#ifndef ITK_FUTURE_LEGACY_REMOVE
using InputCoordRepType ITK_FUTURE_DEPRECATED(
"ITK 6 discourages using `InputCoordRepType`. Please use `InputCoordinateType` instead!") = InputCoordinateType;
#endif
using InputPointType = typename InputMeshType::PointType;
using InputTraits = typename InputMeshType::Traits;
using InputPointIdentifier = typename InputMeshType::PointIdentifier;
Expand All @@ -111,7 +115,11 @@ class ITK_TEMPLATE_EXPORT BorderQuadEdgeMeshFilter : public QuadEdgeMeshToQuadEd

using OutputMeshType = TOutputMesh;
using OutputMeshPointer = typename OutputMeshType::Pointer;
using OutputCoordRepType = typename OutputMeshType::CoordinateType;
using OutputCoordinateType = typename OutputMeshType::CoordinateType;
#ifndef ITK_FUTURE_LEGACY_REMOVE
using OutputCoordRepType ITK_FUTURE_DEPRECATED(
"ITK 6 discourages using `OutputCoordRepType`. Please use `OutputCoordinateType` instead!") = OutputCoordinateType;
#endif
using OutputPointType = typename OutputMeshType::PointType;
using OutputTraits = typename OutputMeshType::Traits;
using OutputPointIdentifier = typename OutputMeshType::PointIdentifier;
Expand Down Expand Up @@ -153,8 +161,8 @@ class ITK_TEMPLATE_EXPORT BorderQuadEdgeMeshFilter : public QuadEdgeMeshToQuadEd
itkSetEnumMacro(BorderPick, BorderPickEnum);
itkGetConstMacro(BorderPick, BorderPickEnum);

itkSetMacro(Radius, InputCoordRepType);
itkGetConstMacro(Radius, InputCoordRepType);
itkSetMacro(Radius, InputCoordinateType);
itkGetConstMacro(Radius, InputCoordinateType);

void
ComputeTransform();
Expand All @@ -176,7 +184,7 @@ class ITK_TEMPLATE_EXPORT BorderQuadEdgeMeshFilter : public QuadEdgeMeshToQuadEd
BorderTransformEnum m_TransformType{};
BorderPickEnum m_BorderPick{};

InputCoordRepType m_Radius{};
InputCoordinateType m_Radius{};

InputVectorPointType m_Border{};

Expand All @@ -200,7 +208,7 @@ class ITK_TEMPLATE_EXPORT BorderQuadEdgeMeshFilter : public QuadEdgeMeshToQuadEd
InputPointType
GetMeshBarycentre();

InputCoordRepType
InputCoordinateType
RadiusMaxSquare();

void
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -107,9 +107,9 @@ BorderQuadEdgeMeshFilter<TInputMesh, TOutputMesh>::ComputeLongestBorder() -> Inp
itkGenericExceptionMacro("This filter requires at least one boundary");
}

InputCoordRepType max_length(0.0);
InputCoordRepType length(0.0);
auto oborder_it = list->begin();
InputCoordinateType max_length(0.0);
InputCoordinateType length(0.0);
auto oborder_it = list->begin();

for (auto b_it = list->begin(); b_it != list->end(); ++b_it)
{
Expand Down Expand Up @@ -194,21 +194,21 @@ BorderQuadEdgeMeshFilter<TInputMesh, TOutputMesh>::DiskTransform()

auto NbBoundaryPt = static_cast<InputPointIdentifier>(this->m_BoundaryPtMap.size());

InputCoordRepType r = this->RadiusMaxSquare();
InputCoordinateType r = this->RadiusMaxSquare();

InputCoordRepType two_r = 2.0 * r;
InputCoordRepType inv_two_r = 1.0 / two_r;
InputCoordinateType two_r = 2.0 * r;
InputCoordinateType inv_two_r = 1.0 / two_r;

InputPointIdentifier id = this->m_BoundaryPtMap.begin()->first;
InputPointType pt1 = input->GetPoint(id);

id = (--m_BoundaryPtMap.end())->first;
InputPointType pt2 = input->GetPoint(id);

InputCoordRepType dist = pt1.SquaredEuclideanDistanceTo(pt2);
InputCoordinateType dist = pt1.SquaredEuclideanDistanceTo(pt2);

std::vector<InputCoordRepType> tetas(NbBoundaryPt, 0.0);
tetas[0] = static_cast<InputCoordRepType>(std::acos((two_r - dist) * inv_two_r));
std::vector<InputCoordinateType> tetas(NbBoundaryPt, 0.0);
tetas[0] = static_cast<InputCoordinateType>(std::acos((two_r - dist) * inv_two_r));

auto BoundaryPtIterator = this->m_BoundaryPtMap.begin();

Expand All @@ -231,7 +231,7 @@ BorderQuadEdgeMeshFilter<TInputMesh, TOutputMesh>::DiskTransform()
++BoundaryPtIterator;
}

InputCoordRepType a = (2.0 * itk::Math::pi) / tetas[NbBoundaryPt - 1];
InputCoordinateType a = (2.0 * itk::Math::pi) / tetas[NbBoundaryPt - 1];

if (this->m_Radius == 0.0)
{
Expand All @@ -244,8 +244,8 @@ BorderQuadEdgeMeshFilter<TInputMesh, TOutputMesh>::DiskTransform()
id = BoundaryPtMapIterator->first;
j = BoundaryPtMapIterator->second;

pt1[0] = this->m_Radius * static_cast<InputCoordRepType>(std::cos(a * tetas[j]));
pt1[1] = this->m_Radius * static_cast<InputCoordRepType>(std::sin(a * tetas[j]));
pt1[0] = this->m_Radius * static_cast<InputCoordinateType>(std::cos(a * tetas[j]));
pt1[1] = this->m_Radius * static_cast<InputCoordinateType>(std::sin(a * tetas[j]));
pt1[2] = 0.0;

this->m_Border[j] = pt1;
Expand All @@ -255,19 +255,19 @@ BorderQuadEdgeMeshFilter<TInputMesh, TOutputMesh>::DiskTransform()
// ----------------------------------------------------------------------------
template <typename TInputMesh, typename TOutputMesh>
auto
BorderQuadEdgeMeshFilter<TInputMesh, TOutputMesh>::RadiusMaxSquare() -> InputCoordRepType
BorderQuadEdgeMeshFilter<TInputMesh, TOutputMesh>::RadiusMaxSquare() -> InputCoordinateType
{
InputMeshConstPointer input = this->GetInput();

InputPointType center = this->GetMeshBarycentre();

InputCoordRepType oRmax(0.);
InputCoordRepType r;
InputCoordinateType oRmax(0.);
InputCoordinateType r;

for (auto BoundaryPtIterator = this->m_BoundaryPtMap.begin(); BoundaryPtIterator != this->m_BoundaryPtMap.end();
++BoundaryPtIterator)
{
r = static_cast<InputCoordRepType>(center.SquaredEuclideanDistanceTo(input->GetPoint(BoundaryPtIterator->first)));
r = static_cast<InputCoordinateType>(center.SquaredEuclideanDistanceTo(input->GetPoint(BoundaryPtIterator->first)));

if (r > oRmax)
{
Expand Down Expand Up @@ -306,7 +306,7 @@ BorderQuadEdgeMeshFilter<TInputMesh, TOutputMesh>::GetMeshBarycentre() -> InputP
++PointIterator;
}

InputCoordRepType invNbOfPoints = 1.0 / static_cast<InputCoordRepType>(input->GetNumberOfPoints());
InputCoordinateType invNbOfPoints = 1.0 / static_cast<InputCoordinateType>(input->GetNumberOfPoints());

for (i = 0; i < PointDimension; ++i)
{
Expand Down Expand Up @@ -355,10 +355,10 @@ BorderQuadEdgeMeshFilter<TInputMesh, TOutputMesh>::ArcLengthSquareTransform()

auto NbBoundaryPt = static_cast<InputPointIdentifier>(this->m_BoundaryPtMap.size());

std::vector<InputCoordRepType> Length(NbBoundaryPt + 1, 0.0);
std::vector<InputCoordinateType> Length(NbBoundaryPt + 1, 0.0);

InputCoordRepType TotalLength(0.0);
InputCoordRepType distance;
InputCoordinateType TotalLength(0.0);
InputCoordinateType distance;

InputPointIdentifier i(0);
InputPointIdentifier org(0);
Expand All @@ -384,8 +384,8 @@ BorderQuadEdgeMeshFilter<TInputMesh, TOutputMesh>::ArcLengthSquareTransform()
this->m_Radius = 1000.;
}

InputCoordRepType EdgeLength = 2.0 * this->m_Radius;
InputCoordRepType ratio = 4.0 * EdgeLength / TotalLength;
InputCoordinateType EdgeLength = 2.0 * this->m_Radius;
InputCoordinateType ratio = 4.0 * EdgeLength / TotalLength;

for (i = 0; i < NbBoundaryPt + 1; ++i)
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,7 @@ class ITK_TEMPLATE_EXPORT CleanQuadEdgeMeshFilter : public QuadEdgeMeshToQuadEdg

using InputMeshType = TInputMesh;
using typename Superclass::InputMeshPointer;
using typename Superclass::InputCoordRepType;
using typename Superclass::InputCoordinateType;
using typename Superclass::InputPointType;
using typename Superclass::InputPointIdentifier;
using typename Superclass::InputQEPrimal;
Expand All @@ -74,7 +74,7 @@ class ITK_TEMPLATE_EXPORT CleanQuadEdgeMeshFilter : public QuadEdgeMeshToQuadEdg

using OutputMeshType = TOutputMesh;
using typename Superclass::OutputMeshPointer;
using typename Superclass::OutputCoordRepType;
using typename Superclass::OutputCoordinateType;
using typename Superclass::OutputPointType;
using typename Superclass::OutputPointIdentifier;
using typename Superclass::OutputQEPrimal;
Expand All @@ -88,7 +88,7 @@ class ITK_TEMPLATE_EXPORT CleanQuadEdgeMeshFilter : public QuadEdgeMeshToQuadEdg
using OutputCellsContainerIterator = typename OutputMeshType::CellsContainerIterator;

using BoundingBoxType =
BoundingBox<InputPointIdentifier, Self::PointDimension, InputCoordRepType, InputPointsContainer>;
BoundingBox<InputPointIdentifier, Self::PointDimension, InputCoordinateType, InputPointsContainer>;

using BoundingBoxPointer = typename BoundingBoxType::Pointer;

Expand All @@ -99,12 +99,12 @@ class ITK_TEMPLATE_EXPORT CleanQuadEdgeMeshFilter : public QuadEdgeMeshToQuadEdg
using DecimationPointer = typename DecimationType::Pointer;

/** TODO */
itkSetMacro(AbsoluteTolerance, InputCoordRepType);
itkGetConstMacro(AbsoluteTolerance, InputCoordRepType);
itkSetMacro(AbsoluteTolerance, InputCoordinateType);
itkGetConstMacro(AbsoluteTolerance, InputCoordinateType);

/** TODO */
itkSetClampMacro(RelativeTolerance, InputCoordRepType, 0.0, 1.0);
itkGetConstMacro(RelativeTolerance, InputCoordRepType);
itkSetClampMacro(RelativeTolerance, InputCoordinateType, 0.0, 1.0);
itkGetConstMacro(RelativeTolerance, InputCoordinateType);

protected:
CleanQuadEdgeMeshFilter();
Expand All @@ -115,7 +115,7 @@ class ITK_TEMPLATE_EXPORT CleanQuadEdgeMeshFilter : public QuadEdgeMeshToQuadEdg
GenerateData() override;

virtual void
MergePoints(const InputCoordRepType absoluteToleranceSquared);
MergePoints(const InputCoordinateType absoluteToleranceSquared);

virtual void
CleanPoints();
Expand All @@ -124,8 +124,8 @@ class ITK_TEMPLATE_EXPORT CleanQuadEdgeMeshFilter : public QuadEdgeMeshToQuadEdg
PrintSelf(std::ostream & os, Indent indent) const override;

private:
InputCoordRepType m_AbsoluteTolerance{};
InputCoordRepType m_RelativeTolerance{};
InputCoordinateType m_AbsoluteTolerance{};
InputCoordinateType m_RelativeTolerance{};

BoundingBoxPointer m_BoundingBox{};
CriterionPointer m_Criterion{};
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -26,8 +26,8 @@ namespace itk
template <typename TInputMesh, typename TOutputMesh>
CleanQuadEdgeMeshFilter<TInputMesh, TOutputMesh>::CleanQuadEdgeMeshFilter()
{
this->m_AbsoluteTolerance = InputCoordRepType{};
this->m_RelativeTolerance = InputCoordRepType{};
this->m_AbsoluteTolerance = InputCoordinateType{};
this->m_RelativeTolerance = InputCoordinateType{};

this->m_BoundingBox = BoundingBoxType::New();

Expand All @@ -43,9 +43,9 @@ template <typename TInputMesh, typename TOutputMesh>
void
CleanQuadEdgeMeshFilter<TInputMesh, TOutputMesh>::GenerateData()
{
InputCoordRepType zeroValue{};
InputCoordinateType zeroValue{};

InputCoordRepType absoluteToleranceSquared = this->m_AbsoluteTolerance * this->m_AbsoluteTolerance;
InputCoordinateType absoluteToleranceSquared = this->m_AbsoluteTolerance * this->m_AbsoluteTolerance;
if ((Math::ExactlyEquals(this->m_AbsoluteTolerance, zeroValue)) &&
(Math::NotExactlyEquals(this->m_RelativeTolerance, zeroValue)))
{
Expand All @@ -63,7 +63,7 @@ CleanQuadEdgeMeshFilter<TInputMesh, TOutputMesh>::GenerateData()

template <typename TInputMesh, typename TOutputMesh>
void
CleanQuadEdgeMeshFilter<TInputMesh, TOutputMesh>::MergePoints(const InputCoordRepType absoluteToleranceSquared)
CleanQuadEdgeMeshFilter<TInputMesh, TOutputMesh>::MergePoints(const InputCoordinateType absoluteToleranceSquared)
{
OutputMeshPointer output = this->GetOutput();

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,11 @@ class ITK_TEMPLATE_EXPORT DelaunayConformingQuadEdgeMeshFilter
/** Input types. */
using InputMeshType = TInputMesh;
using InputMeshPointer = typename InputMeshType::Pointer;
using InputCoordRepType = typename InputMeshType::CoordinateType;
using InputCoordinateType = typename InputMeshType::CoordinateType;
#ifndef ITK_FUTURE_LEGACY_REMOVE
using InputCoordRepType ITK_FUTURE_DEPRECATED(
"ITK 6 discourages using `InputCoordRepType`. Please use `InputCoordinateType` instead!") = InputCoordinateType;
#endif
using InputPointType = typename InputMeshType::PointType;
using InputPointVectorType = typename InputPointType::VectorType;
using InputPointIdentifier = typename InputMeshType::PointIdentifier;
Expand All @@ -73,7 +77,11 @@ class ITK_TEMPLATE_EXPORT DelaunayConformingQuadEdgeMeshFilter
/** Output types. */
using OutputMeshType = TOutputMesh;
using OutputMeshPointer = typename OutputMeshType::Pointer;
using OutputCoordRepType = typename OutputMeshType::CoordinateType;
using OutputCoordinateType = typename OutputMeshType::CoordinateType;
#ifndef ITK_FUTURE_LEGACY_REMOVE
using OutputCoordRepType ITK_FUTURE_DEPRECATED(
"ITK 6 discourages using `OutputCoordRepType`. Please use `OutputCoordinateType` instead!") = OutputCoordinateType;
#endif
using OutputPointType = typename OutputMeshType::PointType;
using OutputPointIdentifier = typename OutputMeshType::PointIdentifier;
using OutputCellType = typename OutputMeshType::CellType;
Expand Down Expand Up @@ -166,10 +174,10 @@ class ITK_TEMPLATE_EXPORT DelaunayConformingQuadEdgeMeshFilter
OutputVectorType v2A = ptA - pt2;
OutputVectorType v2B = ptB - pt2;

OutputCoordRepType sq_norm1A = v1A * v1A;
OutputCoordRepType sq_norm1B = v1B * v1B;
OutputCoordRepType sq_norm2A = v2A * v2A;
OutputCoordRepType sq_norm2B = v2B * v2B;
OutputCoordinateType sq_norm1A = v1A * v1A;
OutputCoordinateType sq_norm1B = v1B * v1B;
OutputCoordinateType sq_norm2A = v2A * v2A;
OutputCoordinateType sq_norm2B = v2B * v2B;

auto dotA = static_cast<CriterionValueType>(v1A * v2A);
auto dotB = static_cast<CriterionValueType>(v1B * v2B);
Expand Down
Loading
Loading