Loading...
Searching...
No Matches
itkGenericMultiResolutionPyramidImageFilter.h
Go to the documentation of this file.
/*=========================================================================
*
* Copyright UMC Utrecht and contributors
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0.txt
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*
*=========================================================================*/
#ifndef itkGenericMultiResolutionPyramidImageFilter_h
#define itkGenericMultiResolutionPyramidImageFilter_h
#include "itkMultiResolutionPyramidImageFilter.h"
#include "itkSmoothingRecursiveGaussianImageFilter.h"
namespace itk
{
template <class TInputImage, class TOutputImage, class TPrecisionType = double>
class ITK_TEMPLATE_EXPORT GenericMultiResolutionPyramidImageFilter
: public MultiResolutionPyramidImageFilter<TInputImage, TOutputImage>
{
public:
ITK_DISALLOW_COPY_AND_MOVE(GenericMultiResolutionPyramidImageFilter);
using Self = GenericMultiResolutionPyramidImageFilter;
using Superclass = MultiResolutionPyramidImageFilter<TInputImage, TOutputImage>;
using SuperSuperclass = typename Superclass::Superclass;
using Pointer = SmartPointer<Self>;
using ConstPointer = SmartPointer<const Self>;
itkNewMacro(Self);
itkTypeMacro(GenericMultiResolutionPyramidImageFilter, MultiResolutionPyramidImageFilter);
itkStaticConstMacro(ImageDimension, unsigned int, TInputImage::ImageDimension);
itkStaticConstMacro(OutputImageDimension, unsigned int, TOutputImage::ImageDimension);
using typename Superclass::ScheduleType;
using typename Superclass::InputImageType;
using typename Superclass::OutputImageType;
using typename Superclass::InputImagePointer;
using typename Superclass::OutputImagePointer;
using typename Superclass::InputImageConstPointer;
using SpacingType = typename Superclass::InputImageType::SpacingType;
using PixelType = typename InputImageType::PixelType;
using ScalarRealType = typename NumericTraits<PixelType>::ScalarRealType;
using SmoothingScheduleType = vnl_matrix<ScalarRealType>;
using RescaleScheduleType = ScheduleType;
using SigmaArrayType = FixedArray<ScalarRealType, Self::ImageDimension>;
using RescaleFactorArrayType = SigmaArrayType;
void
SetSchedule(const ScheduleType & schedule) override;
virtual void
SetRescaleSchedule(const RescaleScheduleType & schedule);
virtual void
SetRescaleScheduleToUnity();
const RescaleScheduleType &
GetRescaleSchedule() const
{
return this->m_Schedule;
}
virtual void
SetSmoothingSchedule(const SmoothingScheduleType & schedule);
virtual void
SetSmoothingScheduleToZero();
itkGetConstReferenceMacro(SmoothingSchedule, SmoothingScheduleType);
void
SetNumberOfLevels(unsigned int num) override;
virtual void
SetCurrentLevel(unsigned int level);
itkGetConstReferenceMacro(CurrentLevel, unsigned int);
virtual void
SetComputeOnlyForCurrentLevel(const bool _arg);
itkGetConstMacro(ComputeOnlyForCurrentLevel, bool);
itkBooleanMacro(ComputeOnlyForCurrentLevel);
#ifdef ITK_USE_CONCEPT_CHECKING
itkConceptMacro(SameDimensionCheck, (Concept::SameDimension<ImageDimension, OutputImageDimension>));
itkConceptMacro(OutputHasNumericTraitsCheck, (Concept::HasNumericTraits<typename TOutputImage::PixelType>));
#endif
protected:
GenericMultiResolutionPyramidImageFilter();
~GenericMultiResolutionPyramidImageFilter() override = default;
void
PrintSelf(std::ostream & os, Indent indent) const override;
void
GenerateOutputInformation() override;
void
GenerateOutputRequestedRegion(DataObject * output) override;
void
GenerateInputRequestedRegion() override;
void
GenerateData() override;
void
ReleaseOutputs();
SmoothingScheduleType m_SmoothingSchedule{};
unsigned int m_CurrentLevel{};
bool m_ComputeOnlyForCurrentLevel{};
bool m_SmoothingScheduleDefined{};
private:
using SmootherType = SmoothingRecursiveGaussianImageFilter<InputImageType, OutputImageType>;
using ImageToImageFilterSameTypes = ImageToImageFilter<OutputImageType, OutputImageType>;
using ImageToImageFilterDifferentTypes = ImageToImageFilter<InputImageType, OutputImageType>;
bool
SetupSmoother(const unsigned int level,
typename SmootherType::Pointer & smoother,
const InputImageConstPointer & input);
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);
void
DefineShrinkerOrResampler(const bool sameType,
const RescaleFactorArrayType & shrinkFactors,
const OutputImagePointer & outputPtr,
typename ImageToImageFilterSameTypes::Pointer & rescaleSameTypes,
typename ImageToImageFilterDifferentTypes::Pointer & rescaleDifferentTypes);
void
SetSmoothingScheduleToDefault();
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
GetSigma(const unsigned int level, SigmaArrayType & sigmaArray) const;
void
GetShrinkFactors(const unsigned int level, RescaleFactorArrayType & shrinkFactors) const;
bool
AreSigmasAllZeros(const SigmaArrayType & sigmaArray) const;
bool
AreRescaleFactorsAllOnes(const RescaleFactorArrayType & rescaleFactorArray) const;
bool
IsSmoothingUsed() const;
bool
IsRescaleUsed() const;
};
} // namespace itk
#ifndef ITK_MANUAL_INSTANTIATION
# include "itkGenericMultiResolutionPyramidImageFilter.hxx"
#endif
#endif
itk::GenericMultiResolutionPyramidImageFilter::~GenericMultiResolutionPyramidImageFilter
~GenericMultiResolutionPyramidImageFilter() override=default
itk::GenericMultiResolutionPyramidImageFilter::Pointer
SmartPointer< Self > Pointer
Definition itkGenericMultiResolutionPyramidImageFilter.h:127
itk::GenericMultiResolutionPyramidImageFilter::SetSmoothingScheduleToDefault
void SetSmoothingScheduleToDefault()
itk::GenericMultiResolutionPyramidImageFilter::GetRescaleSchedule
const RescaleScheduleType & GetRescaleSchedule() const
Definition itkGenericMultiResolutionPyramidImageFilter.h:185
itk::GenericMultiResolutionPyramidImageFilter::ImageToImageFilterSameTypes
ImageToImageFilter< OutputImageType, OutputImageType > ImageToImageFilterSameTypes
Definition itkGenericMultiResolutionPyramidImageFilter.h:288
itk::GenericMultiResolutionPyramidImageFilter::SetComputeOnlyForCurrentLevel
virtual void SetComputeOnlyForCurrentLevel(const bool _arg)
itk::GenericMultiResolutionPyramidImageFilter::GenericMultiResolutionPyramidImageFilter
GenericMultiResolutionPyramidImageFilter()
itk::GenericMultiResolutionPyramidImageFilter::AreRescaleFactorsAllOnes
bool AreRescaleFactorsAllOnes(const RescaleFactorArrayType &rescaleFactorArray) const
itk::GenericMultiResolutionPyramidImageFilter::SigmaArrayType
FixedArray< ScalarRealType, Self::ImageDimension > SigmaArrayType
Definition itkGenericMultiResolutionPyramidImageFilter.h:156
itk::GenericMultiResolutionPyramidImageFilter::SpacingType
typename Superclass::InputImageType::SpacingType SpacingType
Definition itkGenericMultiResolutionPyramidImageFilter.h:147
itk::GenericMultiResolutionPyramidImageFilter::SetSmoothingSchedule
virtual void SetSmoothingSchedule(const SmoothingScheduleType &schedule)
itk::GenericMultiResolutionPyramidImageFilter::Superclass
MultiResolutionPyramidImageFilter< TInputImage, TOutputImage > Superclass
Definition itkGenericMultiResolutionPyramidImageFilter.h:125
itk::GenericMultiResolutionPyramidImageFilter< typename FixedImagePyramidBase< TElastix >::InputImageType, typename FixedImagePyramidBase< TElastix >::OutputImageType >::m_ComputeOnlyForCurrentLevel
bool m_ComputeOnlyForCurrentLevel
Definition itkGenericMultiResolutionPyramidImageFilter.h:275
itk::GenericMultiResolutionPyramidImageFilter::ITK_DISALLOW_COPY_AND_MOVE
ITK_DISALLOW_COPY_AND_MOVE(GenericMultiResolutionPyramidImageFilter)
itk::GenericMultiResolutionPyramidImageFilter::RescaleScheduleType
ScheduleType RescaleScheduleType
Definition itkGenericMultiResolutionPyramidImageFilter.h:153
itk::GenericMultiResolutionPyramidImageFilter::GenerateOutputInformation
void GenerateOutputInformation() override
itk::GenericMultiResolutionPyramidImageFilter::IsRescaleUsed
bool IsRescaleUsed() const
itk::GenericMultiResolutionPyramidImageFilter::SetRescaleSchedule
virtual void SetRescaleSchedule(const RescaleScheduleType &schedule)
itk::GenericMultiResolutionPyramidImageFilter::SetSmoothingScheduleToZero
virtual void SetSmoothingScheduleToZero()
itk::GenericMultiResolutionPyramidImageFilter::SmoothingScheduleType
vnl_matrix< ScalarRealType > SmoothingScheduleType
Definition itkGenericMultiResolutionPyramidImageFilter.h:152
itk::GenericMultiResolutionPyramidImageFilter::IsSmoothingUsed
bool IsSmoothingUsed() const
itk::GenericMultiResolutionPyramidImageFilter::ComputeForCurrentLevel
bool ComputeForCurrentLevel(const unsigned int level) const
itk::GenericMultiResolutionPyramidImageFilter::GetDefaultSigma
double GetDefaultSigma(const unsigned int level, const unsigned int dim, const unsigned int *factors, const SpacingType &spacing) const
itk::GenericMultiResolutionPyramidImageFilter::GetShrinkFactors
void GetShrinkFactors(const unsigned int level, RescaleFactorArrayType &shrinkFactors) const
itk::GenericMultiResolutionPyramidImageFilter::GenerateData
void GenerateData() override
itk::GenericMultiResolutionPyramidImageFilter::SetupShrinkerOrResampler
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)
itk::GenericMultiResolutionPyramidImageFilter::RescaleFactorArrayType
SigmaArrayType RescaleFactorArrayType
Definition itkGenericMultiResolutionPyramidImageFilter.h:157
itk::GenericMultiResolutionPyramidImageFilter::SuperSuperclass
typename Superclass::Superclass SuperSuperclass
Definition itkGenericMultiResolutionPyramidImageFilter.h:126
itk::GenericMultiResolutionPyramidImageFilter::itkStaticConstMacro
itkStaticConstMacro(ImageDimension, unsigned int, TInputImage::ImageDimension)
itk::GenericMultiResolutionPyramidImageFilter< typename FixedImagePyramidBase< TElastix >::InputImageType, typename FixedImagePyramidBase< TElastix >::OutputImageType >::m_SmoothingSchedule
SmoothingScheduleType m_SmoothingSchedule
Definition itkGenericMultiResolutionPyramidImageFilter.h:273
itk::GenericMultiResolutionPyramidImageFilter::SetCurrentLevel
virtual void SetCurrentLevel(unsigned int level)
itk::GenericMultiResolutionPyramidImageFilter::SmootherType
SmoothingRecursiveGaussianImageFilter< InputImageType, OutputImageType > SmootherType
Definition itkGenericMultiResolutionPyramidImageFilter.h:282
itk::GenericMultiResolutionPyramidImageFilter::GenerateOutputRequestedRegion
void GenerateOutputRequestedRegion(DataObject *output) override
itk::GenericMultiResolutionPyramidImageFilter< typename FixedImagePyramidBase< TElastix >::InputImageType, typename FixedImagePyramidBase< TElastix >::OutputImageType >::m_CurrentLevel
unsigned int m_CurrentLevel
Definition itkGenericMultiResolutionPyramidImageFilter.h:274
itk::GenericMultiResolutionPyramidImageFilter::itkStaticConstMacro
itkStaticConstMacro(OutputImageDimension, unsigned int, TOutputImage::ImageDimension)
itk::GenericMultiResolutionPyramidImageFilter::GetSigma
void GetSigma(const unsigned int level, SigmaArrayType &sigmaArray) const
itk::GenericMultiResolutionPyramidImageFilter::ImageToImageFilterDifferentTypes
ImageToImageFilter< InputImageType, OutputImageType > ImageToImageFilterDifferentTypes
Definition itkGenericMultiResolutionPyramidImageFilter.h:289
itk::GenericMultiResolutionPyramidImageFilter::SetSchedule
void SetSchedule(const ScheduleType &schedule) override
itk::GenericMultiResolutionPyramidImageFilter::ReleaseOutputs
void ReleaseOutputs()
itk::GenericMultiResolutionPyramidImageFilter::AreSigmasAllZeros
bool AreSigmasAllZeros(const SigmaArrayType &sigmaArray) const
itk::GenericMultiResolutionPyramidImageFilter::ScalarRealType
typename NumericTraits< PixelType >::ScalarRealType ScalarRealType
Definition itkGenericMultiResolutionPyramidImageFilter.h:149
itk::GenericMultiResolutionPyramidImageFilter::SetupSmoother
bool SetupSmoother(const unsigned int level, typename SmootherType::Pointer &smoother, const InputImageConstPointer &input)
itk::GenericMultiResolutionPyramidImageFilter< typename FixedImagePyramidBase< TElastix >::InputImageType, typename FixedImagePyramidBase< TElastix >::OutputImageType >::m_SmoothingScheduleDefined
bool m_SmoothingScheduleDefined
Definition itkGenericMultiResolutionPyramidImageFilter.h:276
itk::GenericMultiResolutionPyramidImageFilter::ConstPointer
SmartPointer< const Self > ConstPointer
Definition itkGenericMultiResolutionPyramidImageFilter.h:128
itk::GenericMultiResolutionPyramidImageFilter::DefineShrinkerOrResampler
void DefineShrinkerOrResampler(const bool sameType, const RescaleFactorArrayType &shrinkFactors, const OutputImagePointer &outputPtr, typename ImageToImageFilterSameTypes::Pointer &rescaleSameTypes, typename ImageToImageFilterDifferentTypes::Pointer &rescaleDifferentTypes)
itk::GenericMultiResolutionPyramidImageFilter::PrintSelf
void PrintSelf(std::ostream &os, Indent indent) const override
itk::GenericMultiResolutionPyramidImageFilter::SetRescaleScheduleToUnity
virtual void SetRescaleScheduleToUnity()
itk::GenericMultiResolutionPyramidImageFilter::Self
GenericMultiResolutionPyramidImageFilter Self
Definition itkGenericMultiResolutionPyramidImageFilter.h:124
itk::GenericMultiResolutionPyramidImageFilter::SetNumberOfLevels
void SetNumberOfLevels(unsigned int num) override
itk::GenericMultiResolutionPyramidImageFilter::GenerateInputRequestedRegion
void GenerateInputRequestedRegion() override
itk
Definition itkAdvancedImageToImageMetric.h:43

Generated on 1768596610 for elastix by 1.15.0 |