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
4356dff9
Commit
4356dff9
authored
12 years ago
by
Sebastien Harasse
Browse files
Options
Downloads
Patches
Plain Diff
BUG: region merging : fixed InputLabelType instead of OutputLabelType
parent
b49a2697
No related branches found
Branches containing commit
No related tags found
Tags containing commit
No related merge requests found
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
Code/BasicFilters/otbLabelImageRegionMergingFilter.h
+1
-1
1 addition, 1 deletion
Code/BasicFilters/otbLabelImageRegionMergingFilter.h
Code/BasicFilters/otbLabelImageRegionMergingFilter.txx
+6
-6
6 additions, 6 deletions
Code/BasicFilters/otbLabelImageRegionMergingFilter.txx
with
7 additions
and
7 deletions
Code/BasicFilters/otbLabelImageRegionMergingFilter.h
+
1
−
1
View file @
4356dff9
...
...
@@ -125,7 +125,7 @@ protected:
virtual
void
PrintSelf
(
std
::
ostream
&
os
,
itk
::
Indent
indent
)
const
;
/** Method to build a map of adjacent regions */
RegionAdjacencyMapType
LabelImageToRegionAdjacencyMap
(
typename
In
putLabelImageType
::
Pointer
inputLabelImage
);
RegionAdjacencyMapType
LabelImageToRegionAdjacencyMap
(
typename
Out
putLabelImageType
::
Pointer
inputLabelImage
);
private:
LabelImageRegionMergingFilter
(
const
Self
&
);
//purposely not implemented
...
...
This diff is collapsed.
Click to expand it.
Code/BasicFilters/otbLabelImageRegionMergingFilter.txx
+
6
−
6
View file @
4356dff9
...
...
@@ -178,7 +178,7 @@ LabelImageRegionMergingFilter<TInputLabelImage, TInputSpectralImage, TOutputLabe
++outputIt;
}
RegionAdjacencyMapType regionAdjacencyMap = LabelImageToRegionAdjacencyMap(
in
putLabelImage);
RegionAdjacencyMapType regionAdjacencyMap = LabelImageToRegionAdjacencyMap(
out
putLabelImage);
unsigned int regionCount = regionAdjacencyMap.size() - 1;
// Initialize arrays for mode information
...
...
@@ -409,13 +409,13 @@ LabelImageRegionMergingFilter<TInputLabelImage, TInputSpectralImage, TOutputLabe
template <class TInputLabelImage, class TInputSpectralImage, class TOutputLabelImage, class TOutputClusteredImage>
typename LabelImageRegionMergingFilter<TInputLabelImage, TInputSpectralImage, TOutputLabelImage, TOutputClusteredImage>::RegionAdjacencyMapType
LabelImageRegionMergingFilter<TInputLabelImage, TInputSpectralImage, TOutputLabelImage, TOutputClusteredImage>
::LabelImageToRegionAdjacencyMap(typename
In
putLabelImageType::Pointer
inputL
abelImage)
::LabelImageToRegionAdjacencyMap(typename
Out
putLabelImageType::Pointer
l
abelImage)
{
// declare the output map
RegionAdjacencyMapType ram;
// Find the maximum label value
itk::ImageRegionConstIterator<
In
putLabelImageType> it(
inputL
abelImage,
inputL
abelImage->GetRequestedRegion());
itk::ImageRegionConstIterator<
Out
putLabelImageType> it(
l
abelImage,
l
abelImage->GetRequestedRegion());
it.GoToBegin();
LabelType maxLabel = 0;
while(!it.IsAtEnd())
...
...
@@ -430,11 +430,11 @@ LabelImageRegionMergingFilter<TInputLabelImage, TInputSpectralImage, TOutputLabe
// set the image region without bottom and right borders so that bottom and
// right neighbors always exist
RegionType regionWithoutBottomRightBorders =
inputL
abelImage->GetRequestedRegion();
RegionType regionWithoutBottomRightBorders =
l
abelImage->GetRequestedRegion();
SizeType size = regionWithoutBottomRightBorders.GetSize();
for(unsigned int d = 0; d < ImageDimension; ++d) size[d] -= 1;
regionWithoutBottomRightBorders.SetSize(size);
itk::ImageRegionConstIteratorWithIndex<
In
putLabelImageType> inputIt(
inputL
abelImage, regionWithoutBottomRightBorders);
itk::ImageRegionConstIteratorWithIndex<
Out
putLabelImageType> inputIt(
l
abelImage, regionWithoutBottomRightBorders);
inputIt.GoToBegin();
while(!inputIt.IsAtEnd())
...
...
@@ -448,7 +448,7 @@ LabelImageRegionMergingFilter<TInputLabelImage, TInputSpectralImage, TOutputLabe
InputIndexType neighborIndex = index;
neighborIndex[d]++;
LabelType neighborLabel =
inputL
abelImage->GetPixel(neighborIndex);
LabelType neighborLabel =
l
abelImage->GetPixel(neighborIndex);
// add adjacency if different labels
if(neighborLabel != label)
...
...
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