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::SpacingType InputImageSpacingType;
84  typedef typename InputImageType::PointType InputImagePointType;
85  typedef typename InputImagePointType::ValueType InputImagePointValueType;
87  typedef SpatialObject<
88  itkGetStaticConstMacro( InputImageDimension ) > MaskType;
89  typedef typename MaskType::Pointer MaskPointer;
90  typedef typename MaskType::ConstPointer MaskConstPointer;
91  typedef std::vector< MaskConstPointer > MaskVectorType;
92  typedef std::vector< InputImageRegionType > InputImageRegionVectorType;
93 
97  virtual void SetMask( const MaskType *_arg, unsigned int pos );
98 
101  virtual void SetMask( const MaskType *_arg )
102  {
103  this->SetMask( _arg, 0 );
104  }
105 
107  virtual const MaskType * GetMask( unsigned int pos ) const;
108 
110  virtual const MaskType * GetMask( void ) const
111  {
112  return this->GetMask( 0 );
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 
133  virtual const InputImageRegionType & GetInputImageRegion( unsigned int pos ) const;
134 
136  virtual const InputImageRegionType & GetInputImageRegion( void ) const
137  {
138  return this->GetInputImageRegion( 0 );
139  };
140 
142  virtual void SetNumberOfInputImageRegions( const unsigned int _arg );
143 
145  itkGetConstMacro( NumberOfInputImageRegions, unsigned int );
146 
152  virtual bool SelectNewSamplesOnUpdate( void );
153 
155  virtual bool SelectingNewSamplesOnUpdateSupported( void ) const
156  {
157  return true;
158  }
159 
161  itkGetConstReferenceMacro( CroppedInputImageRegion, InputImageRegionType );
162 
163  protected:
164 
167 
169  virtual ~ImageSamplerBase() {};
170 
172  void PrintSelf( std::ostream& os, Indent indent ) const;
173 
175  virtual void GenerateInputRequestedRegion( void );
176 
178  virtual bool IsInsideAllMasks( const InputImagePointType & point ) const;
179 
181  virtual void UpdateAllMasks( void );
182 
186  virtual bool CheckInputImageRegions( void );
187 
189  void CropInputImageRegion( void );
190 
191  private:
192 
194  ImageSamplerBase( const Self& ); // purposely not implemented
196  void operator=( const Self& ); // purposely not implemented
197 
201  unsigned int m_NumberOfMasks;
205 
208 
209  }; // end class ImageSamplerBase
210 
211 
212 } // end namespace itk
213 
214 #ifndef ITK_MANUAL_INSTANTIATION
215 #include "itkImageSamplerBase.txx"
216 #endif
217 
218 #endif // end #ifndef __ImageSamplerBase_h
219 
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)
InputImageType::SpacingType InputImageSpacingType
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-01-2014 for elastix by doxygen 1.8.5 elastix logo