Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
BornAgain
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
Service Desk
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
Terms and privacy
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
mlz
BornAgain
Commits
4207d3df
Commit
4207d3df
authored
4 years ago
by
Wuttke, Joachim
Browse files
Options
Downloads
Patches
Plain Diff
repairing FT test ...
parent
6e9579f6
No related branches found
No related tags found
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
Tests/Functional/Core/CoreSpecial/FourierTransformationTest.cpp
+5
-28
5 additions, 28 deletions
...Functional/Core/CoreSpecial/FourierTransformationTest.cpp
with
5 additions
and
28 deletions
Tests/Functional/Core/CoreSpecial/FourierTransformationTest.cpp
+
5
−
28
View file @
4207d3df
...
...
@@ -27,28 +27,6 @@ namespace
const
double
threshold
=
1e-10
;
//! Returns file names to test fft.
std
::
vector
<
std
::
string
>
inputImages
()
{
return
{
"CylindersAndPrisms.int.gz"
,
"RectDetectorGeneric.int.gz"
};
}
//! Returns location of images to test fft.
std
::
string
inputImageDir
()
{
return
BATesting
::
CoreReferenceDir
();
}
//! Returns file names with paths to test fft.
std
::
vector
<
std
::
string
>
inputImageNames
()
{
std
::
vector
<
std
::
string
>
result
;
for
(
auto
name
:
inputImages
())
result
.
push_back
(
FileSystemUtils
::
jointPath
(
inputImageDir
(),
name
));
return
result
;
}
//! Returns name of fft image based on given image name.
std
::
string
fftReferenceImage
(
const
std
::
string
&
input_image
)
{
...
...
@@ -60,10 +38,9 @@ std::string fftReferenceImage(const std::string& input_image)
//! Runs test over one image. Returns true upon success.
bool
test_fft
(
const
std
::
string
&
input_image_name
,
const
std
::
string
&
reference_fft_name
)
{
std
::
cout
<<
"
\n
FourierTransformationTest::test_fft()"
<<
"
\n
"
;
std
::
cout
<<
"Input image: "
<<
input_image_name
<<
"
\n
"
;
std
::
cout
<<
"Reference fft: "
<<
reference_fft_name
<<
"
\n
"
;
std
::
cout
<<
"
\n
FourierTransformationTest::test_fft()"
<<
std
::
endl
;
std
::
cout
<<
"Input image: "
<<
input_image_name
<<
std
::
endl
;
std
::
cout
<<
"Reference fft: "
<<
reference_fft_name
<<
std
::
endl
;
// loading input image
std
::
unique_ptr
<
OutputData
<
double
>>
input_image
;
...
...
@@ -96,7 +73,7 @@ bool test_fft(const std::string& input_image_name, const std::string& reference_
FileSystemUtils
::
jointPath
(
BATesting
::
CoreOutputDir
(),
FileSystemUtils
::
filename
(
reference_fft_name
));
IntensityDataIOFactory
::
writeOutputData
(
*
fft
,
out_fname
);
std
::
cout
<<
"New fft image stored in "
<<
out_fname
<<
"
\n
"
;
std
::
cout
<<
"New fft image stored in "
<<
out_fname
<<
std
::
endl
;
}
return
success
;
...
...
@@ -110,6 +87,6 @@ class FourierTransformationTest : public ::testing::Test
TEST_F
(
FourierTransformationTest
,
FourierTransformation
)
{
for
(
auto
inputImage
:
inputImageNames
()
)
for
(
const
char
*
inputImage
:
{
"CylindersAndPrisms.int.gz"
,
"RectDetectorGeneric.int.gz"
}
)
EXPECT_TRUE
(
test_fft
(
inputImage
,
fftReferenceImage
(
inputImage
)));
}
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