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
3f98f15a
Commit
3f98f15a
authored
6 years ago
by
Victor Poughon
Committed by
Julien Michel
6 years ago
Browse files
Options
Downloads
Patches
Plain Diff
REFAC: use FunctorFilter in DomainTransform
parent
8aa9f900
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
Modules/Applications/AppDomainTransform/app/otbDomainTransform.cxx
+12
-37
12 additions, 37 deletions
...pplications/AppDomainTransform/app/otbDomainTransform.cxx
Modules/Applications/AppDomainTransform/otb-module.cmake
+1
-0
1 addition, 0 deletions
Modules/Applications/AppDomainTransform/otb-module.cmake
with
13 additions
and
37 deletions
Modules/Applications/AppDomainTransform/app/otbDomainTransform.cxx
+
12
−
37
View file @
3f98f15a
...
...
@@ -28,38 +28,17 @@
#include
<itkConfigure.h>
#include
<itkForwardFFTImageFilter.h>
#include
<itkInverseFFTImageFilter.h>
#include
<itkUnaryFunctorImageFilter.h>
#include
<itkFFTShiftImageFilter.h>
#include
<itkFFTWGlobalConfiguration.h>
#include
"otbFunctorImageFilter.h"
#include
"otbComplexToVectorImageCastFilter.h"
namespace
otb
{
namespace
Wrapper
{
template
<
class
TInput
,
class
TOutput
>
class
ToComplexPixel
{
public:
ToComplexPixel
(
)
{
};
~
ToComplexPixel
(
)
{
};
bool
operator
!=
(
const
ToComplexPixel
&
)
const
{
return
false
;
}
bool
operator
==
(
const
ToComplexPixel
&
other
)
const
{
return
!
(
*
this
!=
other
);
}
inline
TOutput
operator
(
)(
const
TInput
&
A
)
const
{
return
TOutput
(
static_cast
<
typename
TOutput
::
value_type
>
(
A
[
0
]
),
static_cast
<
typename
TOutput
::
value_type
>
(
A
[
1
]
)
);
}
};
class
DomainTransform
:
public
Application
{
...
...
@@ -282,7 +261,7 @@ private:
fwdFilter
->
SetInput
(
inImage
);
//typedef VectorImage for output
of UnaryFunctorImageFilter
//
typedef VectorImage for output
typedef
otb
::
VectorImage
<
OutputPixelType
>
TOutputImage
;
typedef
otb
::
ComplexToVectorImageCastFilter
<
...
...
@@ -330,16 +309,12 @@ private:
//typedef TOutputImage for InverseFFTImageFilter output
typedef
otb
::
Image
<
OutputPixelType
>
TOutputImage
;
// a unary functor to convert vectorimage to complex image
typedef
itk
::
UnaryFunctorImageFilter
<
TInputImage
,
TComplexImage
,
ToComplexPixel
<
TInputImage
::
PixelType
,
TComplexImage
::
PixelType
>
>
UnaryFunctorImageFilter
;
auto
toComplex
=
[](
const
typename
TInputImage
::
PixelType
&
A
){
return
typename
TComplexImage
::
PixelType
(
static_cast
<
typename
TComplexImage
::
PixelType
::
value_type
>
(
A
[
0
]
),
static_cast
<
typename
TComplexImage
::
PixelType
::
value_type
>
(
A
[
1
]
)
);
};
UnaryFunctorImageFilter
::
Pointer
unaryFunctorImageFilter
=
UnaryFunctorImageFilter
::
New
();
auto
toComplexFilter
=
NewFunctorFilter
(
toComplex
);
if
(
shift
)
{
...
...
@@ -353,21 +328,21 @@ private:
fftShiftFilter
->
Update
();
unaryFunctorImage
Filter
->
SetInput
(
fftShiftFilter
->
GetOutput
()
);
toComplex
Filter
->
Set
V
Input
s
(
fftShiftFilter
->
GetOutput
()
);
}
else
{
unaryFunctorImage
Filter
->
SetInput
(
inImage
);
toComplex
Filter
->
Set
V
Input
s
(
inImage
);
}
unaryFunctorImage
Filter
->
Update
();
toComplex
Filter
->
Update
();
//typedef itk::::InverseFFTImageFilter over TComplexImage
typedef
itk
::
InverseFFTImageFilter
<
TComplexImage
,
TOutputImage
>
FFTFilter
;
FFTFilter
::
Pointer
invFilter
=
FFTFilter
::
New
();
invFilter
->
SetInput
(
unaryFunctorImage
Filter
->
GetOutput
()
);
invFilter
->
SetInput
(
toComplex
Filter
->
GetOutput
()
);
invFilter
->
Update
();
//set output image
...
...
This diff is collapsed.
Click to expand it.
Modules/Applications/AppDomainTransform/otb-module.cmake
+
1
−
0
View file @
3f98f15a
...
...
@@ -24,6 +24,7 @@ otb_module(OTBAppDomainTransform
DEPENDS
OTBWavelet
OTBApplicationEngine
OTBFunctor
TEST_DEPENDS
OTBTestKernel
...
...
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