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
Sébastien Peillet
otb
Commits
d5573945
Commit
d5573945
authored
7 years ago
by
Marina Bertolino
Browse files
Options
Downloads
Patches
Plain Diff
REFAC: rename paramters (mono->grayscale and default->all)
parent
3fd06b3b
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
Modules/Applications/AppImageUtils/app/otbConvert.cxx
+20
-9
20 additions, 9 deletions
Modules/Applications/AppImageUtils/app/otbConvert.cxx
Modules/Applications/AppImageUtils/test/CMakeLists.txt
+1
-1
1 addition, 1 deletion
Modules/Applications/AppImageUtils/test/CMakeLists.txt
with
21 additions
and
10 deletions
Modules/Applications/AppImageUtils/app/otbConvert.cxx
+
20
−
9
View file @
d5573945
...
...
@@ -98,9 +98,9 @@ private:
"The choice of the output channels can be done with the extended filename, "
"but less easy to handle. To do this, a 'channels' parameter allows you to select "
"the desired bands at the output. There are 3 modes, the available choices are:
\n
"
" *
mono : select first band in the 3 output channels
.
\n
"
" *
grayscale : to display mono image as standard color image
.
\n
"
" * rgb : select 3 bands in the input image (multi-bands).
\n
"
" *
default
: keep all bands.
\n
"
);
" *
all
: keep all bands.
\n
"
);
SetDocLimitations
(
"None"
);
SetDocAuthors
(
"OTB-Team"
);
SetDocSeeAlso
(
"Rescale"
);
...
...
@@ -155,10 +155,12 @@ private:
SetParameterDescription
(
"channels"
,
"It's possible to select the channels "
"of the output image. There are 3 modes, the available choices are:"
);
AddChoice
(
"channels.
default
"
,
"Default mode"
);
SetParameterDescription
(
"channels.
default
"
,
"Select all bands in the input image, (1,1,1)."
);
AddChoice
(
"channels.
all
"
,
"Default mode"
);
SetParameterDescription
(
"channels.
all
"
,
"Select all bands in the input image, (1,1,1)."
);
AddChoice
(
"channels.mono"
,
"Select first band in the 3 output channels."
);
AddChoice
(
"channels.grayscale"
,
"Display mono image as standard color image."
);
AddParameter
(
ParameterType_Int
,
"channels.grayscale.channel"
,
"Grayscale channel"
);
SetDefaultParameterInt
(
"channels.grayscale.channel"
,
1
);
AddChoice
(
"channels.rgb"
,
"Channels selection RGB"
);
SetParameterDescription
(
"channels.rgb"
,
"Select 3 bands in the input image "
...
...
@@ -370,9 +372,18 @@ private:
int
nbChan
=
GetParameterImage
(
"in"
)
->
GetNumberOfComponentsPerPixel
();
std
::
string
channelMode
=
GetParameterString
(
"channels"
);
if
(
channelMode
==
"
mono
"
)
if
(
channelMode
==
"
grayscale
"
)
{
channels
=
{
1
,
1
,
1
};
if
(
GetParameterInt
(
"channels.grayscale.channel"
)
<=
nbChan
)
{
channels
=
{
GetParameterInt
(
"channels.grayscale.channel"
),
GetParameterInt
(
"channels.grayscale.channel"
),
GetParameterInt
(
"channels.grayscale.channel"
)};
}
else
{
itkExceptionMacro
(
<<
"The channel has an invalid index"
);
}
}
else
if
(
channelMode
==
"rgb"
)
{
...
...
@@ -389,7 +400,7 @@ private:
itkExceptionMacro
(
<<
"At least one needed channel has an invalid index"
);
}
}
else
if
(
channelMode
==
"
default
"
)
else
if
(
channelMode
==
"
all
"
)
{
// take all bands
channels
.
resize
(
nbChan
);
...
...
@@ -417,7 +428,7 @@ private:
concatener
=
ListConcatenerFilterType
::
New
();
extractorList
=
ExtractROIFilterListType
::
New
();
const
bool
monoChannel
=
IsParameterEnabled
(
"channels.
mono
"
);
const
bool
monoChannel
=
IsParameterEnabled
(
"channels.
grayscale
"
);
// get band order
std
::
vector
<
int
>
channels
=
GetChannels
();
...
...
This diff is collapsed.
Click to expand it.
Modules/Applications/AppImageUtils/test/CMakeLists.txt
+
1
−
1
View file @
d5573945
...
...
@@ -81,7 +81,7 @@ otb_test_application(NAME apTvUtConvertMonoChannel
APP Convert
OPTIONS -in
${
INPUTDATA
}
/QB_Toulouse_Ortho_PAN.tif
-out
${
TEMP
}
/apTvUtConvertMonoChannelOutput.tif
-channels
mono
-channels
grayscale
-type linear
VALID --compare-image
${
NOTOL
}
${
INPUTDATA
}
/apTvUtConvertMonoChannelOutput.tif
...
...
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