go home Home | Main Page | Modules | Namespace List | Class Hierarchy | Alphabetical List | Data Structures | File List | Namespace Members | Data Fields | Globals | Related Pages
itkImageSamplerBase.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 __ImageSamplerBase_h
19 #define __ImageSamplerBase_h
20 
22 #include "itkImageSample.h"
23 #include "itkVectorDataContainer.h"
24 #include "itkSpatialObject.h"
25 
26 namespace itk
27 {
41 template< class TInputImage >
43  public ImageToVectorContainerFilter< TInputImage,
44  VectorDataContainer< std::size_t, ImageSample< TInputImage > > >
45 {
46 public:
47 
51  TInputImage, VectorDataContainer<
53  typedef SmartPointer< Self > Pointer;
54  typedef SmartPointer< const Self > ConstPointer;
55 
57  itkNewMacro( Self );
58 
61 
71 
73  itkStaticConstMacro( InputImageDimension, unsigned int,
74  InputImageType::ImageDimension );
75 
80  typedef typename InputImageType::SizeType InputImageSizeType;
81  typedef typename InputImageType::IndexType InputImageIndexType;
82  typedef typename InputImageType::PointType InputImagePointType;
83  typedef typename InputImagePointType::ValueType InputImagePointValueType;
85  typedef SpatialObject< Self::InputImageDimension > MaskType;
86  typedef typename MaskType::Pointer MaskPointer;
87  typedef typename MaskType::ConstPointer MaskConstPointer;
88  typedef std::vector< MaskConstPointer > MaskVectorType;
89  typedef std::vector< InputImageRegionType > InputImageRegionVectorType;
90 
94  virtual void SetMask( const MaskType * _arg, unsigned int pos );
95 
99  virtual void SetMask( const MaskType * _arg )
100  {
101  this->SetMask( _arg, 0 );
102  }
103 
104 
106  virtual const MaskType * GetMask( unsigned int pos ) const;
107 
109  virtual const MaskType * GetMask( void ) const
110  {
111  return this->GetMask( 0 );
112  }
113 
114 
116  virtual void SetNumberOfMasks( const unsigned int _arg );
117 
119  itkGetConstMacro( NumberOfMasks, unsigned int );
120 
124  virtual void SetInputImageRegion( const InputImageRegionType _arg, unsigned int pos );
125 
127  virtual void SetInputImageRegion( const InputImageRegionType _arg )
128  {
129  this->SetInputImageRegion( _arg, 0 );
130  }
131 
132 
134  virtual const InputImageRegionType & GetInputImageRegion( unsigned int pos ) const;
135 
137  virtual const InputImageRegionType & GetInputImageRegion( void ) const
138  {
139  return this->GetInputImageRegion( 0 );
140  }
141 
142 
144  virtual void SetNumberOfInputImageRegions( const unsigned int _arg );
145 
147  itkGetConstMacro( NumberOfInputImageRegions, unsigned int );
148 
155  virtual bool SelectNewSamplesOnUpdate( void );
156 
158  virtual bool SelectingNewSamplesOnUpdateSupported( void ) const
159  {
160  return true;
161  }
162 
163 
165  itkGetConstReferenceMacro( CroppedInputImageRegion, InputImageRegionType );
166 
168  itkSetClampMacro( NumberOfSamples, unsigned long, 1, NumericTraits< unsigned long >::max() );
169  itkGetConstMacro( NumberOfSamples, unsigned long );
170 
172  itkSetMacro( UseMultiThread, bool );
173 
174 protected:
175 
178 
180  ~ImageSamplerBase() override {}
181 
183  void PrintSelf( std::ostream & os, Indent indent ) const override;
184 
186  void GenerateInputRequestedRegion( void ) override;
187 
189  virtual bool IsInsideAllMasks( const InputImagePointType & point ) const;
190 
192  virtual void UpdateAllMasks( void );
193 
197  virtual bool CheckInputImageRegions( void );
198 
200  void CropInputImageRegion( void );
201 
203  void BeforeThreadedGenerateData( void ) override;
204 
205  void AfterThreadedGenerateData( void ) override;
206 
207  /***/
208  unsigned long m_NumberOfSamples;
209  std::vector< ImageSampleContainerPointer > m_ThreaderSampleContainer;
210 
211  //tmp?
213 
214 private:
215 
217  ImageSamplerBase( const Self & ); // purposely not implemented
219  void operator=( const Self & ); // purposely not implemented
220 
224  unsigned int m_NumberOfMasks;
228 
231 
232 };
233 
234 } // end namespace itk
235 
236 #ifndef ITK_MANUAL_INSTANTIATION
237 #include "itkImageSamplerBase.hxx"
238 #endif
239 
240 #endif // end #ifndef __ImageSamplerBase_h
A class that defines an image sample, which is the coordinates of a point and its value.
NumericTraits< PixelType >::RealType RealType
This class is a base class for any image sampler.
InputImageType::IndexType InputImageIndexType
SmartPointer< Self > Pointer
MaskType::Pointer MaskPointer
virtual bool SelectNewSamplesOnUpdate(void)
InputImagePointType::ValueType InputImagePointValueType
virtual const MaskType * GetMask(void) const
virtual bool CheckInputImageRegions(void)
Superclass::InputImagePixelType InputImagePixelType
std::vector< InputImageRegionType > InputImageRegionVectorType
void CropInputImageRegion(void)
InputImageRegionType m_CroppedInputImageRegion
virtual void SetMask(const MaskType *_arg, unsigned int pos)
virtual const MaskType * GetMask(unsigned int pos) const
virtual void UpdateAllMasks(void)
MaskType::ConstPointer MaskConstPointer
virtual bool IsInsideAllMasks(const InputImagePointType &point) const
void BeforeThreadedGenerateData(void) override
VectorDataContainer< std::vcl_size_t, ImageSampleType > ImageSampleContainerType
InputImageRegionType m_InputImageRegion
virtual bool SelectingNewSamplesOnUpdateSupported(void) const
SmartPointer< const Self > ConstPointer
ImageSampleContainerType::Pointer ImageSampleContainerPointer
InputImageType::SizeType InputImageSizeType
virtual void SetMask(const MaskType *_arg)
virtual void SetInputImageRegion(const InputImageRegionType _arg)
SpatialObject< Self::InputImageDimension > MaskType
void PrintSelf(std::ostream &os, Indent indent) const override
void GenerateInputRequestedRegion(void) override
InputImageRegionVectorType m_InputImageRegionVector
ImageSampleType::RealType ImageSampleValueType
virtual void SetNumberOfMasks(const unsigned int _arg)
itkStaticConstMacro(InputImageDimension, unsigned int, InputImageType::ImageDimension)
unsigned int m_NumberOfInputImageRegions
virtual void SetNumberOfInputImageRegions(const unsigned int _arg)
Superclass::DataObjectPointer DataObjectPointer
std::vector< MaskConstPointer > MaskVectorType
InputImageType::PointType InputImagePointType
Superclass::InputImageRegionType InputImageRegionType
Superclass::InputImageType InputImageType
InputImageRegionType m_DummyInputImageRegion
ImageToVectorContainerFilter< TInputImage, VectorDataContainer< std::vcl_size_t, ImageSample< TInputImage > > > Superclass
virtual const InputImageRegionType & GetInputImageRegion(void) const
Superclass::OutputVectorContainerPointer OutputVectorContainerPointer
void AfterThreadedGenerateData(void) override
Superclass::InputImagePointer InputImagePointer
std::vector< ImageSampleContainerPointer > m_ThreaderSampleContainer
virtual void SetInputImageRegion(const InputImageRegionType _arg, unsigned int pos)
void operator=(const Self &)
Superclass::OutputVectorContainerType OutputVectorContainerType
ImageSample< InputImageType > ImageSampleType
ImageSamplerBase(const Self &)
Superclass::InputImageConstPointer InputImageConstPointer
virtual const InputImageRegionType & GetInputImageRegion(unsigned int pos) const
Base class that takes in an image and pops out a vector container.
Define a front-end to the STL "vector" container that conforms to the IndexedContainerInterface.
SmartPointer< Self > Pointer


Generated on 1641078589 for elastix by doxygen 1.9.1 elastix logo