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
6f15ca4e
Commit
6f15ca4e
authored
13 years ago
by
Cyrille Valladeau
Browse files
Options
Downloads
Patches
Plain Diff
BUG: add test for bug 479 : writing int8 image
parent
dd140d13
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
Testing/Fa/Failing/0000479-WriteInt8Image.cxx
+98
-0
98 additions, 0 deletions
Testing/Fa/Failing/0000479-WriteInt8Image.cxx
Testing/Fa/Failing/CMakeLists.txt
+15
-2
15 additions, 2 deletions
Testing/Fa/Failing/CMakeLists.txt
with
113 additions
and
2 deletions
Testing/Fa/Failing/0000479-WriteInt8Image.cxx
0 → 100644
+
98
−
0
View file @
6f15ca4e
/*=========================================================================
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.
=========================================================================*/
#if defined(_MSC_VER)
#pragma warning ( disable : 4786 )
#endif
#include
"otbImage.h"
#include
"otbImageFileWriter.h"
#include
"otbImageFileReader.h"
#include
"itkImageRegionIterator.h"
int
main
(
int
argc
,
char
*
argv
[])
{
typedef
char
PixelType
;
const
char
*
out
=
argv
[
1
];
const
PixelType
value
=
static_cast
<
PixelType
>
(
atof
(
argv
[
2
]
));
typedef
otb
::
Image
<
PixelType
,
2
>
ImageType
;
typedef
otb
::
ImageFileWriter
<
ImageType
>
WriterType
;
typedef
itk
::
ImageRegionIterator
<
ImageType
>
IterType
;
ImageType
::
IndexType
id
;
ImageType
::
SizeType
size
;
ImageType
::
RegionType
region
;
id
.
Fill
(
0
);
size
.
Fill
(
10
);
region
.
SetSize
(
size
);
region
.
SetIndex
(
id
);
ImageType
::
Pointer
image
=
ImageType
::
New
();
ImageType
::
PixelType
pix
;
image
->
SetRegions
(
region
);
image
->
Allocate
();
image
->
FillBuffer
(
value
);
IterType
it1
(
image
,
region
);
it1
.
GoToBegin
();
it1
.
GoToBegin
();
while
(
!
it1
.
IsAtEnd
()
)
{
if
(
value
!=
it1
.
Get
()
)
{
std
::
cout
<<
"Allocated image pixel value "
<<
it1
.
Get
()
<<
" differs from the asked one "
<<
(
double
)
value
<<
"."
<<
std
::
endl
;
return
EXIT_FAILURE
;
}
++
it1
;
}
WriterType
::
Pointer
writer
=
WriterType
::
New
();
writer
->
SetInput
(
image
);
writer
->
SetFileName
(
out
);
writer
->
Update
();
typedef
otb
::
Image
<
double
,
2
>
ReaderImageType
;
typedef
otb
::
ImageFileReader
<
ReaderImageType
>
ReaderType
;
typedef
itk
::
ImageRegionIterator
<
ReaderImageType
>
ReaderIterType
;
ReaderType
::
Pointer
reader
=
ReaderType
::
New
();
reader
->
SetFileName
(
out
);
reader
->
Update
();
ReaderIterType
it2
(
reader
->
GetOutput
(),
region
);
it2
.
GoToBegin
();
while
(
!
it2
.
IsAtEnd
()
)
{
if
(
value
!=
it2
.
Get
()
)
{
std
::
cout
<<
"Read image pixel value "
<<
it2
.
Get
()
<<
" differs from the asked one "
<<
(
double
)
value
<<
"."
<<
std
::
endl
;
return
EXIT_FAILURE
;
}
++
it2
;
}
return
EXIT_SUCCESS
;
}
This diff is collapsed.
Click to expand it.
Testing/Fa/Failing/CMakeLists.txt
+
15
−
2
View file @
6f15ca4e
SET
(
TEMP
${
OTBTesting_BINARY_DIR
}
/Temporary
)
# Failing tests showing bugs
# ------- Compare region propagation of ExtractROI filters ------------------------------
ADD_TEST
(
FA-000307-ExtractROIRegion
${
CXX_TEST_PATH
}
/0000307-ExtractROICompareRegion
)
ADD_EXECUTABLE
(
0000307-ExtractROICompareRegion 0000307-ExtractROICompareRegionsImplementations.cxx
)
TARGET_LINK_LIBRARIES
(
0000307-ExtractROICompareRegion OTBIO OTBCommon
)
# ------- Write an int8 image ------------------------------
ADD_TEST
(
FA-0000479-WriteInt8Image
${
CXX_TEST_PATH
}
/0000479-WriteInt8Image
${
TEMP
}
/FA-0000479-WriteInt8Image.tif
-10
)
ADD_EXECUTABLE
(
0000479-WriteInt8Image 0000479-WriteInt8Image.cxx
)
TARGET_LINK_LIBRARIES
(
0000479-WriteInt8Image OTBIO OTBCommon
)
ADD_TEST
(
FA-000209-SVMValidationLinearlySeparableWithProbEstimate_KO
${
CXX_TEST_PATH
}
/0000209-SVMValidationLinearlySeparableProbEstimation
0000209-SVMValidationLinearlySeparableProbEstimation 500 500 0.0025 0.0075 0.0075 0.0025 0. 0.0025 0. 0.0025 0 1
)
ADD_EXECUTABLE
(
0000307-ExtractROICompareRegion 0000307-ExtractROICompareRegionsImplementations.cxx
)
TARGET_LINK_LIBRARIES
(
0000307-ExtractROICompareRegion OTBIO OTBCommon
)
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