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

<!--**
**
** FixedConvolutionImageFilter.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>
      Fixed ConvolutionImageFilter
    </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[
      In convolution, the kernel is effectively flipped and swept across an
      image, and at each pixel the dot product between the kernel centered
      at the pixel and the image to convolve is computed and
      stored. Previously, the ConvolutionImageFilter was not performing the
      flip, and the existing tests were incorrect. This patch makes the
      ConvolutionImageFilter produce the correct output according to the
      predominant definition of the convolution operation, and the tests and
      test data have been modified accordingly.

      In addition, the method SetImageKernelInput() has been renamed to
      SetKernelImage() to be consistent with other filters such as
      MaskImageFilter and the registration classes.

      ]]>
    </Description>

    <!--**
    ** Sample code snippets
    ** Extracted from git diff of changed files in Examples and Testing
    **-->
    <SampleCode>
      <Old>
        <![CDATA[
        typedef itk::ConvolutionImage< ImageType > ConvolutionFilterType;
        ConvolutionFilterType::Pointer convolutionFilter = ConvolutionFilterType::New();
        convolutionFilter->SetInput( inputImage );
        convolutionFilter->SetImageKernelInput( kernelImage );
        convolutionFilter->Update();
        ]]>
      </Old>

      <New>
        <![CDATA[
        #include <itkFlipImageFilter.h>

        // If you're existing code produced desired results, then you will need
        // to flip the kernel prior to setting it as the kernel image in the
        // convolution filter (assuming the kernel is not symmetric about each axis).
        typedef FlipImageFilter< TImage > FlipperType;
        typename FlipperType::Pointer flipper = FlipperType::New();
        typename FlipperType::FlipAxesArrayType axesArray;
        axesArray.Fill( true );
        flipper->SetFlipAxes( axesArray );
        flipper->SetInput( kernelImage );

        typedef itk::ConvolutionImage< ImageType > ConvolutionFilterType;
        ConvolutionFilterType::Pointer convolutionFilter = ConvolutionFilterType::New();
        convolutionFilter->SetInput( inputImage );
        convolutionFilter->SetKernelImage( kernelImage );
        convolutionFilter->Update();
        ]]>
      </New>

    </SampleCode>

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

    <!--**
    ** List of all changed files from the topic branch
    **-->
    <FileList>
      Modules/Filtering/Convolution/include/itkConvolutionImageFilter.hxx
      Modules/Filtering/Convolution/test/Baseline/itkConvolutionImageFilterTestSobelX.nrrd.md5
      Modules/Filtering/Convolution/test/Baseline/itkConvolutionImageFilterTestSobelY.nrrd.md5
      Modules/Filtering/Convolution/test/CMakeLists.txt
      Modules/Filtering/Convolution/test/itkConvolutionImageFilterDeltaFunctionTest.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>
