Skip to content

Commit

Permalink
COMP: Get ITK_USE_FLOAT_SPACE_PRECISION=ON to compile again
Browse files Browse the repository at this point in the history
  • Loading branch information
dzenanz committed Aug 16, 2024
1 parent 79c8195 commit 667868e
Show file tree
Hide file tree
Showing 6 changed files with 10 additions and 10 deletions.
2 changes: 1 addition & 1 deletion examples/CompleteMontage.cxx
Original file line number Diff line number Diff line change
Expand Up @@ -349,7 +349,7 @@ completeMontage(const itk::TileConfiguration<Dimension> & stageTiles,
{
using TileConfig = itk::TileConfiguration<Dimension>;
using ScalarPixelType = typename itk::NumericTraits<PixelType>::ValueType;
using TransformType = itk::TranslationTransform<double, Dimension>;
using TransformType = itk::TranslationTransform<itk::SpacePrecisionType, Dimension>;
using ScalarImageType = itk::Image<ScalarPixelType, Dimension>;
using OriginalImageType = itk::Image<PixelType, Dimension>; // possibly RGB instead of scalar
using BiasFieldType = LogBiasFieldType<Dimension>;
Expand Down
2 changes: 1 addition & 1 deletion examples/RefineMontage.cxx
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@ refineMontage(const itk::TileConfiguration<Dimension> & stageTiles,
const std::string & inputPath)
{
using TileConfig = itk::TileConfiguration<Dimension>;
using TransformType = itk::TranslationTransform<double, Dimension>;
using TransformType = itk::TranslationTransform<itk::SpacePrecisionType, Dimension>;
using ScalarImageType = itk::Image<PixelType, Dimension>;
typename ScalarImageType::SpacingType sp;
sp.Fill(1.0);
Expand Down
2 changes: 1 addition & 1 deletion examples/ResampleMontage.cxx
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@ resampleMontage(const itk::TileConfiguration<Dimension> & actualTiles,
const std::string & outFilename)
{
using TileConfig = itk::TileConfiguration<Dimension>;
using TransformType = itk::TranslationTransform<double, Dimension>;
using TransformType = itk::TranslationTransform<itk::SpacePrecisionType, Dimension>;
using OriginalImageType = itk::Image<PixelType, Dimension>; // possibly RGB instead of scalar
typename OriginalImageType::SpacingType sp;
typename TransformType::ConstPointer identity = TransformType::New();
Expand Down
4 changes: 2 additions & 2 deletions include/itkPhaseCorrelationOptimizer.hxx
Original file line number Diff line number Diff line change
Expand Up @@ -546,8 +546,8 @@ PhaseCorrelationOptimizer<TRealPixelType, VImageDimension>::ComputeOffset()
ratio = (y0 + y2) / (2 * y1);
if (offsetIndex > 0) // clip to -0.999... to 0.999... range
{
ratio = std::min(ratio, 1.0 - std::numeric_limits<OffsetScalarType>::epsilon());
ratio = std::max(ratio, -1.0 + std::numeric_limits<OffsetScalarType>::epsilon());
ratio = std::min(ratio, 1.0f - std::numeric_limits<OffsetScalarType>::epsilon());
ratio = std::max(ratio, -1.0f + std::numeric_limits<OffsetScalarType>::epsilon());
}
omega = std::acos(ratio);
theta = std::atan((y0 - y2) / (2 * y1 * std::sin(omega)));
Expand Down
6 changes: 3 additions & 3 deletions test/itkMontageTestHelper.hxx
Original file line number Diff line number Diff line change
Expand Up @@ -114,9 +114,9 @@ montageTest(const itk::TileConfiguration<Dimension> & stageTiles,
int result = EXIT_SUCCESS;
using ScalarPixelType = typename itk::NumericTraits<PixelType>::ValueType;
using TileConfig = itk::TileConfiguration<Dimension>;
using PointType = itk::Point<double, Dimension>;
using VectorType = itk::Vector<double, Dimension>;
using TransformType = itk::TranslationTransform<double, Dimension>;
using PointType = itk::Point<itk::SpacePrecisionType, Dimension>;
using VectorType = itk::Vector<itk::SpacePrecisionType, Dimension>;
using TransformType = itk::TranslationTransform<itk::SpacePrecisionType, Dimension>;
using ScalarImageType = itk::Image<ScalarPixelType, Dimension>;
using OriginalImageType = itk::Image<PixelType, Dimension>; // possibly RGB instead of scalar
using PCMType = itk::PhaseCorrelationImageRegistrationMethod<ScalarImageType, ScalarImageType>;
Expand Down
4 changes: 2 additions & 2 deletions test/itkPairwiseTestHelper.hxx
Original file line number Diff line number Diff line change
Expand Up @@ -135,13 +135,13 @@ calculateError(const itk::TileConfiguration<Dimension> &

phaseCorrelationMethod->Update();

using TransformType = itk::TranslationTransform<double, Dimension>;
using TransformType = itk::TranslationTransform<itk::SpacePrecisionType, Dimension>;
static_assert(std::is_same<TransformType, typename PhaseCorrelationMethodType::TransformType>::value,
"PhaseCorrelationMethod's TransformType is expected to be a TranslationTransform");
const TransformType * regTr = phaseCorrelationMethod->GetOutput()->Get();

// calculate error
using VectorType = itk::Vector<double, Dimension>;
using VectorType = itk::Vector<itk::SpacePrecisionType, Dimension>;
VectorType tr = regTr->GetOffset(); // translation measured by registration
for (unsigned d = 0; d < Dimension; d++)
{
Expand Down

0 comments on commit 667868e

Please sign in to comment.