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
3ece8b5d
Commit
3ece8b5d
authored
17 years ago
by
Cyrille Valladeau
Browse files
Options
Downloads
Patches
Plain Diff
nomsg
parent
dfc63676
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
Testing/Code/BasicFilters/otbProlateInterpolateImageFunction.cxx
+34
-31
34 additions, 31 deletions
.../Code/BasicFilters/otbProlateInterpolateImageFunction.cxx
with
34 additions
and
31 deletions
Testing/Code/BasicFilters/otbProlateInterpolateImageFunction.cxx
+
34
−
31
View file @
3ece8b5d
...
@@ -32,15 +32,15 @@
...
@@ -32,15 +32,15 @@
#include
"itkDifferenceImageFilter.h"
#include
"itkDifferenceImageFilter.h"
int
otbProlateInterpolateImageFunction
(
int
argc
,
char
*
argv
[])
int
otbProlateInterpolateImageFunction
(
int
argc
,
char
*
argv
[])
{
std
::
cout
<<
"FINrrrttt"
<<
std
::
endl
;
{
const
char
*
infname
=
argv
[
1
];
const
char
*
infname
=
argv
[
1
];
const
char
*
outfname
=
argv
[
2
];
const
char
*
outfname
=
argv
[
2
];
std
::
cout
<<
"FINrrr"
<<
std
::
endl
;
typedef
otb
::
Image
<
double
,
2
>
ImageType
;
typedef
otb
::
Image
<
double
,
2
>
ImageType
;
typedef
otb
::
ProlateInterpolateImageFunction
<
ImageType
>
InterpolatorType
;
typedef
otb
::
ProlateInterpolateImageFunction
<
ImageType
>
InterpolatorType
;
typedef
InterpolatorType
::
ContinuousIndexType
ContinuousIndexType
;
typedef
InterpolatorType
::
ContinuousIndexType
ContinuousIndexType
;
typedef
otb
::
ImageFileReader
<
ImageType
>
ReaderType
;
typedef
otb
::
ImageFileReader
<
ImageType
>
ReaderType
;
std
::
cout
<<
"FINeee"
<<
std
::
endl
;
unsigned
int
i
=
4
;
unsigned
int
i
=
4
;
std
::
vector
<
ContinuousIndexType
>
indicesList
;
std
::
vector
<
ContinuousIndexType
>
indicesList
;
...
@@ -53,32 +53,48 @@ std::cout<<"FINeee"<<std::endl;
...
@@ -53,32 +53,48 @@ std::cout<<"FINeee"<<std::endl;
i
+=
2
;
i
+=
2
;
}
}
std
::
cout
<<
"FINzzz"
<<
std
::
endl
;
// Instantiating object
// Instantiating object
InterpolatorType
::
Pointer
prolate
=
InterpolatorType
::
New
();
InterpolatorType
::
Pointer
prolate
=
InterpolatorType
::
New
();
ReaderType
::
Pointer
reader
=
ReaderType
::
New
();
ReaderType
::
Pointer
reader
=
ReaderType
::
New
();
reader
->
SetFileName
(
infname
);
reader
->
SetFileName
(
infname
);
reader
->
Update
();
reader
->
Update
();
prolate
->
SetInputImage
(
reader
->
GetOutput
());
prolate
->
SetInputImage
(
reader
->
GetOutput
());
std
::
cout
<<
"FINaaa"
<<
std
::
endl
;
prolate
->
SetRadius
(
atoi
(
argv
[
3
]));
prolate
->
SetRadius
(
atoi
(
argv
[
3
]));
std
::
cout
<<
"FINerg"
<<
std
::
endl
;
std
::
ofstream
file
;
std
::
ofstream
file
;
file
.
open
(
outfname
);
file
.
open
(
outfname
);
for
(
std
::
vector
<
ContinuousIndexType
>::
iterator
it
=
indicesList
.
begin
();
it
!=
indicesList
.
end
();
++
it
)
for
(
std
::
vector
<
ContinuousIndexType
>::
iterator
it
=
indicesList
.
begin
();
it
!=
indicesList
.
end
();
++
it
)
{
{
std
::
cout
<<
"FINrger"
<<
std
::
endl
;
file
<<
(
*
it
)
<<
" -> "
<<
prolate
->
EvaluateAtContinuousIndex
((
*
it
))
<<
std
::
endl
;
file
<<
(
*
it
)
<<
" -> "
<<
prolate
->
EvaluateAtContinuousIndex
((
*
it
))
<<
std
::
endl
;
}
}
file
.
close
();
file
.
close
();
std
::
cout
<<
"FIN"
<<
std
::
endl
;
/**********************************************************/
/**********************************************************/
//typedef otb::StreamingImageFileWriter<ImageType> WriterType;
//typedef otb::StreamingImageFileWriter<ImageType> WriterType;
//typedef otb::StreamingResampleImageFilter<ImageType,ImageType,double> StreamingResampleImageFilterType;
//typedef otb::StreamingResampleImageFilter<ImageType,ImageType,double> StreamingResampleImageFilterType;
typedef
otb
::
ImageFileWriter
<
ImageType
>
WriterType
;
typedef
otb
::
ImageFileWriter
<
ImageType
>
WriterType
;
typedef
itk
::
ResampleImageFilter
<
ImageType
,
ImageType
,
double
>
StreamingResampleImageFilterType
;
typedef
itk
::
ResampleImageFilter
<
ImageType
,
ImageType
,
double
>
StreamingResampleImageFilterType
;
WriterType
::
Pointer
prowriter
=
WriterType
::
New
();
StreamingResampleImageFilterType
::
Pointer
proresampler
=
StreamingResampleImageFilterType
::
New
();
InterpolatorType
::
Pointer
pro
=
InterpolatorType
::
New
();
// Resampler connected to input image
proresampler
->
SetInput
(
reader
->
GetOutput
());
pro
->
SetRadius
(
atoi
(
argv
[
3
]));
proresampler
->
SetInterpolator
(
pro
);
StreamingResampleImageFilterType
::
SizeType
size
;
size
[
0
]
=
1000
;
size
[
1
]
=
1000
;
double
tutu
=
0.25
;
proresampler
->
SetSize
(
size
);
proresampler
->
SetOutputSpacing
(
tutu
);
// Result of resampler is written
prowriter
->
SetInput
(
proresampler
->
GetOutput
());
//prowriter->SetNumberOfStreamDivisions(1);
prowriter
->
SetFileName
(
"proresample.tif"
);
prowriter
->
Update
();
/*
/*
unsigned int rad = 10;
unsigned int rad = 10;
...
@@ -92,7 +108,7 @@ std::cout<<"FIN"<<std::endl;
...
@@ -92,7 +108,7 @@ std::cout<<"FIN"<<std::endl;
typedef itk::DifferenceImageFilter<ImageType, ImageType> DiffType;
typedef itk::DifferenceImageFilter<ImageType, ImageType> DiffType;
*/
*/
// Instantiating object
// Instantiating object
WriterType
::
Pointer
prowriter
=
WriterType
::
New
();
/*
/*
WriterType::Pointer gausswriter = WriterType::New();
WriterType::Pointer gausswriter = WriterType::New();
WriterType::Pointer hamwriter = WriterType::New();
WriterType::Pointer hamwriter = WriterType::New();
...
@@ -102,7 +118,7 @@ std::cout<<"FIN"<<std::endl;
...
@@ -102,7 +118,7 @@ std::cout<<"FIN"<<std::endl;
WriterType::Pointer cosdiffwriter = WriterType::New();
WriterType::Pointer cosdiffwriter = WriterType::New();
WriterType::Pointer hamdiffwriter = WriterType::New();
WriterType::Pointer hamdiffwriter = WriterType::New();
*/
*/
StreamingResampleImageFilterType
::
Pointer
proresampler
=
StreamingResampleImageFilterType
::
New
();
/*
/*
StreamingResampleImageFilterType::Pointer gaussresampler = StreamingResampleImageFilterType::New();
StreamingResampleImageFilterType::Pointer gaussresampler = StreamingResampleImageFilterType::New();
StreamingResampleImageFilterType::Pointer hamresampler = StreamingResampleImageFilterType::New();
StreamingResampleImageFilterType::Pointer hamresampler = StreamingResampleImageFilterType::New();
...
@@ -112,8 +128,8 @@ std::cout<<"FIN"<<std::endl;
...
@@ -112,8 +128,8 @@ std::cout<<"FIN"<<std::endl;
DiffType::Pointer hamdiff = DiffType::New();
DiffType::Pointer hamdiff = DiffType::New();
DiffType::Pointer cosdiff = DiffType::New();
DiffType::Pointer cosdiff = DiffType::New();
*/
*/
std
::
cout
<<
"45564"
<<
std
::
endl
;
InterpolatorType
::
Pointer
pro
=
InterpolatorType
::
New
();
/*
/*
HamInterpolatorType::Pointer ham = HamInterpolatorType::New();
HamInterpolatorType::Pointer ham = HamInterpolatorType::New();
CosInterpolatorType::Pointer cos = CosInterpolatorType::New();
CosInterpolatorType::Pointer cos = CosInterpolatorType::New();
...
@@ -121,10 +137,7 @@ std::cout<<"FIN"<<std::endl;
...
@@ -121,10 +137,7 @@ std::cout<<"FIN"<<std::endl;
itkCosInterpolatorType::Pointer itkcos = itkCosInterpolatorType::New();
itkCosInterpolatorType::Pointer itkcos = itkCosInterpolatorType::New();
GaussInterpolatorType::Pointer gauss = GaussInterpolatorType::New();
GaussInterpolatorType::Pointer gauss = GaussInterpolatorType::New();
*/
*/
// Resampler connected to input image
proresampler
->
SetInput
(
reader
->
GetOutput
());
pro
->
SetRadius
(
5
);
proresampler
->
SetInterpolator
(
pro
);
//proresampler->SetInterpolatorNeighborhoodRadius(rad);
//proresampler->SetInterpolatorNeighborhoodRadius(rad);
/*
/*
gaussresampler->SetInput(reader->GetOutput());
gaussresampler->SetInput(reader->GetOutput());
...
@@ -151,13 +164,7 @@ std::cout<<"FIN"<<std::endl;
...
@@ -151,13 +164,7 @@ std::cout<<"FIN"<<std::endl;
//itkcosresampler->SetInterpolatorNeighborhoodRadius(30);
//itkcosresampler->SetInterpolatorNeighborhoodRadius(30);
*/
*/
// Size of output resampler result
// Size of output resampler result
std
::
cout
<<
"ergerg"
<<
std
::
endl
;
StreamingResampleImageFilterType
::
SizeType
size
;
size
[
0
]
=
500
;
size
[
1
]
=
500
;
double
tutu
=
0.25
;
proresampler
->
SetSize
(
size
);
proresampler
->
SetOutputSpacing
(
tutu
);
/*
/*
gaussresampler->SetSize(size);
gaussresampler->SetSize(size);
gaussresampler->SetOutputSpacing(tutu);
gaussresampler->SetOutputSpacing(tutu);
...
@@ -174,11 +181,7 @@ std::cout<<"FIN"<<std::endl;
...
@@ -174,11 +181,7 @@ std::cout<<"FIN"<<std::endl;
itkcosresampler->SetSize(size);
itkcosresampler->SetSize(size);
itkcosresampler->SetOutputSpacing(tutu);
itkcosresampler->SetOutputSpacing(tutu);
*/
*/
// Result of resampler is written
std
::
cout
<<
"utj,,yu"
<<
std
::
endl
;
prowriter
->
SetInput
(
proresampler
->
GetOutput
());
//prowriter->SetNumberOfStreamDivisions(1);
prowriter
->
SetFileName
(
"proresample.tif"
);
/*
/*
gausswriter->SetInput(gaussresampler->GetOutput());
gausswriter->SetInput(gaussresampler->GetOutput());
//gausswriter->SetNumberOfStreamDivisions(1);
//gausswriter->SetNumberOfStreamDivisions(1);
...
@@ -220,8 +223,8 @@ std::cout<<"utj,,yu"<<std::endl;
...
@@ -220,8 +223,8 @@ std::cout<<"utj,,yu"<<std::endl;
cosdiffwriter->Update();
cosdiffwriter->Update();
hamdiffwriter->Update();
hamdiffwriter->Update();
*/
std
::
cout
<<
"####"
<<
std
::
endl
;
*/
prowriter
->
Update
();
std
::
cout
<<
"#&&&&#"
<<
std
::
endl
;
return
EXIT_SUCCESS
;
return
EXIT_SUCCESS
;
}
}
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