Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
otb
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Package registry
Container registry
Model registry
Operate
Environments
Terraform modules
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
David Youssefi
otb
Commits
eb65a4d2
Commit
eb65a4d2
authored
14 years ago
by
Otmane Lahlou
Browse files
Options
Downloads
Patches
Plain Diff
ENH : simplify the class
parent
1cfa6279
Branches
Branches containing commit
Tags
Tags containing commit
No related merge requests found
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
Code/Projections/otbOrthoRectificationFilter.h
+2
-9
2 additions, 9 deletions
Code/Projections/otbOrthoRectificationFilter.h
Code/Projections/otbOrthoRectificationFilter.txx
+12
-26
12 additions, 26 deletions
Code/Projections/otbOrthoRectificationFilter.txx
with
14 additions
and
35 deletions
Code/Projections/otbOrthoRectificationFilter.h
+
2
−
9
View file @
eb65a4d2
...
...
@@ -76,7 +76,7 @@ public:
itkNewMacro
(
Self
);
/** Run-time type information (and related methods). */
itkTypeMacro
(
OrthoRectificationFilter
,
Streaming
ResampleImageFilter
);
itkTypeMacro
(
OrthoRectificationFilter
,
GenericRS
ResampleImageFilter
);
/** Accessors */
virtual
void
SetMapProjection
(
MapProjectionType
*
arg
)
...
...
@@ -84,7 +84,6 @@ public:
if
(
this
->
m_MapProjection
!=
arg
)
{
this
->
m_MapProjection
=
arg
;
m_IsComputed
=
false
;
this
->
Modified
();
}
}
...
...
@@ -100,19 +99,13 @@ protected:
OrthoRectificationFilter
();
virtual
~
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
/** 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
;
/** Map Projection used to transform cartographic coordinates in geographic coordinates */
MapProjectionPointerType
m_MapProjection
;
...
...
This diff is collapsed.
Click to expand it.
Code/Projections/otbOrthoRectificationFilter.txx
+
12
−
26
View file @
eb65a4d2
...
...
@@ -26,17 +26,13 @@ namespace otb
template <class TInputImage, class TOutputImage, class TMapProjection, class TInterpolatorPrecision>
OrthoRectificationFilter<TInputImage, TOutputImage, TMapProjection, TInterpolatorPrecision>
::OrthoRectificationFilter()
{
m_MapProjection = MapProjectionType::New();
m_IsComputed = false;
}
::OrthoRectificationFilter(): m_MapProjection(NULL)
{}
template <class TInputImage, class TOutputImage, class TMapProjection, class TInterpolatorPrecision>
OrthoRectificationFilter<TInputImage, TOutputImage, TMapProjection, TInterpolatorPrecision>
::~OrthoRectificationFilter()
{
}
{}
template <class TInputImage, class TOutputImage, class TMapProjection, class TInterpolatorPrecision>
void OrthoRectificationFilter<TInputImage, TOutputImage, TMapProjection, TInterpolatorPrecision>
...
...
@@ -51,7 +47,6 @@ void
OrthoRectificationFilter<TInputImage, TOutputImage, TMapProjection, TInterpolatorPrecision>
::GenerateInputRequestedRegion()
{
this->ComputeResampleTransformationModel();
Superclass::GenerateInputRequestedRegion();
}
...
...
@@ -62,25 +57,16 @@ OrthoRectificationFilter<TInputImage, TOutputImage, TMapProjection, TInterpolato
{
// call the superclass' implementation of this method
Superclass::GenerateOutputInformation();
// fill up the metadata information for ProjectionRef
itk::MetaDataDictionary& dict = this->GetOutput()->GetMetaDataDictionary();
std::string projectionRef = m_MapProjection->GetWkt();
itk::EncapsulateMetaData<std::string>(dict, MetaDataKey::ProjectionRefKey, projectionRef);
// Fill the GenericRSTransform with those information
this->SetOutputProjectionRef(projectionRef);
}
template <class TInputImage, class TOutputImage, class TMapProjection, class TInterpolatorPrecision>
void
OrthoRectificationFilter<TInputImage, TOutputImage, TMapProjection, TInterpolatorPrecision>
::ComputeResampleTransformationModel()
{
if (m_IsComputed == false)
if(!m_MapProjection.IsNull() && !m_MapProjection->GetWkt().empty())
{
this->SetInputKeywordList(this->GetInput()->GetImageKeywordlist());
m_IsComputed = true;
// fill up the metadata information for ProjectionRef
itk::MetaDataDictionary& dict = this->GetOutput()->GetMetaDataDictionary();
std::string projectionRef = m_MapProjection->GetWkt();
itk::EncapsulateMetaData<std::string>(dict, MetaDataKey::ProjectionRefKey, projectionRef);
// Fill the GenericRSTransform with those information
this->SetOutputProjectionRef(projectionRef);
}
}
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment