Skip to content

Commit

Permalink
Merge pull request #4183 from N-Dekker/ImageRandomIteratorWithIndex-s…
Browse files Browse the repository at this point in the history
…hould-not-assign-it-constructor

BUG: ImageRandomIteratorWithIndex should not assign data in constructor
  • Loading branch information
thewtex authored Sep 5, 2023
2 parents 7fb08b8 + 997ff54 commit 5032941
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 12 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -26,12 +26,8 @@ template <typename TImage>
ImageRandomConstIteratorWithIndex<TImage>::ImageRandomConstIteratorWithIndex(const ImageType * ptr,
const RegionType & region)
: ImageConstIteratorWithIndex<TImage>(ptr, region)
{
m_NumberOfPixelsInRegion = region.GetNumberOfPixels();
m_NumberOfSamplesRequested = 0L;
m_NumberOfSamplesDone = 0L;
m_Generator = Statistics::MersenneTwisterRandomVariateGenerator::New();
}
, m_NumberOfPixelsInRegion{ region.GetNumberOfPixels() }
{}

template <typename TImage>
void
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -26,12 +26,8 @@ template <typename TImage>
ImageRandomConstIteratorWithOnlyIndex<TImage>::ImageRandomConstIteratorWithOnlyIndex(const ImageType * ptr,
const RegionType & region)
: ImageConstIteratorWithOnlyIndex<TImage>(ptr, region)
{
m_NumberOfPixelsInRegion = region.GetNumberOfPixels();
m_NumberOfSamplesRequested = 0L;
m_NumberOfSamplesDone = 0L;
m_Generator = Statistics::MersenneTwisterRandomVariateGenerator::New();
}
, m_NumberOfPixelsInRegion{ region.GetNumberOfPixels() }
{}

template <typename TImage>
void
Expand Down

0 comments on commit 5032941

Please sign in to comment.