Skip to content
GitLab
Projects
Groups
Snippets
Help
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
B
BioEM
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Service Desk
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Operations
Operations
Incidents
Environments
Analytics
Analytics
CI / CD
Repository
Value Stream
Wiki
Wiki
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
MPIBP-Hummer
BioEM
Commits
e7310dea
Commit
e7310dea
authored
Jul 07, 2014
by
David Rohr
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
add printModel flag, get ride of unnecessary fourier transform for FFTALGO
parent
88ded6c5
Changes
3
Show whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
47 additions
and
16 deletions
+47
-16
bioem.cpp
bioem.cpp
+41
-16
include/param.h
include/param.h
+4
-0
param.cpp
param.cpp
+2
-0
No files found.
bioem.cpp
View file @
e7310dea
...
...
@@ -284,6 +284,13 @@ int bioem::run()
// **** Main BioEM routine, projects, convolutes and compares with Map using OpenMP ****
// **************************************************************************************
if
(
param
.
printModel
)
{
//....
return
(
0
);
}
// **** If we want to control the number of threads -> omp_set_num_threads(XX); ******
// ****************** Declarying class of Probability Pointer *************************
...
...
@@ -720,26 +727,44 @@ int bioem::createConvolutedProjectionMap(int iMap, int iConv, mycomplex_t* lproj
// cout << "GG " << i << " " << j << " " << refCTF[i][0] << " " << refCTF[i][1] <<" " <<lproj[i][0] <<" " <<lproj[i][1] << "\n";
}
// *** Calculating Cross-correlations of cal-convoluted map with its self *****
sumC
=
localmultFFT
[
0
][
0
];
sumsquareC
=
0
;
if
(
FFTAlgo
)
{
for
(
int
i
=
0
;
i
<
param
.
param_device
.
NumberPixels
;
i
++
)
{
for
(
int
j
=
1
;
j
<
param
.
param_device
.
NumberFFTPixels1D
;
j
++
)
{
int
k
=
i
*
param
.
param_device
.
NumberFFTPixels1D
+
j
;
sumsquareC
+=
(
localmultFFT
[
k
][
0
]
*
localmultFFT
[
k
][
0
]
+
localmultFFT
[
k
][
1
]
*
localmultFFT
[
k
][
1
])
*
2
;
}
int
k
=
i
*
param
.
param_device
.
NumberFFTPixels1D
;
sumsquareC
+=
localmultFFT
[
k
][
0
]
*
localmultFFT
[
k
][
0
]
+
localmultFFT
[
k
][
1
]
*
localmultFFT
[
k
][
1
];
}
myfloat_t
norm2
=
(
myfloat_t
)
(
param
.
param_device
.
NumberPixels
*
param
.
param_device
.
NumberPixels
);
sumsquareC
=
sumsquareC
/
norm2
;
}
else
{
//FFTW_C2R will destroy the input array, so we have to work on a copy here
memcpy
(
tmp
,
localmultFFT
,
sizeof
(
mycomplex_t
)
*
param
.
param_device
.
NumberPixels
*
param
.
param_device
.
NumberFFTPixels1D
);
// **** Bringing convoluted Map to real Space ****
myfftw_execute_dft_c2r
(
param
.
fft_plan_c2r_backward
,
tmp
,
Mapconv
);
// *** Calculating Cross-correlations of cal-convoluted map with its self *****
sumC
=
0
;
sumsquareC
=
0
;
for
(
int
i
=
0
;
i
<
param
.
param_device
.
NumberPixels
*
param
.
param_device
.
NumberPixels
;
i
++
)
{
sumC
+=
Mapconv
[
i
];
sumsquareC
+=
Mapconv
[
i
]
*
Mapconv
[
i
];
sumC
+=
Mapconv
[
i
];
}
// *** The DTF gives an unnormalized value so have to divded by the total number of pixels in Fourier ***
// Normalizing
myfloat_t
norm2
=
(
myfloat_t
)
(
param
.
param_device
.
NumberPixels
*
param
.
param_device
.
NumberPixels
);
myfloat_t
norm4
=
norm2
*
norm2
;
sumC
=
sumC
/
norm2
;
sumsquareC
=
sumsquareC
/
norm4
;
}
cuda_custom_timeslot_end
;
...
...
include/param.h
View file @
e7310dea
...
...
@@ -65,6 +65,10 @@ public:
int
nTotGridAngles
;
int
nTotCTFs
;
bool
printModel
;
int
printModelOrientation
;
int
printModelConvolution
;
int
fft_plans_created
;
myfftw_plan
fft_plan_c2c_forward
,
fft_plan_c2c_backward
,
fft_plan_r2c_forward
,
fft_plan_c2r_backward
;
...
...
param.cpp
View file @
e7310dea
...
...
@@ -43,6 +43,8 @@ bioem_param::bioem_param()
refCTF
=
NULL
;
CtfParam
=
NULL
;
angles
=
NULL
;
printModel
=
false
;
}
int
bioem_param
::
readParameters
(
const
char
*
fileinput
)
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment