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 * 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 __itkGenericMultiResolutionPyramidImageFilter_h
19#define __itkGenericMultiResolutionPyramidImageFilter_h
20
21#include "itkMultiResolutionPyramidImageFilter.h"
22#include "itkSmoothingRecursiveGaussianImageFilter.h"
23
24namespace itk
25{
116template< class TInputImage, class TOutputImage, class TPrecisionType = double >
118 public MultiResolutionPyramidImageFilter< TInputImage, TOutputImage >
119{
120public:
121
124 typedef MultiResolutionPyramidImageFilter<
125 TInputImage, TOutputImage > Superclass;
126 typedef typename Superclass::Superclass SuperSuperclass;
128 typedef SmartPointer< const Self > ConstPointer;
129
131 itkNewMacro( Self );
132
135 MultiResolutionPyramidImageFilter );
136
138 itkStaticConstMacro( ImageDimension, unsigned int,
139 TInputImage::ImageDimension );
140 itkStaticConstMacro( OutputImageDimension, unsigned int,
141 TOutputImage::ImageDimension );
142
144 typedef typename Superclass::ScheduleType ScheduleType;
145 typedef typename Superclass::InputImageType InputImageType;
146 typedef typename Superclass::OutputImageType OutputImageType;
147 typedef typename Superclass::InputImagePointer InputImagePointer;
148 typedef typename Superclass::OutputImagePointer OutputImagePointer;
149 typedef typename Superclass::InputImageConstPointer InputImageConstPointer;
150 typedef typename Superclass::InputImageType::SpacingType SpacingType;
151 typedef typename InputImageType::PixelType PixelType;
152 typedef typename NumericTraits< PixelType >::ScalarRealType ScalarRealType;
153
157
159 typedef FixedArray< ScalarRealType,
160 itkGetStaticConstMacro( ImageDimension ) > SigmaArrayType;
162
170 void SetSchedule( const ScheduleType & schedule ) override;
171
179 virtual void SetRescaleSchedule( const RescaleScheduleType & schedule );
180
182 virtual void SetRescaleScheduleToUnity( void );
183
186 {
187 return this->m_Schedule;
188 }
189
190
195 virtual void SetSmoothingSchedule( const SmoothingScheduleType & schedule );
196
198 virtual void SetSmoothingScheduleToZero( void );
199
201 itkGetConstReferenceMacro( SmoothingSchedule, SmoothingScheduleType );
202
207 void SetNumberOfLevels( unsigned int num ) override;
208
212 virtual void SetCurrentLevel( unsigned int level );
213
215 itkGetConstReferenceMacro( CurrentLevel, unsigned int );
216
218 virtual void SetComputeOnlyForCurrentLevel( const bool _arg );
219
220 itkGetConstMacro( ComputeOnlyForCurrentLevel, bool );
221 itkBooleanMacro( ComputeOnlyForCurrentLevel );
222
223#ifdef ITK_USE_CONCEPT_CHECKING
225 itkConceptMacro( SameDimensionCheck,
226 ( Concept::SameDimension< ImageDimension, OutputImageDimension > ) );
227 itkConceptMacro( OutputHasNumericTraitsCheck,
228 ( Concept::HasNumericTraits< typename TOutputImage::PixelType > ) );
230#endif
231
232protected:
233
236
238 void PrintSelf( std::ostream & os, Indent indent ) const override;
239
247 void GenerateOutputInformation( void ) override;
248
254 void GenerateOutputRequestedRegion( DataObject * output ) override;
255
257 void GenerateInputRequestedRegion( void ) override;
258
260 void GenerateData( void ) override;
261
263 void ReleaseOutputs( void );
264
266 unsigned int m_CurrentLevel;
269
270private:
271
275 typedef SmoothingRecursiveGaussianImageFilter<
277
282 typedef ImageToImageFilter< OutputImageType, OutputImageType >
284 typedef ImageToImageFilter< InputImageType, OutputImageType >
286
290 bool SetupSmoother( const unsigned int level,
291 typename SmootherType::Pointer & smoother,
292 const InputImageConstPointer & input );
293
297 int SetupShrinkerOrResampler( const unsigned int level,
298 typename SmootherType::Pointer & smoother,
299 const bool sameType,
300 const InputImageConstPointer & input,
301 const OutputImagePointer & outputPtr,
302 typename ImageToImageFilterSameTypes::Pointer & rescaleSameTypes,
303 typename ImageToImageFilterDifferentTypes::Pointer & rescaleDifferentTypes );
304
307 const bool sameType,
308 const RescaleFactorArrayType & shrinkFactors,
309 const OutputImagePointer & outputPtr,
310 typename ImageToImageFilterSameTypes::Pointer & rescaleSameTypes,
311 typename ImageToImageFilterDifferentTypes::Pointer & rescaleDifferentTypes );
312
315
319 bool ComputeForCurrentLevel( const unsigned int level ) const;
320
322 double GetDefaultSigma( const unsigned int level,
323 const unsigned int dim,
324 const unsigned int * factors,
325 const SpacingType & spacing ) const;
326
328 void GetSigma( const unsigned int level,
329 SigmaArrayType & sigmaArray ) const;
330
332 void GetShrinkFactors( const unsigned int level,
333 RescaleFactorArrayType & shrinkFactors ) const;
334
338 bool AreSigmasAllZeros( const SigmaArrayType & sigmaArray ) const;
339
343 bool AreRescaleFactorsAllOnes( const RescaleFactorArrayType & rescaleFactorArray ) const;
344
346 bool IsSmoothingUsed( void ) const;
347
349 bool IsRescaleUsed( void ) const;
350
351private:
352
353 GenericMultiResolutionPyramidImageFilter( const Self & ); // purposely not implemented
354 void operator=( const Self & ); // purposely not implemented
355
356};
357
358} // namespace itk
359
360#ifndef ITK_MANUAL_INSTANTIATION
361#include "itkGenericMultiResolutionPyramidImageFilter.hxx"
362#endif
363
364#endif
Framework for creating images in a multi-resolution pyramid.
ImageToImageFilter< InputImageType, OutputImageType > ImageToImageFilterDifferentTypes
MultiResolutionPyramidImageFilter< TInputImage, TOutputImage > Superclass
virtual void SetComputeOnlyForCurrentLevel(const bool _arg)
bool AreRescaleFactorsAllOnes(const RescaleFactorArrayType &rescaleFactorArray) const
virtual void SetSmoothingSchedule(const SmoothingScheduleType &schedule)
virtual void SetRescaleSchedule(const RescaleScheduleType &schedule)
bool ComputeForCurrentLevel(const unsigned int level) const
double GetDefaultSigma(const unsigned int level, const unsigned int dim, const unsigned int *factors, const SpacingType &spacing) const
void GetShrinkFactors(const unsigned int level, RescaleFactorArrayType &shrinkFactors) const
ImageToImageFilter< OutputImageType, OutputImageType > ImageToImageFilterSameTypes
int SetupShrinkerOrResampler(const unsigned int level, typename SmootherType::Pointer &smoother, const bool sameType, const InputImageConstPointer &input, const OutputImagePointer &outputPtr, typename ImageToImageFilterSameTypes::Pointer &rescaleSameTypes, typename ImageToImageFilterDifferentTypes::Pointer &rescaleDifferentTypes)
itkStaticConstMacro(ImageDimension, unsigned int, TInputImage::ImageDimension)
virtual void SetCurrentLevel(unsigned int level)
SmoothingRecursiveGaussianImageFilter< InputImageType, OutputImageType > SmootherType
void GenerateOutputRequestedRegion(DataObject *output) override
itkStaticConstMacro(OutputImageDimension, unsigned int, TOutputImage::ImageDimension)
void GetSigma(const unsigned int level, SigmaArrayType &sigmaArray) const
void SetSchedule(const ScheduleType &schedule) override
FixedArray< ScalarRealType, itkGetStaticConstMacro(ImageDimension) > SigmaArrayType
bool AreSigmasAllZeros(const SigmaArrayType &sigmaArray) const
bool SetupSmoother(const unsigned int level, typename SmootherType::Pointer &smoother, const InputImageConstPointer &input)
void DefineShrinkerOrResampler(const bool sameType, const RescaleFactorArrayType &shrinkFactors, const OutputImagePointer &outputPtr, typename ImageToImageFilterSameTypes::Pointer &rescaleSameTypes, typename ImageToImageFilterDifferentTypes::Pointer &rescaleDifferentTypes)
void PrintSelf(std::ostream &os, Indent indent) const override
void SetNumberOfLevels(unsigned int num) override


Generated on 1667476801 for elastix by doxygen 1.9.4 elastix logo