Skip to content

Commit

Permalink
STYLE: Default default-constructor of ImageRandom ConstIterator classes
Browse files Browse the repository at this point in the history
  • Loading branch information
N-Dekker authored and dzenanz committed Feb 23, 2023
1 parent e596c01 commit 4e46cb6
Show file tree
Hide file tree
Showing 6 changed files with 9 additions and 39 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -136,7 +136,7 @@ class ITK_TEMPLATE_EXPORT ImageRandomConstIteratorWithIndex : public ImageConstI
using typename Superclass::SizeValueType;

/** Default constructor. Needed since we provide a cast constructor. */
ImageRandomConstIteratorWithIndex();
ImageRandomConstIteratorWithIndex() = default;
~ImageRandomConstIteratorWithIndex() override = default;

/** Constructor establishes an iterator to walk a particular image and a
Expand Down Expand Up @@ -224,7 +224,7 @@ class ITK_TEMPLATE_EXPORT ImageRandomConstIteratorWithIndex : public ImageConstI
RandomJump();

using GeneratorPointer = typename Statistics::MersenneTwisterRandomVariateGenerator::Pointer;
GeneratorPointer m_Generator{};
GeneratorPointer m_Generator{ Statistics::MersenneTwisterRandomVariateGenerator::New() };
SizeValueType m_NumberOfSamplesRequested{};
SizeValueType m_NumberOfSamplesDone{};
SizeValueType m_NumberOfPixelsInRegion{};
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -22,16 +22,6 @@
namespace itk
{

template <typename TImage>
ImageRandomConstIteratorWithIndex<TImage>::ImageRandomConstIteratorWithIndex()
: ImageConstIteratorWithIndex<TImage>()
{
m_NumberOfPixelsInRegion = 0L;
m_NumberOfSamplesRequested = 0L;
m_NumberOfSamplesDone = 0L;
m_Generator = Statistics::MersenneTwisterRandomVariateGenerator::New();
}

template <typename TImage>
ImageRandomConstIteratorWithIndex<TImage>::ImageRandomConstIteratorWithIndex(const ImageType * ptr,
const RegionType & region)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -138,7 +138,7 @@ class ITK_TEMPLATE_EXPORT ImageRandomConstIteratorWithOnlyIndex : public ImageCo
using typename Superclass::SizeValueType;

/** Default constructor. Needed since we provide a cast constructor. */
ImageRandomConstIteratorWithOnlyIndex();
ImageRandomConstIteratorWithOnlyIndex() = default;
~ImageRandomConstIteratorWithOnlyIndex() override = default;

/** Constructor establishes an iterator to walk a particular image and a
Expand Down Expand Up @@ -226,7 +226,7 @@ class ITK_TEMPLATE_EXPORT ImageRandomConstIteratorWithOnlyIndex : public ImageCo
RandomJump();

using GeneratorPointer = typename Statistics::MersenneTwisterRandomVariateGenerator::Pointer;
GeneratorPointer m_Generator{};
GeneratorPointer m_Generator{ Statistics::MersenneTwisterRandomVariateGenerator::New() };
SizeValueType m_NumberOfSamplesRequested{};
SizeValueType m_NumberOfSamplesDone{};
SizeValueType m_NumberOfPixelsInRegion{};
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -22,16 +22,6 @@
namespace itk
{

template <typename TImage>
ImageRandomConstIteratorWithOnlyIndex<TImage>::ImageRandomConstIteratorWithOnlyIndex()
: ImageConstIteratorWithOnlyIndex<TImage>()
{
m_NumberOfPixelsInRegion = 0L;
m_NumberOfSamplesRequested = 0L;
m_NumberOfSamplesDone = 0L;
m_Generator = Statistics::MersenneTwisterRandomVariateGenerator::New();
}

template <typename TImage>
ImageRandomConstIteratorWithOnlyIndex<TImage>::ImageRandomConstIteratorWithOnlyIndex(const ImageType * ptr,
const RegionType & region)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -234,7 +234,7 @@ class ITK_TEMPLATE_EXPORT ImageRandomNonRepeatingConstIteratorWithIndex : public
using typename Superclass::SizeValueType;

/** Default constructor. Needed since we provide a cast constructor. */
ImageRandomNonRepeatingConstIteratorWithIndex();
ImageRandomNonRepeatingConstIteratorWithIndex() = default;
~ImageRandomNonRepeatingConstIteratorWithIndex() override { delete m_Permutation; }

/** Constructor establishes an iterator to walk a particular image and a
Expand Down Expand Up @@ -343,10 +343,10 @@ class ITK_TEMPLATE_EXPORT ImageRandomNonRepeatingConstIteratorWithIndex : public
void
UpdatePosition();

SizeValueType m_NumberOfSamplesRequested;
SizeValueType m_NumberOfSamplesDone;
SizeValueType m_NumberOfPixelsInRegion;
RandomPermutation * m_Permutation;
SizeValueType m_NumberOfSamplesRequested{};
SizeValueType m_NumberOfSamplesDone{};
SizeValueType m_NumberOfPixelsInRegion{};
RandomPermutation * m_Permutation{};
};
} // end namespace itk

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -22,16 +22,6 @@
namespace itk
{

template <typename TImage>
ImageRandomNonRepeatingConstIteratorWithIndex<TImage>::ImageRandomNonRepeatingConstIteratorWithIndex()
: ImageConstIteratorWithIndex<TImage>()
{
m_NumberOfPixelsInRegion = 0L;
m_NumberOfSamplesRequested = 0L;
m_NumberOfSamplesDone = 0L;
m_Permutation = nullptr;
}

template <typename TImage>
ImageRandomNonRepeatingConstIteratorWithIndex<TImage>::ImageRandomNonRepeatingConstIteratorWithIndex(
const ImageType * ptr,
Expand Down

0 comments on commit 4e46cb6

Please sign in to comment.