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 
48  typedef SmartPointer< Self > Pointer;
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 );
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 override;
119 
121  void GenerateData( void ) override;
122 
124  void BeforeThreadedGenerateData( void ) override;
125 
127  const InputImageRegionType & inputRegionForThread,
128  ThreadIdType threadId ) override;
129 
132  const InputImageContinuousIndexType & smallestContIndex,
133  const InputImageContinuousIndexType & largestContIndex,
134  InputImageContinuousIndexType & randomContIndex );
135 
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
Samples an image by randomly composing a set of physical coordinates.
Superclass::InputImagePointType InputImagePointType
void GenerateData(void) override
Superclass::InputImageRegionType InputImageRegionType
Superclass::InputImagePointer InputImagePointer
Superclass::OutputVectorContainerPointer OutputVectorContainerPointer
Superclass::InputImageConstPointer InputImageConstPointer
Superclass::InputImageSizeType InputImageSizeType
virtual void GenerateSampleRegion(const InputImageContinuousIndexType &smallestImageContIndex, const InputImageContinuousIndexType &largestImageContIndex, InputImageContinuousIndexType &smallestContIndex, InputImageContinuousIndexType &largestContIndex)
InterpolateImageFunction< InputImageType, CoordRepType > InterpolatorType
void PrintSelf(std::ostream &os, Indent indent) const override
void ThreadedGenerateData(const InputImageRegionType &inputRegionForThread, ThreadIdType threadId) override
Superclass::ImageSampleContainerPointer ImageSampleContainerPointer
void BeforeThreadedGenerateData(void) override
ImageRandomSamplerBase< TInputImage > Superclass
BSplineInterpolateImageFunction< InputImageType, CoordRepType, double > DefaultInterpolatorType
Superclass::ImageSampleContainerType ImageSampleContainerType
Superclass::OutputVectorContainerType OutputVectorContainerType
Superclass::InputImagePointValueType InputImagePointValueType
ImageRandomCoordinateSampler(const Self &)
Superclass::ImageSampleValueType ImageSampleValueType
RandomGeneratorType::Pointer RandomGeneratorPointer
Superclass::DataObjectPointer DataObjectPointer
Superclass::InputImageIndexType InputImageIndexType
itkGetModifiableObjectMacro(Interpolator, InterpolatorType)
itk::Statistics::MersenneTwisterRandomVariateGenerator RandomGeneratorType
virtual void GenerateRandomCoordinate(const InputImageContinuousIndexType &smallestContIndex, const InputImageContinuousIndexType &largestContIndex, InputImageContinuousIndexType &randomContIndex)
InterpolatorType::ContinuousIndexType InputImageContinuousIndexType
Superclass::InputImagePixelType InputImagePixelType
itkStaticConstMacro(InputImageDimension, unsigned int, Superclass::InputImageDimension)
This class is a base class for any image sampler that randomly picks samples.
Superclass::InputImagePixelType InputImagePixelType
Superclass::InputImageType InputImageType
Superclass::InputImagePointer InputImagePointer
Superclass::DataObjectPointer DataObjectPointer
Superclass::InputImageRegionType InputImageRegionType
Superclass::OutputVectorContainerPointer OutputVectorContainerPointer
Superclass::InputImageConstPointer InputImageConstPointer
Superclass::ImageSampleContainerPointer ImageSampleContainerPointer
A class that defines an image sample, which is the coordinates of a point and its value.
InputImageType::IndexType InputImageIndexType
InputImagePointType::ValueType InputImagePointValueType
InputImageType::SizeType InputImageSizeType
ImageSampleType::RealType ImageSampleValueType
InputImageType::PointType InputImagePointType
Define a front-end to the STL "vector" container that conforms to the IndexedContainerInterface.


Generated on 1667476801 for elastix by doxygen 1.9.1 elastix logo