Skip to content
GitLab
Menu
Projects
Groups
Snippets
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
Menu
Open sidebar
Cresson Remi
LSGRM
Commits
e0fe8022
Commit
e0fe8022
authored
Sep 02, 2016
by
remicres
Browse files
FIX: Use grm::GraphToOTBImage, and fix polygon re-ordering
parent
b4326671
Changes
2
Hide whitespace changes
Inline
Side-by-side
include/lsgrmGraphOperations.txx
View file @
e0fe8022
...
...
@@ -102,6 +102,13 @@ MergeAllGraphsAndAchieveSegmentation(
LabelImageIterator it(labelImage, labelImage->GetLargestPossibleRegion());
const typename TSegmenter::LabelImageType::InternalPixelType noDataLabel = 0;
typename TSegmenter::LabelImageType::InternalPixelType label = 1;
// Get the maximum label value
for(it.GoToBegin();!it.IsAtEnd(); ++it)
if (it.Get() > label)
label = it.Get();
// Compute LUT
vnl_vector<typename TSegmenter::LabelImageType::InternalPixelType> lut(label,noDataLabel);
for(it.GoToBegin();!it.IsAtEnd(); ++it)
{
...
...
@@ -112,6 +119,8 @@ MergeAllGraphsAndAchieveSegmentation(
label++;
}
}
// Apply LUT
for(it.GoToBegin();!it.IsAtEnd(); ++it)
it.Set(lut[it.Get()]);
...
...
include/lsgrmSegmenter.h
View file @
e0fe8022
...
...
@@ -21,7 +21,6 @@
#include "macro-generator.h"
#include "grmSegmenter.h"
#include "lsgrmGraphToOtbImage.h"
namespace
lsgrm
{
template
<
class
TSegmenterType
>
...
...
Write
Preview
Markdown
is supported
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