Skip to content

Commit ef01cad

Browse files
committed
STYLE: Adjust several scripts to adhere to clang format
1 parent 3d4b8b0 commit ef01cad

File tree

4 files changed

+84
-82
lines changed

4 files changed

+84
-82
lines changed

include/itkLabelSetDilateImageFilter.hxx

Lines changed: 22 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -32,31 +32,32 @@ namespace itk
3232
template <typename TInputImage, typename TOutputImage>
3333
void
3434
LabelSetDilateImageFilter<TInputImage, TOutputImage>::ThreadedGenerateData(
35-
const OutputImageRegionType & outputRegionForThread, ThreadIdType threadId)
35+
const OutputImageRegionType & outputRegionForThread,
36+
ThreadIdType threadId)
3637
{
37-
// compute the number of rows first, so we can setup a progress reporter
38-
typename std::vector< unsigned int > NumberOfRows;
39-
InputSizeType size = outputRegionForThread.GetSize();
38+
// compute the number of rows first, so we can setup a progress reporter
39+
typename std::vector<unsigned int> NumberOfRows;
40+
InputSizeType size = outputRegionForThread.GetSize();
4041

41-
for ( unsigned int i = 0; i < InputImageDimension; i++ )
42+
for (unsigned int i = 0; i < InputImageDimension; i++)
43+
{
44+
NumberOfRows.push_back(1);
45+
for (unsigned int d = 0; d < InputImageDimension; d++)
4246
{
43-
NumberOfRows.push_back(1);
44-
for ( unsigned int d = 0; d < InputImageDimension; d++ )
45-
{
46-
if ( d != i )
47-
{
48-
NumberOfRows[i] *= size[d];
49-
}
50-
}
47+
if (d != i)
48+
{
49+
NumberOfRows[i] *= size[d];
50+
}
5151
}
52-
float progressPerDimension = 1.0 / ImageDimension;
53-
54-
auto *progress = new ProgressReporter(this,
55-
threadId,
56-
NumberOfRows[this->m_CurrentDimension],
57-
30,
58-
this->m_CurrentDimension * progressPerDimension,
59-
progressPerDimension);
52+
}
53+
float progressPerDimension = 1.0 / ImageDimension;
54+
55+
auto * progress = new ProgressReporter(this,
56+
threadId,
57+
NumberOfRows[this->m_CurrentDimension],
58+
30,
59+
this->m_CurrentDimension * progressPerDimension,
60+
progressPerDimension);
6061

6162
// this is where the work happens. We use a distance image with
6263
// floating point pixel to perform the parabolic operations. The

include/itkLabelSetErodeImageFilter.hxx

Lines changed: 17 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,8 @@ namespace itk
3232
template <typename TInputImage, typename TOutputImage>
3333
void
3434
LabelSetErodeImageFilter<TInputImage, TOutputImage>::ThreadedGenerateData(
35-
const OutputImageRegionType & outputRegionForThread, ThreadIdType threadId)
35+
const OutputImageRegionType & outputRegionForThread,
36+
ThreadIdType threadId)
3637
{
3738
// this is where the work happens. We use a distance image with
3839
// floating point pixel to perform the parabolic operations. The
@@ -43,28 +44,28 @@ LabelSetErodeImageFilter<TInputImage, TOutputImage>::ThreadedGenerateData(
4344
// Similarly, the thresholding on output needs to be integrated
4445
// with the last processing stage.
4546

46-
typename std::vector< unsigned int > NumberOfRows;
47-
InputSizeType size = outputRegionForThread.GetSize();
47+
typename std::vector<unsigned int> NumberOfRows;
48+
InputSizeType size = outputRegionForThread.GetSize();
4849

49-
for ( unsigned int i = 0; i < InputImageDimension; i++ )
50+
for (unsigned int i = 0; i < InputImageDimension; i++)
5051
{
51-
NumberOfRows.push_back(1);
52-
for ( unsigned int d = 0; d < InputImageDimension; d++ )
52+
NumberOfRows.push_back(1);
53+
for (unsigned int d = 0; d < InputImageDimension; d++)
54+
{
55+
if (d != i)
5356
{
54-
if ( d != i )
55-
{
56-
NumberOfRows[i] *= size[d];
57-
}
57+
NumberOfRows[i] *= size[d];
5858
}
59+
}
5960
}
6061
float progressPerDimension = 1.0 / ImageDimension;
6162

62-
auto *progress = new ProgressReporter(this,
63-
threadId,
64-
NumberOfRows[this->m_CurrentDimension],
65-
30,
66-
this->m_CurrentDimension * progressPerDimension,
67-
progressPerDimension);
63+
auto * progress = new ProgressReporter(this,
64+
threadId,
65+
NumberOfRows[this->m_CurrentDimension],
66+
30,
67+
this->m_CurrentDimension * progressPerDimension,
68+
progressPerDimension);
6869

6970
using InputConstIteratorType = ImageLinearConstIteratorWithIndex<TInputImage>;
7071
using OutputIteratorType = ImageLinearIteratorWithIndex<TOutputImage>;

include/itkLabelSetMorphBaseImageFilter.hxx

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -58,8 +58,8 @@ LabelSetMorphBaseImageFilter<TInputImage, doDilate, TOutputImage>::LabelSetMorph
5858

5959
template <typename TInputImage, bool doDilate, typename TOutputImage>
6060
void
61-
LabelSetMorphBaseImageFilter<TInputImage, doDilate, TOutputImage>::ThreadedGenerateData(
62-
const OutputImageRegionType &, ThreadIdType)
61+
LabelSetMorphBaseImageFilter<TInputImage, doDilate, TOutputImage>::ThreadedGenerateData(const OutputImageRegionType &,
62+
ThreadIdType)
6363
{}
6464

6565
template <typename TInputImage, bool doDilate, typename TOutputImage>

include/itkLabelSetUtils.h

Lines changed: 43 additions & 43 deletions
Original file line numberDiff line numberDiff line change
@@ -234,17 +234,17 @@ DoLineLabelProp(LineBufferType & LineBuf,
234234

235235
template <class TInIter, class TOutDistIter, class TOutLabIter, class RealType>
236236
void
237-
doOneDimensionErodeFirstPass(TInIter & inputIterator,
238-
TOutDistIter & outputIterator,
239-
TOutLabIter & outputLabIterator,
237+
doOneDimensionErodeFirstPass(TInIter & inputIterator,
238+
TOutDistIter & outputIterator,
239+
TOutLabIter & outputLabIterator,
240240
ProgressReporter & progress,
241-
const unsigned LineLength,
242-
const unsigned direction,
243-
const int m_MagnitudeSign,
244-
const bool m_UseImageSpacing,
245-
const RealType image_scale,
246-
const RealType Sigma,
247-
const bool lastpass)
241+
const unsigned LineLength,
242+
const unsigned direction,
243+
const int m_MagnitudeSign,
244+
const bool m_UseImageSpacing,
245+
const RealType image_scale,
246+
const RealType Sigma,
247+
const bool lastpass)
248248
{
249249
// specialised version for binary erosion during first pass. We can
250250
// compute the results directly because the inputs are flat.
@@ -372,16 +372,16 @@ doOneDimensionErodeFirstPass(TInIter & inputIterator,
372372

373373
template <class TInIter, class TOutDistIter, class TOutLabIter, class RealType>
374374
void
375-
doOneDimensionDilateFirstPass(TInIter & inputIterator,
376-
TOutDistIter & outputIterator,
377-
TOutLabIter & outputLabIterator,
375+
doOneDimensionDilateFirstPass(TInIter & inputIterator,
376+
TOutDistIter & outputIterator,
377+
TOutLabIter & outputLabIterator,
378378
ProgressReporter & progress,
379-
const unsigned LineLength,
380-
const unsigned direction,
381-
const int m_MagnitudeSign,
382-
const bool m_UseImageSpacing,
383-
const RealType image_scale,
384-
const RealType Sigma)
379+
const unsigned LineLength,
380+
const unsigned direction,
381+
const int m_MagnitudeSign,
382+
const bool m_UseImageSpacing,
383+
const RealType image_scale,
384+
const RealType Sigma)
385385
{
386386
// specialised version for binary erosion during first pass. We can
387387
// compute the results directly because the inputs are flat.
@@ -454,20 +454,20 @@ doOneDimensionDilateFirstPass(TInIter & inputIterator,
454454

455455
template <class TInIter, class TDistIter, class TOutLabIter, class TOutDistIter, class RealType>
456456
void
457-
doOneDimensionErode(TInIter & inputIterator,
458-
TDistIter & inputDistIterator,
459-
TOutDistIter & outputDistIterator,
460-
TOutLabIter & outputLabIterator,
457+
doOneDimensionErode(TInIter & inputIterator,
458+
TDistIter & inputDistIterator,
459+
TOutDistIter & outputDistIterator,
460+
TOutLabIter & outputLabIterator,
461461
ProgressReporter & progress,
462-
const unsigned LineLength,
463-
const unsigned direction,
464-
const int m_MagnitudeSign,
465-
const bool m_UseImageSpacing,
466-
const RealType m_Extreme,
467-
const RealType image_scale,
468-
const RealType Sigma,
469-
const RealType BaseSigma,
470-
const bool lastpass)
462+
const unsigned LineLength,
463+
const unsigned direction,
464+
const int m_MagnitudeSign,
465+
const bool m_UseImageSpacing,
466+
const RealType m_Extreme,
467+
const RealType image_scale,
468+
const RealType Sigma,
469+
const RealType BaseSigma,
470+
const bool lastpass)
471471
{
472472
// traditional erosion - can't optimise the same way as the first pass
473473
using LineBufferType = typename itk::Array<RealType>;
@@ -595,18 +595,18 @@ doOneDimensionErode(TInIter & inputIterator,
595595

596596
template <class TInIter, class TDistIter, class TOutLabIter, class TOutDistIter, class RealType>
597597
void
598-
doOneDimensionDilate(TInIter & inputIterator,
599-
TDistIter & inputDistIterator,
600-
TOutDistIter & outputDistIterator,
601-
TOutLabIter & outputLabIterator,
598+
doOneDimensionDilate(TInIter & inputIterator,
599+
TDistIter & inputDistIterator,
600+
TOutDistIter & outputDistIterator,
601+
TOutLabIter & outputLabIterator,
602602
ProgressReporter & progress,
603-
const unsigned LineLength,
604-
const unsigned direction,
605-
const int m_MagnitudeSign,
606-
const bool m_UseImageSpacing,
607-
const RealType m_Extreme,
608-
const RealType image_scale,
609-
const RealType Sigma)
603+
const unsigned LineLength,
604+
const unsigned direction,
605+
const int m_MagnitudeSign,
606+
const bool m_UseImageSpacing,
607+
const RealType m_Extreme,
608+
const RealType image_scale,
609+
const RealType Sigma)
610610
{
611611
// specialised version for binary erosion during first pass. We can
612612
// compute the results directly because the inputs are flat.

0 commit comments

Comments
 (0)