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
28de0d21
Commit
28de0d21
authored
14 years ago
by
Otmane Lahlou
Browse files
Options
Downloads
Patches
Plain Diff
ENH : simplify generic rs transform filter
parent
3b60f38c
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/otbGenericRSResampleImageFilter.h
+15
-18
15 additions, 18 deletions
Code/Projections/otbGenericRSResampleImageFilter.h
Code/Projections/otbGenericRSResampleImageFilter.txx
+2
-18
2 additions, 18 deletions
Code/Projections/otbGenericRSResampleImageFilter.txx
with
17 additions
and
36 deletions
Code/Projections/otbGenericRSResampleImageFilter.h
+
15
−
18
View file @
28de0d21
...
@@ -20,7 +20,6 @@
...
@@ -20,7 +20,6 @@
#include
"itkImageToImageFilter.h"
#include
"itkImageToImageFilter.h"
#include
"otbOptResampleImageFilter.h"
#include
"otbOptResampleImageFilter.h"
#include
"itkLinearInterpolateImageFunction.h"
#include
"otbGenericRSTransform.h"
#include
"otbGenericRSTransform.h"
...
@@ -56,7 +55,6 @@ public:
...
@@ -56,7 +55,6 @@ public:
/** Typedef parameters*/
/** Typedef parameters*/
typedef
TInputImage
InputImageType
;
typedef
TInputImage
InputImageType
;
typedef
typename
InputImageType
::
PointType
PointType
;
typedef
TOutputImage
OutputImageType
;
typedef
TOutputImage
OutputImageType
;
typedef
TDeormationField
DeformationFieldType
;
typedef
TDeormationField
DeformationFieldType
;
...
@@ -70,9 +68,7 @@ public:
...
@@ -70,9 +68,7 @@ public:
typedef
typename
ResamplerType
::
IndexType
IndexType
;
typedef
typename
ResamplerType
::
IndexType
IndexType
;
typedef
typename
ResamplerType
::
RegionType
RegionType
;
typedef
typename
ResamplerType
::
RegionType
RegionType
;
typedef
typename
ResamplerType
::
InterpolatorType
InterpolatorType
;
typedef
typename
ResamplerType
::
InterpolatorType
InterpolatorType
;
typedef
typename
ResamplerType
::
DefaultInterpolatorType
DefaultInterpolatorType
;
/** Specialisation of OptResampleFilter with a remote
/** Specialisation of OptResampleFilter with a remote
* sensing transform
* sensing transform
*/
*/
...
@@ -121,12 +117,20 @@ public:
...
@@ -121,12 +117,20 @@ public:
otbGetObjectMemberConstMacro
(
Resampler
,
Interpolator
,
const
InterpolatorType
*
);
otbGetObjectMemberConstMacro
(
Resampler
,
Interpolator
,
const
InterpolatorType
*
);
/** Set/Get for input and output projections. */
/** Set/Get for input and output projections. */
itkSetStringMacro
(
InputProjectionRef
);
void
SetInputProjectionRef
(
const
std
::
string
&
ref
)
itkGetStringMacro
(
InputProjectionRef
);
{
m_Transform
->
SetOutputProjectionRef
(
ref
);
this
->
Modified
();
}
otbGetObjectMemberMacro
(
Transform
,
InputProjectionRef
,
std
::
string
);
void
SetOutputProjectionRef
(
const
std
::
string
&
ref
)
{
m_Transform
->
SetInputProjectionRef
(
ref
);
this
->
Modified
();
}
otbGetObjectMemberMacro
(
Transform
,
OutputProjectionRef
,
std
::
string
);
itkSetStringMacro
(
OutputProjectionRef
);
itkGetStringMacro
(
OutputProjectionRef
);
/** Set/Get Input Keywordlist*/
/** Set/Get Input Keywordlist*/
void
SetInputKeywordList
(
const
ImageKeywordlist
&
kwl
)
void
SetInputKeywordList
(
const
ImageKeywordlist
&
kwl
)
{
{
...
@@ -161,18 +165,11 @@ protected:
...
@@ -161,18 +165,11 @@ protected:
virtual
void
GenerateOutputInformation
();
virtual
void
GenerateOutputInformation
();
virtual
void
GenerateInputRequestedRegion
();
virtual
void
GenerateInputRequestedRegion
();
// Method to instanciate the Generic RS transform
void
UpdateTransform
();
private
:
private
:
GenericRSResampleImageFilter
(
const
Self
&
);
//purposely not implemented
GenericRSResampleImageFilter
(
const
Self
&
);
//purposely not implemented
void
operator
=
(
const
Self
&
);
//purposely not implemented
void
operator
=
(
const
Self
&
);
//purposely not implemented
// GenericRSTransform Parameters
std
::
string
m_InputProjectionRef
;
std
::
string
m_OutputProjectionRef
;
// Filters pointers
// Filters pointers
ResamplerPointerType
m_Resampler
;
ResamplerPointerType
m_Resampler
;
GenericRSTransformPointerType
m_Transform
;
GenericRSTransformPointerType
m_Transform
;
...
...
This diff is collapsed.
Click to expand it.
Code/Projections/otbGenericRSResampleImageFilter.txx
+
2
−
18
View file @
28de0d21
...
@@ -81,26 +81,10 @@ GenericRSResampleImageFilter<TInputImage, TOutputImage, TDeformationField>
...
@@ -81,26 +81,10 @@ GenericRSResampleImageFilter<TInputImage, TOutputImage, TDeformationField>
// Expose the input metadata to the output
// Expose the input metadata to the output
itk::MetaDataDictionary& dict = this->GetOutput()->GetMetaDataDictionary();
itk::MetaDataDictionary& dict = this->GetOutput()->GetMetaDataDictionary();
itk::EncapsulateMetaData<std::string>(dict, MetaDataKey::ProjectionRefKey,
m_Out
putProjectionRef);
itk::EncapsulateMetaData<std::string>(dict, MetaDataKey::ProjectionRefKey,
this->GetIn
putProjectionRef
()
);
outputPtr->SetMetaDataDictionary(dict);
outputPtr->SetMetaDataDictionary(dict);
}
}
template <class TInputImage, class TOutputImage, class TDeformationField>
void
GenericRSResampleImageFilter<TInputImage, TOutputImage, TDeformationField>
::UpdateTransform()
{
// Get the input image
const InputImageType* input = this->GetInput();
// Instanciate the RS Transform
m_Transform->SetOutputProjectionRef(input->GetProjectionRef());
m_Transform->SetInputProjectionRef(m_OutputProjectionRef);
m_Transform->SetOutputKeywordList(input->GetImageKeywordlist());
m_Transform->SetInputKeywordList(this->GetOutputKeywordList());
m_Transform->InstanciateTransform();
}
template <class TInputImage, class TOutputImage, class TDeformationField>
template <class TInputImage, class TOutputImage, class TDeformationField>
void
void
GenericRSResampleImageFilter<TInputImage, TOutputImage, TDeformationField>
GenericRSResampleImageFilter<TInputImage, TOutputImage, TDeformationField>
...
@@ -116,7 +100,7 @@ GenericRSResampleImageFilter<TInputImage, TOutputImage, TDeformationField>
...
@@ -116,7 +100,7 @@ GenericRSResampleImageFilter<TInputImage, TOutputImage, TDeformationField>
RegionType requestedRegion = outputPtr->GetRequestedRegion();
RegionType requestedRegion = outputPtr->GetRequestedRegion();
// Instanciate the RS transform
// Instanciate the RS transform
this->Upd
ateTransform();
m_Transform->Instanci
ateTransform();
// Generate input requested region
// Generate input requested region
m_Resampler->SetInput(inputPtr);
m_Resampler->SetInput(inputPtr);
...
...
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