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
da659aa0
Commit
da659aa0
authored
7 years ago
by
Guillaume Pasero
Browse files
Options
Downloads
Patches
Plain Diff
ENH: switch between raster and vector output
parent
1b9be901
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/AppSegmentation/app/otbLargeScaleMeanShift.cxx
+44
-19
44 additions, 19 deletions
...plications/AppSegmentation/app/otbLargeScaleMeanShift.cxx
with
44 additions
and
19 deletions
Modules/Applications/AppSegmentation/app/otbLargeScaleMeanShift.cxx
+
44
−
19
View file @
da659aa0
...
@@ -97,12 +97,26 @@ private:
...
@@ -97,12 +97,26 @@ private:
ShareParameter
(
"tilesizex"
,
"segmentation.tilesizex"
);
ShareParameter
(
"tilesizex"
,
"segmentation.tilesizex"
);
ShareParameter
(
"tilesizey"
,
"segmentation.tilesizey"
);
ShareParameter
(
"tilesizey"
,
"segmentation.tilesizey"
);
AddParameter
(
ParameterType_InputImage
,
"imfield"
,
"Support image for field computation"
);
AddParameter
(
ParameterType_Choice
,
"mode"
,
"Output mode"
);
SetParameterDescription
(
"imfield"
,
"This is an optional support image "
SetParameterDescription
(
"mode"
,
"Type of segmented output"
);
"that can be used to compute field values in each region."
);
MandatoryOff
(
"imfield"
);
ShareParameter
(
"out"
,
"vectorization.out"
);
AddChoice
(
"mode.vector"
,
"Segmentation as vector output."
);
SetParameterDescription
(
"mode.vector"
,
"In this mode, the application will "
"produce a vector file or database and compute field values for each "
"region"
);
AddParameter
(
ParameterType_InputImage
,
"mode.vector.imfield"
,
"Support image for field computation"
);
SetParameterDescription
(
"mode.vector.imfield"
,
"This is an optional support image "
"that can be used to compute field values in each region. Otherwise, the "
"input image is used as support."
);
MandatoryOff
(
"mode.vector.imfield"
);
ShareParameter
(
"mode.vector.out"
,
"vectorization.out"
);
AddChoice
(
"mode.raster"
,
"Standard segmentation with labeled raster output"
);
SetParameterDescription
(
"mode.raster"
,
"In this mode, the application will produce a standard labeled raster."
);
ShareParameter
(
"mode.raster.out"
,
"merging.out"
);
AddParameter
(
ParameterType_Empty
,
"cleanup"
,
"Temporary files cleaning"
);
AddParameter
(
ParameterType_Empty
,
"cleanup"
,
"Temporary files cleaning"
);
EnableParameter
(
"cleanup"
);
EnableParameter
(
"cleanup"
);
...
@@ -135,6 +149,8 @@ private:
...
@@ -135,6 +149,8 @@ private:
SetDocExampleParameterValue
(
"out"
,
"regions.shp"
);
SetDocExampleParameterValue
(
"out"
,
"regions.shp"
);
SetOfficialDocLink
();
SetOfficialDocLink
();
DebugOn
();
}
}
void
DoUpdateParameters
()
ITK_OVERRIDE
void
DoUpdateParameters
()
ITK_OVERRIDE
...
@@ -144,9 +160,7 @@ private:
...
@@ -144,9 +160,7 @@ private:
{
{
std
::
vector
<
std
::
string
>
tmpFilenames
;
std
::
vector
<
std
::
string
>
tmpFilenames
;
tmpFilenames
.
push_back
(
GetParameterString
(
"out"
)
+
std
::
string
(
"_labelmap.tif"
));
tmpFilenames
.
push_back
(
GetParameterString
(
"out"
)
+
std
::
string
(
"_labelmap.tif"
));
tmpFilenames
.
push_back
(
GetParameterString
(
"out"
)
+
std
::
string
(
"_labelmap_merged.tif"
));
tmpFilenames
.
push_back
(
GetParameterString
(
"out"
)
+
std
::
string
(
"_labelmap.geom"
));
tmpFilenames
.
push_back
(
GetParameterString
(
"out"
)
+
std
::
string
(
"_labelmap.geom"
));
tmpFilenames
.
push_back
(
GetParameterString
(
"out"
)
+
std
::
string
(
"_labelmap_merged.geom"
));
ExecuteInternal
(
"smoothing"
);
ExecuteInternal
(
"smoothing"
);
// in-memory connexion here (saves 1 additional update for foutpos)
// in-memory connexion here (saves 1 additional update for foutpos)
GetInternalApplication
(
"segmentation"
)
->
SetParameterInputImage
(
"in"
,
GetInternalApplication
(
"segmentation"
)
->
SetParameterInputImage
(
"in"
,
...
@@ -165,23 +179,34 @@ private:
...
@@ -165,23 +179,34 @@ private:
GetInternalApplication
(
"merging"
)
->
SetParameterString
(
"inseg"
,
GetInternalApplication
(
"merging"
)
->
SetParameterString
(
"inseg"
,
tmpFilenames
[
0
]);
tmpFilenames
[
0
]);
GetInternalApplication
(
"merging"
)
->
SetParameterString
(
"out"
,
EnableParameter
(
"mode.raster.out"
);
tmpFilenames
[
1
]);
if
(
GetParameterString
(
"mode"
)
==
"vector"
)
GetInternalApplication
(
"merging"
)
->
ExecuteAndWriteOutput
();
if
(
IsParameterEnabled
(
"imfield"
)
&&
HasValue
(
"imfield"
))
{
{
GetInternalApplication
(
"vectorization"
)
->
SetParameterString
(
"in"
,
tmpFilenames
.
push_back
(
GetParameterString
(
"out"
)
+
std
::
string
(
"_labelmap_merged.tif"
));
GetParameterString
(
"imfield"
));
tmpFilenames
.
push_back
(
GetParameterString
(
"out"
)
+
std
::
string
(
"_labelmap_merged.geom"
));
GetInternalApplication
(
"merging"
)
->
SetParameterString
(
"out"
,
tmpFilenames
[
2
]);
GetInternalApplication
(
"merging"
)
->
ExecuteAndWriteOutput
();
if
(
IsParameterEnabled
(
"mode.vector.imfield"
)
&&
HasValue
(
"mode.vector.imfield"
))
{
GetInternalApplication
(
"vectorization"
)
->
SetParameterString
(
"in"
,
GetParameterString
(
"mode.vector.imfield"
));
}
else
{
GetInternalApplication
(
"vectorization"
)
->
SetParameterString
(
"in"
,
GetParameterString
(
"in"
));
}
GetInternalApplication
(
"vectorization"
)
->
SetParameterString
(
"inseg"
,
tmpFilenames
[
2
]);
ExecuteInternal
(
"vectorization"
);
}
}
else
else
{
{
GetInternalApplication
(
"vectorization"
)
->
SetParameterString
(
"in"
,
GetInternalApplication
(
"merging"
)
->
ExecuteAndWriteOutput
();
GetParameterString
(
"in"
));
}
}
GetInternalApplication
(
"vectorization"
)
->
SetParameterString
(
"inseg"
,
DisableParameter
(
"mode.raster.out"
);
tmpFilenames
[
1
]);
ExecuteInternal
(
"vectorization"
);
if
(
IsParameterEnabled
(
"cleanup"
)
)
if
(
IsParameterEnabled
(
"cleanup"
)
)
{
{
...
...
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