24 double hires,
double lores,
double radius,
double sigma,
33 for ( j=0; j<p->
images(); j++ ) {
35 px->
find_shift(prefx, NULL, hires, lores, radius, sigma, 0, planf, planb, cc1);
49 if ( lores <= 0 ) lores = 1e30;
50 if ( hires < p->sampling().x() ) hires = p->
sampling().x();
51 if ( hires > lores ) swap(hires, lores);
52 if ( shift_limit < 0 ) shift_limit = 1e30;
71 dispatch_apply(n, dispatch_get_global_queue(0, 0), ^(
size_t i){
75 #pragma omp parallel for
76 for (
long i=0; i<n; i++ )
103 unsigned long i, j, m, n(p->
images());
104 double ccmax(0), ccavg(0), ccstd(0);
107 cout <<
"Image1\tImage2\tCC" << endl;
108 for ( i=m=0; i<n; i++ ) {
109 for ( j=0; j<n; j++, m++ ) {
110 if ( i == j ) ccmax += cc[i][j];
113 ccstd += cc[i][j]*cc[i][j];
116 cout << setprecision(5) << i <<
tab << j <<
tab << cc[i][j] << endl;
123 ccstd = ccstd/m - ccavg * ccavg;
124 if ( ccstd > 0 ) ccstd = sqrt(ccstd);
128 cout <<
"Correlating all projections:" << endl;
129 cout <<
"Imposed SNR: " << SNR << endl;
130 cout <<
"Resolution limits: " << hires <<
" " << lores << endl;
131 cout <<
"Shift limit: " << shift_limit << endl;
132 cout <<
"CC maximum: " << ccmax << endl;
133 cout <<
"CC average: " << ccavg << endl;
134 cout <<
"CC standard deviation: " << ccstd << endl;
135 cout <<
"Relative maximum sigma units: " << (ccmax - ccavg)/ccstd << endl;
154 unsigned long i, j, k, m, n(p->
images());
156 double ccmax, ccavg, ccstd, cct;
161 cout <<
"ResLim\tk\tCCmax\tCCavg\tCCstd\tCCth" << endl;
162 for ( hires = p->
sampling().x(); hires < lores; hires *= 2 ) {
166 ccmax = ccavg = ccstd = 0;
167 for ( m=i=0; i<n; i++ ) {
168 for ( j=0; j<n; j++, m++ ) {
169 if ( i == j ) ccmax += cc[i][j];
172 ccstd += cc[i][j]*cc[i][j];
175 cout << setprecision(5) << i <<
tab << j <<
tab << cc[i][j] << endl;
182 ccstd = ccstd/m - ccavg * ccavg;
183 if ( ccstd > 0 ) ccstd = sqrt(ccstd);
186 k = (
unsigned long) (p->
real_size().
x()/hires);
189 if ( cct > 1 ) cct = 1;
190 cct = sqrt(SNR/(SNR + cct));
195 cout << hires <<
tab << k <<
tab << ccmax <<
tab << ccavg <<
tab << ccstd <<
tab << cct << endl;
void change_type(char letter)
Get the data type indicated by a single letter code.
Header file for projection functions.
Header file for image class.
Header file for general symmetry functions.
Header file for general utilities.
Class for complex numbers.
3x3 Matrix manipulation functions
int noise_gaussian(double ravg=0, double rstd=1)
Generates an image with a gaussian random distribution of densities.
General image parameter class.
Vector3< double > real_size()
Header file for generalized linked list functions.
Bimage * extract(size_t nn)
Extracts one sub-image into new image structure.
double standard_deviation()
double img_compare_one_projection(Bimage *p, Bimage *pref, size_t i, double hires, double lores, double radius, double sigma, Matrix *cc, fft_plan planf, fft_plan planb)
Bimage * copy()
Copies the header information and data of an image into a new image structure.
fft_plan fft_setup(fft_direction dir, int opt=0)
Sets up a plan for fast Fourier transforms.
Matrix * img_compare_projections_driver(Bimage *p, double SNR, double hires, double lores, double shift_limit)
int fft_destroy_plan(fft_plan plan)
Deallocates a plan for fast Fourier transforms.
double fishers_z_transform(double value)
Calculates Fisher's z-transform.
int find_shift(Bimage *pref, Bimage *pmask, double hires, double lores, double radius, double sigma, int refine_flag)
Calculates a cross-correlation map to find the shift for the pair of images.
int img_compare_projections_lowpass(Bimage *p, double SNR, double shift_limit)
Compares a set of projections from a 3D density map.
Matrix img_compare_projections(Bimage *p, double SNR, double hires, double lores, double shift_limit)
Compares a set of projections from a 3D density map.
ostream & tab(ostream &out)