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 
15 #ifndef __ImageSamplerBase_h
16 #define __ImageSamplerBase_h
17 
19 #include "itkImageSample.h"
20 #include "itkVectorDataContainer.h"
21 #include "itkSpatialObject.h"
22 
23 
24 namespace itk
25 {
26 
40  template < class TInputImage >
42  public ImageToVectorContainerFilter< TInputImage,
43  VectorDataContainer< unsigned long, ImageSample< TInputImage > > >
44  {
45  public:
46 
50  TInputImage,
52  unsigned long,
54  typedef SmartPointer<Self> Pointer;
55  typedef SmartPointer<const Self> ConstPointer;
56 
58  itkNewMacro( Self );
59 
62 
72 
74  itkStaticConstMacro( InputImageDimension, unsigned int,
75  InputImageType::ImageDimension );
76 
79  typedef VectorDataContainer< unsigned long,
81  typedef typename InputImageType::SizeType InputImageSizeType;
82  typedef typename InputImageType::IndexType InputImageIndexType;
83  typedef typename InputImageType::PointType InputImagePointType;
84  typedef typename InputImagePointType::ValueType InputImagePointValueType;
86  typedef SpatialObject<
87  itkGetStaticConstMacro( InputImageDimension ) > MaskType;
88  typedef typename MaskType::Pointer MaskPointer;
89  typedef typename MaskType::ConstPointer MaskConstPointer;
90  typedef std::vector< MaskConstPointer > MaskVectorType;
91  typedef std::vector< InputImageRegionType > InputImageRegionVectorType;
92 
96  virtual void SetMask( const MaskType *_arg, unsigned int pos );
97 
100  virtual void SetMask( const MaskType *_arg )
101  {
102  this->SetMask( _arg, 0 );
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 
115  virtual void SetNumberOfMasks( const unsigned int _arg );
116 
118  itkGetConstMacro( NumberOfMasks, unsigned int );
119 
123  virtual void SetInputImageRegion( const InputImageRegionType _arg, unsigned int pos );
124 
126  virtual void SetInputImageRegion( const InputImageRegionType _arg )
127  {
128  this->SetInputImageRegion( _arg, 0 );
129  }
130 
132  virtual const InputImageRegionType & GetInputImageRegion( unsigned int pos ) const;
133 
135  virtual const InputImageRegionType & GetInputImageRegion( void ) const
136  {
137  return this->GetInputImageRegion( 0 );
138  };
139 
141  virtual void SetNumberOfInputImageRegions( const unsigned int _arg );
142 
144  itkGetConstMacro( NumberOfInputImageRegions, unsigned int );
145 
151  virtual bool SelectNewSamplesOnUpdate( void );
152 
154  virtual bool SelectingNewSamplesOnUpdateSupported( void ) const
155  {
156  return true;
157  }
158 
160  itkGetConstReferenceMacro( CroppedInputImageRegion, InputImageRegionType );
161 
162  protected:
163 
166 
168  virtual ~ImageSamplerBase() {};
169 
171  void PrintSelf( std::ostream& os, Indent indent ) const;
172 
174  virtual void GenerateInputRequestedRegion( void );
175 
177  virtual bool IsInsideAllMasks( const InputImagePointType & point ) const;
178 
180  virtual void UpdateAllMasks( void );
181 
185  virtual bool CheckInputImageRegions( void );
186 
188  void CropInputImageRegion( void );
189 
190  private:
191 
193  ImageSamplerBase( const Self& ); // purposely not implemented
195  void operator=( const Self& ); // purposely not implemented
196 
200  unsigned int m_NumberOfMasks;
204 
207 
208  }; // end class ImageSamplerBase
209 
210 
211 } // end namespace itk
212 
213 #ifndef ITK_MANUAL_INSTANTIATION
214 #include "itkImageSamplerBase.txx"
215 #endif
216 
217 #endif // end #ifndef __ImageSamplerBase_h
218 
NumericTraits< PixelType >::RealType RealType
std::vector< MaskConstPointer > MaskVectorType
virtual void SetInputImageRegion(const InputImageRegionType _arg)
ImageSampleType::RealType ImageSampleValueType
SmartPointer< Self > Pointer
InputImageRegionType m_DummyInputImageRegion
MaskType::ConstPointer MaskConstPointer
InputImageType::PointType InputImagePointType
virtual bool SelectNewSamplesOnUpdate(void)
InputImageRegionType m_InputImageRegion
A class that defines an image sample, which is the coordinates of a point and its value...
SmartPointer< const Self > ConstPointer
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 &quot;vector&quot; container that conforms to the IndexedContainerInterface.
Superclass::OutputVectorContainerType OutputVectorContainerType
virtual void GenerateInputRequestedRegion(void)
InputImagePointType::ValueType InputImagePointValueType
void CropInputImageRegion(void)
Superclass::InputImageRegionType InputImageRegionType
virtual bool IsInsideAllMasks(const InputImagePointType &point) const
VectorDataContainer< unsigned long, ImageSampleType > ImageSampleContainerType
Superclass::OutputVectorContainerPointer OutputVectorContainerPointer
virtual void SetMask(const MaskType *_arg)
void PrintSelf(std::ostream &os, Indent indent) const
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.
SpatialObject< itkGetStaticConstMacro(InputImageDimension) > MaskType
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 05-12-2013 for elastix by doxygen 1.8.5 elastix logo