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
0fd65a59
Commit
0fd65a59
authored
8 years ago
by
Rashad Kanavath
Browse files
Options
Downloads
Patches
Plain Diff
ENH: fix check for input values of direction and mode
parent
1120b0d9
No related branches found
Branches containing commit
No related tags found
Tags containing commit
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
Modules/Applications/AppDomainTransform/app/otbDomainTransform.cxx
+26
-22
26 additions, 22 deletions
...pplications/AppDomainTransform/app/otbDomainTransform.cxx
with
26 additions
and
22 deletions
Modules/Applications/AppDomainTransform/app/otbDomainTransform.cxx
+
26
−
22
View file @
0fd65a59
...
@@ -150,11 +150,11 @@ namespace otb
...
@@ -150,11 +150,11 @@ namespace otb
AddParameter
(
ParameterType_Choice
,
AddParameter
(
ParameterType_Choice
,
"dir
ection
"
,
"dir"
,
"dir
ection: forwar
d/inv
erse
"
);
"dir
: fw
d/inv"
);
AddChoice
(
"dir
ection.forwar
d"
,
"f
orwar
d"
);
AddChoice
(
"dir
.fw
d"
,
"f
w
d"
);
AddChoice
(
"dir
ection.inverse
"
,
"inv
erse
"
);
AddChoice
(
"dir
.inv
"
,
"inv"
);
AddParameter
(
ParameterType_OutputImage
,
"out"
,
"Output Image"
);
AddParameter
(
ParameterType_OutputImage
,
"out"
,
"Output Image"
);
SetParameterDescription
(
"out"
,
"Output image"
);
SetParameterDescription
(
"out"
,
"Output image"
);
...
@@ -190,18 +190,22 @@ namespace otb
...
@@ -190,18 +190,22 @@ namespace otb
void
DoExecute
()
ITK_OVERRIDE
void
DoExecute
()
ITK_OVERRIDE
{
{
int
dir
ection
=
GetParameterInt
(
"dir
ection
"
);
int
dir
=
GetParameterInt
(
"dir"
);
int
mode
=
GetParameterInt
(
"mode"
);
int
mode
=
GetParameterInt
(
"mode"
);
if
(
dir
ection
!=
0
||
dir
ection
!=
1
)
if
(
dir
!=
0
&&
dir
!=
1
)
{
{
itkExceptionMacro
(
<<
"direction must be either 'fwd' or 'inv'"
);
itkExceptionMacro
(
<<
"-dir is '"
<<
dir
<<
"'."
<<
"It must be either 'fwd' or 'inv'"
);
}
}
if
(
mode
!=
0
||
mode
!=
1
)
if
(
mode
!=
0
&&
mode
!=
1
)
{
{
itkExceptionMacro
(
<<
"mode must be either 'fft' or 'wavelet'"
);
itkExceptionMacro
(
<<
"mode is '"
<<
mode
<<
"'."
<<
"It must must be either 'fft' or 'wavelet'"
);
}
}
...
@@ -211,34 +215,34 @@ namespace otb
...
@@ -211,34 +215,34 @@ namespace otb
switch
(
wavelet_type
)
switch
(
wavelet_type
)
{
{
case
0
:
case
0
:
DoWaveletTransform
<
otb
::
Wavelet
::
HAAR
>
(
dir
ection
);
DoWaveletTransform
<
otb
::
Wavelet
::
HAAR
>
(
dir
);
break
;
break
;
case
1
:
case
1
:
DoWaveletTransform
<
otb
::
Wavelet
::
DB4
>
(
dir
ection
);
DoWaveletTransform
<
otb
::
Wavelet
::
DB4
>
(
dir
);
break
;
break
;
case
2
:
case
2
:
DoWaveletTransform
<
otb
::
Wavelet
::
DB4
>
(
dir
ection
);
DoWaveletTransform
<
otb
::
Wavelet
::
DB4
>
(
dir
);
break
;
break
;
case
3
:
case
3
:
DoWaveletTransform
<
otb
::
Wavelet
::
DB6
>
(
dir
ection
);
DoWaveletTransform
<
otb
::
Wavelet
::
DB6
>
(
dir
);
break
;
break
;
case
4
:
case
4
:
DoWaveletTransform
<
otb
::
Wavelet
::
DB8
>
(
dir
ection
);
DoWaveletTransform
<
otb
::
Wavelet
::
DB8
>
(
dir
);
break
;
break
;
case
5
:
case
5
:
DoWaveletTransform
<
otb
::
Wavelet
::
DB12
>
(
dir
ection
);
DoWaveletTransform
<
otb
::
Wavelet
::
DB12
>
(
dir
);
break
;
break
;
case
6
:
case
6
:
DoWaveletTransform
<
otb
::
Wavelet
::
DB20
>
(
dir
ection
);
DoWaveletTransform
<
otb
::
Wavelet
::
DB20
>
(
dir
);
break
;
break
;
case
7
:
case
7
:
DoWaveletTransform
<
otb
::
Wavelet
::
SPLINE_BIORTHOGONAL_2_4
>
(
dir
ection
);
DoWaveletTransform
<
otb
::
Wavelet
::
SPLINE_BIORTHOGONAL_2_4
>
(
dir
);
break
;
break
;
case
8
:
case
8
:
DoWaveletTransform
<
otb
::
Wavelet
::
SPLINE_BIORTHOGONAL_4_4
>
(
dir
ection
);
DoWaveletTransform
<
otb
::
Wavelet
::
SPLINE_BIORTHOGONAL_4_4
>
(
dir
);
break
;
break
;
case
9
:
case
9
:
DoWaveletTransform
<
otb
::
Wavelet
::
SYMLET8
>
(
dir
ection
);
DoWaveletTransform
<
otb
::
Wavelet
::
SYMLET8
>
(
dir
);
break
;
break
;
default:
default:
itkExceptionMacro
(
<<
"Invalid wavelet type: '"
<<
wavelet_type
<<
"'"
);
itkExceptionMacro
(
<<
"Invalid wavelet type: '"
<<
wavelet_type
<<
"'"
);
...
@@ -250,7 +254,7 @@ namespace otb
...
@@ -250,7 +254,7 @@ namespace otb
else
else
{
{
//forward fft
//forward fft
if
(
dir
ection
==
0
)
if
(
dir
==
0
)
{
{
typedef
otb
::
Image
<
TInputPixel
>
TInputImage
;
typedef
otb
::
Image
<
TInputPixel
>
TInputImage
;
...
@@ -339,7 +343,7 @@ namespace otb
...
@@ -339,7 +343,7 @@ namespace otb
template
<
otb
::
Wavelet
::
Wavelet
TWaveletOperator
>
template
<
otb
::
Wavelet
::
Wavelet
TWaveletOperator
>
void
DoWaveletTransform
(
const
int
dir
ection
,
void
DoWaveletTransform
(
const
int
dir
,
const
std
::
string
inkey
=
"in"
,
const
std
::
string
inkey
=
"in"
,
const
std
::
string
outkey
=
"out"
)
const
std
::
string
outkey
=
"out"
)
{
{
...
@@ -353,7 +357,7 @@ namespace otb
...
@@ -353,7 +357,7 @@ namespace otb
inImage
->
UpdateOutputInformation
();
inImage
->
UpdateOutputInformation
();
if
(
dir
ection
==
0
)
if
(
dir
==
0
)
{
{
typedef
otb
::
WaveletImageFilter
<
typedef
otb
::
WaveletImageFilter
<
...
...
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