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  This file is part of the elastix software.
4 
5  Copyright (c) University Medical Center Utrecht. All rights reserved.
6  See src/CopyrightElastix.txt or http://elastix.isi.uu.nl/legal.php for
7  details.
8 
9  This software is distributed WITHOUT ANY WARRANTY; without even
10  the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR
11  PURPOSE. See the above copyright notices for more information.
12 
13 ======================================================================*/
14 #ifndef __ImageSamplerBase_h
15 #define __ImageSamplerBase_h
16 
18 #include "itkImageSample.h"
19 #include "itkVectorDataContainer.h"
20 #include "itkSpatialObject.h"
21 
22 namespace itk
23 {
37 template< class TInputImage >
39  public ImageToVectorContainerFilter< TInputImage,
40  VectorDataContainer< unsigned long, ImageSample< TInputImage > > >
41 {
42 public:
43 
47  TInputImage, VectorDataContainer<
49  typedef SmartPointer< Self > Pointer;
50  typedef SmartPointer< const Self > ConstPointer;
51 
53  itkNewMacro( Self );
54 
57 
67 
69  itkStaticConstMacro( InputImageDimension, unsigned int,
70  InputImageType::ImageDimension );
71 
76  typedef typename InputImageType::SizeType InputImageSizeType;
77  typedef typename InputImageType::IndexType InputImageIndexType;
78  typedef typename InputImageType::PointType InputImagePointType;
79  typedef typename InputImagePointType::ValueType InputImagePointValueType;
81  typedef SpatialObject< Self::InputImageDimension > MaskType;
82  typedef typename MaskType::Pointer MaskPointer;
83  typedef typename MaskType::ConstPointer MaskConstPointer;
84  typedef std::vector< MaskConstPointer > MaskVectorType;
85  typedef std::vector< InputImageRegionType > InputImageRegionVectorType;
86 
90  virtual void SetMask( const MaskType * _arg, unsigned int pos );
91 
95  virtual void SetMask( const MaskType * _arg )
96  {
97  this->SetMask( _arg, 0 );
98  }
99 
100 
102  virtual const MaskType * GetMask( unsigned int pos ) const;
103 
105  virtual const MaskType * GetMask( void ) const
106  {
107  return this->GetMask( 0 );
108  }
109 
110 
112  virtual void SetNumberOfMasks( const unsigned int _arg );
113 
115  itkGetConstMacro( NumberOfMasks, unsigned int );
116 
120  virtual void SetInputImageRegion( const InputImageRegionType _arg, unsigned int pos );
121 
123  virtual void SetInputImageRegion( const InputImageRegionType _arg )
124  {
125  this->SetInputImageRegion( _arg, 0 );
126  }
127 
128 
130  virtual const InputImageRegionType & GetInputImageRegion( unsigned int pos ) const;
131 
133  virtual const InputImageRegionType & GetInputImageRegion( void ) const
134  {
135  return this->GetInputImageRegion( 0 );
136  }
137 
138 
140  virtual void SetNumberOfInputImageRegions( const unsigned int _arg );
141 
143  itkGetConstMacro( NumberOfInputImageRegions, unsigned int );
144 
151  virtual bool SelectNewSamplesOnUpdate( void );
152 
154  virtual bool SelectingNewSamplesOnUpdateSupported( void ) const
155  {
156  return true;
157  }
158 
159 
161  itkGetConstReferenceMacro( CroppedInputImageRegion, InputImageRegionType );
162 
164  itkGetConstMacro( NumberOfSamples, unsigned long );
165 
167  itkSetMacro( UseMultiThread, bool );
168 
169 protected:
170 
173 
175  virtual ~ImageSamplerBase() {}
176 
178  void PrintSelf( std::ostream & os, Indent indent ) const;
179 
181  virtual void GenerateInputRequestedRegion( void );
182 
184  virtual bool IsInsideAllMasks( const InputImagePointType & point ) const;
185 
187  virtual void UpdateAllMasks( void );
188 
192  virtual bool CheckInputImageRegions( void );
193 
195  void CropInputImageRegion( void );
196 
198  virtual void BeforeThreadedGenerateData( void );
199 
200  virtual void AfterThreadedGenerateData( void );
201 
202  /***/
203  unsigned long m_NumberOfSamples;
204  std::vector< ImageSampleContainerPointer > m_ThreaderSampleContainer;
205 
206  //tmp?
208 
209 private:
210 
212  ImageSamplerBase( const Self & ); // purposely not implemented
214  void operator=( const Self & ); // purposely not implemented
215 
219  unsigned int m_NumberOfMasks;
223 
226 
227 };
228 
229 } // end namespace itk
230 
231 #ifndef ITK_MANUAL_INSTANTIATION
232 #include "itkImageSamplerBase.hxx"
233 #endif
234 
235 #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
SmartPointer< Self > Pointer
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 11-03-2014 for elastix by doxygen 1.8.6 elastix logo