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  * 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 __ImageRandomCoordinateSampler_h
19 #define __ImageRandomCoordinateSampler_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 
69  typedef typename Superclass::MaskType MaskType;
71  typedef typename InputImageType::SpacingType InputImageSpacingType;
76 
78  itkStaticConstMacro( InputImageDimension, unsigned int,
79  Superclass::InputImageDimension );
80 
83  typedef double CoordRepType;
84  typedef InterpolateImageFunction<
86  typedef typename InterpolatorType::Pointer InterpolatorPointer;
87  typedef BSplineInterpolateImageFunction<
89 
91  typedef itk::Statistics::MersenneTwisterRandomVariateGenerator RandomGeneratorType;
92  typedef typename RandomGeneratorType::Pointer RandomGeneratorPointer;
93 
95  itkSetObjectMacro( Interpolator, InterpolatorType );
96  itkGetObjectMacro( Interpolator, InterpolatorType );
97 
100  itkSetMacro( SampleRegionSize, InputImageSpacingType );
101  itkGetConstReferenceMacro( SampleRegionSize, InputImageSpacingType );
102 
105  itkGetConstMacro( UseRandomSampleRegion, bool );
106  itkSetMacro( UseRandomSampleRegion, bool );
107 
108 protected:
109 
110  typedef typename InterpolatorType::ContinuousIndexType InputImageContinuousIndexType;
111 
116 
118  void PrintSelf( std::ostream & os, Indent indent ) const;
119 
121  virtual void GenerateData( void );
122 
124  virtual void BeforeThreadedGenerateData( void );
125 
126  virtual void ThreadedGenerateData(
127  const InputImageRegionType & inputRegionForThread,
128  ThreadIdType threadId );
129 
131  virtual void GenerateRandomCoordinate(
132  const InputImageContinuousIndexType & smallestContIndex,
133  const InputImageContinuousIndexType & largestContIndex,
134  InputImageContinuousIndexType & randomContIndex );
135 
136  InterpolatorPointer m_Interpolator;
137  RandomGeneratorPointer m_RandomGenerator;
138  InputImageSpacingType m_SampleRegionSize;
139 
145  virtual void GenerateSampleRegion(
146  const InputImageContinuousIndexType & smallestImageContIndex,
147  const InputImageContinuousIndexType & largestImageContIndex,
148  InputImageContinuousIndexType & smallestContIndex,
149  InputImageContinuousIndexType & largestContIndex );
150 
151 private:
152 
154  ImageRandomCoordinateSampler( const Self & ); // purposely not implemented
156  void operator=( const Self & ); // purposely not implemented
157 
159 
160 };
161 
162 } // end namespace itk
163 
164 #ifndef ITK_MANUAL_INSTANTIATION
165 #include "itkImageRandomCoordinateSampler.hxx"
166 #endif
167 
168 #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 04-09-2015 for elastix by doxygen 1.8.9.1 elastix logo