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 #ifndef __MultiInputImageRandomCoordinateSampler_h
15 #define __MultiInputImageRandomCoordinateSampler_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 
64  typedef typename Superclass::MaskType MaskType;
66  typedef typename InputImageType::SpacingType InputImageSpacingType;
71 
73  itkStaticConstMacro( InputImageDimension, unsigned int,
74  Superclass::InputImageDimension );
75 
79  typedef double CoordRepType;
80  typedef InterpolateImageFunction< InputImageType, CoordRepType > InterpolatorType;
81  typedef typename InterpolatorType::Pointer InterpolatorPointer;
82  typedef BSplineInterpolateImageFunction< InputImageType, CoordRepType, double > DefaultInterpolatorType;
83 
85  typedef itk::Statistics::MersenneTwisterRandomVariateGenerator RandomGeneratorType;
86  typedef typename RandomGeneratorType::Pointer RandomGeneratorPointer;
87 
89  itkSetObjectMacro( Interpolator, InterpolatorType );
90  itkGetObjectMacro( Interpolator, InterpolatorType );
91 
95  itkSetMacro( SampleRegionSize, InputImageSpacingType );
96  itkGetConstReferenceMacro( SampleRegionSize, InputImageSpacingType );
97 
100  itkGetConstMacro( UseRandomSampleRegion, bool );
101  itkSetMacro( UseRandomSampleRegion, bool );
102 
103 protected:
104 
105  typedef typename InterpolatorType::ContinuousIndexType InputImageContinuousIndexType;
106 
109 
112 
114  void PrintSelf( std::ostream & os, Indent indent ) const;
115 
117  virtual void GenerateData( void );
118 
121  virtual void GenerateRandomCoordinate(
122  const InputImageContinuousIndexType & smallestContIndex,
123  const InputImageContinuousIndexType & largestContIndex,
124  InputImageContinuousIndexType & randomContIndex );
125 
129 
131  virtual void GenerateSampleRegion(
132  InputImageContinuousIndexType & smallestContIndex,
133  InputImageContinuousIndexType & largestContIndex );
134 
135 private:
136 
138  MultiInputImageRandomCoordinateSampler( const Self & ); // purposely not implemented
140  void operator=( const Self & ); // purposely not implemented
141 
143 
144 };
145 
146 } // end namespace itk
147 
148 #ifndef ITK_MANUAL_INSTANTIATION
149 #include "itkMultiInputImageRandomCoordinateSampler.hxx"
150 #endif
151 
152 #endif // end #ifndef __MultiInputImageRandomCoordinateSampler_h
BSplineInterpolateImageFunction< InputImageType, CoordRepType, double > DefaultInterpolatorType
void PrintSelf(std::ostream &os, Indent indent) const
A class that defines an image sample, which is the coordinates of a point and its value...
virtual void GenerateSampleRegion(InputImageContinuousIndexType &smallestContIndex, InputImageContinuousIndexType &largestContIndex)
virtual void GenerateRandomCoordinate(const InputImageContinuousIndexType &smallestContIndex, const InputImageContinuousIndexType &largestContIndex, InputImageContinuousIndexType &randomContIndex)
itk::Statistics::MersenneTwisterRandomVariateGenerator RandomGeneratorType
Define a front-end to the STL "vector" container that conforms to the IndexedContainerInterface.
Superclass::OutputVectorContainerPointer OutputVectorContainerPointer
itkStaticConstMacro(InputImageDimension, unsigned int, Superclass::InputImageDimension)
InterpolateImageFunction< InputImageType, CoordRepType > InterpolatorType
Samples an image by randomly composing a set of physical coordinates.
This class is a base class for any image sampler that randomly picks samples.


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