Skip to content

Commit a65e9eb

Browse files
committed
COMP: Fix no-discard warning
itkShrinkDecimateImageFilter.hxx:184:42: warning: ignoring return value of ‘bool itk::ImageBase<VImageDimension>::TransformPhysicalPointToIndex(const itk::Point<TCoordinate, VImageDimension>&, IndexType&) const [with TCoordinate = double; unsigned int VImageDimension = 3; IndexType = itk::Index<3>]’, declared with attribute ‘nodiscard’ [-Wunused-result]
1 parent e334e83 commit a65e9eb

File tree

1 file changed

+4
-5
lines changed

1 file changed

+4
-5
lines changed

include/itkShrinkDecimateImageFilter.hxx

Lines changed: 4 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -168,20 +168,19 @@ ShrinkDecimateImageFilter<TInputImage, TOutputImage>::GenerateInputRequestedRegi
168168
factorSize[i] = m_ShrinkFactors[i];
169169
}
170170

171-
OutputIndexType outputIndex;
172-
InputIndexType inputIndex, inputRequestedRegionIndex;
171+
InputIndexType inputRequestedRegionIndex;
173172
OutputOffsetType offsetIndex;
174173

175174
typename TInputImage::SizeType inputRequestedRegionSize;
176-
typename TOutputImage::PointType tempPoint;
177175

178176
// Use this index to compute the offset everywhere in this class
179-
outputIndex = outputPtr->GetLargestPossibleRegion().GetIndex();
177+
OutputIndexType outputIndex = outputPtr->GetLargestPossibleRegion().GetIndex();
180178

181179
// We wish to perform the following mapping of outputIndex to
182180
// inputIndex on all points in our region
181+
typename TOutputImage::PointType tempPoint;
183182
outputPtr->TransformIndexToPhysicalPoint(outputIndex, tempPoint);
184-
inputPtr->TransformPhysicalPointToIndex(tempPoint, inputIndex);
183+
InputIndexType inputIndex { inputPtr->TransformPhysicalPointToIndex(tempPoint) };
185184

186185
// Given that the size is scaled by a constant factor eq:
187186
// inputIndex = outputIndex * factorSize

0 commit comments

Comments
 (0)