Skip to content

Commit

Permalink
STYLE: Improve function types used in SignedMaurerDistanceMap
Browse files Browse the repository at this point in the history
Prefer using constants, prefer using raw pointers in threaded methods,
and avoid coping ImageRegion by using const ref.
  • Loading branch information
blowekamp committed Sep 29, 2020
1 parent 4fb2831 commit b706cf6
Showing 1 changed file with 5 additions and 5 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -106,9 +106,9 @@ BinaryContourImageFilter<TInputImage, TOutputImage>::BeforeThreadedGenerateData(
OutputImagePointer output = this->GetOutput();
InputImageConstPointer input = this->GetInput();

RegionType reqRegion = output->GetRequestedRegion();
SizeValueType pixelcount = reqRegion.GetNumberOfPixels();
SizeValueType xsize = reqRegion.GetSize()[0];
const RegionType & reqRegion = output->GetRequestedRegion();
const SizeValueType pixelcount = reqRegion.GetNumberOfPixels();
const SizeValueType xsize = reqRegion.GetSize()[0];
const SizeValueType linecount = (xsize > 0 ? pixelcount / xsize : 0);

m_ForegroundLineMap.clear();
Expand All @@ -123,8 +123,8 @@ void
BinaryContourImageFilter<TInputImage, TOutputImage>::DynamicThreadedGenerateData(
const RegionType & outputRegionForThread)
{
OutputImagePointer output = this->GetOutput();
InputImageConstPointer input = this->GetInput();
OutputImageType * output = this->GetOutput();
const InputImageType * input = this->GetInput();

using InputLineIteratorType = ImageScanlineConstIterator<InputImageType>;
InputLineIteratorType inLineIt(input, outputRegionForThread);
Expand Down

0 comments on commit b706cf6

Please sign in to comment.