Skip to content

Commit

Permalink
STYLE: Declare smallestIndex, largestIndex Sampler variables const
Browse files Browse the repository at this point in the history
  • Loading branch information
N-Dekker committed Oct 27, 2023
1 parent 2d5b380 commit c3b58c6
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 9 deletions.
14 changes: 7 additions & 7 deletions Common/ImageSamplers/itkImageRandomCoordinateSampler.hxx
Original file line number Diff line number Diff line change
Expand Up @@ -44,13 +44,13 @@ ImageRandomCoordinateSampler<TInputImage>::GenerateData()
const auto croppedInputImageRegion = this->GetCroppedInputImageRegion();

/** Convert inputImageRegion to bounding box in physical space. */
const auto unitSize = InputImageSizeType::Filled(1);
InputImageIndexType smallestIndex = croppedInputImageRegion.GetIndex();
InputImageIndexType largestIndex = smallestIndex + croppedInputImageRegion.GetSize() - unitSize;
InputImageContinuousIndexType smallestImageContIndex(smallestIndex);
InputImageContinuousIndexType largestImageContIndex(largestIndex);
InputImageContinuousIndexType smallestContIndex;
InputImageContinuousIndexType largestContIndex;
const auto unitSize = InputImageSizeType::Filled(1);
const InputImageIndexType smallestIndex = croppedInputImageRegion.GetIndex();
const InputImageIndexType largestIndex = smallestIndex + croppedInputImageRegion.GetSize() - unitSize;
const InputImageContinuousIndexType smallestImageContIndex(smallestIndex);
const InputImageContinuousIndexType largestImageContIndex(largestIndex);
InputImageContinuousIndexType smallestContIndex;
InputImageContinuousIndexType largestContIndex;
this->GenerateSampleRegion(smallestImageContIndex, largestImageContIndex, smallestContIndex, largestContIndex);

/** Get a handle to the mask. If there was no mask supplied we exercise a multi-threaded version. */
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -178,8 +178,8 @@ MultiInputImageRandomCoordinateSampler<TInputImage>::GenerateSampleRegion(
for (unsigned int i = 0; i < numberOfRegions; ++i)
{
/** Get the outer indices. */
InputImageIndexType smallestIndex = this->GetInputImageRegion(i).GetIndex();
InputImageIndexType largestIndex = smallestIndex + this->GetInputImageRegion(i).GetSize() - unitSize;
const InputImageIndexType smallestIndex = this->GetInputImageRegion(i).GetIndex();
const InputImageIndexType largestIndex = smallestIndex + this->GetInputImageRegion(i).GetSize() - unitSize;

/** Convert to points */
InputImagePointType smallestImagePoint;
Expand Down

0 comments on commit c3b58c6

Please sign in to comment.