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
Julien Cabieces
otb
Commits
7add92ee
Commit
7add92ee
authored
5 years ago
by
Guillaume Pernot
Browse files
Options
Downloads
Patches
Plain Diff
DOC: Fixed typos
minor changes
parent
61e8f514
No related branches found
Branches containing commit
No related tags found
Tags containing commit
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
Documentation/Cookbook/rst/C++/FunctorImageFilter.rst
+5
-5
5 additions, 5 deletions
Documentation/Cookbook/rst/C++/FunctorImageFilter.rst
with
5 additions
and
5 deletions
Documentation/Cookbook/rst/C++/FunctorImageFilter.rst
+
5
−
5
View file @
7add92ee
...
...
@@ -25,7 +25,7 @@ The operation to perform can be defined as a free function:
.. code-block:: cpp
double myFreeFunction(const double&
int
in) {...}
double myFreeFunction(const double& in) {...}
It can also be defined as a functor (i.e. a class defining ``operator()``:
...
...
@@ -34,14 +34,14 @@ It can also be defined as a functor (i.e. a class defining ``operator()``:
class MyFunctor
{
public:
double operator()(const double&
int
in) {...}
double operator()(const double& in) {...}
};
It can also be defined as a lambda:
.. code-block:: cpp
auto myLambda = [](const double
& int
in) -> double {...}
auto myLambda = [](const double
&
in) -> double {...}
Creating a ``FunctorImageFilter``
...
...
@@ -52,7 +52,7 @@ Once the operation to perform has been implemented, it is very easy to get an in
.. code-block:: cpp
auto filterFromFreeFunction = NewFunctorFilter(myFreeFunction);
auto filterFromFunctor = NewFunctorFilter(MyFunctor);
auto filterFromFunctor = NewFunctorFilter(MyFunctor
()
);
auto filterFromLambda = NewFunctorFilter(myLambda);
And you can use it just like any other filter:
...
...
@@ -114,7 +114,7 @@ Alternative prototype for performance
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Automatic type deduction will also work with the following signature:
``void (
const
R&, T1 t1, T2 t2 ..., TN tn)``
``void (R&, T1 t1, T2 t2 ..., TN tn)``
This will be more efficient when ``R`` is of type ``itk::VariableLengthVector<T>`` and should be preferred in this case.
...
...
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