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 #ifndef __ImageRandomCoordinateSampler_h
15 #define __ImageRandomCoordinateSampler_h
16 
18 #include "itkInterpolateImageFunction.h"
19 #include "itkBSplineInterpolateImageFunction.h"
20 #include "itkMersenneTwisterRandomVariateGenerator.h"
21 
22 namespace itk
23 {
24 
35 template< class TInputImage >
37  public ImageRandomSamplerBase< TInputImage >
38 {
39 public:
40 
44  typedef SmartPointer< Self > Pointer;
45  typedef SmartPointer< const Self > ConstPointer;
46 
48  itkNewMacro( Self );
49 
52 
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 typename InterpolatorType::Pointer InterpolatorPointer;
83  typedef BSplineInterpolateImageFunction<
85 
87  typedef itk::Statistics::MersenneTwisterRandomVariateGenerator RandomGeneratorType;
88  typedef typename RandomGeneratorType::Pointer RandomGeneratorPointer;
89 
91  itkSetObjectMacro( Interpolator, InterpolatorType );
92  itkGetObjectMacro( Interpolator, InterpolatorType );
93 
96  itkSetMacro( SampleRegionSize, InputImageSpacingType );
97  itkGetConstReferenceMacro( SampleRegionSize, InputImageSpacingType );
98 
101  itkGetConstMacro( UseRandomSampleRegion, bool );
102  itkSetMacro( UseRandomSampleRegion, bool );
103 
104 protected:
105 
106  typedef typename InterpolatorType::ContinuousIndexType InputImageContinuousIndexType;
107 
112 
114  void PrintSelf( std::ostream & os, Indent indent ) const;
115 
117  virtual void GenerateData( void );
118 
120  virtual void BeforeThreadedGenerateData( void );
121 
122  virtual void ThreadedGenerateData(
123  const InputImageRegionType & inputRegionForThread,
124  ThreadIdType threadId );
125 
127  virtual void GenerateRandomCoordinate(
128  const InputImageContinuousIndexType & smallestContIndex,
129  const InputImageContinuousIndexType & largestContIndex,
130  InputImageContinuousIndexType & randomContIndex );
131 
135 
141  virtual void GenerateSampleRegion(
142  const InputImageContinuousIndexType & smallestImageContIndex,
143  const InputImageContinuousIndexType & largestImageContIndex,
144  InputImageContinuousIndexType & smallestContIndex,
145  InputImageContinuousIndexType & largestContIndex );
146 
147 private:
148 
150  ImageRandomCoordinateSampler( const Self & ); // purposely not implemented
152  void operator=( const Self & ); // purposely not implemented
153 
155 
156 };
157 
158 } // end namespace itk
159 
160 #ifndef ITK_MANUAL_INSTANTIATION
161 #include "itkImageRandomCoordinateSampler.hxx"
162 #endif
163 
164 #endif // end #ifndef __ImageRandomCoordinateSampler_h
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
BSplineInterpolateImageFunction< InputImageType, CoordRepType, double > DefaultInterpolatorType
Superclass::InputImagePointType InputImagePointType
Define a front-end to the STL "vector" 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)
Superclass::ImageSampleContainerPointer ImageSampleContainerPointer
Samples an image by randomly composing a set of physical coordinates.
virtual void ThreadedGenerateData(const InputImageRegionType &inputRegionForThread, ThreadIdType threadId)
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.
RandomGeneratorType::Pointer RandomGeneratorPointer
Superclass::InputImageIndexType InputImageIndexType
virtual void BeforeThreadedGenerateData(void)
itkStaticConstMacro(InputImageDimension, unsigned int, Superclass::InputImageDimension)
Superclass::ImageSampleContainerType ImageSampleContainerType
Superclass::OutputVectorContainerPointer OutputVectorContainerPointer


Generated on 11-03-2014 for elastix by doxygen 1.8.6 elastix logo