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
bdecb6be
Commit
bdecb6be
authored
15 years ago
by
Emmanuel Christophe
Browse files
Options
Downloads
Patches
Plain Diff
ENH: add otbUnaryFunctorImageFilter which is able to change the number of channel with VectorImage
parent
fe2df503
Branches
Branches containing commit
Tags
Tags containing commit
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
Code/BasicFilters/otbUnaryFunctorImageFilter.h
+83
-0
83 additions, 0 deletions
Code/BasicFilters/otbUnaryFunctorImageFilter.h
with
83 additions
and
0 deletions
Code/BasicFilters/otbUnaryFunctorImageFilter.h
0 → 100644
+
83
−
0
View file @
bdecb6be
/*=========================================================================
Program: ORFEO Toolbox
Language: C++
Date: $Date$
Version: $Revision$
Copyright (c) Centre National d'Etudes Spatiales. All rights reserved.
See OTBCopyright.txt for details.
This software is distributed WITHOUT ANY WARRANTY; without even
the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR
PURPOSE. See the above copyright notices for more information.
=========================================================================*/
#ifndef __otbUnaryFunctorImageFilter_h
#define __otbUnaryFunctorImageFilter_h
#include
"itkUnaryFunctorImageFilter.h"
namespace
otb
{
/**
* \class UnaryFunctorImage
* \brief Implements pixel-wise generic operation on one image.
*
* Add the capability to change the number of channel when operation on
* VectorImage compared to the itk::UnaryFunctorImageFilter
*
* The number of channel is provided by the functor: TFunction::OutputSize. If
* this number is lower or equal to zero, the behavior of the itk::UnaryFunctorImageFilter
* remains unchanged.
*
* \sa itk::UnaryFunctorImageFilter
*/
template
<
class
TInputImage
,
class
TOutputImage
,
class
TFunction
>
class
ITK_EXPORT
UnaryFunctorImageFilter
:
public
itk
::
UnaryFunctorImageFilter
<
TInputImage
,
TOutputImage
,
TFunction
>
{
public:
/** Standard class typedefs. */
typedef
UnaryFunctorImageFilter
Self
;
typedef
itk
::
UnaryFunctorImageFilter
<
TInputImage
,
TOutputImage
,
TFunction
>
Superclass
;
typedef
itk
::
SmartPointer
<
Self
>
Pointer
;
typedef
itk
::
SmartPointer
<
const
Self
>
ConstPointer
;
/** Method for creation through the object factory. */
itkNewMacro
(
Self
);
/** Run-time type information (and related methods). */
itkTypeMacro
(
UnaryFunctorImageFilter
,
itk
::
UnaryFunctorImageFilter
);
protected:
UnaryFunctorImageFilter
()
{};
virtual
~
UnaryFunctorImageFilter
()
{};
/** UnaryFunctorImageFilter can produce an image which has a different number of bands
* than its input image. As such, UnaryFunctorImageFilter
* needs to provide an implementation for
* GenerateOutputInformation() in order to inform the pipeline
* execution model. The original documentation of this method is
* below.
*
* \sa ProcessObject::GenerateOutputInformaton() */
virtual
void
GenerateOutputInformation
()
{
Superclass
::
GenerateOutputInformation
();
typename
Superclass
::
OutputImagePointer
outputPtr
=
this
->
GetOutput
();
outputPtr
->
SetNumberOfComponentsPerPixel
(
// propagate vector length info
this
->
GetFunctor
().
GetOutputSize
());
}
private
:
UnaryFunctorImageFilter
(
const
Self
&
);
//purposely not implemented
void
operator
=
(
const
Self
&
);
//purposely not implemented
};
}
// end namespace otb
#endif
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