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
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
David Youssefi
otb
Commits
31239e08
Commit
31239e08
authored
13 years ago
by
Otmane Lahlou
Browse files
Options
Downloads
Patches
Plain Diff
ENH: replace OutputImageParameter by FilenameParameter with an output Role
parent
45c8eec2
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
Applications/Util/otbMultiResolutionPyramid.cxx
+25
-36
25 additions, 36 deletions
Applications/Util/otbMultiResolutionPyramid.cxx
with
25 additions
and
36 deletions
Applications/Util/otbMultiResolutionPyramid.cxx
+
25
−
36
View file @
31239e08
...
...
@@ -21,14 +21,10 @@
#include
"otbPerBandVectorImageFilter.h"
#include
"itkDiscreteGaussianImageFilter.h"
#include
"itkShrinkImageFilter.h"
#include
"otbImageFileReader.h"
#include
"otbObjectList.h"
#include
"otbStreamingImageFileWriter.h"
#include
"otbCommandLineArgumentParser.h"
#include
"otbStandardWriterWatcher.h"
#include
"otbWrapperParameter.h"
#include
"otbWrapperOutputImageParameter.h"
#include
"otbWrapperFilenameParameter.h"
namespace
otb
{
...
...
@@ -72,8 +68,9 @@ private:
{
AddParameter
(
ParameterType_InputImage
,
"in"
,
"Input Image"
);
AddParameter
(
ParameterType_
OutputImag
e
,
"out"
,
"Output Image"
);
AddParameter
(
ParameterType_
Filenam
e
,
"out"
,
"Output Image"
);
SetParameterDescription
(
"out"
,
"will be used to get the prefix and the extension of the images to write"
);
SetParameterRole
(
"out"
,
Role_Output
);
AddParameter
(
ParameterType_Int
,
"level"
,
"Number Of Levels"
);
SetParameterInt
(
"level"
,
1
);
...
...
@@ -120,11 +117,11 @@ private:
// Get the Initial Output Image FileName
Parameter
*
param
=
GetParameterByKey
(
"out"
);
std
::
string
path
,
fname
,
ext
;
if
(
dynamic_cast
<
OutputImag
eParameter
*>
(
param
))
if
(
dynamic_cast
<
Filenam
eParameter
*>
(
param
))
{
OutputImag
eParameter
*
paramDown
=
dynamic_cast
<
OutputImag
eParameter
*>
(
param
);
std
::
string
ofname
=
paramDown
->
Get
FileNam
e
();
Filenam
eParameter
*
paramDown
=
dynamic_cast
<
Filenam
eParameter
*>
(
param
);
std
::
string
ofname
=
paramDown
->
Get
Valu
e
();
// Get the extension and the prefix of the filename
path
=
itksys
::
SystemTools
::
GetFilenamePath
(
ofname
);
...
...
@@ -160,35 +157,27 @@ private:
std
::
cout
<<
"fast scheme enabled : not implemented for the moment "
<<
std
::
endl
;
}
// Get the Output Parameter to change the current image filename
Parameter
*
param
=
GetParameterByKey
(
"out"
);
if
(
dynamic_cast
<
OutputImageParameter
*>
(
param
))
{
OutputImageParameter
*
paramDown
=
dynamic_cast
<
OutputImageParameter
*>
(
param
);
// Create an output parameter to write the current output image
OutputImageParameter
::
Pointer
paramOut
=
OutputImageParameter
::
New
();
// build the current image filename
std
::
ostringstream
oss
;
oss
<<
path
<<
"/"
<<
fname
<<
"_"
<<
currentLevel
<<
ext
;
// writer label
std
::
ostringstream
osswriter
;
osswriter
<<
"writer (level "
<<
currentLevel
<<
")"
;
// Set the filename of the current output image
paramDown
->
SetFileName
(
oss
.
str
());
// Add the current level to be written
SetParameterOutputImage
(
"out"
,
m_ShrinkFilter
->
GetOutput
());
paramDown
->
InitializeWriters
();
AddProcess
(
paramDown
->
GetWriter
(),
osswriter
.
str
());
paramDown
->
Write
();
}
// build the current image filename
std
::
ostringstream
oss
;
oss
<<
path
<<
"/"
<<
fname
<<
"_"
<<
currentLevel
<<
ext
;
// writer label
std
::
ostringstream
osswriter
;
osswriter
<<
"writer (level "
<<
currentLevel
<<
")"
;
// Set the filename of the current output image
paramOut
->
SetFileName
(
oss
.
str
());
paramOut
->
SetValue
(
m_ShrinkFilter
->
GetOutput
());
// Add the current level to be written
paramOut
->
InitializeWriters
();
AddProcess
(
paramOut
->
GetWriter
(),
osswriter
.
str
());
paramOut
->
Write
();
++
currentLevel
;
}
// Disable the output Image parameter to avoid writing
// the last image (Application::ExecuteAndWriteOutput method)
GetParameterByKey
(
"out"
)
->
SetActive
(
false
);
}
SmoothingVectorImageFilterType
::
Pointer
m_SmoothingFilter
;
...
...
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