go home Home | Main Page | Modules | Namespace List | Class Hierarchy | Alphabetical List | Data Structures | File List | Namespace Members | Data Fields | Globals | Related Pages
itkImageRandomCoordinateSampler.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 __ImageRandomCoordinateSampler_h
16 #define __ImageRandomCoordinateSampler_h
17 
19 #include "itkInterpolateImageFunction.h"
20 #include "itkBSplineInterpolateImageFunction.h"
21 #include "itkMersenneTwisterRandomVariateGenerator.h"
22 
23 namespace itk
24 {
25 
36  template < class TInputImage >
38  public ImageRandomSamplerBase< TInputImage >
39  {
40  public:
41 
45  typedef SmartPointer<Self> Pointer;
46  typedef SmartPointer<const Self> ConstPointer;
47 
49  itkNewMacro( Self );
50 
53 
65  typedef typename Superclass::MaskType MaskType;
67  typedef typename InputImageType::SpacingType InputImageSpacingType;
72 
74  itkStaticConstMacro( InputImageDimension, unsigned int,
75  Superclass::InputImageDimension );
76 
79  typedef double CoordRepType;
80  typedef InterpolateImageFunction<
82  typedef BSplineInterpolateImageFunction<
84 
86  typedef itk::Statistics::MersenneTwisterRandomVariateGenerator RandomGeneratorType;
87 
89  itkSetObjectMacro(Interpolator, InterpolatorType);
90  itkGetObjectMacro(Interpolator, InterpolatorType);
91 
94  itkSetMacro( SampleRegionSize, InputImageSpacingType );
95  itkGetConstReferenceMacro( SampleRegionSize, InputImageSpacingType );
96 
99  itkGetConstMacro(UseRandomSampleRegion, bool);
100  itkSetMacro(UseRandomSampleRegion, bool);
101 
102  protected:
103 
104  typedef typename InterpolatorType::ContinuousIndexType InputImageContinuousIndexType;
105 
110 
112  void PrintSelf( std::ostream& os, Indent indent ) const;
113 
115  virtual void GenerateData( void );
116 
119  virtual void GenerateRandomCoordinate(
120  const InputImageContinuousIndexType & smallestContIndex,
121  const InputImageContinuousIndexType & largestContIndex,
122  InputImageContinuousIndexType & randomContIndex);
123 
124  typename InterpolatorType::Pointer m_Interpolator;
125  typename RandomGeneratorType::Pointer m_RandomGenerator;
127 
133  virtual void GenerateSampleRegion(
134  const InputImageContinuousIndexType & smallestImageContIndex,
135  const InputImageContinuousIndexType & largestImageContIndex,
136  InputImageContinuousIndexType & smallestContIndex,
137  InputImageContinuousIndexType & largestContIndex );
138 
139  private:
140 
142  ImageRandomCoordinateSampler( const Self& ); // purposely not implemented
144  void operator=( const Self& ); // purposely not implemented
145 
147 
148  }; // end class ImageRandomCoordinateSampler
149 
150 
151 } // end namespace itk
152 
153 #ifndef ITK_MANUAL_INSTANTIATION
154 #include "itkImageRandomCoordinateSampler.txx"
155 #endif
156 
157 #endif // end #ifndef __ImageRandomCoordinateSampler_h
158 
BSplineInterpolateImageFunction< InputImageType, CoordRepType, double > DefaultInterpolatorType
Superclass::DataObjectPointer DataObjectPointer
Superclass::ImageSampleValueType ImageSampleValueType
Superclass::InputImageSizeType InputImageSizeType
A class that defines an image sample, which is the coordinates of a point and its value...
virtual void GenerateRandomCoordinate(const InputImageContinuousIndexType &smallestContIndex, const InputImageContinuousIndexType &largestContIndex, InputImageContinuousIndexType &randomContIndex)
InterpolatorType::ContinuousIndexType InputImageContinuousIndexType
Superclass::InputImageConstPointer InputImageConstPointer
Superclass::InputImagePointType InputImagePointType
Define a front-end to the STL &quot;vector&quot; container that conforms to the IndexedContainerInterface.
ImageRandomSamplerBase< TInputImage > Superclass
Superclass::InputImagePointValueType InputImagePointValueType
Superclass::InputImageRegionType InputImageRegionType
virtual void GenerateSampleRegion(const InputImageContinuousIndexType &smallestImageContIndex, const InputImageContinuousIndexType &largestImageContIndex, InputImageContinuousIndexType &smallestContIndex, InputImageContinuousIndexType &largestContIndex)
Samples an image by randomly composing a set of physical coordinates.
void PrintSelf(std::ostream &os, Indent indent) const
itk::Statistics::MersenneTwisterRandomVariateGenerator RandomGeneratorType
Superclass::InputImagePixelType InputImagePixelType
Superclass::InputImagePointer InputImagePointer
InterpolateImageFunction< InputImageType, CoordRepType > InterpolatorType
Superclass::OutputVectorContainerType OutputVectorContainerType
This class is a base class for any image sampler that randomly picks samples.
Superclass::InputImageIndexType InputImageIndexType
itkStaticConstMacro(InputImageDimension, unsigned int, Superclass::InputImageDimension)
Superclass::ImageSampleContainerType ImageSampleContainerType
Superclass::OutputVectorContainerPointer OutputVectorContainerPointer


Generated on 05-01-2014 for elastix by doxygen 1.8.5 elastix logo