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
46ce74b1
Commit
46ce74b1
authored
17 years ago
by
Julien Michel
Browse files
Options
Downloads
Patches
Plain Diff
MAJ DrawPathListFilter pour utiliser les otb::PolyLineImageIterator.
parent
6636c909
Branches
Branches containing commit
Tags
Tags containing commit
No related merge requests found
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
Code/Common/otbDrawPathListFilter.h
+1
-1
1 addition, 1 deletion
Code/Common/otbDrawPathListFilter.h
Code/Common/otbDrawPathListFilter.txx
+9
-24
9 additions, 24 deletions
Code/Common/otbDrawPathListFilter.txx
with
10 additions
and
25 deletions
Code/Common/otbDrawPathListFilter.h
+
1
−
1
View file @
46ce74b1
...
...
@@ -28,7 +28,7 @@ namespace otb
* \brief This class can be used to draw a list of path on an image.
*
* This filter first copy the input image to the output, with default casting operators.
* It then uses
itk::Lin
eIterator to draw each
segment of each P
oly
L
ine. This iterator uses
* It then uses
the otb::PolyLineImag
eIterator to draw each
p
oly
l
ine. This iterator uses
* the general Bresenham algorithm known to be efficient in segment drawing.
*
* If the UsePathInternalValue is toggled, the filter check if the metadata dictionnary of the input path has a "Value" key.
...
...
This diff is collapsed.
Click to expand it.
Code/Common/otbDrawPathListFilter.txx
+
9
−
24
View file @
46ce74b1
...
...
@@ -23,7 +23,7 @@
#include "itkImageRegionIterator.h"
#include "itkImageRegionConstIterator.h"
#include "
itkLin
eIterator.h"
#include "
otbPolyLineImag
eIterator.h"
#include "itkMetaDataObject.h"
namespace otb
...
...
@@ -80,9 +80,7 @@ DrawPathListFilter<TInputImage,TInputPath,TOutputImage>
typedef itk::ImageRegionIterator<OutputImageType> OutputIteratorType;
typedef itk::ImageRegionConstIterator<InputImageType> InputIteratorType;
typedef typename InputPathListType::ConstIterator PathListIteratorType;
typedef itk::LineIterator<OutputImageType> LineIteratorType;
typedef typename InputPathType::VertexListType VertexListType;
typedef typename VertexListType::ConstIterator VertexIteratorType;
typedef PolyLineImageIterator<OutputImageType,InputPathType> PolyLineIteratorType;
OutputIteratorType outIt(outputPtr,outputPtr->GetLargestPossibleRegion());
InputIteratorType inIt(inputPtr,inputPtr->GetLargestPossibleRegion());
...
...
@@ -94,12 +92,11 @@ DrawPathListFilter<TInputImage,TInputPath,TOutputImage>
outIt.Set(static_cast<OutputImagePixelType>(inIt.Get()));
}
// Then we use itk::LineIterator to draw polylines
OutputImageIndexType source, target;
VertexIteratorType vertexIt;
OutputImagePixelType value;
// Then we use otb::PolyLineImageIterator to draw polylines
for(PathListIteratorType plIt = pathListPtr->Begin(); plIt!=pathListPtr->End();++plIt)
{
OutputImagePixelType value;
if(m_UseInternalPathValue && plIt.Get()->GetMetaDataDictionary().HasKey("Value"))
{
itk::ExposeMetaData<OutputImagePixelType>(plIt.Get()->GetMetaDataDictionary(),"Value",value);
...
...
@@ -108,23 +105,11 @@ DrawPathListFilter<TInputImage,TInputPath,TOutputImage>
{
value = static_cast<OutputImagePixelType>(m_PathValue);
}
vertexIt = plIt.Get()->GetVertexList()->Begin();
source[0] = static_cast<unsigned int>( (vertexIt.Value())[0]);
source[1] = static_cast<unsigned int>( (vertexIt.Value())[1]);
++vertexIt;
while(vertexIt!=plIt.Get()->GetVertexList()->End())
PolyLineIteratorType imageIt(outputPtr,plIt.Get());
for(imageIt.GoToBegin();!imageIt.IsAtEnd();++imageIt)
{
target[0]=static_cast<unsigned int>((vertexIt.Value())[0]);
target[1]=static_cast<unsigned int>((vertexIt.Value())[1]);
LineIteratorType lineIt(outputPtr,source,target);
lineIt.GoToBegin();
while(!lineIt.IsAtEnd())
{
lineIt.Set(value);
++lineIt;
}
source=target;
++vertexIt;
imageIt.Set(value);
}
}
}
...
...
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