Skip to content

Commit

Permalink
STYLE: Remove unused local ImageRegion variables
Browse files Browse the repository at this point in the history
Fixed ITK.macOS/Darwin/Xcode_13.2.1/clang-1300.0.29.30 warnings that appear when
`ImageRegion` is made trivially copyable, saying:

> warning: unused variable 'requestRegion' [-Wunused-variable]
  • Loading branch information
N-Dekker committed Nov 24, 2023
1 parent 12328e1 commit 9ae32f0
Show file tree
Hide file tree
Showing 13 changed files with 11 additions and 26 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -92,9 +92,8 @@ ZeroFluxNeumannBoundaryCondition<TInputImage, TOutputImage>::GetInputRequestedRe
IndexType outputIndex = outputRequestedRegion.GetIndex();
SizeType outputSize = outputRequestedRegion.GetSize();

IndexType requestIndex;
SizeType requestSize;
RegionType requestRegion;
IndexType requestIndex;
SizeType requestSize;

for (unsigned int i = 0; i < ImageDimension; ++i)
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -31,8 +31,7 @@ itkSpatialObjectToImageStatisticsCalculatorTest(int, char *[])
using EllipseType = itk::EllipseSpatialObject<2>;

// Image Definition
ImageType::RegionType region;
ImageType::SizeType size;
ImageType::SizeType size;
size.Fill(50);
ImageType::SpacingType spacing;
spacing.Fill(1);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,6 @@ BinaryDilateImageFilter<TInputImage, TOutputImage, TKernel>::GenerateData()
KernelType kernel = this->GetKernel();
InputSizeType radius;
radius.Fill(1);
typename TInputImage::RegionType inputRegion = input->GetBufferedRegion();
typename TOutputImage::RegionType outputRegion = output->GetBufferedRegion();

// compute the size of the temp image. It is needed to create the progress
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,6 @@ BinaryErodeImageFilter<TInputImage, TOutputImage, TKernel>::GenerateData()
KernelType kernel = this->GetKernel();
InputSizeType radius;
radius.Fill(1);
typename TInputImage::RegionType inputRegion = input->GetBufferedRegion();
typename TOutputImage::RegionType outputRegion = output->GetBufferedRegion();

// compute the size of the temp image. It is needed to create the progress
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -485,9 +485,6 @@ MirrorPadImageFilter<TInputImage, TOutputImage>::GenerateInputRequestedRegion()
OutputImageSizeType outputSize = outputPtr->GetRequestedRegion().GetSize();
InputImageSizeType inputSize = inputPtr->GetLargestPossibleRegion().GetSize();

OutputImageRegionType outputRegion;
InputImageRegionType inputRegion;

// For n dimensions, there are k^n combinations of before, between, and
// after on these regions. We are keeping this flexible so that we
// can handle other blockings imposed by the mirror and wrap algorithms.
Expand Down
5 changes: 2 additions & 3 deletions Modules/Filtering/ImageGrid/test/itkResampleImageTest8.cxx
Original file line number Diff line number Diff line change
Expand Up @@ -166,9 +166,8 @@ itkResampleImageTest8(int, char *[])
auto tform = TransformType::New();

// OutputImagePointerType outputImage = OutputImageType::New();
OutputImageIndexType outputIndex = { { 0, 0, 0 } };
OutputImageSizeType outputSize = { { 18, 12, 5 } };
OutputImageRegionType outputRegion;
OutputImageIndexType outputIndex = { { 0, 0, 0 } };
OutputImageSizeType outputSize = { { 18, 12, 5 } };

// Create a linear interpolation image function
auto interp = InterpolatorType::New();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -220,8 +220,7 @@ ProjectionImageFilter<TInputImage, TOutputImage, TAccumulator>::DynamicThreadedG
typename TInputImage::SizeType inputSize = inputRegion.GetSize();
typename TInputImage::IndexType inputIndex = inputRegion.GetIndex();

typename TOutputImage::Pointer outputImage = this->GetOutput();
typename TOutputImage::RegionType outputRegion = outputImage->GetLargestPossibleRegion();
typename TOutputImage::Pointer outputImage = this->GetOutput();

typename TOutputImage::SizeType outputSizeForThread = outputRegionForThread.GetSize();
typename TOutputImage::IndexType outputIndexForThread = outputRegionForThread.GetIndex();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -72,9 +72,8 @@ UniformRandomSpatialNeighborSubsampler<TSample, TRegion>::Search(const InstanceI
results->Clear();
results->SetSample(this->m_Sample);

RegionType searchRegion;
IndexType searchStartIndex;
IndexType searchEndIndex;
IndexType searchStartIndex;
IndexType searchEndIndex;

IndexType constraintIndex = this->m_RegionConstraint.GetIndex();
SizeType constraintSize = this->m_RegionConstraint.GetSize();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -96,9 +96,8 @@ CompareHistogramImageToImageMetric<TFixedImage, TMovingImage>::FormTrainingHisto
this->m_TrainingHistogram->Initialize(
this->Superclass::m_HistogramSize, this->Superclass::m_LowerBound, this->Superclass::m_UpperBound);
using TrainingFixedIteratorType = itk::ImageRegionConstIteratorWithIndex<FixedImageType>;
typename FixedImageType::IndexType index;
typename FixedImageType::RegionType fixedRegion;
typename HistogramType::IndexType hIndex;
typename FixedImageType::IndexType index;
typename HistogramType::IndexType hIndex;

TrainingFixedIteratorType ti(this->m_TrainingFixedImage, this->m_TrainingFixedImageRegion);

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -457,8 +457,7 @@ SLICImageFilter<TInputImage, TOutputImage, TDistancePixel>::ThreadedConnectivity


ClusterType cluster(numberOfClusterComponents, &m_Clusters[clusterIndex * numberOfClusterComponents]);
typename InputImageType::RegionType localRegion;
IndexType idx;
IndexType idx;

for (unsigned int d = 0; d < ImageDimension; ++d)
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -1325,7 +1325,6 @@ Segmenter<TInputImage>::GenerateOutputRequestedRegion(DataObject * output)
ImageBase<ImageDimension> * imgData;
ImageBase<ImageDimension> * op;
imgData = dynamic_cast<ImageBase<ImageDimension> *>(output);
typename TInputImage::RegionType c_reg;

if (imgData)
{
Expand Down
1 change: 0 additions & 1 deletion Modules/Video/Core/test/itkImageToVideoFilterTest.cxx
Original file line number Diff line number Diff line change
Expand Up @@ -75,7 +75,6 @@ itkImageToVideoFilterTest(int argc, char * argv[])
ITK_TRY_EXPECT_NO_EXCEPTION(videoFilter->Update());

auto videoOutput = videoFilter->GetOutput();
auto imageRegion = inputImage->GetLargestPossibleRegion();

// Verify start frame and frame duration in output match size of designated temporal axis in input
ITK_TEST_EXPECT_EQUAL(
Expand Down
1 change: 0 additions & 1 deletion Modules/Video/Core/test/itkVectorImageToVideoTest.cxx
Original file line number Diff line number Diff line change
Expand Up @@ -61,7 +61,6 @@ itkVectorImageToVideoTest(int argc, char * argv[])
ITK_TRY_EXPECT_NO_EXCEPTION(videoFilter->Update());

auto videoOutput = videoFilter->GetOutput();
auto imageRegion = inputImage->GetLargestPossibleRegion();

// Verify start frame and frame duration in output match size of designated temporal axis in input
ITK_TEST_EXPECT_EQUAL(
Expand Down

0 comments on commit 9ae32f0

Please sign in to comment.