<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE Change SYSTEM "http://itk.org/migrationv4/ITKMigration.dtd">

<!--**
**
** FFTOutputForRealInput.xml
**
** >>>>>>>>>>>>>>>>>>>>>>>>>>>>
** THIS FILE HAS BEEN AUTOMATICALLY GENERATED. EDIT IT BEFORE COMMITING
** <<<<<<<<<<<<<<<<<<<<<<<<<<<
**
** Please, make sure this file validates the following w3c test before committing it: http://validator.w3.org
**-->
<Change>
    <!--**
    ** Title for the online migration page
    **-->
    <Title>
      Consistent FFT Output
    </Title>

    <!--**
    ** The author of the change
    **-->
    <Author>
      Cory Quammen
    </Author>

    <!--**
    ** Date of creation for the XML document
    **-->
    <Date>
      2011-09-27
    </Date>

    <!--**
    ** Plain text description of the change
    ** Extracted from git commit messages
    **-->
    <Description>
      <![CDATA[
      Made output and expected input of FFT filters consistent
      The ForwardFFTImageFilter's output was different depending on whether
      FFTW was enabled. If FFTW was enabled, the output consisted of only
      the non-redundant half of the full complex transformed image. If it was
      not enabled, the output consisted of the full complex transformed
      image. This change makes the output of ForwardFFTImageFilter always consist
      of the full complex image, and the InverseFFTImageFilter expects
      its input to be the full complex image.

      In addition, the API has changed for the forward and inverse FFT filters.
      Because the full complex image is produced, the method FullMatrix() has
      been removed from both ForwardFFTImageFilter and InverseFFTImageFilter.
      The methods ActualXDimensionIsOdd(), SetActualXDimensionIsOdd(),
      SetActualXDimensionIsOddOff(), and SetActualXDimensionIsOddOn() have
      been removed from InverseFFTImageFilter.

      For access to FFT filters optimized for real inputs, two new filters
      have been added: RealToHalfHermitianForwardFFTImageFilter and
      HalfHermitianToRealInverseFFTImageFilter. RealToHalfHermitianForwardFFTImageFilter
      produces the non-redundant half complex image that used to be produced
      by ForwardFFTImageFilter when FFTW was enabled, and
      HalfHermitianToRealInverseFFTImageFilter expects that format as input.
      ]]>
    </Description>

    <!--**
    ** Sample code snippets
    ** Extracted from git diff of changed files in Examples and Testing
    **-->
    <SampleCode>
      <Old>
        <![CDATA[
        // This assumes that FFTW is not enabled.
        typedef FFTFilterType::OutputImageType ComplexImageType;
        complexWriter->SetInput( fftFilter->GetOutput() );
        realFilter->SetInput( fftFilter->GetOutput() );
        imaginaryFilter->SetInput( fftFilter->GetOutput() );
        ]]>
      </Old>

      <New>
        <![CDATA[
        // It doesn't matter if FFTW is enabled or not.
        typedef FFTFilterType::OutputImageType ComplexImageType;
        complexWriter->SetInput( fftFilter->GetOutput() );
        realFilter->SetInput( fftFilter->GetOutput() );
        imaginaryFilter->SetInput( fftFilter->GetOutput() );
        ]]>
      </New>

    </SampleCode>

    <SampleCode>
      <Old>
        <![CDATA[
        // This assumes that FFTW was enabled
        typedef itk::ForwardFFTImageFilter< InputImageType > FFTFilterType;
        typedef itk::InverseFFTImageFilter< InputImageType > IFFTFilterType;
        FFTFilterType::Pointer fft = FFTFilterType::New();
        fft->SetInput( ... );

        // Do some processing on the half complex frequency image.
        frequencyImageFilter->SetInput( fft->GetOutput() );

        IFFTFilterType::Pointer ifft = IFFTFilterType::New();
        ifft->SetActualXDimensionIsOdd( true );
        bool isOdd = ifft->ActualXDimensionIsOdd();
        ifft->SetInput( frequencyImageFilter->GetOutput() );
        ]]>
      </Old>

      <New>
        <![CDATA[
        // It doesn't matter whether FFTW is enabled or not.
        typedef itk::RealToHalfHermitianForwardFFTImageFilter< InputImageType > FFTFilterType;
        typedef itk::HalfHermitianToRealInverseFFTImageFilter< InputImageType > IFFTFilterType;
        FFTFilterType::Pointer fft = FFTFilterType::New();
        fft->SetInput( ... );

        // Do some processing on the half complex frequency image.
        frequencyImageFilter->SetInput( fft->GetOutput() );

        IFFTFilterType::Pointer ifft = IFFTFilterType::New();
        ifft->SetActualXDimensionIsOdd( true );
        bool isOdd = ifft->ActualXDimensionIsOdd();
        ifft->SetInput( frequencyImageFilter->GetOutput() );
        ]]>
      </New>

    </SampleCode>

    <SampleCode>
      <Old>
        <![CDATA[
        // This assumes that FFTW was not enabled
        typedef itk::ForwardFFTImageFilter< InputImageType > FFTFilterType;
        typedef itk::InverseFFTImageFilter< InputImageType > IFFTFilterType;
        FFTFilterType::Pointer fft = FFTFilterType::New();
        fft->SetInput( ... );

        // Do some processing on the half complex frequency image.
        frequencyImageFilter->SetInput( fft->GetOutput() );

        IFFTFilterType::Pointer ifft = IFFTFilterType::New();
        ifft->SetInput( frequencyImageFilter->GetOutput() );
        ]]>
      </Old>

      <New>
        <![CDATA[
        // No change required
        ]]>
      </New>

    </SampleCode>

    <!--**
    ** The change-ids for all commits in the topic branch
    **-->
    <Gerrit-ChangeId>
      I645fe0fd39f5c2811e4a89987b589cf6d576e379
    </Gerrit-ChangeId>

    <!--**
    ** List of all changed files from the topic branch
    **-->
    <FileList>
      Documentation/Migration/ConsistentFFTOutput.xml
      Modules/Filtering/FFT/include/itkFFTWForwardFFTImageFilter.h
      Modules/Filtering/FFT/include/itkFFTWForwardFFTImageFilter.hxx
      Modules/Filtering/FFT/include/itkFFTWHalfHermitianToRealInverseFFTImageFilter.h
      Modules/Filtering/FFT/include/itkFFTWHalfHermitianToRealInverseFFTImageFilter.hxx
      Modules/Filtering/FFT/include/itkFFTWInverseFFTImageFilter.h
      Modules/Filtering/FFT/include/itkFFTWInverseFFTImageFilter.hxx
      Modules/Filtering/FFT/include/itkFFTWRealToHalfHermitianForwardFFTImageFilter.h
      Modules/Filtering/FFT/include/itkFFTWRealToHalfHermitianForwardFFTImageFilter.hxx
      Modules/Filtering/FFT/include/itkForwardFFTImageFilter.h
      Modules/Filtering/FFT/include/itkForwardFFTImageFilter.hxx
      Modules/Filtering/FFT/include/itkFullToHalfHermitianImageFilter.h
      Modules/Filtering/FFT/include/itkFullToHalfHermitianImageFilter.hxx
      Modules/Filtering/FFT/include/itkHalfHermitianToRealInverseFFTImageFilter.h
      Modules/Filtering/FFT/include/itkHalfHermitianToRealInverseFFTImageFilter.hxx
      Modules/Filtering/FFT/include/itkHalfToFullHermitianImageFilter.h
      Modules/Filtering/FFT/include/itkHalfToFullHermitianImageFilter.hxx
      Modules/Filtering/FFT/include/itkInverseFFTImageFilter.h
      Modules/Filtering/FFT/include/itkInverseFFTImageFilter.hxx
      Modules/Filtering/FFT/include/itkRealToHalfHermitianForwardFFTImageFilter.h
      Modules/Filtering/FFT/include/itkRealToHalfHermitianForwardFFTImageFilter.hxx
      Modules/Filtering/FFT/include/itkVnlFFTCommon.h
      Modules/Filtering/FFT/include/itkVnlFFTCommon.hxx
      Modules/Filtering/FFT/include/itkVnlForwardFFTImageFilter.h
      Modules/Filtering/FFT/include/itkVnlForwardFFTImageFilter.hxx
      Modules/Filtering/FFT/include/itkVnlHalfHermitianToRealInverseFFTImageFilter.h
      Modules/Filtering/FFT/include/itkVnlHalfHermitianToRealInverseFFTImageFilter.hxx
      Modules/Filtering/FFT/include/itkVnlInverseFFTImageFilter.h
      Modules/Filtering/FFT/include/itkVnlInverseFFTImageFilter.hxx
      Modules/Filtering/FFT/include/itkVnlRealToHalfHermitianForwardFFTImageFilter.h
      Modules/Filtering/FFT/include/itkVnlRealToHalfHermitianForwardFFTImageFilter.hxx
      Modules/Filtering/FFT/test/CMakeLists.txt
      Modules/Filtering/FFT/test/itkFFTTest.h
      Modules/Filtering/FFT/test/itkFFTWD_FFTTest.cxx
      Modules/Filtering/FFT/test/itkFFTWD_RealFFTTest.cxx
      Modules/Filtering/FFT/test/itkFFTWF_FFTTest.cxx
      Modules/Filtering/FFT/test/itkFFTWF_RealFFTTest.cxx
      Modules/Filtering/FFT/test/itkFullToHalfHermitianImageFilterTest.cxx
      Modules/Filtering/FFT/test/itkHalfToFullHermitianImageFilterTest.cxx
      Modules/Filtering/FFT/test/itkRealFFTTest.h
      Modules/Filtering/FFT/test/itkVnlFFTTest.cxx
      Modules/Filtering/FFT/test/itkVnlFFTWD_RealFFTTest.cxx
      Modules/Filtering/FFT/test/itkVnlFFTWF_FFTTest.cxx
      Modules/Filtering/FFT/test/itkVnlFFTWF_RealFFTTest.cxx
      Modules/Filtering/FFT/test/itkVnlRealFFTTest.cxx
    </FileList>

    <!--**
    ** If the migration can be accomplished by a simple string
    ** substitution, then use the following construct to define
    ** the substitution rule.
    **
    ** <MigrationFix-Automatic>
    **   <Old>
    **     <![CDATA[MipsleledName]]>
    **   </Old>
    **   <New>
    **     <![CDATA[MisspelledName]]>
    **   </New>
    ** </MigrationFix-Automatic>
    **-->

    <!--**
    ** If the migration can NOT be accomplished by a simple string
    ** substitution, but potential problem spots can be identified,
    ** use the following construct to define a migration flag rule.
    **
    ** <MigrationFix-Manual>
    **   OldFunctionName
    ** </MigrationFix-Manual>
    **-->

</Change>
