File tree 3 files changed +24
-1
lines changed
3 files changed +24
-1
lines changed Original file line number Diff line number Diff line change @@ -317,6 +317,8 @@ class ITK_TEMPLATE_EXPORT AdvancedImageToImageMetric : public ImageToImageMetric
317
317
virtual void
318
318
BeforeThreadedGetValueAndDerivative (const TransformParametersType & parameters) const ;
319
319
320
+ itkSetMacro (RandomVariateGenerator, Statistics::MersenneTwisterRandomVariateGenerator *);
321
+
320
322
protected:
321
323
/* * Constructor. */
322
324
AdvancedImageToImageMetric ();
@@ -598,6 +600,12 @@ class ITK_TEMPLATE_EXPORT AdvancedImageToImageMetric : public ImageToImageMetric
598
600
itkExceptionMacro (" Intentionally left unimplemented!" );
599
601
}
600
602
603
+ auto *
604
+ GetRandomVariateGenerator ()
605
+ {
606
+ return m_RandomVariateGenerator;
607
+ }
608
+
601
609
// Protected using-declaration, to avoid `-Woverloaded-virtual` warnings from GCC (GCC 11.4) or clang (macos-12).
602
610
using Superclass::SetTransform;
603
611
@@ -627,6 +635,8 @@ class ITK_TEMPLATE_EXPORT AdvancedImageToImageMetric : public ImageToImageMetric
627
635
628
636
MovingImageDerivativeScalesType m_MovingImageDerivativeScales{ MovingImageDerivativeScalesType::Filled (1.0 ) };
629
637
638
+ Statistics::MersenneTwisterRandomVariateGenerator * m_RandomVariateGenerator{ nullptr };
639
+
630
640
// Private using-declarations, to avoid `-Woverloaded-virtual` warnings from GCC (GCC 11.4) or clang (macos-12).
631
641
using Superclass::TransformPoint;
632
642
Original file line number Diff line number Diff line change @@ -94,6 +94,8 @@ class ITK_TEMPLATE_EXPORT ImageRandomSamplerBase : public ImageSamplerBase<TInpu
94
94
return m_OptionalSeed;
95
95
}
96
96
97
+ itkSetMacro (RandomVariateGenerator, Statistics::MersenneTwisterRandomVariateGenerator *);
98
+
97
99
/* * The input image dimension. */
98
100
itkStaticConstMacro (InputImageDimension, unsigned int , Superclass::InputImageDimension);
99
101
@@ -108,6 +110,12 @@ class ITK_TEMPLATE_EXPORT ImageRandomSamplerBase : public ImageSamplerBase<TInpu
108
110
void
109
111
GenerateRandomNumberList ();
110
112
113
+ auto *
114
+ GetRandomVariateGenerator ()
115
+ {
116
+ return m_RandomVariateGenerator;
117
+ }
118
+
111
119
/* * PrintSelf. */
112
120
void
113
121
PrintSelf (std::ostream & os, Indent indent) const override ;
@@ -117,6 +125,8 @@ class ITK_TEMPLATE_EXPORT ImageRandomSamplerBase : public ImageSamplerBase<TInpu
117
125
118
126
private:
119
127
std::optional<SeedIntegerType> m_OptionalSeed{};
128
+
129
+ Statistics::MersenneTwisterRandomVariateGenerator * m_RandomVariateGenerator{ nullptr };
120
130
};
121
131
122
132
} // end namespace itk
Original file line number Diff line number Diff line change 19
19
#define elxElastixMain_h
20
20
21
21
#include " elxMainBase.h"
22
-
22
+ #include " elxDefaultConstruct.h"
23
+ #include < itkMersenneTwisterRandomVariateGenerator.h>
23
24
24
25
namespace elastix
25
26
{
@@ -194,6 +195,8 @@ class ElastixMain : public MainBase
194
195
ParameterMapType m_TransformParameterMap{};
195
196
196
197
FlatDirectionCosinesType m_OriginalFixedImageDirectionFlat{};
198
+
199
+ elx::DefaultConstruct<itk::Statistics::MersenneTwisterRandomVariateGenerator> m_RandomVariateGenerator{};
197
200
};
198
201
199
202
} // end namespace elastix
You can’t perform that action at this time.
0 commit comments