go home Home | Main Page | Modules | Namespace List | Class Hierarchy | Alphabetical List | Data Structures | File List | Namespace Members | Data Fields | Globals | Related Pages
itkGenericMultiResolutionPyramidImageFilter.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 __itkGenericMultiResolutionPyramidImageFilter_h
15 #define __itkGenericMultiResolutionPyramidImageFilter_h
16 
17 #include "itkMultiResolutionPyramidImageFilter.h"
18 
19 namespace itk
20 {
104 template< class TInputImage, class TOutputImage >
106  public MultiResolutionPyramidImageFilter< TInputImage, TOutputImage >
107 {
108 public:
109 
112  typedef MultiResolutionPyramidImageFilter<
113  TInputImage, TOutputImage > Superclass;
114  typedef typename Superclass::Superclass SuperSuperclass;
115  typedef SmartPointer< Self > Pointer;
116  typedef SmartPointer< const Self > ConstPointer;
117 
119  itkNewMacro( Self );
120 
123  MultiResolutionPyramidImageFilter );
124 
126  itkStaticConstMacro( ImageDimension, unsigned int,
127  TInputImage::ImageDimension );
128  itkStaticConstMacro( OutputImageDimension, unsigned int,
129  TOutputImage::ImageDimension );
130 
132  typedef typename Superclass::ScheduleType ScheduleType;
133  typedef typename Superclass::InputImageType InputImageType;
134  typedef typename Superclass::OutputImageType OutputImageType;
135  typedef typename Superclass::InputImagePointer InputImagePointer;
136  typedef typename Superclass::OutputImagePointer OutputImagePointer;
137  typedef typename Superclass::InputImageConstPointer InputImageConstPointer;
138  typedef typename Superclass::InputImageType::SpacingType SpacingType;
139  typedef typename InputImageType::PixelType PixelType;
140  typedef typename NumericTraits< PixelType >::ScalarRealType ScalarRealType;
141 
145 
147  typedef FixedArray< ScalarRealType,
148  itkGetStaticConstMacro( ImageDimension ) > SigmaArrayType;
150 
158  virtual void SetSchedule( const ScheduleType & schedule );
159 
167  virtual void SetRescaleSchedule( const RescaleScheduleType & schedule );
168 
171  {
172  return this->m_Schedule;
173  }
174 
175 
180  virtual void SetSmoothingSchedule( const SmoothingScheduleType & schedule );
181 
183  itkGetConstReferenceMacro( SmoothingSchedule, SmoothingScheduleType );
184 
188  virtual void SetNumberOfLevels( unsigned int num );
189 
193  virtual void SetCurrentLevel( unsigned int level );
194 
196  itkGetConstReferenceMacro( CurrentLevel, unsigned int );
197 
199  virtual void SetComputeOnlyForCurrentLevel( const bool _arg );
200 
201  itkGetConstMacro( ComputeOnlyForCurrentLevel, bool );
202  itkBooleanMacro( ComputeOnlyForCurrentLevel );
203 
209  itkSetMacro( UseMultiResolutionRescaleSchedule, bool );
210  itkGetConstMacro( UseMultiResolutionRescaleSchedule, bool );
211  itkBooleanMacro( UseMultiResolutionRescaleSchedule );
212 
217  itkSetMacro( UseMultiResolutionSmoothingSchedule, bool );
218  itkGetConstMacro( UseMultiResolutionSmoothingSchedule, bool );
219  itkBooleanMacro( UseMultiResolutionSmoothingSchedule );
220 
221 #ifdef ITK_USE_CONCEPT_CHECKING
222 
223  itkConceptMacro( SameDimensionCheck,
224  ( Concept::SameDimension< ImageDimension, OutputImageDimension > ) );
225  itkConceptMacro( OutputHasNumericTraitsCheck,
226  ( Concept::HasNumericTraits< typename TOutputImage::PixelType > ) );
228 #endif
229 
230 protected:
231 
234  void PrintSelf( std::ostream & os, Indent indent ) const;
235 
243  virtual void GenerateOutputInformation( void );
244 
250  virtual void GenerateOutputRequestedRegion( DataObject * output );
251 
253  virtual void GenerateInputRequestedRegion( void );
254 
256  virtual void GenerateData( void );
257 
259  void ReleaseOutputs( void );
260 
262  unsigned int m_CurrentLevel;
263 
268 
269 private:
270 
272  void SetSmoothingScheduleToDefault( void );
273 
277  bool ComputeForCurrentLevel( const unsigned int level ) const;
278 
280  double GetDefaultSigma( const unsigned int dim,
281  const unsigned int * factors,
282  const SpacingType & spacing ) const;
283 
285  SigmaArrayType GetSigma( const unsigned int level,
286  SigmaArrayType & sigmaArray ) const;
287 
289  bool AreSigmasAllZeros( const SigmaArrayType & sigmaArray ) const;
290 
292  bool AreRescaleFactorsAllOnes( const RescaleFactorArrayType & rescaleFactorArray ) const;
293 
299  bool IsCasterNeeded( void ) const;
300 
301 private:
302 
303  GenericMultiResolutionPyramidImageFilter( const Self & ); // purposely not implemented
304  void operator=( const Self & ); // purposely not implemented
305 
306 };
307 
308 } // namespace itk
309 
310 #ifndef ITK_MANUAL_INSTANTIATION
311 #include "itkGenericMultiResolutionPyramidImageFilter.hxx"
312 #endif
313 
314 #endif
virtual void SetCurrentLevel(unsigned int level)
virtual void SetNumberOfLevels(unsigned int num)
virtual void SetRescaleSchedule(const RescaleScheduleType &schedule)
virtual void SetSchedule(const ScheduleType &schedule)
Framework for creating images in a multi-resolution pyramid.
void PrintSelf(std::ostream &os, Indent indent) const
FixedArray< ScalarRealType, itkGetStaticConstMacro(ImageDimension) > SigmaArrayType
virtual void GenerateOutputRequestedRegion(DataObject *output)
virtual void SetComputeOnlyForCurrentLevel(const bool _arg)
bool ComputeForCurrentLevel(const unsigned int level) const
double GetDefaultSigma(const unsigned int dim, const unsigned int *factors, const SpacingType &spacing) const
bool AreSigmasAllZeros(const SigmaArrayType &sigmaArray) const
bool AreRescaleFactorsAllOnes(const RescaleFactorArrayType &rescaleFactorArray) const
SigmaArrayType GetSigma(const unsigned int level, SigmaArrayType &sigmaArray) const
virtual void SetSmoothingSchedule(const SmoothingScheduleType &schedule)
MultiResolutionPyramidImageFilter< TInputImage, TOutputImage > Superclass
itkStaticConstMacro(ImageDimension, unsigned int, TInputImage::ImageDimension)


Generated on 27-04-2014 for elastix by doxygen 1.8.6 elastix logo