Skip to content

Commit

Permalink
STYLE: Remove splitRegion from ParallelizeImageRegionRestrictDirection
Browse files Browse the repository at this point in the history
Simplified the code by using local `splitIndex` and `splitSize` variables
instead.
  • Loading branch information
N-Dekker authored and hjmjohnson committed Dec 17, 2023
1 parent 620b592 commit e04d4c2
Showing 1 changed file with 6 additions and 6 deletions.
12 changes: 6 additions & 6 deletions Modules/Core/Common/include/itkMultiThreaderBase.h
Original file line number Diff line number Diff line change
Expand Up @@ -373,23 +373,23 @@ ITK_GCC_PRAGMA_DIAG_POP()
else // Can split, parallelize!
{
constexpr unsigned int SplitDimension = VDimension - 1;
using SplitRegionType = ImageRegion<SplitDimension>;

SplitRegionType splitRegion;
Index<SplitDimension> splitIndex{};
Size<SplitDimension> splitSize{};
for (unsigned int splitDimension = 0, dimension = 0; dimension < VDimension; ++dimension)
{
if (dimension != restrictedDirection)
{
splitRegion.SetIndex(splitDimension, requestedRegion.GetIndex(dimension));
splitRegion.SetSize(splitDimension, requestedRegion.GetSize(dimension));
splitIndex[splitDimension] = requestedRegion.GetIndex(dimension);
splitSize[splitDimension] = requestedRegion.GetSize(dimension);
++splitDimension;
}
}

this->ParallelizeImageRegion(
SplitDimension,
splitRegion.GetIndex().m_InternalArray,
splitRegion.GetSize().m_InternalArray,
splitIndex.m_InternalArray,
splitSize.m_InternalArray,
[&](const IndexValueType index[], const SizeValueType size[]) {
ImageRegion<VDimension> restrictedRequestedRegion;
restrictedRequestedRegion.SetIndex(restrictedDirection, requestedRegion.GetIndex(restrictedDirection));
Expand Down

0 comments on commit e04d4c2

Please sign in to comment.