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  * Copyright UMC Utrecht and contributors
4  *
5  * Licensed under the Apache License, Version 2.0 (the "License");
6  * you may not use this file except in compliance with the License.
7  * You may obtain a copy of the License at
8  *
9  * http://www.apache.org/licenses/LICENSE-2.0.txt
10  *
11  * Unless required by applicable law or agreed to in writing, software
12  * distributed under the License is distributed on an "AS IS" BASIS,
13  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
14  * See the License for the specific language governing permissions and
15  * limitations under the License.
16  *
17  *=========================================================================*/
18 #ifndef __MultiInputImageRandomCoordinateSampler_h
19 #define __MultiInputImageRandomCoordinateSampler_h
20 
22 #include "itkInterpolateImageFunction.h"
23 #include "itkBSplineInterpolateImageFunction.h"
24 #include "itkMersenneTwisterRandomVariateGenerator.h"
25 
26 namespace itk
27 {
28 
39 template< class TInputImage >
41  public ImageRandomSamplerBase< TInputImage >
42 {
43 public:
44 
49  typedef SmartPointer< const Self > ConstPointer;
50 
52  itkNewMacro( Self );
53 
56 
68  typedef typename Superclass::MaskType MaskType;
70  typedef typename InputImageType::SpacingType InputImageSpacingType;
75 
77  itkStaticConstMacro( InputImageDimension, unsigned int,
78  Superclass::InputImageDimension );
79 
83  typedef double CoordRepType;
84  typedef InterpolateImageFunction< InputImageType, CoordRepType > InterpolatorType;
85  typedef typename InterpolatorType::Pointer InterpolatorPointer;
86  typedef BSplineInterpolateImageFunction< InputImageType, CoordRepType, double > DefaultInterpolatorType;
87 
89  typedef itk::Statistics::MersenneTwisterRandomVariateGenerator RandomGeneratorType;
90  typedef typename RandomGeneratorType::Pointer RandomGeneratorPointer;
91 
93  itkSetObjectMacro( Interpolator, InterpolatorType );
94  itkGetObjectMacro( Interpolator, InterpolatorType );
95 
99  itkSetMacro( SampleRegionSize, InputImageSpacingType );
100  itkGetConstReferenceMacro( SampleRegionSize, InputImageSpacingType );
101 
104  itkGetConstMacro( UseRandomSampleRegion, bool );
105  itkSetMacro( UseRandomSampleRegion, bool );
106 
107 protected:
108 
109  typedef typename InterpolatorType::ContinuousIndexType InputImageContinuousIndexType;
110 
113 
116 
118  void PrintSelf( std::ostream & os, Indent indent ) const;
119 
121  virtual void GenerateData( void );
122 
125  virtual void GenerateRandomCoordinate(
126  const InputImageContinuousIndexType & smallestContIndex,
127  const InputImageContinuousIndexType & largestContIndex,
128  InputImageContinuousIndexType & randomContIndex );
129 
130  InterpolatorPointer m_Interpolator;
131  RandomGeneratorPointer m_RandomGenerator;
132  InputImageSpacingType m_SampleRegionSize;
133 
135  virtual void GenerateSampleRegion(
136  InputImageContinuousIndexType & smallestContIndex,
137  InputImageContinuousIndexType & largestContIndex );
138 
139 private:
140 
142  MultiInputImageRandomCoordinateSampler( const Self & ); // purposely not implemented
144  void operator=( const Self & ); // purposely not implemented
145 
147 
148 };
149 
150 } // end namespace itk
151 
152 #ifndef ITK_MANUAL_INSTANTIATION
153 #include "itkMultiInputImageRandomCoordinateSampler.hxx"
154 #endif
155 
156 #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 04-09-2015 for elastix by doxygen 1.8.9.1 elastix logo