Skip to content

Commit

Permalink
COMP: Fix [[nodiscard]] warnings of Image "Transform" member functions
Browse files Browse the repository at this point in the history
These warnings have been introduced by
InsightSoftwareConsortium/ITK@63d4354
  • Loading branch information
Simon Rit authored and SimonRit committed Apr 21, 2023
1 parent abe956f commit 37b2cee
Show file tree
Hide file tree
Showing 6 changed files with 21 additions and 12 deletions.
5 changes: 3 additions & 2 deletions include/rtkAmsterdamShroudImageFilter.hxx
Original file line number Diff line number Diff line change
Expand Up @@ -191,8 +191,9 @@ AmsterdamShroudImageFilter<TInputImage>::CropOutsideProjectedBox()
vnl_vector<double> pCornerVnl = m_Geometry->GetMatrices()[iProj].GetVnlMatrix() * corners[ci].GetVnlVector();
for (unsigned int i = 0; i < 2; i++)
pCorner[i] = pCornerVnl[i] / pCornerVnl[2];
itk::ContinuousIndex<double, 3> pCornerI;
this->GetInput()->TransformPhysicalPointToContinuousIndex(pCorner, pCornerI);
using ValueType = typename TInputImage::PointType::ValueType;
const itk::ContinuousIndex<double, 3> pCornerI =
this->GetInput()->template TransformPhysicalPointToContinuousIndex<ValueType, double>(pCorner);
if (ci == 0)
{
pCornerInf = pCornerI;
Expand Down
5 changes: 3 additions & 2 deletions include/rtkCudaBackProjectionImageFilter.hxx
Original file line number Diff line number Diff line change
Expand Up @@ -53,8 +53,9 @@ CudaBackProjectionImageFilter<ImageType>::GPUGenerateData()
// Rotation center (assumed to be at 0 yet)
typename ImageType::PointType rotCenterPoint;
rotCenterPoint.Fill(0.0);
itk::ContinuousIndex<double, Dimension> rotCenterIndex;
this->GetInput(0)->TransformPhysicalPointToContinuousIndex(rotCenterPoint, rotCenterIndex);
using ValueType = typename ImageType::PointType::ValueType;
itk::ContinuousIndex<double, Dimension> rotCenterIndex =
this->GetInput(0)->template TransformPhysicalPointToContinuousIndex<ValueType, double>(rotCenterPoint);

// Include non-zero index in matrix
itk::Matrix<double, 4, 4> matrixIdxVol;
Expand Down
5 changes: 3 additions & 2 deletions include/rtkFDKBackProjectionImageFilter.hxx
Original file line number Diff line number Diff line change
Expand Up @@ -82,8 +82,9 @@ FDKBackProjectionImageFilter<TInputImage, TOutputImage>::DynamicThreadedGenerate
// Rotation center (assumed to be at 0 yet)
typename TInputImage::PointType rotCenterPoint;
rotCenterPoint.Fill(0.0);
itk::ContinuousIndex<double, Dimension> rotCenterIndex;
this->GetInput(0)->TransformPhysicalPointToContinuousIndex(rotCenterPoint, rotCenterIndex);
using ValueType = typename TInputImage::PointType::ValueType;
const itk::ContinuousIndex<double, Dimension> rotCenterIndex =
this->GetInput(0)->template TransformPhysicalPointToContinuousIndex<ValueType, double>(rotCenterPoint);

// Continuous index at which we interpolate
itk::ContinuousIndex<double, Dimension - 1> pointProj;
Expand Down
10 changes: 6 additions & 4 deletions include/rtkForwardWarpImageFilter.hxx
Original file line number Diff line number Diff line change
Expand Up @@ -48,8 +48,9 @@ ForwardWarpImageFilter<TInputImage, TOutputImage, TDVF>::Protected_EvaluateDispl

const DisplacementFieldType * fieldPtr = this->GetDisplacementField();

itk::ContinuousIndex<double, TDVF::ImageDimension> index;
fieldPtr->TransformPhysicalPointToContinuousIndex(point, index);
using ValueType = typename PointType::ValueType;
const itk::ContinuousIndex<double, TDVF::ImageDimension> index =
fieldPtr->template TransformPhysicalPointToContinuousIndex<ValueType, double>(point);
unsigned int dim = 0; // index over dimension
/**
* Compute base index = closest index below point
Expand Down Expand Up @@ -198,8 +199,9 @@ ForwardWarpImageFilter<TInputImage, TOutputImage, TDVF>::GenerateData()
for (unsigned int j = 0; j < TInputImage::ImageDimension; j++)
point[j] += displacement[j];

itk::ContinuousIndex<double, TInputImage::ImageDimension> continuousIndexInOutput;
outputPtr->TransformPhysicalPointToContinuousIndex(point, continuousIndexInOutput);
using ValueType = typename TOutputImage::PointType::ValueType;
itk::ContinuousIndex<double, TInputImage::ImageDimension> continuousIndexInOutput =
outputPtr->template TransformPhysicalPointToContinuousIndex<ValueType, double>(point);

// compute the base index in output, ie the closest index below point
// Check if the baseIndex is in the output's requested region, otherwise skip the splat part
Expand Down
4 changes: 3 additions & 1 deletion include/rtkZengBackProjectionImageFilter.hxx
Original file line number Diff line number Diff line change
Expand Up @@ -191,7 +191,9 @@ ZengBackProjectionImageFilter<TInputImage, TOutputImage>::GenerateOutputInformat
static_cast<ContinuousIndexValueType>(sizeVolume[k] - 1) / 2.0;
}

this->GetInput(0)->TransformContinuousIndexToPhysicalPoint(centerIndex, m_centerVolume);
using ValueType = typename PointType::ValueType;
m_centerVolume =
this->GetInput(0)->template TransformContinuousIndexToPhysicalPoint<CoordRepType, ValueType>(centerIndex);

PointType centerRotation;
centerRotation.Fill(0);
Expand Down
4 changes: 3 additions & 1 deletion include/rtkZengForwardProjectionImageFilter.hxx
Original file line number Diff line number Diff line change
Expand Up @@ -192,7 +192,9 @@ ZengForwardProjectionImageFilter<TInputImage, TOutputImage>::GenerateOutputInfor
static_cast<ContinuousIndexValueType>(sizeVolume[k] - 1) / 2.0;
}

this->GetInput(1)->TransformContinuousIndexToPhysicalPoint(centerIndex, m_centerVolume);
using ValueType = typename PointType::ValueType;
m_centerVolume =
this->GetInput(1)->template TransformContinuousIndexToPhysicalPoint<CoordRepType, ValueType>(centerIndex);

PointType centerRotation;
centerRotation.Fill(0);
Expand Down

0 comments on commit 37b2cee

Please sign in to comment.