Skip to content

Commit ec145cf

Browse files
committed
ENH: Standardize complextocomplex fft with two-arg template
1 parent e32e05a commit ec145cf

6 files changed

+35
-33
lines changed

Modules/Filtering/FFT/include/itkComplexToComplexFFTImageFilter.h

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -72,16 +72,16 @@ extern ITKFFT_EXPORT std::ostream &
7272
* \sa ForwardFFTImageFilter
7373
* \ingroup ITKFFT
7474
*/
75-
template <typename TImage>
76-
class ITK_TEMPLATE_EXPORT ComplexToComplexFFTImageFilter : public ImageToImageFilter<TImage, TImage>
75+
template <typename TInputImage, typename TOutputImage = TInputImage>
76+
class ITK_TEMPLATE_EXPORT ComplexToComplexFFTImageFilter : public ImageToImageFilter<TInputImage, TOutputImage>
7777
{
7878
public:
7979
ITK_DISALLOW_COPY_AND_MOVE(ComplexToComplexFFTImageFilter);
8080

8181
/** Input and output image types. */
82-
using ImageType = TImage;
83-
using InputImageType = TImage;
84-
using OutputImageType = TImage;
82+
using ImageType = TInputImage;
83+
using InputImageType = TInputImage;
84+
using OutputImageType = TOutputImage;
8585

8686
/** Standard class type aliases. */
8787
using Self = ComplexToComplexFFTImageFilter;

Modules/Filtering/FFT/include/itkComplexToComplexFFTImageFilter.hxx

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -75,9 +75,9 @@ struct DispatchFFTW_Complex_New<TSelfPointer, TImage, float>
7575
};
7676
#endif
7777

78-
template <typename TImage>
78+
template <typename TInputImage, typename TOutputImage>
7979
auto
80-
ComplexToComplexFFTImageFilter<TImage>::New() -> Pointer
80+
ComplexToComplexFFTImageFilter<TInputImage, TOutputImage>::New() -> Pointer
8181
{
8282
Pointer smartPtr = ObjectFactory<Self>::Create();
8383

@@ -96,9 +96,9 @@ ComplexToComplexFFTImageFilter<TImage>::New() -> Pointer
9696
}
9797

9898

99-
template <typename TImage>
99+
template <typename TInputImage, typename TOutputImage>
100100
void
101-
ComplexToComplexFFTImageFilter<TImage>::GenerateInputRequestedRegion()
101+
ComplexToComplexFFTImageFilter<TInputImage, TOutputImage>::GenerateInputRequestedRegion()
102102
{
103103
Superclass::GenerateInputRequestedRegion();
104104
// get pointers to the input and output

Modules/Filtering/FFT/include/itkFFTWComplexToComplexFFTImageFilter.h

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -55,19 +55,20 @@ namespace itk
5555
*
5656
* \sa FFTWGlobalConfiguration
5757
*/
58-
template <typename TImage>
59-
class ITK_TEMPLATE_EXPORT FFTWComplexToComplexFFTImageFilter : public ComplexToComplexFFTImageFilter<TImage>
58+
template <typename TInputImage, typename TOutputImage = TInputImage>
59+
class ITK_TEMPLATE_EXPORT FFTWComplexToComplexFFTImageFilter
60+
: public ComplexToComplexFFTImageFilter<TInputImage, TOutputImage>
6061
{
6162
public:
6263
ITK_DISALLOW_COPY_AND_MOVE(FFTWComplexToComplexFFTImageFilter);
6364

6465
/** Standard class type aliases. */
6566
using Self = FFTWComplexToComplexFFTImageFilter;
66-
using Superclass = ComplexToComplexFFTImageFilter<TImage>;
67+
using Superclass = ComplexToComplexFFTImageFilter<TInputImage, TOutputImage>;
6768
using Pointer = SmartPointer<Self>;
6869
using ConstPointer = SmartPointer<const Self>;
6970

70-
using ImageType = TImage;
71+
using typename Superclass::ImageType;
7172
using PixelType = typename ImageType::PixelType;
7273
using typename Superclass::InputImageType;
7374
using typename Superclass::OutputImageType;

Modules/Filtering/FFT/include/itkFFTWComplexToComplexFFTImageFilter.hxx

Lines changed: 10 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -37,8 +37,8 @@
3737
namespace itk
3838
{
3939

40-
template <typename TImage>
41-
FFTWComplexToComplexFFTImageFilter<TImage>::FFTWComplexToComplexFFTImageFilter()
40+
template <typename TInputImage, typename TOutputImage>
41+
FFTWComplexToComplexFFTImageFilter<TInputImage, TOutputImage>::FFTWComplexToComplexFFTImageFilter()
4242
#ifndef ITK_USE_CUFFTW
4343
: m_PlanRigor(FFTWGlobalConfiguration::GetPlanRigor())
4444
#endif
@@ -47,9 +47,9 @@ FFTWComplexToComplexFFTImageFilter<TImage>::FFTWComplexToComplexFFTImageFilter()
4747
}
4848

4949

50-
template <typename TImage>
50+
template <typename TInputImage, typename TOutputImage>
5151
void
52-
FFTWComplexToComplexFFTImageFilter<TImage>::BeforeThreadedGenerateData()
52+
FFTWComplexToComplexFFTImageFilter<TInputImage, TOutputImage>::BeforeThreadedGenerateData()
5353
{
5454
// get pointers to the input and output
5555
const InputImageType * input = this->GetInput();
@@ -102,9 +102,9 @@ FFTWComplexToComplexFFTImageFilter<TImage>::BeforeThreadedGenerateData()
102102
}
103103

104104

105-
template <typename TImage>
105+
template <typename TInputImage, typename TOutputImage>
106106
void
107-
FFTWComplexToComplexFFTImageFilter<TImage>::DynamicThreadedGenerateData(
107+
FFTWComplexToComplexFFTImageFilter<TInputImage, TOutputImage>::DynamicThreadedGenerateData(
108108
const OutputImageRegionType & outputRegionForThread)
109109
{
110110
// Normalize the output if backward transform
@@ -124,9 +124,9 @@ FFTWComplexToComplexFFTImageFilter<TImage>::DynamicThreadedGenerateData(
124124
}
125125

126126

127-
template <typename TImage>
127+
template <typename TInputImage, typename TOutputImage>
128128
void
129-
FFTWComplexToComplexFFTImageFilter<TImage>::UpdateOutputData(DataObject * output)
129+
FFTWComplexToComplexFFTImageFilter<TInputImage, TOutputImage>::UpdateOutputData(DataObject * output)
130130
{
131131
// we need to catch that information now, because it is changed later
132132
// during the pipeline execution, and thus can't be grabbed in
@@ -136,9 +136,9 @@ FFTWComplexToComplexFFTImageFilter<TImage>::UpdateOutputData(DataObject * output
136136
}
137137

138138

139-
template <typename TImage>
139+
template <typename TInputImage, typename TOutputImage>
140140
void
141-
FFTWComplexToComplexFFTImageFilter<TImage>::PrintSelf(std::ostream & os, Indent indent) const
141+
FFTWComplexToComplexFFTImageFilter<TInputImage, TOutputImage>::PrintSelf(std::ostream & os, Indent indent) const
142142
{
143143
Superclass::PrintSelf(os, indent);
144144

Modules/Filtering/FFT/include/itkVnlComplexToComplexFFTImageFilter.h

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -37,19 +37,20 @@ namespace itk
3737
* \sa VnlForwardFFTImageFilter
3838
* \sa VnlInverseFFTImageFilter
3939
*/
40-
template <typename TImage>
41-
class ITK_TEMPLATE_EXPORT VnlComplexToComplexFFTImageFilter : public ComplexToComplexFFTImageFilter<TImage>
40+
template <typename TInputImage, typename TOutputImage = TInputImage>
41+
class ITK_TEMPLATE_EXPORT VnlComplexToComplexFFTImageFilter
42+
: public ComplexToComplexFFTImageFilter<TInputImage, TOutputImage>
4243
{
4344
public:
4445
ITK_DISALLOW_COPY_AND_MOVE(VnlComplexToComplexFFTImageFilter);
4546

4647
/** Standard class type aliases. */
4748
using Self = VnlComplexToComplexFFTImageFilter;
48-
using Superclass = ComplexToComplexFFTImageFilter<TImage>;
49+
using Superclass = ComplexToComplexFFTImageFilter<TInputImage, TOutputImage>;
4950
using Pointer = SmartPointer<Self>;
5051
using ConstPointer = SmartPointer<const Self>;
5152

52-
using ImageType = TImage;
53+
using typename Superclass::ImageType;
5354
using PixelType = typename ImageType::PixelType;
5455
using typename Superclass::InputImageType;
5556
using typename Superclass::OutputImageType;

Modules/Filtering/FFT/include/itkVnlComplexToComplexFFTImageFilter.hxx

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -28,16 +28,16 @@
2828
namespace itk
2929
{
3030

31-
template <typename TImage>
32-
VnlComplexToComplexFFTImageFilter<TImage>::VnlComplexToComplexFFTImageFilter()
31+
template <typename TInputImage, typename TOutputImage>
32+
VnlComplexToComplexFFTImageFilter<TInputImage, TOutputImage>::VnlComplexToComplexFFTImageFilter()
3333
{
3434
this->DynamicMultiThreadingOn();
3535
}
3636

3737

38-
template <typename TImage>
38+
template <typename TInputImage, typename TOutputImage>
3939
void
40-
VnlComplexToComplexFFTImageFilter<TImage>::BeforeThreadedGenerateData()
40+
VnlComplexToComplexFFTImageFilter<TInputImage, TOutputImage>::BeforeThreadedGenerateData()
4141
{
4242
const ImageType * input = this->GetInput();
4343
ImageType * output = this->GetOutput();
@@ -75,9 +75,9 @@ VnlComplexToComplexFFTImageFilter<TImage>::BeforeThreadedGenerateData()
7575
}
7676

7777

78-
template <typename TImage>
78+
template <typename TInputImage, typename TOutputImage>
7979
void
80-
VnlComplexToComplexFFTImageFilter<TImage>::DynamicThreadedGenerateData(
80+
VnlComplexToComplexFFTImageFilter<TInputImage, TOutputImage>::DynamicThreadedGenerateData(
8181
const OutputImageRegionType & outputRegionForThread)
8282
{
8383
// Normalize the output if backward transform

0 commit comments

Comments
 (0)