diff --git a/include/itkFFTPadPositiveIndexImageFilter.h b/include/itkFFTPadPositiveIndexImageFilter.h index 79cbd6e..af40698 100644 --- a/include/itkFFTPadPositiveIndexImageFilter.h +++ b/include/itkFFTPadPositiveIndexImageFilter.h @@ -91,8 +91,17 @@ class FFTPadPositiveIndexImageFilter: itkGetConstMacro(SizeGreatestPrimeFactor, SizeValueType); itkSetMacro(SizeGreatestPrimeFactor, SizeValueType); /** Set/get the boundary condition. */ - itkSetMacro(BoundaryCondition, BoundaryConditionPointerType); itkGetConstMacro(BoundaryCondition, BoundaryConditionPointerType); + virtual void SetBoundaryCondition(const BoundaryConditionPointerType boundaryCondition) + { + if ( this->m_BoundaryCondition != boundaryCondition ) + { + this->m_BoundaryCondition = boundaryCondition; + this->m_FFTPadFilter->SetBoundaryCondition(this->m_BoundaryCondition); + this->m_FFTPadFilter->Modified(); + this->Modified(); + } + } protected: FFTPadPositiveIndexImageFilter(); diff --git a/include/itkFFTPadPositiveIndexImageFilter.hxx b/include/itkFFTPadPositiveIndexImageFilter.hxx index 11a880d..c8bfaab 100644 --- a/include/itkFFTPadPositiveIndexImageFilter.hxx +++ b/include/itkFFTPadPositiveIndexImageFilter.hxx @@ -53,6 +53,12 @@ FFTPadPositiveIndexImageFilter< TInputImage, TOutputImage > const typename OutputImageType::RegionType & outputRequestedRegion = outputPtr->GetRequestedRegion(); + typename OutputImageType::RegionType shiftedOutputRequestedRegion; + typename OutputImageType::RegionType::IndexType shiftedRequestedIndex = + outputRequestedRegion.GetIndex() - this->m_ChangeInfoFilter->GetOutputOffset(); + shiftedOutputRequestedRegion.SetIndex(shiftedRequestedIndex); + shiftedOutputRequestedRegion.SetSize(outputRequestedRegion.GetSize()); + // Ask the boundary condition for the input requested region. if ( !m_BoundaryCondition ) { @@ -60,7 +66,7 @@ FFTPadPositiveIndexImageFilter< TInputImage, TOutputImage > } typename InputImageType::RegionType inputRequestedRegion = m_BoundaryCondition->GetInputRequestedRegion( inputLargestPossibleRegion, - outputRequestedRegion ); + shiftedOutputRequestedRegion ); inputPtr->SetRequestedRegion( inputRequestedRegion ); }