diff --git a/Modules/Core/Common/include/itkImageRandomConstIteratorWithIndex.hxx b/Modules/Core/Common/include/itkImageRandomConstIteratorWithIndex.hxx index 152166c669a..5295a2b7c8d 100644 --- a/Modules/Core/Common/include/itkImageRandomConstIteratorWithIndex.hxx +++ b/Modules/Core/Common/include/itkImageRandomConstIteratorWithIndex.hxx @@ -26,12 +26,8 @@ template ImageRandomConstIteratorWithIndex::ImageRandomConstIteratorWithIndex(const ImageType * ptr, const RegionType & region) : ImageConstIteratorWithIndex(ptr, region) -{ - m_NumberOfPixelsInRegion = region.GetNumberOfPixels(); - m_NumberOfSamplesRequested = 0L; - m_NumberOfSamplesDone = 0L; - m_Generator = Statistics::MersenneTwisterRandomVariateGenerator::New(); -} + , m_NumberOfPixelsInRegion{ region.GetNumberOfPixels() } +{} template void diff --git a/Modules/Core/Common/include/itkImageRandomConstIteratorWithOnlyIndex.hxx b/Modules/Core/Common/include/itkImageRandomConstIteratorWithOnlyIndex.hxx index 309b0974f2e..fffea4e9941 100644 --- a/Modules/Core/Common/include/itkImageRandomConstIteratorWithOnlyIndex.hxx +++ b/Modules/Core/Common/include/itkImageRandomConstIteratorWithOnlyIndex.hxx @@ -26,12 +26,8 @@ template ImageRandomConstIteratorWithOnlyIndex::ImageRandomConstIteratorWithOnlyIndex(const ImageType * ptr, const RegionType & region) : ImageConstIteratorWithOnlyIndex(ptr, region) -{ - m_NumberOfPixelsInRegion = region.GetNumberOfPixels(); - m_NumberOfSamplesRequested = 0L; - m_NumberOfSamplesDone = 0L; - m_Generator = Statistics::MersenneTwisterRandomVariateGenerator::New(); -} + , m_NumberOfPixelsInRegion{ region.GetNumberOfPixels() } +{} template void