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
e5b77e3c
Commit
e5b77e3c
authored
14 years ago
by
Julien Malik
Browse files
Options
Downloads
Patches
Plain Diff
BUG: InPlaceLabelMapFilter is incompatible with multiple types output
parent
229b14ef
No related branches found
No related tags found
No related merge requests found
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
Code/OBIA/otbMinMaxAttributesLabelMapFilter.h
+15
-11
15 additions, 11 deletions
Code/OBIA/otbMinMaxAttributesLabelMapFilter.h
Code/OBIA/otbMinMaxAttributesLabelMapFilter.txx
+22
-4
22 additions, 4 deletions
Code/OBIA/otbMinMaxAttributesLabelMapFilter.txx
with
37 additions
and
15 deletions
Code/OBIA/otbMinMaxAttributesLabelMapFilter.h
+
15
−
11
View file @
e5b77e3c
...
...
@@ -18,7 +18,7 @@ PURPOSE. See the above copyright notices for more information.
#ifndef __otbMinMaxAttributesLabelMapFilter_h
#define __otbMinMaxAttributesLabelMapFilter_h
#include
"itk
InPlace
LabelMapFilter.h"
#include
"itkLabelMapFilter.h"
#include
"itkSimpleDataObjectDecorator.h"
namespace
otb
{
...
...
@@ -28,27 +28,30 @@ namespace otb {
*/
template
<
class
TInputImage
>
class
ITK_EXPORT
MinMaxAttributesLabelMapFilter
:
public
itk
::
InPlace
LabelMapFilter
<
TInputImage
>
public
itk
::
LabelMapFilter
<
TInputImage
,
TInputImage
>
{
public:
/** Standard class typedefs. */
typedef
MinMaxAttributesLabelMapFilter
Self
;
typedef
itk
::
InPlace
LabelMapFilter
<
TInputImage
>
Superclass
;
typedef
itk
::
SmartPointer
<
Self
>
Pointer
;
typedef
itk
::
SmartPointer
<
const
Self
>
ConstPointer
;
typedef
MinMaxAttributesLabelMapFilter
Self
;
typedef
itk
::
LabelMapFilter
<
TInputImage
,
TInputImage
>
Superclass
;
typedef
itk
::
SmartPointer
<
Self
>
Pointer
;
typedef
itk
::
SmartPointer
<
const
Self
>
ConstPointer
;
/** Some convenient typedefs. */
typedef
TInputImage
InputImageType
;
typedef
typename
InputImageType
::
Pointer
InputImagePointer
;
typedef
typename
InputImageType
::
ConstPointer
InputImageConstPointer
;
typedef
typename
InputImageType
::
RegionType
InputImageRegionType
;
typedef
typename
InputImageType
::
PixelType
InputImagePixelType
;
typedef
typename
InputImageType
::
LabelObjectType
LabelObjectType
;
typedef
typename
InputImageType
::
Pointer
InputImagePointer
;
typedef
typename
InputImageType
::
ConstPointer
InputImageConstPointer
;
typedef
typename
InputImageType
::
RegionType
InputImageRegionType
;
typedef
typename
InputImageType
::
PixelType
InputImagePixelType
;
typedef
typename
InputImageType
::
LabelObjectType
LabelObjectType
;
typedef
typename
LabelObjectType
::
AttributesValueType
AttributesValueType
;
typedef
typename
LabelObjectType
::
AttributesMapType
AttributesMapType
;
typedef
itk
::
SimpleDataObjectDecorator
<
AttributesMapType
>
AttributesMapObjectType
;
typedef
itk
::
DataObject
DataObjectType
;
typedef
DataObjectType
::
Pointer
DataObjectPointerType
;
/** ImageDimension constants */
itkStaticConstMacro
(
InputImageDimension
,
unsigned
int
,
TInputImage
::
ImageDimension
);
...
...
@@ -77,6 +80,7 @@ public:
AttributesMapObjectType
*
GetMaximumOutput
();
const
AttributesMapObjectType
*
GetMaximumOutput
()
const
;
virtual
DataObjectPointerType
MakeOutput
(
unsigned
int
idx
);
protected
:
MinMaxAttributesLabelMapFilter
();
...
...
This diff is collapsed.
Click to expand it.
Code/OBIA/otbMinMaxAttributesLabelMapFilter.txx
+
22
−
4
View file @
e5b77e3c
...
...
@@ -27,13 +27,31 @@ template <class TInputImage>
MinMaxAttributesLabelMapFilter<TInputImage>
::MinMaxAttributesLabelMapFilter()
{
typename AttributesMapObjectType::Pointer min = AttributesMapObjectType::New();
typename AttributesMapObjectType::Pointer max = AttributesMapObjectType::New();
this->Superclass::SetNumberOfRequiredOutputs(3);
this->itk::ProcessObject::SetNthOutput(1, this->MakeOutput(1).GetPointer());
this->itk::ProcessObject::SetNthOutput(2, this->MakeOutput(2).GetPointer());
}
this->itk::ProcessObject::SetNthOutput(1, min.GetPointer());
this->itk::ProcessObject::SetNthOutput(2, max.GetPointer());
template<class TInputImage>
typename MinMaxAttributesLabelMapFilter<TInputImage>::DataObjectPointerType
MinMaxAttributesLabelMapFilter<TInputImage>
::MakeOutput(unsigned int i)
{
DataObjectPointerType ret;
switch (i)
{
case 0:
ret = InputImageType::New();
break;
case 1:
case 2:
ret = AttributesMapObjectType::New();
break;
}
return ret;
}
template<class TInputImage>
typename MinMaxAttributesLabelMapFilter<TInputImage>::AttributesMapObjectType*
MinMaxAttributesLabelMapFilter<TInputImage>
...
...
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