Commit d76258da authored by Guillaume Pasero's avatar Guillaume Pasero

REFAC: use improved itkWarpImageFilter rather than otb clone

parent 16b22cbf
......@@ -21,14 +21,14 @@
#ifndef otbStreamingWarpImageFilter_h
#define otbStreamingWarpImageFilter_h
#include "otbWarpImageFilter.h"
#include "itkWarpImageFilter.h"
#include "otbStreamingTraits.h"
namespace otb
{
/** \class StreamingWarpImageFilter
* \brief This class acts like the otb::WarpImageFilter, but it does not request the largest possible region of the image to warp.
* \brief This class acts like the itk::WarpImageFilter, but it does not request the largest possible region of the image to warp.
*
* Instead, the user should assess the maximum displacement in the displacement field and set it via the SetMaximumDisplacement() method.
*
......@@ -50,12 +50,12 @@ namespace otb
template <class TInputImage, class TOutputImage, class TDisplacementField>
class ITK_EXPORT StreamingWarpImageFilter
: public otb::WarpImageFilter<TInputImage, TOutputImage, TDisplacementField>
: public itk::WarpImageFilter<TInputImage, TOutputImage, TDisplacementField>
{
public:
/** Standard class typedefs. */
typedef StreamingWarpImageFilter Self;
typedef otb::WarpImageFilter<TInputImage, TOutputImage, TDisplacementField> Superclass;
typedef itk::WarpImageFilter<TInputImage, TOutputImage, TDisplacementField> Superclass;
typedef itk::SmartPointer<Self> Pointer;
typedef itk::SmartPointer<const Self> ConstPointer;
......
......@@ -44,6 +44,8 @@ void
StreamingWarpImageFilter<TInputImage, TOutputImage, TDisplacementField>
::GenerateInputRequestedRegion()
{
Superclass::GenerateInputRequestedRegion();
// Get the input and displacement field pointers
InputImageType * inputPtr
= const_cast<InputImageType *>(this->GetInput());
......@@ -228,6 +230,11 @@ StreamingWarpImageFilter<TInputImage, TOutputImage, TDisplacementField>
noDataValue.resize(this->GetOutput()->GetNumberOfComponentsPerPixel(),0.0);
}
PixelType edgePadding = this->GetEdgePaddingValue();
if (itk::NumericTraits<PixelType>::GetLength(edgePadding) != this->GetOutput()->GetNumberOfComponentsPerPixel())
{
itk::NumericTraits<PixelType>::SetLength(edgePadding,this->GetOutput()->GetNumberOfComponentsPerPixel());
this->SetEdgePaddingValue(edgePadding);
}
for (unsigned int i=0; i<noDataValueAvailable.size() ; ++i)
{
if (!noDataValueAvailable[i])
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment