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
Container Registry
Model registry
Operate
Environments
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
Antoine Belvire
otb
Commits
c818cf85
Commit
c818cf85
authored
16 years ago
by
Emmanuel Christophe
Browse files
Options
Downloads
Plain Diff
MRG
parents
23dc28c8
93e66a5a
No related branches found
No related tags found
No related merge requests found
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
Code/Projections/otbGenericRSTransform.h
+18
-23
18 additions, 23 deletions
Code/Projections/otbGenericRSTransform.h
Code/Projections/otbGenericRSTransform.txx
+6
-10
6 additions, 10 deletions
Code/Projections/otbGenericRSTransform.txx
with
24 additions
and
33 deletions
Code/Projections/otbGenericRSTransform.h
+
18
−
23
View file @
c818cf85
...
...
@@ -75,6 +75,7 @@ namespace otb
typedef
itk
::
Transform
<
double
,
2
,
2
>
GenericTransformType
;
typedef
typename
GenericTransformType
::
Pointer
GenericTransformPointerType
;
typedef
otb
::
CompositeTransform
<
GenericTransformType
,
GenericTransformType
>
TransformType
;
typedef
typename
TransformType
::
Pointer
TransformPointerType
;
// typedef itk::MetaDataDictionary MetaDataDictionary;
// typedef itk::SmartPointer<MetaDataDictionary> MetaDataDictionaryPointer;
...
...
@@ -111,46 +112,37 @@ namespace otb
const
itk
::
MetaDataDictionary
&
GetInputDictionary
()
const
{
return
*
m_InputDictionary
;
return
m_InputDictionary
;
}
void
SetInputDictionary
(
const
itk
::
MetaDataDictionary
&
dictionary
)
{
if
(
m_InputDictionary
==
NULL
)
{
m_InputDictionary
=
new
itk
::
MetaDataDictionary
;
}
*
m_InputDictionary
=
dictionary
;
m_InputDictionary
=
dictionary
;
this
->
Modified
();
}
const
itk
::
MetaDataDictionary
&
GetOutputDictionary
()
const
{
return
*
m_OutputDictionary
;
return
m_OutputDictionary
;
}
void
SetOutputDictionary
(
itk
::
MetaDataDictionary
&
dictionary
)
{
if
(
m_OutputDictionary
==
NULL
)
{
m_OutputDictionary
=
new
itk
::
MetaDataDictionary
;
}
*
m_OutputDictionary
=
dictionary
;
m_OutputDictionary
=
dictionary
;
this
->
Modified
();
}
itkGetMacro
(
InputKeywordList
,
ImageKeywordlist
);
void
SetInputKeywordList
(
ImageKeywordlist
kwl
)
void
SetInputKeywordList
(
const
ImageKeywordlist
&
kwl
)
{
this
->
m_InputKeywordList
=
kwl
;
this
->
Modified
();
}
itkGetMacro
(
OutputKeywordList
,
ImageKeywordlist
);
void
SetOutputKeywordList
(
ImageKeywordlist
kwl
)
void
SetOutputKeywordList
(
const
ImageKeywordlist
&
kwl
)
{
this
->
m_OutputKeywordList
=
kwl
;
this
->
Modified
();
...
...
@@ -192,7 +184,7 @@ namespace otb
itkGetConstReferenceMacro
(
OutputSpacing
,
SpacingType
);
/** Methods prototypes */
virtual
const
TransformType
*
GetTransform
()
const
;
virtual
const
TransformType
*
GetTransform
()
const
;
OutputPointType
TransformPoint
(
const
InputPointType
&
point
)
const
;
...
...
@@ -202,10 +194,13 @@ namespace otb
protected
:
GenericRSTransform
();
virtual
~
GenericRSTransform
()
{};
virtual
void
Modified
()
{
delete
m_InputDictionary
;
delete
m_OutputDictionary
;
}
;
this
->
Superclass
::
Modified
()
;
m_TransformUpToDate
=
false
;
}
private
:
GenericRSTransform
(
const
Self
&
);
//purposely not implemented
...
...
@@ -214,8 +209,8 @@ namespace otb
ImageKeywordlist
m_InputKeywordList
;
ImageKeywordlist
m_OutputKeywordList
;
itk
::
MetaDataDictionary
*
m_InputDictionary
;
itk
::
MetaDataDictionary
*
m_OutputDictionary
;
itk
::
MetaDataDictionary
m_InputDictionary
;
itk
::
MetaDataDictionary
m_OutputDictionary
;
std
::
string
m_InputProjectionRef
;
std
::
string
m_OutputProjectionRef
;
...
...
@@ -226,11 +221,11 @@ namespace otb
SpacingType
m_OutputSpacing
;
OriginType
m_OutputOrigin
;
TransformType
*
m_Transform
;
Transform
Pointer
Type
m_Transform
;
GenericTransformPointerType
m_InputTransform
;
GenericTransformPointerType
m_OutputTransform
;
bool
reinstanciate
Transform
;
bool
m_
Transform
UpToDate
;
};
...
...
This diff is collapsed.
Click to expand it.
Code/Projections/otbGenericRSTransform.txx
+
6
−
10
View file @
c818cf85
...
...
@@ -43,9 +43,7 @@ GenericRSTransform<TScalarType, NInputDimensions, NOutputDimensions>
m_Transform = NULL;
m_InputTransform = NULL;
m_OutputTransform = NULL;
m_InputDictionary = NULL;
m_OutputDictionary = NULL;
reinstanciateTransform=true;
m_TransformUpToDate = false;
}
...
...
@@ -197,7 +195,7 @@ GenericRSTransform<TScalarType, NInputDimensions, NOutputDimensions>
::GetTransform() const
{
itkDebugMacro("returning MapProjection address " << this->m_Transform );
if ((
reinstanciate
Transform) || (m_Transform
== NULL
))
if ((
!m_
Transform
UpToDate
) || (m_Transform
.IsNull()
))
{
itkExceptionMacro(<<"m_Transform not up-to-date, call InstanciateTransform() first");
}
...
...
@@ -217,10 +215,6 @@ void
GenericRSTransform<TScalarType, NInputDimensions, NOutputDimensions>
::InstanciateTransform(void)
{
assert(m_InputDictionary != NULL);
assert(m_OutputDictionary != NULL);
m_Transform = TransformType::New();
//If the information was not specified by the user, it is filled from the metadata
...
...
@@ -230,12 +224,12 @@ GenericRSTransform<TScalarType, NInputDimensions, NOutputDimensions>
if (m_InputKeywordList.GetSize() == 0)
{
ossimKeywordlist kwl;
itk::ExposeMetaData<ossimKeywordlist>(
*
m_InputDictionary, MetaDataKey::OSSIMKeywordlistKey, kwl );
itk::ExposeMetaData<ossimKeywordlist>(m_InputDictionary, MetaDataKey::OSSIMKeywordlistKey, kwl );
m_InputKeywordList.SetKeywordlist(kwl);
}
if (m_InputProjectionRef.empty())
{
itk::ExposeMetaData<std::string>(
*
m_InputDictionary, MetaDataKey::ProjectionRefKey, m_InputProjectionRef );
itk::ExposeMetaData<std::string>(m_InputDictionary, MetaDataKey::ProjectionRefKey, m_InputProjectionRef );
}
...
...
@@ -351,6 +345,8 @@ GenericRSTransform<TScalarType, NInputDimensions, NOutputDimensions>
m_Transform->SetFirstTransform(m_InputTransform);
m_Transform->SetSecondTransform(m_OutputTransform);
m_TransformUpToDate = true;
}
...
...
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