Skip to content
GitLab
Menu
Projects
Groups
Snippets
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
Open sidebar
Main Repositories
otb
Commits
c2690e5e
Commit
c2690e5e
authored
Mar 09, 2022
by
Julien Osman
Browse files
ENH: Group the output parameters (out.xml, out.mean, etc)
parent
daf85237
Pipeline
#9950
failed with stages
in 98 minutes and 30 seconds
Changes
2
Pipelines
1
Hide whitespace changes
Inline
Side-by-side
Modules/Applications/AppClassification/app/otbComputeImagesStatistics.cxx
View file @
c2690e5e
...
...
@@ -74,31 +74,37 @@ private:
SetParameterDescription
(
"bv"
,
"Background value to ignore in computation of statistics."
);
MandatoryOff
(
"bv"
);
AddParameter
(
ParameterType_OutputFilename
,
"out"
,
"Output XML file"
);
SetParameterDescription
(
"out"
,
"XML filename where the statistics are saved for future reuse."
);
MandatoryOff
(
"out"
);
AddParameter
(
ParameterType_Group
,
"out"
,
"Optional outputs"
);
AddParameter
(
ParameterType_
String
,
"mean"
,
"Mean pixel Valu
e"
);
SetParameterDescription
(
"
mean"
,
"Mean pixel value
"
);
SetParameterRole
(
"mean"
,
Role_Output
);
AddParameter
(
ParameterType_
OutputFilename
,
"out.xml"
,
"Output XML fil
e"
);
SetParameterDescription
(
"
out.xml"
,
"XML filename where the statistics are saved for future reuse.
"
);
MandatoryOff
(
"out.xml"
);
AddParameter
(
ParameterType_String
,
"min"
,
"Min pixel Value"
);
SetParameterDescription
(
"min"
,
"Minimum pixel value"
);
SetParameterRole
(
"min"
,
Role_Output
);
AddParameter
(
ParameterType_String
,
"out.mean"
,
"Mean pixel Value"
);
SetParameterDescription
(
"out.mean"
,
"Mean pixel value."
);
SetParameterRole
(
"out.mean"
,
Role_Output
);
MandatoryOff
(
"out.mean"
);
AddParameter
(
ParameterType_String
,
"max"
,
"Max pixel Value"
);
SetParameterDescription
(
"max"
,
"Maximum pixel value"
);
SetParameterRole
(
"max"
,
Role_Output
);
AddParameter
(
ParameterType_String
,
"out.min"
,
"Min pixel Value"
);
SetParameterDescription
(
"out.min"
,
"Minimum pixel value."
);
SetParameterRole
(
"out.min"
,
Role_Output
);
MandatoryOff
(
"out.min"
);
AddParameter
(
ParameterType_String
,
"std"
,
"Standard deviation of pixel Value"
);
SetParameterDescription
(
"std"
,
"Standard deviation of pixel value"
);
SetParameterRole
(
"std"
,
Role_Output
);
AddParameter
(
ParameterType_String
,
"out.max"
,
"Max pixel Value"
);
SetParameterDescription
(
"out.max"
,
"Maximum pixel value."
);
SetParameterRole
(
"out.max"
,
Role_Output
);
MandatoryOff
(
"out.max"
);
AddParameter
(
ParameterType_String
,
"out.std"
,
"Standard deviation of pixel Value"
);
SetParameterDescription
(
"out.std"
,
"Standard deviation of pixel value."
);
SetParameterRole
(
"out.std"
,
Role_Output
);
MandatoryOff
(
"out.std"
);
AddRAMParameter
();
// Doc example parameter settings
SetDocExampleParameterValue
(
"il"
,
"QB_1_ortho.tif"
);
SetDocExampleParameterValue
(
"out"
,
"EstimateImageStatisticsQB1.xml"
);
SetDocExampleParameterValue
(
"out
.xml
"
,
"EstimateImageStatisticsQB1.xml"
);
SetOfficialDocLink
();
}
...
...
@@ -260,17 +266,17 @@ private:
oss_min
<<
totalMinPerBand
;
oss_max
<<
totalMaxPerBand
;
oss_std
<<
stddev
;
SetParameterString
(
"mean"
,
oss_mean
.
str
());
SetParameterString
(
"min"
,
oss_min
.
str
());
SetParameterString
(
"max"
,
oss_max
.
str
());
SetParameterString
(
"std"
,
oss_std
.
str
());
SetParameterString
(
"
out.
mean"
,
oss_mean
.
str
());
SetParameterString
(
"
out.
min"
,
oss_min
.
str
());
SetParameterString
(
"
out.
max"
,
oss_max
.
str
());
SetParameterString
(
"
out.
std"
,
oss_std
.
str
());
if
(
HasValue
(
"out"
))
if
(
HasValue
(
"out
.xml
"
))
{
// Write the Statistics via the statistic writer
typedef
otb
::
StatisticsXMLFileWriter
<
MeasurementType
>
StatisticsWriter
;
StatisticsWriter
::
Pointer
writer
=
StatisticsWriter
::
New
();
writer
->
SetFileName
(
GetParameterString
(
"out"
));
writer
->
SetFileName
(
GetParameterString
(
"out
.xml
"
));
writer
->
AddInput
(
"mean"
,
totalMeanPerBand
);
writer
->
AddInput
(
"min"
,
totalMinPerBand
);
writer
->
AddInput
(
"max"
,
totalMaxPerBand
);
...
...
Modules/Applications/AppClassification/test/CMakeLists.txt
View file @
c2690e5e
...
...
@@ -736,7 +736,7 @@ endif()
otb_test_application
(
NAME apTvClComputeImagesStatisticsQB1
APP ComputeImagesStatistics
OPTIONS -il
${
INPUTDATA
}
/Classification/QB_1_ortho.tif
-out
${
TEMP
}
/apTvClEstimateImageStatisticsQB1.xml
-out
.xml
${
TEMP
}
/apTvClEstimateImageStatisticsQB1.xml
VALID --compare-ascii
${
NOTOL
}
${
OTBAPP_BASELINE_FILES
}
/clImageStatisticsQB1.xml
${
TEMP
}
/apTvClEstimateImageStatisticsQB1.xml
)
...
...
@@ -746,7 +746,7 @@ otb_test_application(NAME apTvClComputeImagesStatisticsQB456
OPTIONS -il
${
INPUTDATA
}
/Classification/QB_4_extract.tif
${
INPUTDATA
}
/Classification/QB_5_extract.tif
${
INPUTDATA
}
/Classification/QB_6_extract.tif
-out
${
TEMP
}
/apTvClEstimateImageStatisticsQB456.xml
-out
.xml
${
TEMP
}
/apTvClEstimateImageStatisticsQB456.xml
VALID --compare-ascii
${
NOTOL
}
${
OTBAPP_BASELINE_FILES
}
/clImageStatisticsQB456.xml
${
TEMP
}
/apTvClEstimateImageStatisticsQB456.xml
)
...
...
@@ -756,7 +756,7 @@ otb_test_application(NAME apTvClComputeImagesStatisticsQB123
OPTIONS -il
${
INPUTDATA
}
/Classification/QB_1_ortho.tif
${
INPUTDATA
}
/Classification/QB_2_ortho.tif
${
INPUTDATA
}
/Classification/QB_3_ortho.tif
-out
${
TEMP
}
/apTvClEstimateImageStatisticsQB123.xml
-out
.xml
${
TEMP
}
/apTvClEstimateImageStatisticsQB123.xml
VALID --compare-ascii
${
NOTOL
}
${
OTBAPP_BASELINE_FILES
}
/clImageStatisticsQB123.xml
${
TEMP
}
/apTvClEstimateImageStatisticsQB123.xml
)
...
...
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment