go home Home | Main Page | Modules | Namespace List | Class Hierarchy | Alphabetical List | Data Structures | File List | Namespace Members | Data Fields | Globals | Related Pages
itkMultiInputImageRandomCoordinateSampler.h
Go to the documentation of this file.
1 /*======================================================================
2 
3  This file is part of the elastix software.
4 
5  Copyright (c) University Medical Center Utrecht. All rights reserved.
6  See src/CopyrightElastix.txt or http://elastix.isi.uu.nl/legal.php for
7  details.
8 
9  This software is distributed WITHOUT ANY WARRANTY; without even
10  the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR
11  PURPOSE. See the above copyright notices for more information.
12 
13 ======================================================================*/
14 
15 #ifndef __MultiInputImageRandomCoordinateSampler_h
16 #define __MultiInputImageRandomCoordinateSampler_h
17 
19 #include "itkInterpolateImageFunction.h"
20 #include "itkBSplineInterpolateImageFunction.h"
21 #include "itkMersenneTwisterRandomVariateGenerator.h"
22 
23 
24 namespace itk
25 {
26 
37  template < class TInputImage >
39  public ImageRandomSamplerBase< TInputImage >
40  {
41  public:
42 
46  typedef SmartPointer<Self> Pointer;
47  typedef SmartPointer<const Self> ConstPointer;
48 
50  itkNewMacro( Self );
51 
54 
66  typedef typename Superclass::MaskType MaskType;
68  typedef typename InputImageType::SpacingType InputImageSpacingType;
73 
75  itkStaticConstMacro( InputImageDimension, unsigned int,
76  Superclass::InputImageDimension );
77 
81  typedef double CoordRepType;
82  typedef InterpolateImageFunction<
86 
88  typedef itk::Statistics::MersenneTwisterRandomVariateGenerator RandomGeneratorType;
89 
91  itkSetObjectMacro( Interpolator, InterpolatorType );
92  itkGetObjectMacro( Interpolator, InterpolatorType );
93 
97  itkSetMacro( SampleRegionSize, InputImageSpacingType );
98  itkGetConstReferenceMacro( SampleRegionSize, InputImageSpacingType );
99 
102  itkGetConstMacro( UseRandomSampleRegion, bool );
103  itkSetMacro( UseRandomSampleRegion, bool );
104 
105  protected:
106 
107  typedef typename InterpolatorType::ContinuousIndexType InputImageContinuousIndexType;
108 
111 
114 
116  void PrintSelf( std::ostream& os, Indent indent ) const;
117 
119  virtual void GenerateData( void );
120 
123  virtual void GenerateRandomCoordinate(
124  const InputImageContinuousIndexType & smallestContIndex,
125  const InputImageContinuousIndexType & largestContIndex,
126  InputImageContinuousIndexType & randomContIndex);
127 
128  typename InterpolatorType::Pointer m_Interpolator;
129  typename RandomGeneratorType::Pointer m_RandomGenerator;
131 
133  virtual void GenerateSampleRegion(
134  InputImageContinuousIndexType & smallestContIndex,
135  InputImageContinuousIndexType & largestContIndex );
136 
137  private:
138 
140  MultiInputImageRandomCoordinateSampler( const Self& ); // purposely not implemented
142  void operator=( const Self& ); // purposely not implemented
143 
145 
146  }; // end class MultiInputImageRandomCoordinateSampler
147 
148 
149 } // end namespace itk
150 
151 #ifndef ITK_MANUAL_INSTANTIATION
152 #include "itkMultiInputImageRandomCoordinateSampler.txx"
153 #endif
154 
155 #endif // end #ifndef __MultiInputImageRandomCoordinateSampler_h
156 


Generated on 27-06-2013 for elastix by doxygen 1.8.3.1 elastix logo