Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
D
diapotb
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
Luc Hermitte
diapotb
Commits
aa00281e
Commit
aa00281e
authored
6 years ago
by
Gaëlle USSEGLIO
Browse files
Options
Downloads
Patches
Plain Diff
UPDATE : Correction into DEMPolygonsAnalysis and Doppler 0 + Compatibility Python2/3 for diapOTB.py
parent
9e481a84
No related branches found
Branches containing commit
No related tags found
Tags containing commit
No related merge requests found
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
app/otbSARDoppler0.cxx
+1
-1
1 addition, 1 deletion
app/otbSARDoppler0.cxx
include/otbSARDEMPolygonsAnalysisImageFilter.txx
+3
-3
3 additions, 3 deletions
include/otbSARDEMPolygonsAnalysisImageFilter.txx
python_src/diapOTB.py
+19
-14
19 additions, 14 deletions
python_src/diapOTB.py
with
23 additions
and
18 deletions
app/otbSARDoppler0.cxx
+
1
−
1
View file @
aa00281e
...
...
@@ -97,7 +97,7 @@ private:
// Define pipeline
corFilter
->
SetInput
(
GetParameterComplexDoubleImage
(
"in"
));
corFilter
->
SetInput
(
GetParameterComplexDoubleImage
(
"in
sar
"
));
// Execute pipeline
corFilter
->
Update
();
...
...
This diff is collapsed.
Click to expand it.
include/otbSARDEMPolygonsAnalysisImageFilter.txx
+
3
−
3
View file @
aa00281e
...
...
@@ -229,7 +229,7 @@ namespace otb
//////// Check Input/Output in function of Functor ////////
//////// The functor can be required a classic image or a vector Image as main output ////////
if (inputPtr->GetNameOfClass()
!=
"VectorImage")
if
(strcmp
(inputPtr->GetNameOfClass()
,
"VectorImage")
!= 0)
{
itkExceptionMacro(<<"Input must be a Vector Image.");
return;
...
...
@@ -245,7 +245,7 @@ namespace otb
unsigned int numberOfEstimatedComponents = m_FunctionOnPolygon->GetNumberOfEstimatedComponents();
if (numberOfEstimatedComponents > 1)
{
if (outputPtr->GetNameOfClass()
!=
"VectorImage")
if
(strcmp
(outputPtr->GetNameOfClass()
,
"VectorImage")
!= 0)
{
itkExceptionMacro(<<"Output must be a Vector Image.");
return;
...
...
@@ -256,7 +256,7 @@ namespace otb
}
else
{
if (outputPtr->GetNameOfClass()
!=
"Image")
if
(strcmp
(outputPtr->GetNameOfClass()
,
"Image")
!= 0)
{
itkExceptionMacro(<<"Output must be a Vector Image.");
return;
...
...
This diff is collapsed.
Click to expand it.
python_src/diapOTB.py
+
19
−
14
View file @
aa00281e
...
...
@@ -20,6 +20,7 @@
# limitations under the License.
#
from
__future__
import
print_function
__author__
=
"
POC-THALES
"
__version__
=
"
0.1
"
...
...
@@ -29,10 +30,15 @@ __last_modified__ = "27/10/2017"
# Imports
import
logging
import
ConfigParser
try
:
from
ConfigParser
import
SafeConfigParser
as
ConfigParser
except
ImportError
:
from
configparser
import
ConfigParser
import
os
import
sys
import
argparse
import
otbApplication
as
otb
logger
=
logging
.
getLogger
(
__name__
)
...
...
@@ -74,11 +80,11 @@ def ConfigCheck(config):
for
option
in
dictOfSections
[
section
]
:
# Check if option exists into section of config
if
not
config
.
has_option
(
section
,
option
)
:
print
option
+
"
is missing for the section
"
+
section
+
"
of the configuration file
"
print
(
option
+
"
is missing for the section
"
+
section
+
"
of the configuration file
"
)
configOk
=
False
else
:
print
section
+
"
is missing into the configuration file
"
print
(
section
+
"
is missing into the configuration file
"
)
configOk
=
False
...
...
@@ -93,18 +99,17 @@ if __name__ == "__main__":
parser
=
argparse
.
ArgumentParser
()
parser
.
add_argument
(
"
configfile
"
,
help
=
"
input conguration file for the application DiapOTB
"
)
args
=
parser
.
parse_args
()
print
args
.
configfile
print
(
args
.
configfile
)
# Read the configuration file
Config
=
ConfigParser
.
ConfigParser
()
Config
=
ConfigParser
()
Config
.
read
(
args
.
configfile
)
configOk
=
ConfigCheck
(
Config
)
# If some values are missing, quit the application
if
not
configOk
:
quit
()
# Get elements from configuration file
master_Image
=
ConfigSectionMap
(
Config
,
"
Global
"
)[
'
master_image_path
'
]
slave_Image
=
ConfigSectionMap
(
Config
,
"
Global
"
)[
'
slave_image_path
'
]
...
...
@@ -123,19 +128,19 @@ if __name__ == "__main__":
# Check if images exist
if
not
os
.
path
.
exists
(
master_Image
)
:
print
master_Image
+
"
does not exists
"
print
(
master_Image
+
"
does not exists
"
)
quit
()
if
not
os
.
path
.
exists
(
slave_Image
)
:
print
slave_Image
+
"
does not exists
"
print
(
slave_Image
+
"
does not exists
"
)
quit
()
if
not
os
.
path
.
exists
(
dem
)
:
print
dem
+
"
does not exists
"
print
(
dem
+
"
does not exists
"
)
quit
()
if
not
os
.
path
.
exists
(
output_dir
):
print
"
The output directory does not exist and will be created
"
print
(
"
The output directory does not exist and will be created
"
)
os
.
makedirs
(
output_dir
)
else
:
print
"
The output directory exists. Some files can be overwritten
"
print
(
"
The output directory exists. Some files can be overwritten
"
)
master_Image_base
=
os
.
path
.
basename
(
master_Image
)
slave_Image_base
=
os
.
path
.
basename
(
slave_Image
)
...
...
@@ -147,7 +152,7 @@ if __name__ == "__main__":
dopFile
.
write
(
"
Doppler for master image :
"
+
os
.
path
.
basename
(
master_Image_base
)
+
"
\n
"
)
dopFile
.
close
()
appDoppler0Master
=
otb
.
Registry
.
CreateApplication
(
"
SARDoppler0
"
)
appDoppler0Master
.
SetParameterString
(
"
in
"
,
master_Image
)
appDoppler0Master
.
SetParameterString
(
"
in
sar
"
,
master_Image
)
appDoppler0Master
.
SetParameterString
(
"
outfile
"
,
os
.
path
.
join
(
output_dir
,
dop_file
))
appDoppler0Master
.
SetParameterInt
(
"
ram
"
,
4000
)
appDoppler0Master
.
ExecuteAndWriteOutput
()
...
...
@@ -157,7 +162,7 @@ if __name__ == "__main__":
dopFile
.
write
(
"
Doppler for slave image :
"
+
os
.
path
.
basename
(
slave_Image_base
)
+
"
\n
"
)
dopFile
.
close
()
appDoppler0Slave
=
otb
.
Registry
.
CreateApplication
(
"
SARDoppler0
"
)
appDoppler0Slave
.
SetParameterString
(
"
in
"
,
slave_Image
)
appDoppler0Slave
.
SetParameterString
(
"
in
sar
"
,
slave_Image
)
appDoppler0Slave
.
SetParameterString
(
"
outfile
"
,
os
.
path
.
join
(
output_dir
,
dop_file
))
appDoppler0Slave
.
SetParameterInt
(
"
ram
"
,
4000
)
appDoppler0Slave
.
ExecuteAndWriteOutput
()
...
...
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