Skip to content
Snippets Groups Projects
Commit 5c6991f2 authored by Cyrille Valladeau's avatar Cyrille Valladeau
Browse files

OUPS : wrong commit, sorry

parent 90f9f683
Branches
Tags
No related merge requests found
......@@ -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
......
......@@ -96,8 +96,8 @@ int otbOrthoRectificationFilter( int argc, char* argv[] )
orthoRectifFilter->SetAverageElevation(10);
writer->SetInput(orthoRectifFilter->GetOutput());
writer->SetTilingStreamDivisions(10);
//writer->SetTilingStreamDivisions();
writer->SetTilingStreamDivisions();
writer->Update();
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment