32 double resolution,
double sampling_ratio,
float* cutoff)
49 cerr <<
"Error: No reference map(s) specified!" << endl;
54 cout <<
"Determining particle resolution:" << endl;
55 cout <<
"Number\tMap" << endl;
56 for ( i=0, map = project->
reference; i<nmap && map; i++, map = map->next )
57 cout << i+1 <<
tab << *map << endl;
77 Bplot* plotsum = NULL;
79 int* num =
new int[nmap+1];
80 double* fom =
new double[npart*nmap];
81 for ( i=0; i<nmap+1; i++ ) num[i] = 0;
82 for ( i=0; i<npart*nmap; i++ ) fom[i] = 0;
84 if ( real_mask_file.
length() ) {
85 prealmask =
read_img(real_mask_file, 1, 0);
87 error_show(
"img_determine_resolution", __FILE__, __LINE__);
92 if ( ft_mask_file.
length() ) {
93 pftmask =
read_img(ft_mask_file, 1, 0);
95 error_show(
"img_determine_resolution", __FILE__, __LINE__);
101 cout <<
"Map\tParticle\tID\tDPR" << endl;
102 for ( i=0, m=0, map=project->
reference; i<nmap && map; i++, map=map->next ) {
105 error_show(
"img_determine_resolution", __FILE__, __LINE__);
111 for ( field=project->
field; field; field=field->
next ) {
112 for ( mg=field->
mg; mg; mg=mg->
next ) {
113 for ( part=mg->
part; part; part=part->
next ) {
131 plot =
img_resolution(p, proj, prealmask, pftmask, resolution, 0, sampling_ratio);
132 fom[m*nmap+i] = plot->
cut(2, cutoff[1]);
134 cout << map <<
tab << mg->
fpart <<
tab << part->
id <<
tab << fom[m*nmap+i] << endl;
137 if ( !plotsum ) plotsum = plot;
148 if ( prealmask)
delete prealmask;
149 if ( pftmask)
delete pftmask;
155 cout <<
"\nFilename\tID\tMap\tDPR\tFOM" << endl;
156 for ( m=0, field=project->
field; field; field=field->
next ) {
157 for ( mg=field->
mg; mg; mg=mg->
next ) {
158 for ( part=mg->
part; part; part=part->
next ) {
161 for ( i=0; i<nmap; i++ ) {
162 if ( maxfom < fom[m*nmap+i] ) {
163 maxfom = fom[m*nmap+i];
164 if ( maxfom >= 0 ) part->
sel = i+1;
168 part->
fom[0] = 1/maxfom;
172 <<
tab << maxfom <<
tab << part->
fom[0] << endl;
178 cout <<
"Map\tNumber\tPercentage" << endl;
179 for ( i=0; i<=nmap; i++ )
180 cout << i <<
tab << num[i] <<
tab << num[i]*100.0/npart << endl;
188 cout <<
"k\ts\tFSC\tDPR" << endl;
189 for ( i=0, j=plotsum->
rows(), k = j+plotsum->
rows(); i<plotsum->
rows(); i++, j++, k++ )
190 cout << i <<
tab << (*plotsum)[i] <<
tab << (*plotsum)[j] <<
tab << (*plotsum)[k] << endl;
void change_type(char letter)
Get the data type indicated by a single letter code.
Bstring * string_add(Bstring **list, const char *string)
Adds a string to a linked list.
Header file for general utilities.
long count_list(char *list)
Counts the number of items in a linked list.
long project_count_mg_particles(Bproject *project)
Counts all the particles in the project structure.
int error_show(const char *message, const char *file, int line)
Displays the error with file and line reference.
Vector3< size_t > size() const
size_t statistics()
Calculates the statistics for an image.
Bimage * rotate_project(Matrix3 mat, Vector3< double > translate, double radial_cutoff)
Rotates a 3D map and projects it along the z-axis.
General image parameter class.
Header file for generalized linked list functions.
int rescale_to_avg_std(double nuavg=0, double nustd=1)
Rescales the image data to a given average and standard deviation.
double cut(long icol, double threshold)
Bimage * read_img(const char *filename, int readdata, int img_select)
General driver function to read multiple image formats.
Bplot * img_resolution(Bimage *p, Bimage *pmod, Bimage *prealmask, Bimage *pftmask, double hi_res, double aligned_res, double sampling_ratio)
Calculates resolution measures.
int mg_determine_resolution(Bproject *project, Bstring &ref_file, Bstring &real_mask_file, Bstring &ft_mask_file, double resolution, double sampling_ratio, float *cutoff)
Determines the resolution of particle images with respect to several reference maps.
void origin(double x, double y, double z)
Header file for postscript output functions.
Library routines to estimate resolution.
Header file for 2D and 3D image I/O.
Library routines to estimate resolution.
int bexit(int value)
Exit function for cleanup and debugging.
ostream & tab(ostream &out)
int string_kill(Bstring *list)
Kills a string linked list.