FourierPixelInserter3DMode2 - encapsulates "method 2" for inserting a 2D Fourier slice into a 3D volume See comments in FourierPixelInserter3D for explanations.
More...
FourierPixelInserter3DMode2 - encapsulates "method 2" for inserting a 2D Fourier slice into a 3D volume See comments in FourierPixelInserter3D for explanations.
Definition at line 193 of file reconstructor_tools.h.
bool FourierInserter3DMode2::insert_pixel |
( |
const float & |
xx, |
|
|
const float & |
yy, |
|
|
const float & |
zz, |
|
|
const std::complex< float > |
dt, |
|
|
const float & |
weight = 1.0 |
|
) |
| |
|
virtual |
Insert a complex pixel [dt[0]+dt[1]i] at (float) coordinate [xx,yy,zz] with weighting into a discrete 3D volume.
- Parameters
-
xx | the floating point x coordinate |
yy | the floating point y coordinate |
zz | the floating point z coordinate |
dt | the complex pixel value (dt[0] is real, dt[1] is imaginary) |
weight | the weight to given to this complex pixel |
- Returns
- A boolean that indicates the pixel has been inserted (or not)
Implements EMAN::FourierPixelInserter3D.
Definition at line 128 of file reconstructor_tools.cpp.
130 int x0 = (int) floor(xx);
131 int y0 = (int) floor(yy);
132 int z0 = (int) floor(zz);
136 if (x0<-
nx2-1 || y0<-
ny2-1 || z0<-nz2-1 || x0>
nx2 || y0>
ny2 || z0>
nz2 )
return false;
153 for (
int k = z0 ; k <= z1; k++) {
154 for (
int j = y0 ; j <= y1; j++) {
155 for (
int i = x0; i <= x1; i ++) {
160 off=
data->add_complex_at_fast(i,j,k,dt*gg);
172 for (
int k = z0 ; k <= z0 + 1; k++) {
173 for (
int j = y0 ; j <= y0 + 1; j++) {
174 for (
int i = x0; i <= x0 + 1; i ++) {
179 if (
subx0<0) off=
data->add_complex_at(i,j,k,dt*gg);
181 if (
static_cast<int>(off)!=
nxyz) {
norm[off/2]+=gg; pc+=1; }
186 if (pc>0)
return true;
EMData * data
A pointer to the constructor argument real_data.
float * norm
A pointer to the constructor argument normalize_values.
static int hypot3sq(int x, int y, int z)
Euclidean distance function squared in 3D: f(x,y,z) = (x*x + y*y + z*z);.
static float fast_exp(const float &f)
Returns an approximate of exp(x) using a cached table uses actual exp(x) outside the cached range.
References EMAN::FourierPixelInserter3D::data, EMAN::Util::fast_exp(), EMAN::FourierPixelInserter3D::fullnx, EMAN::FourierPixelInserter3D::fullny, EMAN::FourierPixelInserter3D::fullnz, EMAN::Util::hypot3sq(), EMAN::EMConsts::I2G, EMAN::FourierPixelInserter3D::norm, EMAN::FourierPixelInserter3D::nx2, EMAN::FourierPixelInserter3D::nxyz, EMAN::FourierPixelInserter3D::ny2, EMAN::FourierPixelInserter3D::nz2, EMAN::FourierPixelInserter3D::subx0, EMAN::FourierPixelInserter3D::suby0, and EMAN::FourierPixelInserter3D::subz0.