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< unsigned long, ImageSample< TInputImage > > >
45 {
46 public:
47 
51  TInputImage, VectorDataContainer<
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  itkGetConstMacro( NumberOfSamples, unsigned long );
169 
171  itkSetMacro( UseMultiThread, bool );
172 
173 protected:
174 
177 
179  virtual ~ImageSamplerBase() {}
180 
182  void PrintSelf( std::ostream & os, Indent indent ) const;
183 
185  virtual void GenerateInputRequestedRegion( void );
186 
188  virtual bool IsInsideAllMasks( const InputImagePointType & point ) const;
189 
191  virtual void UpdateAllMasks( void );
192 
196  virtual bool CheckInputImageRegions( void );
197 
199  void CropInputImageRegion( void );
200 
202  virtual void BeforeThreadedGenerateData( void );
203 
204  virtual void AfterThreadedGenerateData( void );
205 
206  /***/
207  unsigned long m_NumberOfSamples;
208  std::vector< ImageSampleContainerPointer > m_ThreaderSampleContainer;
209 
210  //tmp?
212 
213 private:
214 
216  ImageSamplerBase( const Self & ); // purposely not implemented
218  void operator=( const Self & ); // purposely not implemented
219 
221  MaskConstPointer m_Mask;
222  MaskVectorType m_MaskVector;
223  unsigned int m_NumberOfMasks;
224  InputImageRegionType m_InputImageRegion;
225  InputImageRegionVectorType m_InputImageRegionVector;
227 
228  InputImageRegionType m_CroppedInputImageRegion;
229  InputImageRegionType m_DummyInputImageRegion;
230 
231 };
232 
233 } // end namespace itk
234 
235 #ifndef ITK_MANUAL_INSTANTIATION
236 #include "itkImageSamplerBase.hxx"
237 #endif
238 
239 #endif // end #ifndef __ImageSamplerBase_h
std::vector< MaskConstPointer > MaskVectorType
virtual void SetInputImageRegion(const InputImageRegionType _arg)
ImageSampleType::RealType ImageSampleValueType
InputImageRegionType m_DummyInputImageRegion
MaskType::ConstPointer MaskConstPointer
InputImageType::PointType InputImagePointType
virtual bool SelectNewSamplesOnUpdate(void)
virtual void AfterThreadedGenerateData(void)
InputImageRegionType m_InputImageRegion
ImageSampleContainerType::Pointer ImageSampleContainerPointer
SmartPointer< Self > Pointer
A class that defines an image sample, which is the coordinates of a point and its value...
SpatialObject< Self::InputImageDimension > MaskType
virtual void BeforeThreadedGenerateData(void)
std::vector< InputImageRegionType > InputImageRegionVectorType
Superclass::DataObjectPointer DataObjectPointer
virtual bool CheckInputImageRegions(void)
Superclass::InputImagePixelType InputImagePixelType
virtual void SetNumberOfInputImageRegions(const unsigned int _arg)
This class is a base class for any image sampler.
InputImageRegionType m_CroppedInputImageRegion
ImageSample< InputImageType > ImageSampleType
Define a front-end to the STL "vector" container that conforms to the IndexedContainerInterface.
Superclass::OutputVectorContainerType OutputVectorContainerType
virtual void GenerateInputRequestedRegion(void)
InputImagePointType::ValueType InputImagePointValueType
void CropInputImageRegion(void)
SmartPointer< const Self > ConstPointer
Superclass::InputImageRegionType InputImageRegionType
virtual bool IsInsideAllMasks(const InputImagePointType &point) const
NumericTraits< PixelType >::RealType RealType
VectorDataContainer< unsigned long, ImageSampleType > ImageSampleContainerType
Superclass::OutputVectorContainerPointer OutputVectorContainerPointer
virtual void SetMask(const MaskType *_arg)
void PrintSelf(std::ostream &os, Indent indent) const
std::vector< ImageSampleContainerPointer > m_ThreaderSampleContainer
virtual bool SelectingNewSamplesOnUpdateSupported(void) const
InputImageType::SizeType InputImageSizeType
unsigned int m_NumberOfInputImageRegions
Superclass::InputImagePointer InputImagePointer
virtual const InputImageRegionType & GetInputImageRegion(void) const
InputImageRegionVectorType m_InputImageRegionVector
virtual void SetMask(const MaskType *_arg, unsigned int pos)
virtual void SetInputImageRegion(const InputImageRegionType _arg, unsigned int pos)
virtual const MaskType * GetMask(void) const
virtual void SetNumberOfMasks(const unsigned int _arg)
virtual void UpdateAllMasks(void)
Base class that takes in an image and pops out a vector container.
Superclass::InputImageConstPointer InputImageConstPointer
MaskType::Pointer MaskPointer
Superclass::InputImageType InputImageType
itkStaticConstMacro(InputImageDimension, unsigned int, InputImageType::ImageDimension)
InputImageType::IndexType InputImageIndexType
ImageToVectorContainerFilter< TInputImage, VectorDataContainer< unsigned long, ImageSample< TInputImage > > > Superclass
void operator=(const Self &)


Generated on 04-09-2015 for elastix by doxygen 1.8.9.1 elastix logo