From 7757890c444358b94312c1a087e51bfb414f80b5 Mon Sep 17 00:00:00 2001 From: Pablo Hernandez-Cerdan Date: Wed, 6 Jun 2018 18:04:00 -0400 Subject: [PATCH] COMP: Remove FrequencyIterators (merged into ITK) Also FrequencyBandImageFilter was merged. They are in the internal module: ITKImageFrequency, which is now a dependency in this module. --- include/itkFrequencyBandImageFilter.h | 204 ----------- include/itkFrequencyBandImageFilter.hxx | 226 ------------ ...TLayoutImageRegionConstIteratorWithIndex.h | 300 ---------------- ...ncyFFTLayoutImageRegionIteratorWithIndex.h | 138 -------- ...equencyImageRegionConstIteratorWithIndex.h | 188 ---------- ...itkFrequencyImageRegionIteratorWithIndex.h | 138 -------- ...TLayoutImageRegionConstIteratorWithIndex.h | 274 --------------- ...tedFFTLayoutImageRegionIteratorWithIndex.h | 138 -------- itk-module.cmake | 2 + test/CMakeLists.txt | 14 - test/itkFrequencyBandImageFilterTest.cxx | 248 -------------- ...LayoutImageRegionIteratorWithIndexTest.cxx | 323 ------------------ wrapping/itkFrequencyBandImageFilter.wrap | 7 - ...ageRegionConstIteratorWithIndex.notwrapped | 1 - ...outImageRegionIteratorWithIndex.notwrapped | 1 - ...ageRegionConstIteratorWithIndex.notwrapped | 1 - ...ncyImageRegionIteratorWithIndex.notwrapped | 1 - ...ageRegionConstIteratorWithIndex.notwrapped | 1 - ...outImageRegionIteratorWithIndex.notwrapped | 1 - 19 files changed, 2 insertions(+), 2204 deletions(-) delete mode 100644 include/itkFrequencyBandImageFilter.h delete mode 100644 include/itkFrequencyBandImageFilter.hxx delete mode 100644 include/itkFrequencyFFTLayoutImageRegionConstIteratorWithIndex.h delete mode 100644 include/itkFrequencyFFTLayoutImageRegionIteratorWithIndex.h delete mode 100644 include/itkFrequencyImageRegionConstIteratorWithIndex.h delete mode 100644 include/itkFrequencyImageRegionIteratorWithIndex.h delete mode 100644 include/itkFrequencyShiftedFFTLayoutImageRegionConstIteratorWithIndex.h delete mode 100644 include/itkFrequencyShiftedFFTLayoutImageRegionIteratorWithIndex.h delete mode 100644 test/itkFrequencyBandImageFilterTest.cxx delete mode 100644 test/itkFrequencyFFTLayoutImageRegionIteratorWithIndexTest.cxx delete mode 100644 wrapping/itkFrequencyBandImageFilter.wrap delete mode 100644 wrapping/itkFrequencyFFTLayoutImageRegionConstIteratorWithIndex.notwrapped delete mode 100644 wrapping/itkFrequencyFFTLayoutImageRegionIteratorWithIndex.notwrapped delete mode 100644 wrapping/itkFrequencyImageRegionConstIteratorWithIndex.notwrapped delete mode 100644 wrapping/itkFrequencyImageRegionIteratorWithIndex.notwrapped delete mode 100644 wrapping/itkFrequencyShiftedFFTLayoutImageRegionConstIteratorWithIndex.notwrapped delete mode 100644 wrapping/itkFrequencyShiftedFFTLayoutImageRegionIteratorWithIndex.notwrapped diff --git a/include/itkFrequencyBandImageFilter.h b/include/itkFrequencyBandImageFilter.h deleted file mode 100644 index 89eae5c..0000000 --- a/include/itkFrequencyBandImageFilter.h +++ /dev/null @@ -1,204 +0,0 @@ -/*========================================================================= - * - * Copyright Insight Software Consortium - * - * 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 itkFrequencyBandImageFilter_h -#define itkFrequencyBandImageFilter_h - -#include -#include - -namespace itk -{ -/** \class FrequencyBandImageFilter - * \brief Performs a frequency band filter in the range LowFrequencyThreshold and HighFrequencyThreshold. - * - * The default is a pass band between threshold frequencies [0,0.5] Hz or [0, pi] radians, - * where both boundary values also pass (equivalent to SetPassBand(true,true)). - * A pass band sets to zero any value outside the defined range, and let pass without modification the input image inside the band. - * - * Instead, a stop band can be set between the threshold values. - * In this case, the delimited band act as a stop band, setting values to zero in this range, - * and don't modify input image values outside this range. - * To set a stop band use SetPassBand(false), but more clarifying is to use - * SetStopBand(bool, bool) that also control behaviour at band boundaries. - * - * Control of letting pass the boundaries of the band are controlled with - * SetPassLow(High)FrequencyThreshold(bool). The default is to let pass low and high boundaries. - * Also, SetPassBand(true, false), will let pass low boundary/threshold, and stop the high value. - * - * \ingroup IsotropicWavelets - */ -template< typename TImageType, - typename TFrequencyIteratorType = FrequencyFFTLayoutImageRegionIteratorWithIndex > -class FrequencyBandImageFilter: - public ImageToImageFilter -{ -public: - ITK_DISALLOW_COPY_AND_ASSIGN(FrequencyBandImageFilter); - - /** Standard class type alias. */ - using Self = FrequencyBandImageFilter; - using Superclass = ImageToImageFilter; - using Pointer = SmartPointer; - using ConstPointer = SmartPointer; - - /** Method for creation through the object factory. */ - itkNewMacro(Self); - - /** Run-time type information (and related methods). */ - itkTypeMacro(FrequencyBandImageFilter, ImageToImageFilter); - - /** Typedef to images */ - using ImageType = TImageType; - using ImagePointer = typename ImageType::Pointer; - using ImageConstPointer = typename ImageType::ConstPointer; - using IndexType = typename TImageType::IndexType; - using PixelType = typename TImageType::PixelType; - - /** Typedef to describe the image region type. */ - using ImageRegionType = typename TImageType::RegionType; - - static constexpr unsigned int ImageDimension = TImageType::ImageDimension; - -#ifdef ITK_USE_CONCEPT_CHECKING - /** Begin concept checking */ - itkConceptMacro( ImageTypeHasNumericTraitsCheck, - ( Concept::HasNumericTraits< typename TImageType::PixelType > ) ); - /** End concept checking */ -#endif - - /** Frequency Iterator types */ - using FrequencyIteratorType = TFrequencyIteratorType; - using FrequencyValueType = typename FrequencyIteratorType::FrequencyValueType; - - /****** Frequency Threshold Getters/Setters *****/ - /** Band range: Low threshold/boundary in Hertz */ - itkGetConstReferenceMacro(LowFrequencyThreshold, FrequencyValueType); - itkSetMacro(LowFrequencyThreshold, FrequencyValueType); - /** - * Set low frequency threshold when input frequency is in radians. - * @param freq_low_in_radians low freq in radians. - */ - void SetLowFrequencyThresholdInRadians(const FrequencyValueType& freq_low_in_radians); - - /** Band range: High threshold/boundary in Hertz */ - itkGetConstReferenceMacro(HighFrequencyThreshold, FrequencyValueType); - itkSetMacro(HighFrequencyThreshold, FrequencyValueType); - void SetHighFrequencyThresholdInRadians(const FrequencyValueType& freq_high_in_radians); - - /** - * Set LowFrequencyThreshold and HighFrequencyThreshold at the same time, - * input frequencies in Hertz. - * - * @param freq_low in hertz. - * @param freq_high in hertz. - */ - void SetFrequencyThresholds( const FrequencyValueType& freq_low, - const FrequencyValueType& freq_high); - - /** - * Set LowFrequencyThreshold and HighFrequencyThreshold at the same time, - * input frequencies in Radians. 1Hz = (1/2pi) rad - * - * @param freq_low_in_radians low freq in radians. - * @param freq_high_in_radians high freq in radians. - */ - void SetFrequencyThresholdsInRadians( const FrequencyValueType& freq_low_in_radians, - const FrequencyValueType& freq_high_in_radians); - - /** The pixel values that correspond to m_LowFrequencyThreshold are passed to the output image, - * independent of m_PassBand */ - itkSetMacro( PassLowFrequencyThreshold, bool ); - itkGetConstReferenceMacro(PassLowFrequencyThreshold, bool); - itkBooleanMacro( PassLowFrequencyThreshold ); - - /** The pixel values that correspond to m_HighFrequencyThreshold are passed to the output image, - * independent of m_PassBand */ - itkSetMacro( PassHighFrequencyThreshold, bool ); - itkGetConstReferenceMacro(PassHighFrequencyThreshold, bool); - itkBooleanMacro( PassHighFrequencyThreshold ); - - /** True: the band is a PassBand. False: StopBand **/ - itkSetMacro( PassBand, bool ); - itkGetConstReferenceMacro(PassBand, bool); - itkBooleanMacro( PassBand ); - - /** - * Utility method equivalent to: - * SetPassBand(true) - * SetPassLowFrequencyThreshold(pass_low_threshold) - * SetPassHighFrequencyThreshold(pass_high_threshold) - * - * @param pass_low_threshold flag to let pass or not low boundary - * @param pass_high_threshold flag to let pass or not high boundary - */ - void SetPassBand(const bool pass_low_threshold, const bool pass_high_threshold); - - /** - * Utility method equivalent to: - * SetPassBand(false) - * SetPassLowFrequencyThreshold(pass_low_threshold) - * SetPassHighFrequencyThreshold(pass_high_threshold) - * - * @param pass_low_threshold flag to let pass or not low boundary - * @param pass_high_threshold flag to let pass or not high boundary - */ - void SetStopBand(const bool pass_low_threshold, const bool pass_high_threshold); - - /** If true the frequency cut-off uses the radius of the frequency vector. If false, it uses the max absolute value of the frequency vector. */ - itkSetMacro( RadialBand, bool ); - itkGetConstReferenceMacro(RadialBand, bool); - itkBooleanMacro( RadialBand ); - - /** Control if negative frequencies with absolute value equal to low frequency threshold are passing. - * Only effective when RadialBand is false **/ - itkSetMacro( PassNegativeLowFrequencyThreshold, bool ); - itkGetConstReferenceMacro(PassNegativeLowFrequencyThreshold, bool); - itkBooleanMacro( PassNegativeLowFrequencyThreshold ); - - /** Control if negative frequencies with absolute value equal to high frequency threshold are passing. - * Only effective when RadialBand is false **/ - itkSetMacro( PassNegativeHighFrequencyThreshold, bool ); - itkGetConstReferenceMacro(PassNegativeHighFrequencyThreshold, bool); - itkBooleanMacro( PassNegativeHighFrequencyThreshold ); - -protected: - FrequencyBandImageFilter(); - void PrintSelf(std::ostream & os, Indent indent) const override; - - void BeforeThreadedGenerateData() override; - - void DynamicThreadedGenerateData(const ImageRegionType & outputRegionForThread) override; - -private: - FrequencyValueType m_LowFrequencyThreshold; - FrequencyValueType m_HighFrequencyThreshold; - - bool m_PassBand; - bool m_PassLowFrequencyThreshold; - bool m_PassHighFrequencyThreshold; - bool m_RadialBand; - bool m_PassNegativeLowFrequencyThreshold; - bool m_PassNegativeHighFrequencyThreshold; -}; -} // end namespace itk - -#ifndef ITK_MANUAL_INSTANTIATION -#include "itkFrequencyBandImageFilter.hxx" -#endif - -#endif diff --git a/include/itkFrequencyBandImageFilter.hxx b/include/itkFrequencyBandImageFilter.hxx deleted file mode 100644 index 12f62a5..0000000 --- a/include/itkFrequencyBandImageFilter.hxx +++ /dev/null @@ -1,226 +0,0 @@ -/*========================================================================= - * - * Copyright Insight Software Consortium - * - * 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 itkFrequencyBandImageFilter_hxx -#define itkFrequencyBandImageFilter_hxx - -#include -#include -#include - -namespace itk -{ -template< typename TImageType, typename TFrequencyIteratorType > -FrequencyBandImageFilter< TImageType, TFrequencyIteratorType > -::FrequencyBandImageFilter() - : m_LowFrequencyThreshold(0), - m_HighFrequencyThreshold(0.5), // Nyquist in hertz - m_PassBand(true), - m_PassLowFrequencyThreshold(true), - m_PassHighFrequencyThreshold(true), - m_RadialBand(true), - m_PassNegativeLowFrequencyThreshold(true), - m_PassNegativeHighFrequencyThreshold(true) -{ - this->DynamicMultiThreadingOn(); -} - -template< typename TImageType, typename TFrequencyIteratorType > -void -FrequencyBandImageFilter< TImageType, TFrequencyIteratorType > -::PrintSelf(std::ostream & os, Indent indent) const -{ - Superclass::PrintSelf(os, indent); - os << indent << "FrequencyThresholds: Low: " << this->m_LowFrequencyThreshold - << ", High: " << this->m_HighFrequencyThreshold << std::endl; - os << indent << (this->m_PassBand ? "PassBand " : "StopBand ") << std::endl; - os << indent << " PassLowFrequencyThreshold? " << (this->m_PassLowFrequencyThreshold ? "Yes" : "No ") << std::endl; - os << indent << " PassHighFrequencyThreshold? " << (this->m_PassHighFrequencyThreshold ? "Yes" : "No ") - << std::endl; - os << indent << " RadialBand? " << (this->m_RadialBand ? "Yes" : "No ") << std::endl; -} - -template< typename TImageType, typename TFrequencyIteratorType > -void -FrequencyBandImageFilter< TImageType, TFrequencyIteratorType > -::SetPassBand(const bool pass_low_threshold, const bool pass_high_threshold) -{ - this->m_PassBand = true; - this->m_PassLowFrequencyThreshold = pass_low_threshold; - this->m_PassHighFrequencyThreshold = pass_high_threshold; - this->Modified(); -} - -template< typename TImageType, typename TFrequencyIteratorType > -void -FrequencyBandImageFilter< TImageType, TFrequencyIteratorType > -::SetStopBand(const bool pass_low_threshold, const bool pass_high_threshold) -{ - this->m_PassBand = false; - this->m_PassLowFrequencyThreshold = pass_low_threshold; - this->m_PassHighFrequencyThreshold = pass_high_threshold; - this->Modified(); -} - -template< typename TImageType, typename TFrequencyIteratorType > -void -FrequencyBandImageFilter< TImageType, TFrequencyIteratorType > -::SetFrequencyThresholds( const FrequencyValueType& freq_low, - const FrequencyValueType& freq_high) -{ - itkAssertInDebugAndIgnoreInReleaseMacro(freq_low <= freq_high); - this->m_LowFrequencyThreshold = freq_low; - this->m_HighFrequencyThreshold = freq_high; - this->Modified(); -} - -template< typename TImageType, typename TFrequencyIteratorType > -void -FrequencyBandImageFilter< TImageType, TFrequencyIteratorType > -::SetLowFrequencyThresholdInRadians( const FrequencyValueType& freq_in_radians_low) -{ - this->SetLowFrequencyThreshold( freq_in_radians_low * 0.5 * itk::Math::one_over_pi); -} - -template< typename TImageType, typename TFrequencyIteratorType > -void -FrequencyBandImageFilter< TImageType, TFrequencyIteratorType > -::SetHighFrequencyThresholdInRadians( const FrequencyValueType& freq_in_radians_high) -{ - this->SetHighFrequencyThreshold( freq_in_radians_high * 0.5 * itk::Math::one_over_pi); -} - -template< typename TImageType, typename TFrequencyIteratorType > -void -FrequencyBandImageFilter< TImageType, TFrequencyIteratorType > -::SetFrequencyThresholdsInRadians( const FrequencyValueType& freq_in_radians_low, - const FrequencyValueType& freq_in_radians_high) -{ - this->SetFrequencyThresholds( - freq_in_radians_low * 0.5 * itk::Math::one_over_pi, - freq_in_radians_high * 0.5 * itk::Math::one_over_pi ); -} - -template< typename TImageType, typename TFrequencyIteratorType > -void -FrequencyBandImageFilter< TImageType, TFrequencyIteratorType > -::BeforeThreadedGenerateData() -{ - if ( this->m_LowFrequencyThreshold > this->m_HighFrequencyThreshold ) - { - itkExceptionMacro("FrequencyThresholds wrong: " - << this->m_LowFrequencyThreshold << " , " << this->m_HighFrequencyThreshold); - } - - ImageAlgorithm::Copy(this->GetInput(), this->GetOutput(), - this->GetInput()->GetLargestPossibleRegion(), - this->GetOutput()->GetLargestPossibleRegion() ); -} - -template< typename TImageType, typename TFrequencyIteratorType > -void -FrequencyBandImageFilter< TImageType, TFrequencyIteratorType > -::DynamicThreadedGenerateData( const ImageRegionType & outputRegionForThread ) -{ - // outputPtr is a copy of input image from BeforeThreadedGenerateData - ImagePointer outputPtr = this->GetOutput(); - - FrequencyIteratorType freqIt(outputPtr, outputRegionForThread); - - freqIt.GoToBegin(); - FrequencyValueType f; - typename FrequencyIteratorType::FrequencyType w; - FrequencyValueType wMax; - FrequencyValueType wMin; - bool freqIsNegative = false; - - while ( !freqIt.IsAtEnd() ) - { - if ( this->m_RadialBand ) - { - f = sqrt(freqIt.GetFrequencyModuloSquare()); - } - else // Cut-off box taking into account max absolute frequency. - { - w = freqIt.GetFrequency(); - wMax = std::abs( *std::max_element(w.Begin(), w.End()) ); - wMin = std::abs( *std::min_element(w.Begin(), w.End()) ); - f = std::max(wMax, wMin); - if ( wMin < wMax ) - { - freqIsNegative = true; - } - } - - if ( this->m_PassBand ) - { - if ( f < this->m_LowFrequencyThreshold || f > this->m_HighFrequencyThreshold ) - { - freqIt.Set( NumericTraits< PixelType >::ZeroValue() ); - } - } - else // Stop Band - { - if ( f > this->m_LowFrequencyThreshold && f < this->m_HighFrequencyThreshold ) - { - freqIt.Set( NumericTraits< PixelType >::ZeroValue() ); - } - } - - // Boundaries: Do not pass threshold frequencies if requested. - if ( !this->m_PassLowFrequencyThreshold ) - { - if ( itk::Math::FloatAlmostEqual(f, this->m_LowFrequencyThreshold) ) - { - // Different boundaries when negative frequencies in the non-radial case. - if ( !this->m_RadialBand - && this->m_PassNegativeLowFrequencyThreshold - && freqIsNegative ) - { - continue; - } - else - { - freqIt.Set( NumericTraits< PixelType >::ZeroValue() ); - } - } - } - - if ( !this->m_PassHighFrequencyThreshold ) - { - if ( itk::Math::FloatAlmostEqual(f, this->m_HighFrequencyThreshold) ) - { - // Different boundaries when negative frequencies in the non-radial case. - if ( !this->m_RadialBand - && this->m_PassNegativeHighFrequencyThreshold - && freqIsNegative ) - { - continue; - } - else - { - freqIt.Set( NumericTraits< PixelType >::ZeroValue() ); - } - } - } - - ++freqIt; - } -} -} // end namespace itk - -#endif diff --git a/include/itkFrequencyFFTLayoutImageRegionConstIteratorWithIndex.h b/include/itkFrequencyFFTLayoutImageRegionConstIteratorWithIndex.h deleted file mode 100644 index a49c60e..0000000 --- a/include/itkFrequencyFFTLayoutImageRegionConstIteratorWithIndex.h +++ /dev/null @@ -1,300 +0,0 @@ -/*========================================================================= - * - * Copyright Insight Software Consortium - * - * 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 itkFrequencyFFTLayoutImageRegionConstIteratorWithIndex_h -#define itkFrequencyFFTLayoutImageRegionConstIteratorWithIndex_h - -#include "itkImageRegionConstIteratorWithIndex.h" - -namespace itk -{ -/** \class FrequencyFFTLayoutImageRegionConstIteratorWithIndex - * \brief A multi-dimensional iterator templated over image type that walks - * pixels within a region and is specialized to keep track of its image index - * location. - * - * This class is a specialization of ImageRegionConstIteratorWithIndex, - * adding method GetFrequencyBins to give the frequency bins corresponding to image indices, and GetFrequency to get the frequency of the bin. - * The frequency bins depends on the image size. The default assumes that the image to iterate over is - * the output of a forward FFT filter, where the first index corresponds to 0 frequency, and Nyquist Frequencies are - * in the middle, between positive and negative frequencies. - * - * This class can be specialized further to iterate over other frequency - * layouts, for example shifted images (where 0 frequency is in the middle of the image, and Nyquist are in the border). - * For different layout, use other frequency iterator. - * - * This iterator is for the frequency layout that results from applying a FFT (vnl or fftw) to an image. - * The default ImageInformation is: Origin = {{0}}, Spacing = {{1}}. - * In this case the frequency values will be in the range: [-1/2, 1/2] Hz - * Or [-pi, pi] rad/s - * To modify those ranges: - * a) Avoid modifying the origin. The origin index always corresponds to zero frequency after a FFT. - * The range should be always centered around zero. - * b) The spacing control the range of frequencies (always around zero). - * If the spacing is = {{0.5}} we get a frequency range of [-1/4, 1/4] or [-pi/2, pi/2]. - * - * The frequency layout is assumed to be: where fs is frequency sampling, or frequency spacing (1.0 by default). - * If N is even: - * Nyquist frequency at index=N/2 is shared between + and - regions. - * <------------positive f ---------------><------------negative f--------------> - * 0(DC) fs/N 2*fs/N ... (N/2 -1)*fs/N fs/2 -(N/2-1)*fs/N ... -2*fs/N -fs/N - * - * Example: Size 6: - * + | - - * ------------ - * 0 <-- DC Component (0 freq) - * 1 | 5 - * 2 | 4 - * 3 <-- Shared between regions, unique Nyquist. - * - * If N is odd: - * Nyquist frequency is not represented but there are simmetric largest frequencies at index=N/2, N/2 +1 - * <----------positive f ---------------><------------negative f-----------------> - * 0(DC) fs/N 2*fs/N ...... fs/2*(N-1)/N -fs/2*(N-1)/N ... -2*fs/N -fs/N - * - * Example: Size 5: - * + | - - * ------------ - * 0 <-- DC Component (0 freq) - * 1 | 4 - * 2 | 3 <-- Absolute Largest Frequency bins (+, -) - * - * Please see ImageRegionConstIteratorWithIndex for more information. - * \sa ForwardFFTImageFilter - * - * \par MORE INFORMATION - * For a complete description of the ITK Image Iterators and their API, please - * see the Iterators chapter in the ITK Software Guide. The ITK Software Guide - * is available in print and as a free .pdf download from https://www.itk.org. - * - * \ingroup ImageIterators - * - * \sa ImageRegionIteratorWithIndex - * \sa ImageConstIterator \sa ConditionalConstIterator - * \sa ConstNeighborhoodIterator \sa ConstShapedNeighborhoodIterator - * \sa ConstSliceIterator \sa CorrespondenceDataStructureIterator - * \sa FloodFilledFunctionConditionalConstIterator - * \sa FloodFilledImageFunctionConditionalConstIterator - * \sa FloodFilledImageFunctionConditionalIterator - * \sa FloodFilledSpatialFunctionConditionalConstIterator - * \sa FloodFilledSpatialFunctionConditionalIterator - * \sa ImageConstIterator \sa ImageConstIteratorWithIndex - * \sa ImageIterator \sa ImageIteratorWithIndex - * \sa ImageLinearConstIteratorWithIndex \sa ImageLinearIteratorWithIndex - * \sa ImageRandomConstIteratorWithIndex \sa ImageRandomIteratorWithIndex - * \sa ImageRegionConstIterator \sa ImageRegionConstIteratorWithIndex - * \sa ImageRegionExclusionConstIteratorWithIndex - * \sa ImageRegionExclusionIteratorWithIndex - * \sa ImageRegionIterator \sa ImageRegionIteratorWithIndex - * \sa ImageRegionReverseConstIterator \sa ImageRegionReverseIterator - * \sa ImageReverseConstIterator \sa ImageReverseIterator - * \sa ImageSliceConstIteratorWithIndex \sa ImageSliceIteratorWithIndex - * \sa NeighborhoodIterator \sa PathConstIterator \sa PathIterator - * \sa ShapedNeighborhoodIterator \sa SliceIterator - * \sa ImageConstIteratorWithIndex - * - * \ingroup IsotropicWavelets - * - */ -template< typename TImage > -class FrequencyFFTLayoutImageRegionConstIteratorWithIndex: - public ImageRegionConstIteratorWithIndex< TImage > -{ -public: - /** Standard class type alias. */ - using Self = FrequencyFFTLayoutImageRegionConstIteratorWithIndex; - using Superclass = ImageRegionConstIteratorWithIndex< TImage >; - - /** Types inherited from the Superclass */ - using IndexType = typename Superclass::IndexType; - using SizeType = typename Superclass::SizeType; - using OffsetType = typename Superclass::OffsetType; - using RegionType = typename Superclass::RegionType; - using ImageType = typename Superclass::ImageType; - using PixelContainer = typename Superclass::PixelContainer; - using PixelContainerPointer = typename Superclass::PixelContainerPointer; - using InternalPixelType = typename Superclass::InternalPixelType; - using PixelType = typename Superclass::PixelType; - using AccessorType = typename Superclass::AccessorType; - - using FrequencyType = typename ImageType::SpacingType; - using FrequencyValueType = typename ImageType::SpacingValueType; - /** Default constructor. Needed since we provide a cast constructor. */ - FrequencyFFTLayoutImageRegionConstIteratorWithIndex() : - ImageRegionConstIteratorWithIndex< TImage >() - { - this->Init(); - } - - /** Constructor establishes an iterator to walk a particular image and a - * particular region of that image. */ - FrequencyFFTLayoutImageRegionConstIteratorWithIndex(const TImage *ptr, const RegionType & region) : - ImageRegionConstIteratorWithIndex< TImage >(ptr, region) - { - this->Init(); - } - - /** Constructor that can be used to cast from an ImageIterator to an - * ImageRegionIteratorWithIndex. Many routines return an ImageIterator, but for a - * particular task, you may want an ImageRegionIteratorWithIndex. Rather than - * provide overloaded APIs that return different types of Iterators, itk - * returns ImageIterators and uses constructors to cast from an - * ImageIterator to a ImageRegionIteratorWithIndex. */ - explicit FrequencyFFTLayoutImageRegionConstIteratorWithIndex(const Superclass & it) : - ImageRegionConstIteratorWithIndex< TImage >(it) - { - this->Init(); - } - - /* - * Image Index [0, N - 1] returns [0 to N/2] (positive) union [-N/2 + 1, -1] (negative). So index N/2 + 1 returns the bin -N/2 + 1. - * If first index of the image is not zero, it stills returns values in the same range. - * f = [0, 1, ..., N/2-1, -N/2, ..., -1] if N is even - * f = [0, 1, ..., (N-1)/2, -(N-1)/2, ..., -1] if N is odd - */ - IndexType GetFrequencyBin() const - { - IndexType freqInd; - - freqInd.Fill(0); - for (unsigned int dim = 0; dim < TImage::ImageDimension; dim++) - { - if (this->m_PositionIndex[dim] <= m_LargestPositiveFrequencyIndex[dim]) - { - freqInd[dim] = this->m_PositionIndex[dim] - this->m_MinIndex[dim]; - } - else // -. From -N/2 + 1 (Nyquist if even) to -1 (-df in frequency) - { - freqInd[dim] = this->m_PositionIndex[dim] - (this->m_MaxIndex[dim] + 1); - } - } - return freqInd; - } - - /** Note that this method is independent of the region in the constructor. - * It takes into account the ImageInformation of the Image in the frequency domain. - * This iterator is for the frequency layout that results from applying a FFT (vnl or fftw) to an image. - * If your image has a different layout, use other frequency iterator. - * The default ImageInformation is: Origin = {{0}}, Spacing = {{1}}. - * In this case the frequency values will be in the range: [-1/2, 1/2] Hz - * Or [-pi, pi] rad/s - * To modify those ranges: - * a) Avoid modifying the origin. The origin index always corresponds to zero frequency after a FFT. - * The range should be always centered around zero. - * b) The spacing control the range of frequencies (always around zero). - * If the spacing is = {{0.5}} we get a frequency range of [-1/4, 1/4] or [-pi/2, pi/2]. - * - * f = [0, 1, ..., N/2-1, -N/2, ..., -1] * FrequencySpacing if N is even - * f = [0, 1, ..., (N-1)/2, -(N-1)/2, ..., -1] * FrequencySpacing if N is odd - * - * Where FrequencySpacing = samplingFrequency / N; - * and samplingFrequency = 1.0 / inputImageSpatialDomainSpacing; - */ - FrequencyType GetFrequency() const - { - FrequencyType freq; - IndexType freqInd = this->GetFrequencyBin(); - - for (unsigned int dim = 0; dim < TImage::ImageDimension; dim++) - { - freq[dim] = this->m_FrequencyOrigin[dim] - + this->m_FrequencySpacing[dim] * freqInd[dim]; - } - return freq; - } - - FrequencyValueType GetFrequencyModuloSquare() const - { - FrequencyValueType w2(0); - FrequencyType w( this->GetFrequency() ); - - for (unsigned int dim = 0; dim < TImage::ImageDimension; dim++) - { - w2 += w[dim] * w[dim]; - } - return w2; - } - - /** - * Index corresponding to the first highest frequency (Nyquist) after a FFT transform. - * If the size of the image is even, the Nyquist frequency = fs/2 is unique and shared - * between positive and negative frequencies. - * (Even Size) LargestPositiveFrequencyIndex = originIndex + N / 2 - * If odd, Nyquist frequency is not represented, but there is still a largest frequency at this index - * = fs/2 * (N-1)/N. - * (Odd Size) LargestPositiveFrequencyIndex = originIndex + (N + 1) / 2 - */ - itkGetConstReferenceMacro(LargestPositiveFrequencyIndex, IndexType); - void SetLargestPositiveFrequencyIndex(const IndexType largestPositiveFrequencyIndex) - { - this->m_LargestPositiveFrequencyIndex = largestPositiveFrequencyIndex; - }; - /** Default to first index of the largest possible Region. */ - itkGetConstReferenceMacro(MinIndex, IndexType); - /** Default to UpperIndex of the largest possible Region. */ - itkGetConstReferenceMacro(MaxIndex, IndexType); - - /** Origin of frequencies is zero for FFT output. */ - itkGetConstReferenceMacro(FrequencyOrigin, FrequencyType); - void SetFrequencyOrigin(const FrequencyType frequencyOrigin) - { - this->m_FrequencyOrigin = frequencyOrigin; - }; - - /** This is the pixel width, or the bin size of the frequency. - * FrequencySpacing = SamplingFrequency / ImageSize */ - itkGetConstReferenceMacro(FrequencySpacing, FrequencyType); - void SetFrequencySpacing(const FrequencyType frequencySpacing) - { - this->m_FrequencySpacing = frequencySpacing; - }; - -private: - /** Calculate Nyquist frequency index (m_LargestPositiveFrequencyIndex), and Min/Max indices from LargestPossibleRegion. - * Called at constructors. */ - void Init() - { - SizeType sizeImage = - this->m_Image->GetLargestPossibleRegion().GetSize(); - this->m_MinIndex = - this->m_Image->GetLargestPossibleRegion().GetIndex(); - this->m_MaxIndex = - this->m_Image->GetLargestPossibleRegion().GetUpperIndex(); - FrequencyType samplingFrequency; - for (unsigned int dim = 0; dim < ImageType::ImageDimension; dim++) - { - this->m_LargestPositiveFrequencyIndex[dim] = static_cast( - this->m_MinIndex[dim] + std::floor( sizeImage[dim] / 2.0 )); - // Set frequency metadata. - // Origin of frequencies is zero in the standard layout of a FFT output. - this->m_FrequencyOrigin[dim] = 0.0; - // SamplingFrequency = 1.0 / SpatialSpacing - samplingFrequency[dim] = 1.0 / this->m_Image->GetSpacing()[dim]; - // Freq_BinSize = SamplingFrequency / Size - this->m_FrequencySpacing[dim] = samplingFrequency[dim] - / sizeImage[dim]; - } - } - - IndexType m_LargestPositiveFrequencyIndex; - IndexType m_MinIndex; - IndexType m_MaxIndex; - FrequencyType m_FrequencyOrigin; - FrequencyType m_FrequencySpacing; -}; -} // end namespace itk -#endif diff --git a/include/itkFrequencyFFTLayoutImageRegionIteratorWithIndex.h b/include/itkFrequencyFFTLayoutImageRegionIteratorWithIndex.h deleted file mode 100644 index a2f8a45..0000000 --- a/include/itkFrequencyFFTLayoutImageRegionIteratorWithIndex.h +++ /dev/null @@ -1,138 +0,0 @@ -/*========================================================================= - * - * Copyright Insight Software Consortium - * - * 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 itkFrequencyFFTLayoutImageRegionIteratorWithIndex_h -#define itkFrequencyFFTLayoutImageRegionIteratorWithIndex_h - -#include "itkImageRegionIteratorWithIndex.h" -#include "itkFrequencyFFTLayoutImageRegionConstIteratorWithIndex.h" - -namespace itk -{ -/** \class FrequencyFFTLayoutImageRegionIteratorWithIndex - - * Iterator providing method GetFrequency() to retrieve the frequency associated to an index. - * This value is related to the specific layout of frequencies from an image in the dual (frequency) space. - * In this case, the layout corresponds to the output of a FastFourierTransform from FFTW library. - * This class is a non-const version of FrequencyFFTLayoutImageRegionConstIteratorWithIndex. - * - * \ingroup ImageIterators - * \sa FrequencyFFTLayoutImageRegionConstIteratorWithIndex - * \sa ImageRegionIteratorWithIndex - * \sa ImageConstIterator \sa ConditionalConstIterator - * \sa ConstNeighborhoodIterator \sa ConstShapedNeighborhoodIterator - * \sa ConstSliceIterator \sa CorrespondenceDataStructureIterator - * \sa FloodFilledFunctionConditionalConstIterator - * \sa FloodFilledImageFunctionConditionalConstIterator - * \sa FloodFilledImageFunctionConditionalIterator - * \sa FloodFilledSpatialFunctionConditionalConstIterator - * \sa FloodFilledSpatialFunctionConditionalIterator - * \sa ImageConstIterator \sa ImageConstIteratorWithIndex - * \sa ImageIterator \sa ImageIteratorWithIndex - * \sa ImageLinearConstIteratorWithIndex \sa ImageLinearIteratorWithIndex - * \sa ImageRandomConstIteratorWithIndex \sa ImageRandomIteratorWithIndex - * \sa ImageRegionConstIterator \sa ImageRegionConstIteratorWithIndex - * \sa ImageRegionExclusionConstIteratorWithIndex - * \sa ImageRegionExclusionIteratorWithIndex - * \sa ImageRegionIterator \sa ImageRegionIteratorWithIndex - * \sa ImageRegionReverseConstIterator \sa ImageRegionReverseIterator - * \sa ImageReverseConstIterator \sa ImageReverseIterator - * \sa ImageSliceConstIteratorWithIndex \sa ImageSliceIteratorWithIndex - * \sa NeighborhoodIterator \sa PathConstIterator \sa PathIterator - * \sa ShapedNeighborhoodIterator \sa SliceIterator - * \sa ImageConstIteratorWithIndex - * - * \ingroup IsotropicWavelets - * - */ -template< typename TImage > -class FrequencyFFTLayoutImageRegionIteratorWithIndex: - public FrequencyFFTLayoutImageRegionConstIteratorWithIndex< TImage > -{ -public: - /** Standard class type alias. */ - using Self = FrequencyFFTLayoutImageRegionIteratorWithIndex; - using Superclass = ImageRegionIteratorWithIndex< TImage >; - - /** Types inherited from the Superclass */ - using IndexType = typename Superclass::IndexType; - using SizeType = typename Superclass::SizeType; - using OffsetType = typename Superclass::OffsetType; - using RegionType = typename Superclass::RegionType; - using ImageType = typename Superclass::ImageType; - using PixelContainer = typename Superclass::PixelContainer; - using PixelContainerPointer = typename Superclass::PixelContainerPointer; - using InternalPixelType = typename Superclass::InternalPixelType; - using PixelType = typename Superclass::PixelType; - using AccessorType = typename Superclass::AccessorType; - - using FrequencyType = typename ImageType::SpacingType; - using FrequencyValueType = typename ImageType::SpacingValueType; - /** Default constructor. Needed since we provide a cast constructor. */ - FrequencyFFTLayoutImageRegionIteratorWithIndex() : - FrequencyFFTLayoutImageRegionConstIteratorWithIndex< TImage >() - { - } - - /** Constructor establishes an iterator to walk a particular image and a - * particular region of that image. */ - FrequencyFFTLayoutImageRegionIteratorWithIndex(TImage *ptr, const RegionType & region) : - FrequencyFFTLayoutImageRegionConstIteratorWithIndex< TImage >(ptr, region) - { - } - - /** Constructor that can be used to cast from an ImageIterator to an - * ImageRegionIteratorWithIndex. Many routines return an ImageIterator, but for a - * particular task, you may want an ImageRegionIteratorWithIndex. Rather than - * provide overloaded APIs that return different types of Iterators, itk - * returns ImageIterators and uses constructors to cast from an - * ImageIterator to a ImageRegionIteratorWithIndex. */ - FrequencyFFTLayoutImageRegionIteratorWithIndex(const ImageIteratorWithIndex< TImage > & it) : - FrequencyFFTLayoutImageRegionConstIteratorWithIndex< TImage >(it) - { - } - - /** Set the pixel value */ - void Set(const PixelType & value) const - { - this->m_PixelAccessorFunctor.Set(*( const_cast< InternalPixelType * >( this->m_Position ) ), value); - } - - /** Return a reference to the pixel. - * This method will provide the fastest access to pixel - * data, but it will NOT support ImageAdaptors. */ - PixelType & Value(void) - { - return *( const_cast< InternalPixelType * >( this->m_Position ) ); - } - -protected: - /** The construction from a const iterator is declared protected - in order to enforce const correctness. */ - FrequencyFFTLayoutImageRegionIteratorWithIndex(const FrequencyFFTLayoutImageRegionConstIteratorWithIndex< TImage > & it) : - FrequencyFFTLayoutImageRegionConstIteratorWithIndex< TImage >(it) - { - } - - Self & operator=(const FrequencyFFTLayoutImageRegionConstIteratorWithIndex< TImage > & it) - { - this->FrequencyFFTLayoutImageRegionConstIteratorWithIndex< TImage >::operator=(it); - return *this; - } -}; -} // end namespace itk -#endif diff --git a/include/itkFrequencyImageRegionConstIteratorWithIndex.h b/include/itkFrequencyImageRegionConstIteratorWithIndex.h deleted file mode 100644 index cc61c2c..0000000 --- a/include/itkFrequencyImageRegionConstIteratorWithIndex.h +++ /dev/null @@ -1,188 +0,0 @@ -/*========================================================================= - * - * Copyright Insight Software Consortium - * - * 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 itkFrequencyImageRegionConstIteratorWithIndex_h -#define itkFrequencyImageRegionConstIteratorWithIndex_h - -#include "itkImageRegionConstIteratorWithIndex.h" - -namespace itk -{ -/** \class FrequencyImageRegionConstIteratorWithIndex - * \brief A multi-dimensional iterator templated over image type that walks - * pixels within a region and is specialized to keep track of its image index - * location. - * - * This class is a specialization of ImageRegionConstIteratorWithIndex, - * adding method GetFrequencyBins to give the frequency bins corresponding to image indices, and GetFrequency to get the frequency of the bin. - * - * This iterator assumes that the image is already in the frequency domain, so GetFrequencyBin is a wrap around GetIndex(), and GetFrequency is a wrap around Get(). - * - * For a different layout, use other frequency iterator. - * - * Please see ImageRegionConstIteratorWithIndex for more information. - * \sa ForwardFFTImageFilter - * - * \par MORE INFORMATION - * For a complete description of the ITK Image Iterators and their API, please - * see the Iterators chapter in the ITK Software Guide. The ITK Software Guide - * is available in print and as a free .pdf download from https://www.itk.org. - * - * \ingroup ImageIterators - * - * \sa ImageRegionIteratorWithIndex - * \sa ImageConstIterator \sa ConditionalConstIterator - * \sa ConstNeighborhoodIterator \sa ConstShapedNeighborhoodIterator - * \sa ConstSliceIterator \sa CorrespondenceDataStructureIterator - * \sa FloodFilledFunctionConditionalConstIterator - * \sa FloodFilledImageFunctionConditionalConstIterator - * \sa FloodFilledImageFunctionConditionalIterator - * \sa FloodFilledSpatialFunctionConditionalConstIterator - * \sa FloodFilledSpatialFunctionConditionalIterator - * \sa ImageConstIterator \sa ImageConstIteratorWithIndex - * \sa ImageIterator \sa ImageIteratorWithIndex - * \sa ImageLinearConstIteratorWithIndex \sa ImageLinearIteratorWithIndex - * \sa ImageRandomConstIteratorWithIndex \sa ImageRandomIteratorWithIndex - * \sa ImageRegionConstIterator \sa ImageRegionConstIteratorWithIndex - * \sa ImageRegionExclusionConstIteratorWithIndex - * \sa ImageRegionExclusionIteratorWithIndex - * \sa ImageRegionIterator \sa ImageRegionIteratorWithIndex - * \sa ImageRegionReverseConstIterator \sa ImageRegionReverseIterator - * \sa ImageReverseConstIterator \sa ImageReverseIterator - * \sa ImageSliceConstIteratorWithIndex \sa ImageSliceIteratorWithIndex - * \sa NeighborhoodIterator \sa PathConstIterator \sa PathIterator - * \sa ShapedNeighborhoodIterator \sa SliceIterator - * \sa ImageConstIteratorWithIndex - * - * \ingroup IsotropicWavelets - * - */ -template< typename TImage > -class FrequencyImageRegionConstIteratorWithIndex: - public ImageRegionConstIteratorWithIndex< TImage > -{ -public: - /** Standard class type alias. */ - using Self = FrequencyImageRegionConstIteratorWithIndex; - using Superclass = ImageRegionConstIteratorWithIndex< TImage >; - - /** Types inherited from the Superclass */ - using IndexType = typename Superclass::IndexType; - using SizeType = typename Superclass::SizeType; - using OffsetType = typename Superclass::OffsetType; - using RegionType = typename Superclass::RegionType; - using ImageType = typename Superclass::ImageType; - using PixelContainer = typename Superclass::PixelContainer; - using PixelContainerPointer = typename Superclass::PixelContainerPointer; - using InternalPixelType = typename Superclass::InternalPixelType; - using PixelType = typename Superclass::PixelType; - using AccessorType = typename Superclass::AccessorType; - - using FrequencyType = typename ImageType::SpacingType; - using FrequencyValueType = typename ImageType::SpacingValueType; - /** Default constructor. Needed since we provide a cast constructor. */ - FrequencyImageRegionConstIteratorWithIndex() : - ImageRegionConstIteratorWithIndex< TImage >() - { - this->Init(); - } - - /** Constructor establishes an iterator to walk a particular image and a - * particular region of that image. */ - FrequencyImageRegionConstIteratorWithIndex(const TImage *ptr, const RegionType & region) : - ImageRegionConstIteratorWithIndex< TImage >(ptr, region) - { - this->Init(); - } - - /** Constructor that can be used to cast from an ImageIterator to an - * ImageRegionIteratorWithIndex. Many routines return an ImageIterator, but for a - * particular task, you may want an ImageRegionIteratorWithIndex. Rather than - * provide overloaded APIs that return different types of Iterators, itk - * returns ImageIterators and uses constructors to cast from an - * ImageIterator to a ImageRegionIteratorWithIndex. */ - explicit FrequencyImageRegionConstIteratorWithIndex(const Superclass & it) : - ImageRegionConstIteratorWithIndex< TImage >(it) - { - this->Init(); - } - - /* - * The image is in the frequency domain already, return the index. - */ - IndexType GetFrequencyBin() const - { - return this->GetIndex(); - } - - /* Similar to TransformIndexToPhysicalPoint on GetIndex(), - * but the result is cast to FrequencyType. And direction is not taken into account. - */ - FrequencyType GetFrequency() const - { - FrequencyType freq; - IndexType freqInd = this->GetFrequencyBin(); - // FrequencyType freq; - for (unsigned int dim = 0; dim < TImage::ImageDimension; dim++) - { - freq[dim] = this->m_FrequencyOrigin[dim] - + this->m_FrequencySpacing[dim] * freqInd[dim]; - } - return freq; - } - - FrequencyValueType GetFrequencyModuloSquare() const - { - FrequencyValueType w2(0); - FrequencyType w( this->GetFrequency() ); - - for (unsigned int dim = 0; dim < TImage::ImageDimension; dim++) - { - w2 += w[dim] * w[dim]; - } - return w2; - } - - /** Origin of frequencies is set to be equal to m_Image->GetOrigin(). */ - itkGetConstReferenceMacro(FrequencyOrigin, FrequencyType); - void SetFrequencyOrigin(const FrequencyType frequencyOrigin) - { - this->m_FrequencyOrigin = frequencyOrigin; - } - - /** This is the pixel width, or the bin size of the frequency. - * FrequencySpacing = SamplingFrequency / ImageSize */ - itkGetConstReferenceMacro(FrequencySpacing, FrequencyType); - void SetFrequencySpacing(const FrequencyType frequencySpacing) - { - this->m_FrequencySpacing = frequencySpacing; - } - -private: - /** Set the frequency metadata. - * Called at constructors. */ - void Init() - { - this->m_FrequencyOrigin = this->m_Image->GetOrigin(); - this->m_FrequencySpacing = this->m_Image->GetSpacing(); - } - - FrequencyType m_FrequencyOrigin; - FrequencyType m_FrequencySpacing; -}; -} // end namespace itk -#endif diff --git a/include/itkFrequencyImageRegionIteratorWithIndex.h b/include/itkFrequencyImageRegionIteratorWithIndex.h deleted file mode 100644 index ca7221d..0000000 --- a/include/itkFrequencyImageRegionIteratorWithIndex.h +++ /dev/null @@ -1,138 +0,0 @@ -/*========================================================================= - * - * Copyright Insight Software Consortium - * - * 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 itkFrequencyImageRegionIteratorWithIndex_h -#define itkFrequencyImageRegionIteratorWithIndex_h - -#include "itkImageRegionIteratorWithIndex.h" -#include "itkFrequencyImageRegionConstIteratorWithIndex.h" - -namespace itk -{ -/** \class FrequencyImageRegionIteratorWithIndex - - * Iterator providing method GetFrequency() to retrieve the frequency associated to an index. - * This value is related to the specific layout of frequencies from an image in the dual (frequency) space. - * In this case, the layout corresponds to the output of a FastFourierTransform from FFTW library. - * This class is a non-const version of FrequencyImageRegionConstIteratorWithIndex. - * - * \ingroup ImageIterators - * \sa FrequencyImageRegionConstIteratorWithIndex - * \sa ImageRegionIteratorWithIndex - * \sa ImageConstIterator \sa ConditionalConstIterator - * \sa ConstNeighborhoodIterator \sa ConstShapedNeighborhoodIterator - * \sa ConstSliceIterator \sa CorrespondenceDataStructureIterator - * \sa FloodFilledFunctionConditionalConstIterator - * \sa FloodFilledImageFunctionConditionalConstIterator - * \sa FloodFilledImageFunctionConditionalIterator - * \sa FloodFilledSpatialFunctionConditionalConstIterator - * \sa FloodFilledSpatialFunctionConditionalIterator - * \sa ImageConstIterator \sa ImageConstIteratorWithIndex - * \sa ImageIterator \sa ImageIteratorWithIndex - * \sa ImageLinearConstIteratorWithIndex \sa ImageLinearIteratorWithIndex - * \sa ImageRandomConstIteratorWithIndex \sa ImageRandomIteratorWithIndex - * \sa ImageRegionConstIterator \sa ImageRegionConstIteratorWithIndex - * \sa ImageRegionExclusionConstIteratorWithIndex - * \sa ImageRegionExclusionIteratorWithIndex - * \sa ImageRegionIterator \sa ImageRegionIteratorWithIndex - * \sa ImageRegionReverseConstIterator \sa ImageRegionReverseIterator - * \sa ImageReverseConstIterator \sa ImageReverseIterator - * \sa ImageSliceConstIteratorWithIndex \sa ImageSliceIteratorWithIndex - * \sa NeighborhoodIterator \sa PathConstIterator \sa PathIterator - * \sa ShapedNeighborhoodIterator \sa SliceIterator - * \sa ImageConstIteratorWithIndex - * - * \ingroup IsotropicWavelets - * - */ -template< typename TImage > -class FrequencyImageRegionIteratorWithIndex: - public FrequencyImageRegionConstIteratorWithIndex -{ -public: - /** Standard class type alias. */ - using Self = FrequencyImageRegionIteratorWithIndex; - using Superclass = ImageRegionIteratorWithIndex< TImage >; - - /** Types inherited from the Superclass */ - using IndexType = typename Superclass::IndexType; - using SizeType = typename Superclass::SizeType; - using OffsetType = typename Superclass::OffsetType; - using RegionType = typename Superclass::RegionType; - using ImageType = typename Superclass::ImageType; - using PixelContainer = typename Superclass::PixelContainer; - using PixelContainerPointer = typename Superclass::PixelContainerPointer; - using InternalPixelType = typename Superclass::InternalPixelType; - using PixelType = typename Superclass::PixelType; - using AccessorType = typename Superclass::AccessorType; - - using FrequencyType = typename ImageType::SpacingType; - using FrequencyValueType = typename ImageType::SpacingValueType; - /** Default constructor. Needed since we provide a cast constructor. */ - FrequencyImageRegionIteratorWithIndex() : - FrequencyImageRegionConstIteratorWithIndex< TImage >() - { - } - - /** Constructor establishes an iterator to walk a particular image and a - * particular region of that image. */ - FrequencyImageRegionIteratorWithIndex(TImage *ptr, const RegionType & region) : - FrequencyImageRegionConstIteratorWithIndex< TImage >(ptr, region) - { - } - - /** Constructor that can be used to cast from an ImageIterator to an - * ImageRegionIteratorWithIndex. Many routines return an ImageIterator, but for a - * particular task, you may want an ImageRegionIteratorWithIndex. Rather than - * provide overloaded APIs that return different types of Iterators, itk - * returns ImageIterators and uses constructors to cast from an - * ImageIterator to a ImageRegionIteratorWithIndex. */ - FrequencyImageRegionIteratorWithIndex(const ImageIteratorWithIndex< TImage > & it) : - FrequencyImageRegionConstIteratorWithIndex< TImage >(it) - { - } - - /** Set the pixel value */ - void Set(const PixelType & value) const - { - this->m_PixelAccessorFunctor.Set(*( const_cast< InternalPixelType * >( this->m_Position ) ), value); - } - - /** Return a reference to the pixel. - * This method will provide the fastest access to pixel - * data, but it will NOT support ImageAdaptors. */ - PixelType & Value(void) - { - return *( const_cast< InternalPixelType * >( this->m_Position ) ); - } - -protected: - /** The construction from a const iterator is declared protected - in order to enforce const correctness. */ - FrequencyImageRegionIteratorWithIndex(const FrequencyImageRegionConstIteratorWithIndex< TImage > & it) : - FrequencyImageRegionConstIteratorWithIndex< TImage >(it) - { - } - - Self & operator=(const FrequencyImageRegionConstIteratorWithIndex< TImage > & it) - { - this->FrequencyImageRegionConstIteratorWithIndex< TImage >::operator=(it); - return *this; - } -}; -} // end namespace itk -#endif diff --git a/include/itkFrequencyShiftedFFTLayoutImageRegionConstIteratorWithIndex.h b/include/itkFrequencyShiftedFFTLayoutImageRegionConstIteratorWithIndex.h deleted file mode 100644 index 7120c09..0000000 --- a/include/itkFrequencyShiftedFFTLayoutImageRegionConstIteratorWithIndex.h +++ /dev/null @@ -1,274 +0,0 @@ -/*========================================================================= - * - * Copyright Insight Software Consortium - * - * 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 itkFrequencyShiftedFFTLayoutImageRegionConstIteratorWithIndex_h -#define itkFrequencyShiftedFFTLayoutImageRegionConstIteratorWithIndex_h - -#include "itkImageRegionConstIteratorWithIndex.h" - -namespace itk -{ -/** \class FrequencyShiftedFFTLayoutImageRegionConstIteratorWithIndex - * \brief A multi-dimensional iterator templated over image type that walks - * pixels within a region and is specialized to keep track of its image index - * location. - * - * This class is a specialization of ImageRegionConstIteratorWithIndex, - * adding method GetFrequencyBins to give the frequency bins corresponding to image indices, and GetFrequency to get the frequency of the bin. - * The frequency bins depends on the image size. The default assumes that the image to iterate over is - * the output of a forward FFT filter, where the first index corresponds to 0 frequency, and Nyquist Frequencies are - * in the middle, between positive and negative frequencies. - * - * This class can be specialized further to iterate over other frequency - * layouts, for example shifted images (where 0 frequency is in the middle of the image, and Nyquist are in the border). - * For different layout, use other frequency iterator. - * - * This iterator is for the frequency layout that results from applying a FFT (vnl or fftw) to an image. - * The default ImageInformation is: Origin = {{0}}, Spacing = {{1}}. - * In this case the frequency values will be in the range: [-1/2, 1/2] Hz - * Or [-pi, pi] rad/s - * To modify those ranges: - * a) Avoid modifying the origin. The origin index always corresponds to zero frequency after a FFT. - * The range should be always centered around zero. - * b) The spacing control the range of frequencies (always around zero). - * If the spacing is = {{0.5}} we get a frequency range of [-1/4, 1/4] or [-pi/2, pi/2]. - * - * The frequency layout is assumed to be: where fs is frequency sampling, or frequency spacing (1.0 by default). - * If N is even: - * Nyquist frequency at index=N/2 is shared between + and - regions. - * <------------positive f ---------------><------------negative f--------------> - * 0(DC) fs/N 2*fs/N ... (N/2 -1)*fs/N fs/2 -(N/2-1)*fs/N ... -2*fs/N -fs/N - * - * Example: Size 6: - * + | - - * ------------ - * 0 <-- DC Component (0 freq) - * 1 | 5 - * 2 | 4 - * 3 <-- Shared between regions, unique Nyquist. - * - * If N is odd: - * Nyquist frequency is not represented but there are simmetric largest frequencies at index=N/2, N/2 +1 - * <----------positive f ---------------><------------negative f-----------------> - * 0(DC) fs/N 2*fs/N ...... fs/2*(N-1)/N -fs/2*(N-1)/N ... -2*fs/N -fs/N - * - * Example: Size 5: - * + | - - * ------------ - * 0 <-- DC Component (0 freq) - * 1 | 4 - * 2 | 3 <-- Absolute Largest Frequency bins (+, -) - * - * Please see ImageRegionConstIteratorWithIndex for more information. - * \sa ForwardFFTImageFilter - * - * \par MORE INFORMATION - * For a complete description of the ITK Image Iterators and their API, please - * see the Iterators chapter in the ITK Software Guide. The ITK Software Guide - * is available in print and as a free .pdf download from https://www.itk.org. - * - * \ingroup ImageIterators - * - * \sa ImageRegionIteratorWithIndex - * \sa ImageConstIterator \sa ConditionalConstIterator - * \sa ConstNeighborhoodIterator \sa ConstShapedNeighborhoodIterator - * \sa ConstSliceIterator \sa CorrespondenceDataStructureIterator - * \sa FloodFilledFunctionConditionalConstIterator - * \sa FloodFilledImageFunctionConditionalConstIterator - * \sa FloodFilledImageFunctionConditionalIterator - * \sa FloodFilledSpatialFunctionConditionalConstIterator - * \sa FloodFilledSpatialFunctionConditionalIterator - * \sa ImageConstIterator \sa ImageConstIteratorWithIndex - * \sa ImageIterator \sa ImageIteratorWithIndex - * \sa ImageLinearConstIteratorWithIndex \sa ImageLinearIteratorWithIndex - * \sa ImageRandomConstIteratorWithIndex \sa ImageRandomIteratorWithIndex - * \sa ImageRegionConstIterator \sa ImageRegionConstIteratorWithIndex - * \sa ImageRegionExclusionConstIteratorWithIndex - * \sa ImageRegionExclusionIteratorWithIndex - * \sa ImageRegionIterator \sa ImageRegionIteratorWithIndex - * \sa ImageRegionReverseConstIterator \sa ImageRegionReverseIterator - * \sa ImageReverseConstIterator \sa ImageReverseIterator - * \sa ImageSliceConstIteratorWithIndex \sa ImageSliceIteratorWithIndex - * \sa NeighborhoodIterator \sa PathConstIterator \sa PathIterator - * \sa ShapedNeighborhoodIterator \sa SliceIterator - * \sa ImageConstIteratorWithIndex - * - * \ingroup IsotropicWavelets - * - */ -template< typename TImage > -class FrequencyShiftedFFTLayoutImageRegionConstIteratorWithIndex: - public ImageRegionConstIteratorWithIndex< TImage > -{ -public: - /** Standard class type alias. */ - using Self = FrequencyShiftedFFTLayoutImageRegionConstIteratorWithIndex; - using Superclass = ImageRegionConstIteratorWithIndex< TImage >; - - /** Types inherited from the Superclass */ - using IndexType = typename Superclass::IndexType; - using SizeType = typename Superclass::SizeType; - using OffsetType = typename Superclass::OffsetType; - using RegionType = typename Superclass::RegionType; - using ImageType = typename Superclass::ImageType; - using PixelContainer = typename Superclass::PixelContainer; - using PixelContainerPointer = typename Superclass::PixelContainerPointer; - using InternalPixelType = typename Superclass::InternalPixelType; - using PixelType = typename Superclass::PixelType; - using AccessorType = typename Superclass::AccessorType; - - using FrequencyType = typename ImageType::SpacingType; - using FrequencyValueType = typename ImageType::SpacingValueType; - /** Default constructor. Needed since we provide a cast constructor. */ - FrequencyShiftedFFTLayoutImageRegionConstIteratorWithIndex() : - ImageRegionConstIteratorWithIndex< TImage >() - { - this->Init(); - } - - /** Constructor establishes an iterator to walk a particular image and a - * particular region of that image. */ - FrequencyShiftedFFTLayoutImageRegionConstIteratorWithIndex(const TImage *ptr, const RegionType & region) : - ImageRegionConstIteratorWithIndex< TImage >(ptr, region) - { - this->Init(); - } - - /** Constructor that can be used to cast from an ImageIterator to an - * ImageRegionIteratorWithIndex. Many routines return an ImageIterator, but for a - * particular task, you may want an ImageRegionIteratorWithIndex. Rather than - * provide overloaded APIs that return different types of Iterators, itk - * returns ImageIterators and uses constructors to cast from an - * ImageIterator to a ImageRegionIteratorWithIndex. */ - explicit FrequencyShiftedFFTLayoutImageRegionConstIteratorWithIndex(const Superclass & it) : - ImageRegionConstIteratorWithIndex< TImage >(it) - { - this->Init(); - } - - /* - * Image Index [0, N - 1] returns [-N/2 + 1, -1] (negative) union [0 to N/2] (positive). So index N/2 + 1 returns the bin 0. - * It is a shift by -N/2 + 1, from [0, N-1] to [-N/2 + 1, N/2] - * If first index of the image is not zero, it stills returns values in the same range. - */ - IndexType GetFrequencyBin() const - { - IndexType freqInd; - - freqInd.Fill(0); - for (unsigned int dim = 0; dim < TImage::ImageDimension; dim++) - { - freqInd[dim] = this->m_PositionIndex[dim] - this->m_ZeroFrequencyIndex[dim]; - } - return freqInd; - } - - /** Note that this method is independent of the region in the constructor. - * It takes into account the ImageInformation of the Image in the frequency domain. - * This iterator is for the frequency layout that results from applying a FFT and then ShiftFFT to center the zero frequency component. - * If your image has a different layout, use other frequency iterator. - * The default ImageInformation is: Origin = {{0}}, Spacing = {{1}}. - * In this case the frequency values will be in the range: [-1/2, 1/2] Hz - * Or [-pi, pi] rad/s - * To modify those ranges: - * a) Avoid modifying the origin. The origin index always corresponds to zero frequency after a FFT. - * The range should be always centered around zero. - * b) The spacing control the range of frequencies (always around zero). - * If the spacing is = {{0.5}} we get a frequency range of [-1/4, 1/4] or [-pi/2, pi/2]. - */ - FrequencyType GetFrequency() const - { - FrequencyType freq; - IndexType freqInd = this->GetFrequencyBin(); - - for (unsigned int dim = 0; dim < TImage::ImageDimension; dim++) - { - freq[dim] = this->m_FrequencyOrigin[dim] - + this->m_FrequencySpacing[dim] * freqInd[dim]; - } - return freq; - } - - FrequencyValueType GetFrequencyModuloSquare() const - { - FrequencyValueType w2(0); - FrequencyType w( this->GetFrequency() ); - - for (unsigned int dim = 0; dim < TImage::ImageDimension; dim++) - { - w2 += w[dim] * w[dim]; - } - return w2; - } - - /** - * Index with the zero frequency value. - * By default: - * ZeroFrequencyIndex = floor(sizeImage / 2); - * This is: N/2 if N even, (N - 1)/2 if N odd. - */ - itkGetConstReferenceMacro(ZeroFrequencyIndex, IndexType); - void SetZeroFrequencyIndex(const IndexType zeroFrequencyIndex) - { - this->m_ZeroFrequencyIndex = zeroFrequencyIndex; - }; - /** Origin of frequencies is zero for FFT output. */ - itkGetConstReferenceMacro(FrequencyOrigin, FrequencyType); - void SetFrequencyOrigin(const FrequencyType frequencyOrigin) - { - this->m_FrequencyOrigin = frequencyOrigin; - }; - - /** This is the pixel width, or the bin size of the frequency. - * FrequencySpacing = SamplingFrequency / ImageSize */ - itkGetConstReferenceMacro(FrequencySpacing, FrequencyType); - void SetFrequencySpacing(const FrequencyType frequencySpacing) - { - this->m_FrequencySpacing = frequencySpacing; - }; - -private: - /** Calculate m_ZeroFrequencyIndex, and frequency spacing/origin. - * Called at constructors. */ - void Init() - { - IndexType minIndex = - this->m_Image->GetLargestPossibleRegion().GetIndex(); - SizeType sizeImage = - this->m_Image->GetLargestPossibleRegion().GetSize(); - FrequencyType samplingFrequency; - for (unsigned int dim = 0; dim < ImageType::ImageDimension; dim++) - { - this->m_ZeroFrequencyIndex[dim] = static_cast( - minIndex[dim] + std::floor( sizeImage[dim] / 2.0 )); - // Set frequency metadata. - // Origin of frequencies is zero in the standard layout of a FFT output. - this->m_FrequencyOrigin[dim] = 0.0; - // SamplingFrequency = 1.0 / SpatialSpacing - samplingFrequency[dim] = 1.0 / this->m_Image->GetSpacing()[dim]; - // Freq_BinSize = SamplingFrequency / Size - this->m_FrequencySpacing[dim] = samplingFrequency[dim] - / sizeImage[dim]; - } - } - - IndexType m_ZeroFrequencyIndex; - FrequencyType m_FrequencyOrigin; - FrequencyType m_FrequencySpacing; -}; -} // end namespace itk -#endif diff --git a/include/itkFrequencyShiftedFFTLayoutImageRegionIteratorWithIndex.h b/include/itkFrequencyShiftedFFTLayoutImageRegionIteratorWithIndex.h deleted file mode 100644 index dd089c5..0000000 --- a/include/itkFrequencyShiftedFFTLayoutImageRegionIteratorWithIndex.h +++ /dev/null @@ -1,138 +0,0 @@ -/*========================================================================= - * - * Copyright Insight Software Consortium - * - * 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 itkFrequencyShiftedFFTLayoutImageRegionIteratorWithIndex_h -#define itkFrequencyShiftedFFTLayoutImageRegionIteratorWithIndex_h - -#include "itkImageRegionIteratorWithIndex.h" -#include "itkFrequencyShiftedFFTLayoutImageRegionConstIteratorWithIndex.h" - -namespace itk -{ -/** \class FrequencyShiftedFFTLayoutImageRegionIteratorWithIndex - - * Iterator providing method GetFrequency() to retrieve the frequency associated to an index. - * This value is related to the specific layout of frequencies from an image in the dual (frequency) space. - * In this case, the layout corresponds to the output of a FastFourierTransform from FFTW library. - * This class is a non-const version of FrequencyShiftedFFTLayoutImageRegionConstIteratorWithIndex. - * - * \ingroup ImageIterators - * \sa FrequencyShiftedFFTLayoutImageRegionConstIteratorWithIndex - * \sa ImageRegionIteratorWithIndex - * \sa ImageConstIterator \sa ConditionalConstIterator - * \sa ConstNeighborhoodIterator \sa ConstShapedNeighborhoodIterator - * \sa ConstSliceIterator \sa CorrespondenceDataStructureIterator - * \sa FloodFilledFunctionConditionalConstIterator - * \sa FloodFilledImageFunctionConditionalConstIterator - * \sa FloodFilledImageFunctionConditionalIterator - * \sa FloodFilledSpatialFunctionConditionalConstIterator - * \sa FloodFilledSpatialFunctionConditionalIterator - * \sa ImageConstIterator \sa ImageConstIteratorWithIndex - * \sa ImageIterator \sa ImageIteratorWithIndex - * \sa ImageLinearConstIteratorWithIndex \sa ImageLinearIteratorWithIndex - * \sa ImageRandomConstIteratorWithIndex \sa ImageRandomIteratorWithIndex - * \sa ImageRegionConstIterator \sa ImageRegionConstIteratorWithIndex - * \sa ImageRegionExclusionConstIteratorWithIndex - * \sa ImageRegionExclusionIteratorWithIndex - * \sa ImageRegionIterator \sa ImageRegionIteratorWithIndex - * \sa ImageRegionReverseConstIterator \sa ImageRegionReverseIterator - * \sa ImageReverseConstIterator \sa ImageReverseIterator - * \sa ImageSliceConstIteratorWithIndex \sa ImageSliceIteratorWithIndex - * \sa NeighborhoodIterator \sa PathConstIterator \sa PathIterator - * \sa ShapedNeighborhoodIterator \sa SliceIterator - * \sa ImageConstIteratorWithIndex - * - * \ingroup IsotropicWavelets - * - */ -template< typename TImage > -class FrequencyShiftedFFTLayoutImageRegionIteratorWithIndex: - public FrequencyShiftedFFTLayoutImageRegionConstIteratorWithIndex -{ -public: - /** Standard class type alias. */ - using Self = FrequencyShiftedFFTLayoutImageRegionIteratorWithIndex; - using Superclass = ImageRegionIteratorWithIndex< TImage >; - - /** Types inherited from the Superclass */ - using IndexType = typename Superclass::IndexType; - using SizeType = typename Superclass::SizeType; - using OffsetType = typename Superclass::OffsetType; - using RegionType = typename Superclass::RegionType; - using ImageType = typename Superclass::ImageType; - using PixelContainer = typename Superclass::PixelContainer; - using PixelContainerPointer = typename Superclass::PixelContainerPointer; - using InternalPixelType = typename Superclass::InternalPixelType; - using PixelType = typename Superclass::PixelType; - using AccessorType = typename Superclass::AccessorType; - - using FrequencyType = typename ImageType::SpacingType; - using FrequencyValueType = typename ImageType::SpacingValueType; - /** Default constructor. Needed since we provide a cast constructor. */ - FrequencyShiftedFFTLayoutImageRegionIteratorWithIndex() : - FrequencyShiftedFFTLayoutImageRegionConstIteratorWithIndex< TImage >() - { - } - - /** Constructor establishes an iterator to walk a particular image and a - * particular region of that image. */ - FrequencyShiftedFFTLayoutImageRegionIteratorWithIndex(TImage *ptr, const RegionType & region) : - FrequencyShiftedFFTLayoutImageRegionConstIteratorWithIndex< TImage >(ptr, region) - { - } - - /** Constructor that can be used to cast from an ImageIterator to an - * ImageRegionIteratorWithIndex. Many routines return an ImageIterator, but for a - * particular task, you may want an ImageRegionIteratorWithIndex. Rather than - * provide overloaded APIs that return different types of Iterators, itk - * returns ImageIterators and uses constructors to cast from an - * ImageIterator to a ImageRegionIteratorWithIndex. */ - FrequencyShiftedFFTLayoutImageRegionIteratorWithIndex(const ImageIteratorWithIndex< TImage > & it) : - FrequencyShiftedFFTLayoutImageRegionConstIteratorWithIndex< TImage >(it) - { - } - - /** Set the pixel value */ - void Set(const PixelType & value) const - { - this->m_PixelAccessorFunctor.Set(*( const_cast< InternalPixelType * >( this->m_Position ) ), value); - } - - /** Return a reference to the pixel. - * This method will provide the fastest access to pixel - * data, but it will NOT support ImageAdaptors. */ - PixelType & Value(void) - { - return *( const_cast< InternalPixelType * >( this->m_Position ) ); - } - -protected: - /** The construction from a const iterator is declared protected - in order to enforce const correctness. */ - FrequencyShiftedFFTLayoutImageRegionIteratorWithIndex(const FrequencyShiftedFFTLayoutImageRegionConstIteratorWithIndex< TImage > & it) : - FrequencyShiftedFFTLayoutImageRegionConstIteratorWithIndex< TImage >(it) - { - } - - Self & operator=(const FrequencyShiftedFFTLayoutImageRegionConstIteratorWithIndex< TImage > & it) - { - this->FrequencyShiftedFFTLayoutImageRegionConstIteratorWithIndex< TImage >::operator=(it); - return *this; - } -}; -} // end namespace itk -#endif diff --git a/itk-module.cmake b/itk-module.cmake index 3f7ed8f..f2fd6d2 100644 --- a/itk-module.cmake +++ b/itk-module.cmake @@ -14,6 +14,7 @@ itk_module(IsotropicWavelets ITKFFT ITKRegistrationCommon ITKConvolution + ITKImageFrequency TEST_DEPENDS ITKTestKernel ITKVtkGlue @@ -29,6 +30,7 @@ itk_module(IsotropicWavelets ITKFFT ITKRegistrationCommon ITKConvolution + ITKImageFrequency TEST_DEPENDS ITKTestKernel EXCLUDE_FROM_DEFAULT diff --git a/test/CMakeLists.txt b/test/CMakeLists.txt index 898838d..bd384c0 100644 --- a/test/CMakeLists.txt +++ b/test/CMakeLists.txt @@ -4,10 +4,6 @@ set(Libraries set(IsotropicWaveletsTests #### Frequency Manipulation ### - # Iterator with Index. - itkFrequencyFFTLayoutImageRegionIteratorWithIndexTest.cxx - # BandPass Filter - itkFrequencyBandImageFilterTest.cxx # Resize itkFrequencyExpandTest.cxx itkFrequencyShrinkTest.cxx @@ -296,17 +292,9 @@ itk_add_test(NAME itkShannonIsotropicWaveletTest COMMAND IsotropicWaveletsTestDriver itkShannonIsotropicWaveletTest) itk_add_test(NAME itkVowIsotropicWaveletTest COMMAND IsotropicWaveletsTestDriver itkVowIsotropicWaveletTest) -# FrequencyIterator -itk_add_test(NAME itkFrequencyFFTLayoutImageRegionIteratorWithIndexTest - COMMAND IsotropicWaveletsTestDriver itkFrequencyFFTLayoutImageRegionIteratorWithIndexTest) ##Ind2Sub itk_add_test(NAME itkInd2SubTest COMMAND IsotropicWaveletsTestDriver itkInd2SubTest) -## BandPass -itk_add_test(NAME itkFrequencyBandImageFilterEvenTest - COMMAND IsotropicWaveletsTestDriver itkFrequencyBandImageFilterTest "Even") -itk_add_test(NAME itkFrequencyBandImageFilterOddTest - COMMAND IsotropicWaveletsTestDriver itkFrequencyBandImageFilterTest "Odd") ## ExpandWithZeros (in spatial domain) itk_add_test(NAME itkExpandWithZerosImageFilterTest2D COMMAND IsotropicWaveletsTestDriver itkExpandWithZerosImageFilterTest 2 3) @@ -451,5 +439,3 @@ itk_python_expression_add_test(NAME itkFrequencyExpandViaInverseFFTImageFilterPy EXPRESSION "instance = itk.FrequencyExpandViaInverseFFTImageFilter.New()") itk_python_expression_add_test(NAME itkFrequencyShrinkViaInverseFFTImageFilterPythonTest EXPRESSION "instance = itk.FrequencyShrinkViaInverseFFTImageFilter.New()") -itk_python_expression_add_test(NAME itkFrequencyBandImageFilterPythonTest - EXPRESSION "instance = itk.FrequencyBandImageFilter.New()") diff --git a/test/itkFrequencyBandImageFilterTest.cxx b/test/itkFrequencyBandImageFilterTest.cxx deleted file mode 100644 index 0d32a5a..0000000 --- a/test/itkFrequencyBandImageFilterTest.cxx +++ /dev/null @@ -1,248 +0,0 @@ -/*========================================================================= - * - * Copyright Insight Software Consortium - * - * 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. - * - *=========================================================================*/ - -#include "itkAddImageFilter.h" -#include "itkFrequencyBandImageFilter.h" -#include "itkFrequencyShiftedFFTLayoutImageRegionIteratorWithIndex.h" -#include "itkImage.h" -#include "itkImageFileWriter.h" -#include "itkTestingComparisonImageFilter.h" -#include "itkTestingMacros.h" - -// Visualize for dev/debug purposes. Set in cmake file. Requires VTK -#ifdef ITK_VISUALIZE_TESTS -#include "itkViewImage.h" -#endif - -int -itkFrequencyBandImageFilterTest( int argc, char* argv[] ) -{ - constexpr unsigned int Dimension = 3; - - if ( argc != 2 ) - { - std::cerr << "Usage: " << argv[0] - << " Even|Odd" << std::endl; - return EXIT_FAILURE; - } - - const std::string evenOrOddInput = argv[1]; - bool isOdd = false; - if ( evenOrOddInput == "Even" ) - { - isOdd = false; - } - else if ( evenOrOddInput == "Odd" ) - { - isOdd = true; - } - else - { - std::cerr << "Unkown string: " + evenOrOddInput + " . Use Even or Odd." << std::endl; - return EXIT_FAILURE; - } - - using PixelType = float; - using ImageType3D = itk::Image< PixelType, Dimension >; - - ImageType3D::SizeType size = { { 10, 20, 40 } }; - if ( isOdd ) - { - for ( unsigned int i = 0; i < Dimension; ++i ) - { - size[i]++; - } - } - - // Create an image - auto image = ImageType3D::New(); - ImageType3D::RegionType region; - region.SetSize( size ); - - image->SetRegions(region); - image->SetLargestPossibleRegion( region ); - image->SetBufferedRegion( region ); - image->Allocate(); - image->FillBuffer( 1.0 ); - - using BandFilterType = itk::FrequencyBandImageFilter< ImageType3D >; - auto passBandFilter = BandFilterType::New(); - - EXERCISE_BASIC_OBJECT_METHODS( passBandFilter, FrequencyBandImageFilter, - ImageToImageFilter ); - - passBandFilter->SetInput( image ); - - // Test exception cases - BandFilterType::FrequencyValueType lowFreqThreshold = 0.5; - passBandFilter->SetLowFrequencyThreshold( lowFreqThreshold ); - TEST_SET_GET_VALUE( lowFreqThreshold, passBandFilter->GetLowFrequencyThreshold() ); - - BandFilterType::FrequencyValueType highFreqThreshold = 0.0; - passBandFilter->SetHighFrequencyThreshold( highFreqThreshold ); - TEST_SET_GET_VALUE( highFreqThreshold, passBandFilter->GetHighFrequencyThreshold() ); - - - TRY_EXPECT_EXCEPTION( passBandFilter->Update() ); - - - lowFreqThreshold = 0.0; - passBandFilter->SetLowFrequencyThreshold( lowFreqThreshold ); - TEST_SET_GET_VALUE( lowFreqThreshold, passBandFilter->GetLowFrequencyThreshold() ); - - highFreqThreshold = 0.5; - passBandFilter->SetHighFrequencyThreshold( highFreqThreshold ); - TEST_SET_GET_VALUE( highFreqThreshold, passBandFilter->GetHighFrequencyThreshold() ); - - bool passBand = true; - TEST_SET_GET_BOOLEAN(passBandFilter, PassBand, passBand); - - bool passLowFreqThreshold = true; - TEST_SET_GET_BOOLEAN(passBandFilter, PassLowFrequencyThreshold, passLowFreqThreshold); - - bool passHighFreqThreshold = true; - TEST_SET_GET_BOOLEAN(passBandFilter, PassHighFrequencyThreshold, passHighFreqThreshold); - - passBandFilter->SetPassBand( passLowFreqThreshold, passHighFreqThreshold ); - TEST_SET_GET_VALUE( passLowFreqThreshold, passBandFilter->GetPassLowFrequencyThreshold() ); - TEST_SET_GET_VALUE( passHighFreqThreshold, passBandFilter->GetPassHighFrequencyThreshold() ); - - - TRY_EXPECT_NO_EXCEPTION( passBandFilter->Update() ); - -#ifdef ITK_VISUALIZE_TESTS - itk::ViewImage::View( passBandFilter->GetOutput(), "PassBand - default" ); -#endif - - // Stop-band - auto stopBandFilter = BandFilterType::New(); - - stopBandFilter->SetInput(image); - - stopBandFilter->SetLowFrequencyThreshold( lowFreqThreshold ); - stopBandFilter->SetHighFrequencyThreshold( highFreqThreshold ); - - passLowFreqThreshold = false; - passHighFreqThreshold = false; - stopBandFilter->SetStopBand( passLowFreqThreshold, passHighFreqThreshold ); - TEST_SET_GET_VALUE( passLowFreqThreshold, stopBandFilter->GetPassLowFrequencyThreshold() ); - TEST_SET_GET_VALUE( passHighFreqThreshold, stopBandFilter->GetPassHighFrequencyThreshold() ); - - TRY_EXPECT_NO_EXCEPTION( stopBandFilter->Update() ); - -#ifdef ITK_VISUALIZE_TESTS - itk::ViewImage::View(stopBandFilter->GetOutput(), "StopBand" ); -#endif - - // Regression test - // Sum of bandPass and stopBand images with these settings should be equal - // to original image - using AddFilterType = itk::AddImageFilter< ImageType3D, ImageType3D >; - auto addFilter = AddFilterType::New(); - addFilter->SetInput1( passBandFilter->GetOutput() ); - addFilter->SetInput2( stopBandFilter->GetOutput() ); - - using DifferenceFilterType = itk::Testing::ComparisonImageFilter< ImageType3D, ImageType3D >; - auto differenceFilter = DifferenceFilterType::New(); - - differenceFilter->SetToleranceRadius( 0 ); - differenceFilter->SetDifferenceThreshold( 0 ); - differenceFilter->SetValidInput( image ); - differenceFilter->SetTestInput( addFilter->GetOutput() ); - - differenceFilter->Update(); - - unsigned int numberOfDiffPixels = differenceFilter->GetNumberOfPixelsWithDifferences(); - if ( numberOfDiffPixels > 0 ) - { - std::cerr << "Test failed! " << std::endl; - std::cerr << "Expected images to be equal, but got " << numberOfDiffPixels - << "unequal pixels" << std::endl; - return EXIT_FAILURE; - } - - // Tests with radians - - BandFilterType::FrequencyValueType lowFreqThresholdRadians = itk::Math::pi_over_4; - passBandFilter->SetLowFrequencyThresholdInRadians( lowFreqThresholdRadians ); - - BandFilterType::FrequencyValueType highFreqThresholdRadians = itk::Math::pi_over_2; - passBandFilter->SetHighFrequencyThresholdInRadians( highFreqThresholdRadians ); - - BandFilterType::FrequencyValueType knownLowFrequencyHertz = - lowFreqThresholdRadians / (2 * itk::Math::pi); - BandFilterType::FrequencyValueType knownHighFrequencyHertz = - highFreqThresholdRadians / (2 * itk::Math::pi); - - if ( itk::Math::NotAlmostEquals( knownLowFrequencyHertz, - passBandFilter->GetLowFrequencyThreshold()) - || itk::Math::NotAlmostEquals( knownHighFrequencyHertz, - passBandFilter->GetHighFrequencyThreshold()) ) - { - std::cerr << "Test failed! " << std::endl; - std::cerr << "Setting frequency in radians failed." << std::endl; - return EXIT_FAILURE; - } - - TRY_EXPECT_NO_EXCEPTION( passBandFilter->Update() ); - -#ifdef ITK_VISUALIZE_TESTS - itk::ViewImage::View( passBandFilter->GetOutput(), "PassBand - radians" ); -#endif - - // Test the non-radial cut-off. - // Don't pass negative frequency thresholds. - - bool radialBand = false; - TEST_SET_GET_BOOLEAN(passBandFilter, RadialBand, radialBand); - bool passNegativeLowFrequencyThreshold = false; - TEST_SET_GET_BOOLEAN(passBandFilter, PassNegativeLowFrequencyThreshold, passNegativeLowFrequencyThreshold); - bool passNegativeHighFrequencyThreshold = false; - TEST_SET_GET_BOOLEAN(passBandFilter, PassNegativeHighFrequencyThreshold, passNegativeHighFrequencyThreshold); - passBandFilter->Update(); - -#ifdef ITK_VISUALIZE_TESTS - itk::ViewImage::View( passBandFilter->GetOutput(), "PassBand - RadialBandOff" ); -#endif - - // Test with ShiftedIterator. - using FrequencyShiftedIterator = itk::FrequencyShiftedFFTLayoutImageRegionIteratorWithIndex< ImageType3D >; - using BandShiftedFilterType = itk::FrequencyBandImageFilter< ImageType3D, FrequencyShiftedIterator >; - auto passBandShiftedFilter = BandShiftedFilterType::New(); - - passBandShiftedFilter->SetInput( image ); - passBandShiftedFilter->SetLowFrequencyThreshold( lowFreqThreshold ); - passBandShiftedFilter->SetHighFrequencyThreshold( highFreqThreshold ); - passBandShiftedFilter->SetPassBand(true); - passLowFreqThreshold = false; - passHighFreqThreshold = true; - passBandShiftedFilter->SetPassBand( passLowFreqThreshold, passHighFreqThreshold ); - TRY_EXPECT_NO_EXCEPTION( passBandShiftedFilter->Update() ); -#ifdef ITK_VISUALIZE_TESTS - itk::ViewImage::View( passBandShiftedFilter->GetOutput(), "PassBand - FrequencyShiftedIterator" ); -#endif - - // using WriterType = itk::ImageFileWriter< ImageType3D >; - // auto writer = WriterType::New(); - // writer->SetInput( passBandFilter->GetOutput() ); - // writer->SetFileName( argv[1] ); - // - // TRY_EXPECT_NO_EXCEPTION( writer->Update() ); - - return EXIT_SUCCESS; -} diff --git a/test/itkFrequencyFFTLayoutImageRegionIteratorWithIndexTest.cxx b/test/itkFrequencyFFTLayoutImageRegionIteratorWithIndexTest.cxx deleted file mode 100644 index e1771b8..0000000 --- a/test/itkFrequencyFFTLayoutImageRegionIteratorWithIndexTest.cxx +++ /dev/null @@ -1,323 +0,0 @@ -/*========================================================================= - * - * Copyright Insight Software Consortium - * - * 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. - * - *=========================================================================*/ - -#include "itkFrequencyFFTLayoutImageRegionIteratorWithIndex.h" -#include "itkTestingMacros.h" - -#include -#include -#include - -template< typename TImage > -class itkFrequencyFFTLayoutImageRegionIteratorWithIndexTester -{ -public: - using ImageType = TImage; - using IndexType = typename ImageType::IndexType; - using FrequencyType = typename ImageType::SpacingType; - - using IteratorType = itk::FrequencyFFTLayoutImageRegionIteratorWithIndex< ImageType >; - - explicit itkFrequencyFFTLayoutImageRegionIteratorWithIndexTester( size_t inputImageSize ) - { - m_Image = ImageType::New(); - - typename ImageType::SizeType size; - size.Fill( inputImageSize ); - - typename ImageType::IndexType start; - start.Fill(0); - - typename ImageType::RegionType region; - region.SetSize( size ); - region.SetIndex( start ); - - m_Image->SetRegions( region ); - - // Setup the half, positive frequencies region. - size.Fill( inputImageSize / 2 ); - start.Fill(1); - m_PositiveHalfRegion.SetSize( size ); - m_PositiveHalfRegion.SetIndex( start ); - - m_ImageIsOdd = inputImageSize % 2 == 1 ? 1 : 0; - // Setup the half, negative frequencies region. - unsigned int isImageSizeOdd = m_ImageIsOdd ? 1 : 0; - size.Fill( inputImageSize / 2 ); - start.Fill( inputImageSize / 2 + isImageSizeOdd ); - m_NegativeHalfRegion.SetSize( size ); - m_NegativeHalfRegion.SetIndex( start ); - // - // With default frequency_spacing = 1 ( = sampling frequency) - // Nyquist_first = fs * (N/2) / N where N is the size of that dim. - // If image is Even, there is only one Nyquist at index = N/2, shared between + and - frequencies. - // If Odd, Nyquist Freq = fs/2 is not represented, but there is still - // a largest frequency at half index with value = fs/2 * (N-1)/N - // - for ( unsigned int dim = 0; dim < ImageType::ImageDimension; dim++ ) - { - m_LargestFrequency[dim] = 0.5; // = fs/2 with default spacing = 1.0 - if ( m_ImageIsOdd ) - { - m_LargestFrequency[dim] = 0.5 * (inputImageSize - 1) * (1.0 / inputImageSize); - } - } - } - - bool - TestIterator() - { - typename ImageType::RegionType region = m_Image->GetLargestPossibleRegion(); - std::cout << "LargestRegion:" << region << std::endl; - if ( TestLargestRegion() == false ) - { - std::cout << "Failed testing largest region." << std::endl; - return false; - } - - if ( TestFrequenciesHaveHermitianSimmetry() == false ) - { - std::cout << "Failed testing Hermitian simmetry." << std::endl; - return false; - } - - region = m_PositiveHalfRegion; - std::cout << "Positive Half Region (excluding 0 freqs in all dim):" << region << std::endl; - - region = m_NegativeHalfRegion; - std::cout << "Negative Half Region: (including Nyquist freq if N even)" << region << std::endl; - - if ( TestNegativeRegion( region ) == false ) - { - std::cout << "Failed testing negative frequencies region." << std::endl; - return false; - } - - return true; - } - - bool - TestFrequenciesHaveHermitianSimmetry() - { - IteratorType it( m_Image, m_PositiveHalfRegion); - IteratorType reverseIt( m_Image, m_NegativeHalfRegion ); - - it.GoToBegin(); - reverseIt.GoToReverseBegin(); - while ( !it.IsAtEnd() ) - { - for ( unsigned int dim = 0; dim < ImageType::ImageDimension; dim++ ) - { - if ( itk::Math::NotAlmostEquals( it.GetFrequency()[dim], - itk::Math::abs(reverseIt.GetFrequency()[dim] ) ) ) - { - std::cout << "Failed testing Hermitian property at index:" - << it.GetIndex() << " freq: " << it.GetFrequency() << "\n" - << " reverseIt: " << reverseIt.GetIndex() << " freq: " << reverseIt.GetFrequency() << std::endl; - return false; - } - } - --reverseIt; - ++it; - } - - return true; - } - - // If N is even, the Nyquist frequency is stored in the positive region, - // but shared with the negative region. - // If N is odd, the largest frequency has a positive and negative component. - bool - TestNegativeRegion( typename ImageType::RegionType & region ) - { - IteratorType it( m_Image, region ); - - it.GoToBegin(); - IndexType halfIndexPlusOne; - for ( unsigned int dim = 0; dim < ImageType::ImageDimension; dim++ ) - { - halfIndexPlusOne[dim] = it.GetLargestPositiveFrequencyIndex()[dim] + 1; - } - IndexType firstNegativeIndex = m_ImageIsOdd ? halfIndexPlusOne : it.GetLargestPositiveFrequencyIndex(); - IndexType smallestNegativeFreqIndex; - for ( unsigned int dim = 0; dim < ImageType::ImageDimension; dim++ ) - { - smallestNegativeFreqIndex[dim] = m_ImageIsOdd ? - -firstNegativeIndex[dim] + 1 : firstNegativeIndex[dim]; - } - while ( !it.IsAtEnd() ) - { - if ( it.GetIndex() == firstNegativeIndex ) - { - // abs value should be equal to largest freq for odd images - if ( m_ImageIsOdd == true && - m_LargestFrequency != it.GetFrequency() && - -m_LargestFrequency != it.GetFrequency() ) - { - std::cout << " Frequency value is wrong." << it.GetFrequency() - << " should be: " << m_LargestFrequency << std::endl; - return false; - } - if ( it.GetFrequencyBin() != smallestNegativeFreqIndex ) - { - std::cout << " Smallest negative frequency bin is wrong." << it.GetFrequencyBin() - << " should be: " << smallestNegativeFreqIndex << ".iterator index: " << it.GetIndex() - << std::endl; - return false; - } - } - ++it; - } - - return true; - } - - bool - TestLargestRegion() - { - IteratorType it( m_Image, m_Image->GetLargestPossibleRegion() ); - - typename ImageType::IndexType truthHalfIndex; - for ( unsigned int dim = 0; dim < ImageType::ImageDimension; dim++ ) - { - truthHalfIndex[dim] = - m_Image->GetLargestPossibleRegion().GetIndex()[dim] - + m_Image->GetLargestPossibleRegion().GetSize()[dim] / 2; - if ( it.GetLargestPositiveFrequencyIndex()[dim] != truthHalfIndex[dim] ) - { - std::cerr << "Test failed! " << std::endl; - std::cerr << "Error in GetLargestPositiveFrequencyIndex()[" << dim << "]" << std::endl; - std::cerr << "Expected: " << truthHalfIndex << ", but got " - << it.GetLargestPositiveFrequencyIndex() << std::endl; - return false; - } - } - - IndexType zero_freq_index; - zero_freq_index.Fill(0); - it.GoToBegin(); - - if ( it.GetIndex() == m_Image->GetLargestPossibleRegion().GetIndex() && - it.GetFrequencyBin() != zero_freq_index ) - { - std::cerr << "Test failed! " << std::endl; - std::cerr << "Error: Zero frequency is not at the minimum index!" << std::endl; - return false; - } - - while ( !it.IsAtEnd() ) - { - IndexType index = it.GetIndex(); - // Check to see if the index is within allowed bounds - bool isInside = m_Image->GetLargestPossibleRegion().IsInside( index ); - if ( !isInside ) - { - std::cerr << "Test failed! " << std::endl; - std::cerr << "Index is not inside region!: " << index << std::endl; - return false; - } - // Check repeatibility - if ( index != it.GetIndex() ) - { - std::cerr << "Test failed! " << std::endl; - std::cerr << "Failed to repeat GetIndex()" << std::endl; - return false; - } - - if ( index == it.GetLargestPositiveFrequencyIndex() && - it.GetFrequency() != m_LargestFrequency && - it.GetFrequencyBin() != it.GetLargestPositiveFrequencyIndex() ) - { - std::cerr << "Test failed! " << std::endl; - std::cerr << "Error in largest frequency bin" << std::endl; - std::cerr << "Expected: " << m_LargestFrequency << ", but got " - << it.GetFrequency() << std::endl; - return false; - } - // increment and test index - ++it; - } - - return true; - } - -private: - typename ImageType::Pointer m_Image; - typename ImageType::RegionType m_PositiveHalfRegion; - typename ImageType::RegionType m_NegativeHalfRegion; - FrequencyType m_LargestFrequency; - bool m_ImageIsOdd; -}; - -int -itkFrequencyFFTLayoutImageRegionIteratorWithIndexTest( int, char * [] ) -{ - bool testPassed = true; // let's be optimistic - - constexpr unsigned int Dimension = 3; - - using CharPixelType = char; - using FloatPixelType = char; - - // Even input image size test - { - size_t inputImageSize( 8 ); - std::cout << "Testing with EVEN Image< std::complex, 3 > with size: " - << inputImageSize << std::endl; - itkFrequencyFFTLayoutImageRegionIteratorWithIndexTester< - itk::Image< std::complex< FloatPixelType >, Dimension > > Tester( inputImageSize ); - if ( Tester.TestIterator() == false ) - { - testPassed = false; - } - } - - // Even input image size test - { - size_t inputImageSize( 10 ); - std::cout << "Testing with EVEN Image< char, 3 > with size: " - << inputImageSize << std::endl; - itkFrequencyFFTLayoutImageRegionIteratorWithIndexTester< - itk::Image< CharPixelType, Dimension > > Tester( inputImageSize ); - if ( Tester.TestIterator() == false ) - { - testPassed = false; - } - } - - // Odd input image size test - { - size_t inputImageSize(9); - std::cout << "Testing with ODD Image< char, 3 > with size: " - << inputImageSize << std::endl; - itkFrequencyFFTLayoutImageRegionIteratorWithIndexTester< - itk::Image< CharPixelType, Dimension > > Tester( inputImageSize ); - if ( Tester.TestIterator() == false ) - { - testPassed = false; - } - } - - if ( !testPassed ) - { - std::cout << "Test failed!" << std::endl; - return EXIT_FAILURE; - } - - return EXIT_SUCCESS; -} diff --git a/wrapping/itkFrequencyBandImageFilter.wrap b/wrapping/itkFrequencyBandImageFilter.wrap deleted file mode 100644 index 235ef06..0000000 --- a/wrapping/itkFrequencyBandImageFilter.wrap +++ /dev/null @@ -1,7 +0,0 @@ -itk_wrap_class("itk::FrequencyBandImageFilter" POINTER) - foreach(d ${ITK_WRAP_IMAGE_DIMS}) - foreach(t ${WRAP_ITK_COMPLEX_REAL}) - itk_wrap_template("${ITKM_I${t}${d}}" "${ITKT_I${t}${d}}") - endforeach() - endforeach() -itk_end_wrap_class() diff --git a/wrapping/itkFrequencyFFTLayoutImageRegionConstIteratorWithIndex.notwrapped b/wrapping/itkFrequencyFFTLayoutImageRegionConstIteratorWithIndex.notwrapped deleted file mode 100644 index e27410c..0000000 --- a/wrapping/itkFrequencyFFTLayoutImageRegionConstIteratorWithIndex.notwrapped +++ /dev/null @@ -1 +0,0 @@ -message(FATAL_ERROR "No use to wrapping the iterator.") diff --git a/wrapping/itkFrequencyFFTLayoutImageRegionIteratorWithIndex.notwrapped b/wrapping/itkFrequencyFFTLayoutImageRegionIteratorWithIndex.notwrapped deleted file mode 100644 index e27410c..0000000 --- a/wrapping/itkFrequencyFFTLayoutImageRegionIteratorWithIndex.notwrapped +++ /dev/null @@ -1 +0,0 @@ -message(FATAL_ERROR "No use to wrapping the iterator.") diff --git a/wrapping/itkFrequencyImageRegionConstIteratorWithIndex.notwrapped b/wrapping/itkFrequencyImageRegionConstIteratorWithIndex.notwrapped deleted file mode 100644 index e27410c..0000000 --- a/wrapping/itkFrequencyImageRegionConstIteratorWithIndex.notwrapped +++ /dev/null @@ -1 +0,0 @@ -message(FATAL_ERROR "No use to wrapping the iterator.") diff --git a/wrapping/itkFrequencyImageRegionIteratorWithIndex.notwrapped b/wrapping/itkFrequencyImageRegionIteratorWithIndex.notwrapped deleted file mode 100644 index e27410c..0000000 --- a/wrapping/itkFrequencyImageRegionIteratorWithIndex.notwrapped +++ /dev/null @@ -1 +0,0 @@ -message(FATAL_ERROR "No use to wrapping the iterator.") diff --git a/wrapping/itkFrequencyShiftedFFTLayoutImageRegionConstIteratorWithIndex.notwrapped b/wrapping/itkFrequencyShiftedFFTLayoutImageRegionConstIteratorWithIndex.notwrapped deleted file mode 100644 index e27410c..0000000 --- a/wrapping/itkFrequencyShiftedFFTLayoutImageRegionConstIteratorWithIndex.notwrapped +++ /dev/null @@ -1 +0,0 @@ -message(FATAL_ERROR "No use to wrapping the iterator.") diff --git a/wrapping/itkFrequencyShiftedFFTLayoutImageRegionIteratorWithIndex.notwrapped b/wrapping/itkFrequencyShiftedFFTLayoutImageRegionIteratorWithIndex.notwrapped deleted file mode 100644 index e27410c..0000000 --- a/wrapping/itkFrequencyShiftedFFTLayoutImageRegionIteratorWithIndex.notwrapped +++ /dev/null @@ -1 +0,0 @@ -message(FATAL_ERROR "No use to wrapping the iterator.")