Skip to content
Snippets Groups Projects
Commit f723adbd authored by Julien Michel's avatar Julien Michel
Browse files

COMP: Fixed compilation of the StreamingWarpImageFilter tests and class

parent d1b8f2a9
No related branches found
No related tags found
No related merge requests found
......@@ -49,20 +49,18 @@ public:
itkTypeMacro(StreamingWarpImageFilter, itk::WarpImageFilter);
/** template parameters typedef */
typedef TInputImage InputImageType;
typedef InputImageType::Pointer InputImagePointerType;
typedef TOutputImage OutputImageType;
typedef typename OutputImageType::Pointer OutputImagePointerType;
typedef TDeformationField DeformationFieldType;
typedef DeformationFieldType::PixelType DeformationValueType;
typedef typename DeformationFieldType::Pointer DeformationFieldPointerType;
typedef TInputImage InputImageType;
typedef typename InputImageType::Pointer InputImagePointerType;
typedef TOutputImage OutputImageType;
typedef typename OutputImageType::Pointer OutputImagePointerType;
typedef TDeformationField DeformationFieldType;
typedef typename DeformationFieldType::PixelType DeformationValueType;
typedef typename DeformationFieldType::Pointer DeformationFieldPointerType;
/**
* This filters requires only a part of the input and of the deformation field to
* produce its output. As such, we need to overload the GenerateInputRequestedRegion() method.
*/
virtual void GenerateInputRequestedRegion() ;
/** Accessors */
itkSetMacro(MaximumDeformation,DeformationValueType);
itkGetConstReferenceMacro(MaximumDeformation,DeformationValueType);
protected:
/** Constructor */
StreamingWarpImageFilter();
......@@ -70,17 +68,18 @@ protected:
virtual ~StreamingWarpImageFilter() {};
/** PrintSelf */
void PrintSelf(std::ostream& os, itk::Indent indent) const;
/**
* This filters requires only a part of the input and of the deformation field to
* produce its output. As such, we need to overload the GenerateInputRequestedRegion() method.
*/
virtual void GenerateInputRequestedRegion() ;
/** Accessors */
itkSetMacro(MaximumDeformation,DeformationValueType);
itkGetConstReferenceMacro(MaximumDeformation,DeformationValueType);
private:
StreamingWarpImageFilter(const Self&); //purposely not implemented
void operator=(const Self&); //purposely not implemented
// Assesment of the maximum deformation for streaming
DeformationValueType m_MaximumDeformation;s
DeformationValueType m_MaximumDeformation;
};
} // end namespace otb
......
......@@ -31,8 +31,6 @@ template<class TInputImage, class TOutputImage, class TDeformationField>
StreamingWarpImageFilter<TInputImage,TOutputImage,TDeformationField>
::StreamingWarpImageFilter()
{
// Default neighborhood interpolation radius is one pixel
m_InterpolatorNeighborhoodRadius = 1 ;
// Fill the default maximum deformation
m_MaximumDeformation.SetSize(InputImageType::ImageDimension);
m_MaximumDeformation.Fill(1);
......@@ -59,7 +57,7 @@ StreamingWarpImageFilter<TInputImage,TOutputImage,TDeformationField>
// Compute the security margin radius
typename InputImageType::SizeType radius;
typename InputImageType::SpacingType sapcing = inputPtr->GetSpacing();
typename InputImageType::SpacingType spacing = inputPtr->GetSpacing();
// Add the padding due to the interpolator
unsigned int interpolatorRadius = StreamingTraits<typename Superclass::InputImageType>::CalculateNeededRadiusForInterpolator(this->GetInterpolator());
......@@ -67,7 +65,7 @@ StreamingWarpImageFilter<TInputImage,TOutputImage,TDeformationField>
// Compute the margin due to the maximum deformation value and interpolator radius
for(unsigned int i = 0; i<InputImageType::ImageDimension;++i)
{
radius[i]=interpolatorRadius + static_cast<unsigned int>(vcl_ceil(m_MaximumDeformation/spacing[i]));
radius[i]=interpolatorRadius + static_cast<unsigned int>(vcl_ceil(m_MaximumDeformation[i]/spacing[i]));
}
otbMsgDevMacro(<<"WarpImageFilter: MaximumDeformation: "<<m_MaximumDeformation<<", interpolator radius: "<<interpolatorRadius<<", total radius: "<<radius);
......@@ -95,7 +93,7 @@ StreamingWarpImageFilter<TInputImage,TOutputImage,TDeformationField>
inputPtr->SetRequestedRegion( inputRequestedRegion );
// build an exception
InvalidRequestedRegionError e(__FILE__, __LINE__);
itk::InvalidRequestedRegionError e(__FILE__, __LINE__);
e.SetLocation(ITK_LOCATION);
e.SetDescription("Requested region is (at least partially) outside the largest possible region.");
e.SetDataObject(inputPtr);
......@@ -109,8 +107,7 @@ StreamingWarpImageFilter<TInputImage,TOutputImage,TDeformationField>
::PrintSelf(std::ostream& os, itk::Indent indent) const
{
Superclass::PrintSelf(os,indent);
os << indent << "m_InterpolatorNeighborhoodRadius: " << m_InterpolatorNeighborhoodRadius<<std::endl;
os << indent << "m_AddedRadius: " <<m_AddedRadius<< std::endl;
os << indent << "Maximum deformation: " << m_MaximumDeformation<<std::endl;
}
......
......@@ -20,7 +20,7 @@
#include "otbImageFileReader.h"
#include "otbStreamingImageFileWriter.h"
#include "itkWarpImageFilter.h"
#include "otbStreamingWarpImageFilter.h"
int otbStreamingWarpImageFilter(int argc, char* argv[])
......@@ -52,9 +52,9 @@ int otbStreamingWarpImageFilter(int argc, char* argv[])
typedef otb::StreamingImageFileWriter<ImageType> WriterType;
// Objects creation
DeformationReaderType::Pointer deformationReader::New();
ReaderType::Pointer movingReader = ReaderType::New();
WriterType::pointer writer WriterType::New();
DeformationReaderType::Pointer deformationReader = DeformationReaderType::New();
ReaderType::Pointer reader = ReaderType::New();
WriterType::Pointer writer = WriterType::New();
ImageWarperType::Pointer warper = ImageWarperType::New();
// Reading
......
......@@ -20,7 +20,7 @@
#include "otbImageFileReader.h"
#include "otbStreamingImageFileWriter.h"
#include "itkWarpImageFilter.h"
#include "otbStreamingWarpImageFilter.h"
int otbStreamingWarpImageFilterNew(int argc, char* argv[])
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment