diff --git a/Code/Projections/otbInverseSensorModel.txx b/Code/Projections/otbInverseSensorModel.txx index 9f724ef4dfe387d7f89ee209969e73ef7ea39946..03ae8963c2fc14048b22bd162b86bb47d86aa266 100644 --- a/Code/Projections/otbInverseSensorModel.txx +++ b/Code/Projections/otbInverseSensorModel.txx @@ -92,7 +92,7 @@ namespace otb itkExceptionMacro(<<"TransformPoint(): Invalid Model pointer m_Model == NULL !"); } - this->m_Model->worldToLineSample(ossimGPoint, ossimDPoint); //"worldToLineSample" appelle la m�thode "lineSampleHeightToWorld" pour prendre en compte l'�l�vation. + this->m_Model->worldToLineSample(ossimGPoint, ossimDPoint); //"worldToLineSample" call "lineSampleHeightToWorld" method for take in care elevation information. OutputPointType outputPoint; diff --git a/Code/Projections/otbOrthoRectificationFilter.h b/Code/Projections/otbOrthoRectificationFilter.h index 011ae349dec515274baf026e7f4ca36350a5e170..14c38a69b1f7ecf5acff519f548321455c2e0217 100644 --- a/Code/Projections/otbOrthoRectificationFilter.h +++ b/Code/Projections/otbOrthoRectificationFilter.h @@ -43,117 +43,116 @@ namespace otb * */ - template <class TInputImage, class TOutputImage, class TMapProjection, class TInterpolatorPrecision=double> - class ITK_EXPORT OrthoRectificationFilter : - public StreamingResampleImageFilter<TInputImage, TOutputImage, TInterpolatorPrecision> - { - public : - /** Standard class typedefs */ - typedef StreamingResampleImageFilter<TInputImage, - TOutputImage, - TInterpolatorPrecision> Superclass; - typedef OrthoRectificationFilter Self; - typedef itk::SmartPointer<Self> Pointer; - typedef itk::SmartPointer<const Self> ConstPointer; - - typedef typename TInputImage::IndexType IndexType; - typedef typename TInputImage::SizeType SizeType; - typedef typename TInputImage::SpacingType SpacingType; - typedef typename TInputImage::PointType PointType; - typedef typename TInputImage::RegionType RegionType; +template <class TInputImage, class TOutputImage, class TMapProjection, class TInterpolatorPrecision=double> +class ITK_EXPORT OrthoRectificationFilter : +public StreamingResampleImageFilter<TInputImage, TOutputImage, TInterpolatorPrecision> +{ + public : + /** Standard class typedefs */ + typedef StreamingResampleImageFilter<TInputImage, + TOutputImage, + TInterpolatorPrecision> Superclass; + typedef OrthoRectificationFilter Self; + typedef itk::SmartPointer<Self> Pointer; + typedef itk::SmartPointer<const Self> ConstPointer; - typedef typename TOutputImage::PixelType OutputPixelType; + typedef typename TInputImage::IndexType IndexType; + typedef typename TInputImage::SizeType SizeType; + typedef typename TInputImage::SpacingType SpacingType; + typedef typename TInputImage::PointType PointType; + typedef typename TInputImage::RegionType RegionType; - typedef TMapProjection MapProjectionType; - typedef typename TMapProjection::Pointer MapProjectionPointerType; + typedef typename TOutputImage::PixelType OutputPixelType; - typedef InverseSensorModel<double> SensorModelType; - typedef typename SensorModelType::Pointer SensorModelPointerType; + typedef TMapProjection MapProjectionType; + typedef typename TMapProjection::Pointer MapProjectionPointerType; - typedef CompositeTransform< MapProjectionType,SensorModelType> CompositeTransformType; - typedef typename CompositeTransformType::Pointer CompositeTransformPointerType; + typedef InverseSensorModel<double> SensorModelType; + typedef typename SensorModelType::Pointer SensorModelPointerType; - /** Method for creation through the object factory. */ - itkNewMacro( Self ); + typedef CompositeTransform< MapProjectionType,SensorModelType> CompositeTransformType; + typedef typename CompositeTransformType::Pointer CompositeTransformPointerType; - /** Run-time type information (and related methods). */ - itkTypeMacro( OrthoRectificationFilter, StreamingResampleImageFilter ); + /** Method for creation through the object factory. */ + itkNewMacro( Self ); - /** Accessors */ - virtual void SetMapProjection (MapProjectionType* _arg) - { - if (this->m_MapProjection != _arg) - { - this->m_MapProjection = _arg; - m_CompositeTransform->SetFirstTransform(_arg); - m_IsComputed = false; - this->Modified(); - } - } + /** Run-time type information (and related methods). */ + itkTypeMacro( OrthoRectificationFilter, StreamingResampleImageFilter ); - itkGetObjectMacro(MapProjection, MapProjectionType); - - /** Specify where are DEM files, and load useful ones */ - virtual void SetDEMDirectory(const std::string& directory) + /** Accessors */ + virtual void SetMapProjection (MapProjectionType* _arg) + { + if (this->m_MapProjection != _arg) { - m_SensorModel->SetDEMDirectory(directory); - this->Modified(); + this->m_MapProjection = _arg; + m_CompositeTransform->SetFirstTransform(_arg); + m_IsComputed = false; + this->Modified(); } + } - /** Methods to enable DEM */ - virtual void EnableDEM() - { - m_SensorModel->EnableDEM(); - this->Modified(); - } + itkGetObjectMacro(MapProjection, MapProjectionType); - /** Methods to desable DEM */ - virtual void DisableDEM() - { - m_SensorModel->DisableDEM(); - this->Modified(); - } + /** Specify where are DEM files, and load useful ones */ + virtual void SetDEMDirectory(const std::string& directory) + { + m_SensorModel->SetDEMDirectory(directory); + this->Modified(); + } + /** Methods to enable DEM */ + virtual void EnableDEM() + { + m_SensorModel->EnableDEM(); + this->Modified(); + } - /** Specify average elevation.*/ - virtual void SetAverageElevation(double elevation) - { - m_SensorModel->SetAverageElevation(elevation); - this->Modified(); - } + /** Methods to desable DEM */ + virtual void DisableDEM() + { + m_SensorModel->DisableDEM(); + this->Modified(); + } + /** Specify average elevation.*/ + virtual void SetAverageElevation(double elevation) + { + m_SensorModel->SetAverageElevation(elevation); + this->Modified(); + } - protected: - OrthoRectificationFilter(); - ~OrthoRectificationFilter(); - void PrintSelf(std::ostream& os, itk::Indent indent) const; - virtual void GenerateInputRequestedRegion(); - virtual void GenerateOutputInformation( void ); + protected: + OrthoRectificationFilter(); + ~OrthoRectificationFilter(); + void PrintSelf(std::ostream& os, itk::Indent indent) const; + + virtual void GenerateInputRequestedRegion(); + virtual void GenerateOutputInformation( void ); - private: - OrthoRectificationFilter(const Self&); //purposely not implemented - void operator=(const Self&); //purposely not implemented + private: + OrthoRectificationFilter(const Self&); //purposely not implemented + void operator=(const Self&); //purposely not implemented - /** Calculate transformation model from sensor model and map projection composition */ - void ComputeResampleTransformationModel(); + /** Calculate transformation model from sensor model and map projection composition */ + void ComputeResampleTransformationModel(); - /** Boolean used to know if transformation model computation is needed */ - bool m_IsComputed; + /** Boolean used to know if transformation model computation is needed */ + bool m_IsComputed; - /** Sensor Model used to transform geographic coordinates in image sensor index */ - SensorModelPointerType m_SensorModel; + /** Sensor Model used to transform geographic coordinates in image sensor index */ + SensorModelPointerType m_SensorModel; - /** Map Projection used to transform cartographic coordinates in geographic coordinates */ - MapProjectionPointerType m_MapProjection; + /** Map Projection used to transform cartographic coordinates in geographic coordinates */ + MapProjectionPointerType m_MapProjection; - /** Composite Transform of Sensor Model and Map Projection, used for Resampler */ - CompositeTransformPointerType m_CompositeTransform; + /** Composite Transform of Sensor Model and Map Projection, used for Resampler */ + CompositeTransformPointerType m_CompositeTransform; - }; +}; } // namespace otb diff --git a/Testing/Code/Projections/otbOrthoRectificationFilter.cxx b/Testing/Code/Projections/otbOrthoRectificationFilter.cxx index fd6c2d175764e2a7f49709386b0f90bd06f0fc57..1c798c7e337d57b07e38d89e6bb93f0dbd654567 100644 --- a/Testing/Code/Projections/otbOrthoRectificationFilter.cxx +++ b/Testing/Code/Projections/otbOrthoRectificationFilter.cxx @@ -29,7 +29,6 @@ #include "otbImageFileReader.h" #include "otbStreamingImageFileWriter.h" #include "otbInverseSensorModel.h" -#include "otbStreamingResampleImageFilter.h" #include "otbOrthoRectificationFilter.h" #include "otbMapProjections.h" @@ -94,6 +93,7 @@ int otbOrthoRectificationFilter( int argc, char* argv[] ) utmMapProjection->SetZone(atoi(argv[9])); utmMapProjection->SetHemisphere(argv[10][0]); orthoRectifFilter->SetMapProjection(utmMapProjection); + orthoRectifFilter->SetAverageElevation(10); writer->SetInput(orthoRectifFilter->GetOutput());