#include <reconstructor.h>
Inheritance diagram for EMAN::ReconstructorVolumeData:
Public Member Functions | |
ReconstructorVolumeData () | |
Only constructor All member variables are zeroed. | |
virtual | ~ReconstructorVolumeData () |
Destructor safely frees memory. | |
const EMData *const | get_emdata () |
Get the main image pointer, probably redundant (not used). | |
Protected Member Functions | |
void | free_memory () |
Free allocated memorys The inherited class may have allocated image of tmp_data In either case you can safely call this function to delete either of those pointers, even if they bdb:refine_03#threed_00are NULL. | |
virtual void | normalize_threed (const bool sqrt_damp=false, const bool wiener=false) |
Normalize on the assumption that image is a Fourier volume and that tmp_data is a volume of weights corresponding in size to this Fourier volume. | |
virtual void | zero_memory () |
Sends the pixels in tmp_data and image to zero Convenience only. | |
Protected Attributes | |
EMData * | image |
Inheriting class allocates this, probably in setup(). | |
EMData * | tmp_data |
Inheriting class may allocate this, probably in setup(). | |
int | nx |
int | nx2 |
int | ny |
int | ny2 |
int | nz |
int | nz2 |
int | subnx |
int | subny |
int | subnz |
int | subx0 |
int | suby0 |
int | subz0 |
Private Member Functions | |
ReconstructorVolumeData (const ReconstructorVolumeData &that) | |
Disallow copy construction. | |
ReconstructorVolumeData & | operator= (const ReconstructorVolumeData &) |
Disallow assignment. |
One EMData object basically stores the real pixel data, the other is used for storing normalization values. This class was originally added simply to encapsulate the the things common to FourierReconstructor, WienerFourierReconstructor and BackProjectionReconstructor. It was never expected to instantiated on its own, and is intended to be a parent of the Reconstructor class. d.woolford May 2007
Definition at line 202 of file reconstructor.h.
|
Only constructor All member variables are zeroed.
Definition at line 208 of file reconstructor.h. 00208 : image(0), tmp_data(0), nx(0), ny(0), nz(0), subnx(0), subny(0), subnz(0), subx0(0), suby0(0), subz0(0) {}
|
|
Destructor safely frees memory.
Definition at line 212 of file reconstructor.h. References free_memory(). 00212 { free_memory(); }
|
|
Disallow copy construction.
|
|
Free allocated memorys The inherited class may have allocated image of tmp_data In either case you can safely call this function to delete either of those pointers, even if they bdb:refine_03#threed_00are NULL.
Reimplemented in EMAN::FourierReconstructor. Definition at line 243 of file reconstructor.h. 00244 { 00245 if (image != 0) {delete image; image = 0;} 00246 if ( tmp_data != 0 ) { delete tmp_data; tmp_data = 0; } 00247 }
|
|
Get the main image pointer, probably redundant (not used).
Definition at line 216 of file reconstructor.h. 00216 { return image; }
|
|
Normalize on the assumption that image is a Fourier volume and that tmp_data is a volume of weights corresponding in size to this Fourier volume. This means tmp_data is assumed to have have as many x pixels as image. Definition at line 250 of file reconstructor.cpp. References EMAN::EMData::get_data(), image, norm(), NullPointerException, nx, ny, nz, rdata, sqrt(), subnx, subny, subx0, tmp_data, and y. Referenced by EMAN::WienerFourierReconstructor::finish(), EMAN::FourierReconstructor::finish(), and EMAN::FourierReconstructorSimple2D::finish(). 00252 { 00253 float* norm = tmp_data->get_data(); 00254 float* rdata = image->get_data(); 00255 00256 // printf("%d %d %d %d %d %d\n",subnx,subny,subnz,image->get_xsize(),image->get_ysize(),image->get_zsize()); 00257 00258 // FIXME should throw a sensible error 00259 if ( 0 == norm ) throw NullPointerException("The normalization volume was null!"); 00260 if ( 0 == rdata ) throw NullPointerException("The complex reconstruction volume was null!"); 00261 00262 // The math is a bit tricky to explain. Wiener filter is basically SNR/(1+SNR) 00263 // In this case, data have already been effectively multiplied by SNR (one image at a time), 00264 // so without Wiener filter, we just divide by total SNR. With Wiener filter, we just add 00265 // 1.0 to total SNR, and we're done --steve 00266 float wfilt=0.0; 00267 if (wiener) wfilt=1.0; 00268 00269 for (int i = 0; i < subnx * subny * subnz; i += 2) { 00270 float d = norm[i/2]; 00271 if (sqrt_damp) d*=sqrt(d); 00272 if (d == 0) { 00273 rdata[i] = 0; 00274 rdata[i + 1] = 0; 00275 } 00276 else { 00277 // rdata[i]=1.0/d; 00278 // rdata[i+1]=0.0; // for debugging only 00279 rdata[i] /= d+wfilt; 00280 rdata[i + 1] /= d+wfilt; 00281 } 00282 } 00283 00284 // enforce complex conj, only works on subvolumes if the complete conjugate plane is in the volume 00285 if (subx0==0 && subnx>1 && subny==ny && subnz==nz) { 00286 for (int z=0; z<=nz/2; z++) { 00287 for (int y=1; y<=ny; y++) { 00288 if (y==0 && z==0) continue; 00289 // x=0 00290 int i=(y%ny)*subnx+(z%nz)*subnx*subny; 00291 int i2=(ny-y)*subnx+((nz-z)%nz)*subnx*subny; 00292 float ar=(rdata[i]+rdata[i2])/2.0f; 00293 float ai=(rdata[i+1]-rdata[i2+1])/2.0f; 00294 rdata[i]=ar; 00295 rdata[i2]=ar; 00296 rdata[i+1]=ai; 00297 rdata[i2+1]=-ai; 00298 } 00299 } 00300 } 00301 00302 if (subx0+subnx==nx && subnx>1 && subny==ny && subnz==nz) { 00303 for (int z=0; z<=nz/2; z++) { 00304 for (int y=1; y<=ny; y++) { 00305 if (y==0 && z==0) continue; 00306 // x=0 00307 int i=(y%ny)*subnx+(z%nz)*subnx*subny+subnx-2; 00308 int i2=(ny-y)*subnx+((nz-z)%nz)*subnx*subny+subnx-2; 00309 float ar=(rdata[i]+rdata[i2])/2.0f; 00310 float ai=(rdata[i+1]-rdata[i2+1])/2.0f; 00311 rdata[i]=ar; 00312 rdata[i2]=ar; 00313 rdata[i+1]=ai; 00314 rdata[i2+1]=-ai; 00315 } 00316 } 00317 } 00318 }
|
|
Disallow assignment.
|
|
Sends the pixels in tmp_data and image to zero Convenience only.
Definition at line 259 of file reconstructor.h. References EMAN::EMData::to_zero(). 00260 { 00261 if (tmp_data != 0 ) tmp_data->to_zero(); 00262 if (image != 0 ) image->to_zero(); 00263 }
|
|
Inheriting class allocates this, probably in setup().
Definition at line 220 of file reconstructor.h. Referenced by normalize_threed(). |
|
Definition at line 225 of file reconstructor.h. Referenced by normalize_threed(). |
|
Definition at line 225 of file reconstructor.h. |
|
Definition at line 226 of file reconstructor.h. Referenced by normalize_threed(). |
|
Definition at line 226 of file reconstructor.h. |
|
Definition at line 227 of file reconstructor.h. Referenced by normalize_threed(). |
|
Definition at line 227 of file reconstructor.h. |
|
Definition at line 229 of file reconstructor.h. Referenced by normalize_threed(). |
|
Definition at line 230 of file reconstructor.h. Referenced by normalize_threed(). |
|
Definition at line 231 of file reconstructor.h. |
|
Definition at line 233 of file reconstructor.h. Referenced by normalize_threed(). |
|
Definition at line 234 of file reconstructor.h. |
|
Definition at line 235 of file reconstructor.h. |
|
Inheriting class may allocate this, probably in setup().
Definition at line 222 of file reconstructor.h. Referenced by normalize_threed(). |