 |
Bsoft
2.1.0
Bernard's software package
|
Go to the documentation of this file.
58 for ( i=0; i<nmg; i++, j++ ) {
67 for ( i=0; i<nrec; i++, j++ ) {
94 cout <<
"Setting micrograph and particle file names to be the same" << endl << endl;
97 for ( mg = field->
mg; mg; mg = mg->
next ) {
101 else cerr <<
"No file name for micrograph " << mg->
id << endl;
123 Bfield* this_field = *field;
125 memset(nu_field, 0,
sizeof(
Bfield));
135 while ( this_field->
next ) this_field = this_field->
next;
136 this_field->
next = nu_field;
160 if ( mg_id.
length() ) nu_mg->
id = mg_id;
170 while ( this_mg->
next ) this_mg = this_mg->
next;
171 this_mg->
next = nu_mg;
191 Bframe* this_frame = *frame;
193 memset(nu_frame, 0,
sizeof(
Bframe));
202 while ( this_frame->
next ) this_frame = this_frame->
next;
203 this_frame->
next = nu_frame;
230 nu_part->
view[2] = 1;
237 while ( this_part->
next ) this_part = this_part->
next;
238 this_part->
next = nu_part;
255 for ( part = mg->
part; part; part = part->
next ) part->
mg = mg;
269 for ( part = rec->
part; part; part = part->
next ) part->
rec = rec;
292 for ( mg = field->
mg; mg; mg = mg->
next ) {
294 if ( part )
return part;
300 if ( part )
return part;
330 while ( this_fil->
next ) this_fil = this_fil->
next;
331 this_fil->
next = nu_fil;
353 memset(nu_fnode, 0,
sizeof(
Bfilnode));
360 while ( this_fnode->
next ) this_fnode = this_fnode->
next;
361 this_fnode->
next = nu_fnode;
404 if ( rec_id.
length() ) nu_rec->
id = rec_id;
414 while ( this_rec->
next ) this_rec = this_rec->
next;
415 this_rec->
next = nu_rec;
442 field2 = field->
next;
468 if ( !field )
return 0;
474 for ( mg = field->
mg; mg; ) {
530 if ( !part )
return 0;
554 if ( !fil )
return 0;
560 for ( fnode=fil->
node; fnode; ) {
561 fnode2 = fnode->
next;
584 if ( !rec )
return 0;
630 for ( i=0; i<
NFOM; i++ ) partnu->
fom[i] = part->
fom[i];
632 partnu->
mg = part->
mg;
648 for ( part = partlist; part; part = part->
next )
660 for ( bad = badlist; bad; bad = bad->
next ) {
677 for ( fil = fillist; fil; fil = fil->
next ) {
680 for ( fnode = fil->
node; fnode; fnode = fnode->
next ) {
682 fnodenu->
loc = fnode->
loc;
695 for ( sf = sflist; sf; sf = sf->
next ) {
716 for ( line = layerlist; line; line = line->
next ) {
740 cout <<
"Copying micrograph " << mg->
id << endl;
816 for ( nu_field = proj_new->
field; nu_field; nu_field = nu_field->
next ) {
817 for ( nu_mg = nu_field->
mg; nu_mg; nu_mg = nu_mg->
next ) {
820 for ( mg = field->
mg; mg && notfound; ) {
821 if ( mg->
id == nu_mg->id )
828 cerr <<
"Error: Micrograph " << nu_mg->
id <<
" not found!" << endl;
834 for ( nu_rec = proj_new->
rec; nu_rec; nu_rec = nu_rec->
next ) {
836 for ( rec =
project->
rec; rec && notfound; ) {
837 if ( rec->
id == nu_rec->id )
843 cerr <<
"Error: Reconstruction " << nu_rec->
id <<
" not found!" << endl;
880 if ( nu_mg->
select < 1 )
return 0;
883 cout <<
"DEBUG micrograph_update: " << nu_mg->
id <<
tab << nu_mg->
select <<
tab << flags << endl;
886 cout <<
"Updating micrograph " << mg->
id << endl;
918 if ( (flags & 2) && nu_mg->
bad ) {
920 cout <<
"Replacing bad areas" << endl;
926 if ( (flags & 4) && nu_mg->
fil ) {
928 cout <<
"Replacing filaments" << endl;
934 if ( (flags & 8) && nu_mg->
sf ) {
936 cout <<
"Replacing structure factors" << endl;
942 if ( (flags & 16) && nu_mg->
layer ) {
944 cout <<
"Replacing layer lines" << endl;
950 if ( (flags & 32) && nu_mg->
mark ) {
952 cout <<
"Replacing markers" << endl;
984 if ( nu_rec->
select < 1 )
return 0;
987 cout <<
"DEBUG reconstruction_update: " << nu_rec->
id <<
tab << nu_rec->
select <<
tab << flags << endl;
990 cout <<
"Updating reconstruction " << rec->
id << endl;
1028 if ( nu_part->
def > 0 ) {
1029 part->
def = nu_part->
def;
1030 part->
dev = nu_part->
dev;
1031 part->
ast = nu_part->
ast;
1034 if ( nu_part->
mag > 0 && nu_part->
mag != 1 )
1035 part->
mag = nu_part->
mag;
1038 part->
loc = nu_part->
loc;
1044 part->
ori = nu_part->
ori;
1049 for (
int f=0; f<
NFOM; f++ )
1050 if ( nu_part->
fom[f] ) part->
fom[f] = nu_part->
fom[f];
1052 part->
sel = nu_part->
sel;
1076 cout <<
"Updating particles" << endl;
1078 int notfound(1), set_new(0);
1081 for ( ; nu_part; nu_part = nu_part->
next ) {
1084 for ( part = *pnt_part; part && notfound; ) {
1085 if ( part->
id == nu_part->
id ) notfound = 0;
1086 else part = part->
next;
1089 cerr <<
"Particle " << nu_part->
id <<
" not found!" << endl;
1093 part->
fom[fom_index] = 0;
1096 if ( nu_part->
sel > 0 ) {
1098 if ( part->
sel > 0 ) {
1099 if ( nu_part->
fom[fom_index] < part->
fom[fom_index] ) set_new = 0;
1104 cout <<
"DEBUG particle_update: " << part->
id <<
tab << part->
sel <<
tab << nu_part->
sel <<
tab
1105 << part->
fom[fom_index] <<
tab << nu_part->
fom[fom_index] <<
tab << set_new << endl;
1120 if ( !
project || ! partproject )
return 0;
1122 Bfield *field, *partfield;
1127 cout <<
"Merging particle parameters into the main project" << endl << endl;
1130 for ( mg=field->
mg, partmg=partfield->
mg; mg && partmg; mg=mg->
next, partmg=partmg->
next ) {
1135 for ( rec=
project->
rec, partrec=partproject->
rec; rec && partrec; rec=rec->
next, partrec=partrec->
next ) {
1156 for ( mg = field->
mg; mg; mg = mg->
next )
1175 for ( part = mg->
part; part; part = part->
next, npart++ ) part->
mg = mg;
1190 for ( part = rec->
part; part; part = part->
next, npart++ ) part->
rec = rec;
1206 long i, j, k, t, nmg(0), nrec(0), ndiv(0);
1208 Bfield* field, *field_prev;
1213 for ( mg = field->
mg; mg; mg = mg->
next )
if ( mg->
select)
1217 if ( rec->
select ) nrec++;
1222 for ( i=j=k=0; i<n; i++ ) {
1224 for ( ; field && j<t; field_prev = field, field = field->
next )
1225 for ( mg = field->mg; mg; mg = mg->
next )
1228 for ( ; rec && k<t; rec_prev = rec, rec = rec->
next )
1229 if ( rec->select) k++;
1230 if ( field || rec ) {
1231 if ( field_prev ) field_prev->
next = NULL;
1232 if ( rec_prev ) rec_prev->
next = NULL;
1234 project2 = project2->
next;
1235 project2->
field = field;
1236 project2->
rec = rec;
1260 for ( mg = field->
mg; mg; mg = mg->
next )
if ( mg->
select)
1266 for ( mg = field->
mg; mg; mg = mg->
next )
if ( mg->
select)
1289 for ( mg = field->
mg; mg; mg = mg->
next ) {
1290 for ( part = mg->
part; part; part = part->
next ) {
1292 if ( ( part_select<0 && part->sel ) || ( part->
sel==
part_select ) )
1295 part->
fom[0] = part->
fom[1] = part->
sel = 0;
1303 for ( mg = field->
mg; mg; mg = mg->
next ) {
1304 for ( part = mg->
part; part; part = part->
next ) {
1305 if ( ( part_select<0 && part->sel ) || ( part->
sel==
part_select ) )
1306 partarr[npart++] = part;
1330 for ( part = rec->
part; part; part = part->
next ) {
1331 if ( ( part_select<0 && part->sel ) || ( part->
sel==
part_select ) )
1334 part->
fom[0] = part->
fom[1] = part->
sel = 0;
1341 for ( part = rec->
part; part; part = part->
next ) {
1342 if ( ( part_select<0 && part->sel ) || ( part->
sel==
part_select ) )
1343 partarr[npart++] = part;
1364 for ( npart=0, part = partlist; part; part = part->
next ) {
1365 if ( ( part_select<0 && part->sel ) || ( part->
sel==
part_select ) )
1368 part->
fom[0] = part->
fom[1] = part->
sel = 0;
1373 for ( npart=0, part = partlist; part; part = part->
next )
1374 if ( ( part_select<0 && part->sel ) || ( part->
sel==
part_select ) )
1375 partarr[npart++] = part;
1391 if ( !project_old )
return 0;
1393 Bfield* field, *field_old;
1399 cout <<
"Reverting to old particle file names in: " << project_old->
filename << endl << endl;
1402 for ( field_old = project_old->
field; field_old && field_old->
id != field->
id; field_old = field_old->
next ) ;
1404 for ( mg = field->
mg; mg; mg = mg->
next ) {
1405 for ( mg_old = field_old->
mg; mg_old && mg_old->
id != mg->
id; mg_old = mg_old->
next ) ;
1407 if ( flag & 1 ) mg->
fmg = mg_old->
fmg;
1409 if ( flag & 2 ) mg->
fps = mg_old->
fps;
1412 part_old = mg_old->
part;
1413 for ( part = mg->
part; part; part = part->
next ) {
1414 for ( ; part_old && part_old->
id != part->
id; part_old = part_old->
next ) ;
1426 for ( rec_old = project_old->
rec; rec_old && rec_old->
id != rec->
id; rec_old = rec_old->
next ) ;
1428 if ( flag & 4 ) rec->
frec = rec_old->
frec;
1430 part_old = rec_old->
part;
1431 for ( part = rec->
part; part; part = part->
next ) {
1432 for ( ; part_old && part_old->
id != part->
id; part_old = part_old->
next ) ;
1461 Bfield* nu_field_start = NULL;
1466 for ( mg = field->
mg; mg; mg = mg->
next ) {
1467 if ( i%nseries == 0 ) {
1469 if ( i == 0 ) nu_field_start = nu_field;
1470 else nu_mg->
next = NULL;
1471 nu_field->
mg = nu_mg = mg;
1482 nu_field = field->
next;
1489 if ( field_id.
length() > 0 ) {
1494 field->
id = field_id +
Bstring(i,
"_%04d");
1512 long i, j, k, l, nf(0), nmg(0), nmgsel(0);
1513 long npart(0), nsel(0), nfil(0), nfn(0);
1514 double nmgpercent(0), npercent(0);
1521 long gmax = 10000000;
1522 int* ng =
new int[gmax];
1523 for ( i=0; i<gmax; i++ ) ng[i] = 0;
1526 cout <<
"Project hierarchy:" << endl;
1530 cout <<
"Field: " << field->
id <<
" (" << field->
select <<
")" << endl;
1531 for ( mg = field->
mg; mg; mg = mg->
next, nmg++ ) {
1532 if ( mg->
select ) nmgsel++;
1533 for ( part = mg->
part; part; part = part->
next ) {
1535 if ( g >= gmax ) g = gmax-1;
1547 cout <<
"\tMicrograph: " << mg->
id <<
" ("
1548 << mg->
select <<
")\tParticles: " << i <<
" ("
1549 << j <<
")\tFilaments: " << k <<
" (" << l <<
")" << endl;
1552 if ( nmg ) nmgpercent = nmgsel*100.0/nmg;
1553 if ( npart ) npercent = nsel*100.0/npart;
1554 cout <<
"Totals:" << endl;
1555 cout << nf <<
" fields\t" << nmg <<
" micrographs\t"
1556 << nmgsel <<
" selected\t(" << nmgpercent <<
"%)" << endl;
1558 cout << npart <<
" particles\t" << nsel <<
" selected\t("
1559 << npercent <<
"%)" << endl;
1561 cout << nfil <<
" filaments\t" << nfn <<
" filament nodes" << endl;
1563 cout <<
"Group\tCount" << endl;
1564 for ( g=0; g<gmax; g++ )
if ( ng[g] )
1565 cout << g <<
tab << ng[g] << endl;
1569 for ( g=0; g<gmax; g++ ) ng[g] = 0;
1571 npart = nsel = nfil = nfn = 0;
1574 for ( part = rec->
part; part; part = part->
next ) {
1576 if ( g >= gmax ) g = gmax-1;
1580 cout <<
"Reconstruction: " << rec->
id;
1593 cout <<
"\tParticles: " << i <<
" (" << j <<
")\tFilaments: " << k <<
" (" << l <<
")" << endl;
1595 if ( npart ) npercent = nsel*100.0/npart;
1596 cout <<
"Totals:\t" << npart <<
" particles\t" << nsel <<
" selected\t("
1597 << npercent <<
"%)\t" << nfil <<
" filaments\t" << nfn <<
" filament nodes" << endl;
1599 cout <<
"Group\tCount" << endl;
1600 for ( g=0; g<gmax; g++ )
if ( ng[g] )
1601 cout << g <<
tab << ng[g] << endl;
1627 cout <<
"Class averages:" << endl;
1628 cout <<
"Class\tNumber\t % \tFOM" << endl;
1631 setw(8) << part->
sel*100.0/npart <<
tab <<
1632 part->
fom[0] << endl;
1651 long i, j, npart(0), nsel(0);
1659 ofstream fd(filename.
c_str());
1660 if ( fd.fail() )
return -1;
1662 fd <<
"Project hierarchy:" << endl;
1664 fd <<
"Field: " << field->
id << endl;
1665 for ( mg = field->
mg; mg; mg = mg->
next ) {
1670 fd <<
"Micrograph: " << mg->
id <<
tab << i <<
" particles\t" << j <<
" selected" << endl;
1672 else fd <<
"ID\tox\toy\toz\tphi\ttheta\tpsi";
1673 for ( f=0; f<
NFOM; f++ ) fd <<
"\tFOM" << f;
1675 for ( part = mg->
part; part; part = part->
next ) {
1689 for ( f=0; f<
NFOM; f++ ) fd <<
tab << part->
fom[f];
1696 if ( npart ) npercent = nsel*100.0/npart;
1697 fd <<
"Totals:\t" << npart <<
" particles\t" << nsel <<
" selected\t(" << npercent <<
"%)" << endl << endl;
1705 fd <<
"Reconstruction: " << rec->
id <<
tab << i <<
" particles\t" << j <<
" selected" << endl;
1707 else fd <<
"ID\tox\toy\toz\tphi\ttheta\tpsi";
1708 for ( f=0; f<
NFOM; f++ ) fd <<
"\tFOM" << f;
1710 for ( part = rec->
part; part; part = part->
next ) {
1724 for ( f=0; f<
NFOM; f++ ) fd <<
tab << part->
fom[f];
1730 if ( npart ) npercent = nsel*100.0/npart;
1731 if ( npart ) npercent = nsel*100.0/npart;
1732 fd <<
"Totals:\t" << npart <<
" particles\t" << nsel <<
" selected\t(" << npercent <<
"%)" << endl << endl;
1743 cout <<
"DEBUG path_update: Old name = " << filename << endl;
1745 if ( path[-1] !=
'/' ) path +=
"/";
1750 if ( path.
length() && path !=
"./" ) newname = path + newname;
1752 cout <<
"DEBUG path_update: New name = " << newname << endl;
1769 if ( path.
length() < 1 )
return 0;
1775 cout <<
"Setting micrograph path to " << path << endl;
1798 if ( path.
length() < 1 )
return 0;
1804 cout <<
"Setting micrograph frames path to " << path << endl;
1827 if ( path.
length() < 1 )
return 0;
1833 cout <<
"Setting power spectrum path to " << path << endl;
1856 if ( path.
length() < 1 )
return 0;
1864 cout <<
"Setting particle path to " << path << endl;
1869 for ( part = rec->
part; part; part = part->
next )
1877 for ( mg = field->
mg; mg; mg = mg->
next ) {
1879 for ( part = mg->
part; part; part = part->
next )
1889 cout <<
"DEBUG project_set_particle_path: done" << endl;
1906 if ( path.
length() < 1 )
return 0;
1916 cout <<
"DEBUG project_set_particle_path: Old name = " << rec->
ffil << endl;
1917 newname = rec->
ffil;
1925 cout <<
"DEBUG project_set_filament_path: New name = " << rec->
ffil << endl;
1929 for ( mg = field->
mg; mg; mg = mg->
next ) {
1931 cout <<
"DEBUG project_set_particle_path: Old name = " << mg->
ffil << endl;
1940 cout <<
"DEBUG project_set_filament_path: New name = " << mg->
ffil << endl;
1962 for ( mg = field->
mg; mg; mg = mg->
next )
1985 for ( mg = field->
mg; mg; mg = mg->
next )
2005 cout <<
"DEBUG project_set_mg_pixel_size: pixel_size = " << pixel_size << endl;
2009 for ( mg = field->
mg; mg; mg = mg->
next )
2028 cout <<
"DEBUG project_set_rec_voxel_size: voxel_size = " << pixel_size << endl;
2052 cout <<
"DEBUG project_set_part_pixel_size: pixel_size = " << pixel_size << endl;
2056 for ( part = rec->
part; part; part = part->
next )
2061 for ( mg = field->
mg; mg; mg = mg->
next )
2062 for ( part = mg->
part; part; part = part->
next )
2084 for ( mg = field->
mg; mg; mg = mg->
next ) {
2107 for ( mg = field->
mg; mg; mg = mg->
next )
2132 cout <<
"Setting micrograph origins to " << origin << endl;
2136 for ( mg = field->
mg; mg; mg = mg->
next )
2165 for ( part = rec->
part; part; part = part->
next ) {
2172 for ( mg = field->
mg; mg; mg = mg->
next ) {
2173 for ( part = mg->
part; part; part = part->
next ) {
2210 cout <<
"Flipping origins along ";
2211 if ( fx ) cout <<
"x";
2212 if ( fy ) cout <<
"y";
2213 if ( fz ) cout <<
"z";
2219 for ( part = rec->
part; part; part = part->
next ) {
2227 for ( mg = field->
mg; mg; mg = mg->
next ) {
2228 for ( part = mg->
part; part; part = part->
next ) {
2258 cout <<
"Renumbering particles" << endl << endl;
2262 for ( n=1, part = rec->
part; part; part = part->
next, n++, np++ )
2266 for ( mg = field->
mg; mg; mg = mg->
next )
2267 for ( n=1, part = mg->
part; part; part = part->
next, n++, np++ )
2294 cout <<
"Setting the box size to " << box_size << endl << endl;
2298 for ( part = rec->
part; part; part = part->
next )
2301 for ( part = rec->
part; part; part = part->
next )
2307 for ( mg = field->
mg; mg; mg = mg->
next ) {
2308 for ( part = mg->
part; part; part = part->
next )
2311 for ( part = mg->
part; part; part = part->
next )
2358 cout <<
"Setting origins to " << origin << endl << endl;
2362 for ( part = rec->
part; part; part = part->
next )
2366 for ( mg = field->
mg; mg; mg = mg->
next )
2367 for ( part = mg->
part; part; part = part->
next )
2406 cout <<
"Setting particle views to the asymmetric unit for point group " << sym->
label << endl << endl;
2410 for ( part = rec->
part; part; part = part->
next )
2414 for ( mg = field->
mg; mg; mg = mg->
next )
2415 for ( part = mg->
part; part; part = part->
next )
2433 if ( view[2] >= 0.999999 )
return 0;
2442 cout <<
"Rotating particle views relative to the reference view:" << endl;
2443 cout << view << endl << endl;
2448 for ( part = rec->
part; part; part = part->
next ) {
2454 for ( mg=field->
mg; mg ; mg=mg->
next )
2455 for ( part=mg->
part; part; part=part->
next) {
2482 cout <<
"Applying map magnifications to particles:" << endl;
2483 cout <<
"Number of reference maps: " << mag_num << endl;
2484 for ( i=0; i<mag_num; i++ ) cout << i+1 <<
tab << mag[i] << endl;
2489 for ( mg = field->
mg; mg; mg = mg->
next ) {
2490 for ( part = mg->
part; part; part = part->
next ) {
2491 if ( part->
sel > 0 && part->
sel <= mag_num ) {
2492 part->
mag = mag[part->
sel-1];
2499 for ( part = rec->
part; part; part = part->
next ) {
2500 if ( part->
sel > 0 && part->
sel <= mag_num ) {
2501 part->
mag = mag[part->
sel-1];
2520 if ( reset[0] ==
'd' ) reset =
"defocus";
2530 cout <<
"Resetting " << reset <<
" from the micrographs" << endl;
2534 for ( mg = field->
mg; mg; mg = mg->
next ) {
2535 for ( part = mg->
part; part; part = part->
next ) {
2536 if ( part->
sel && mg->
ctf ) {
2545 for ( part = rec->
part; part; part = part->
next ) {
2546 if ( part->
sel && rec->
ctf ) {
2555 cout <<
"Number of particles changed: " << np << endl << endl;
2579 cout <<
"Retrieving the particle views from the micrographs" << endl << endl;
2581 for ( mg = field->
mg; mg; mg = mg->
next )
2582 for ( part = mg->
part; part; part = part->
next ) {
2583 if ( selection==0 || ( selection==part->
sel ) || ( selection<0 && part->sel>0 ) ) {
2585 if ( !view ) view = v;
2592 cout <<
"Retrieving the particle views from the reconstructions" << endl << endl;
2594 for ( part = rec->
part; part; part = part->
next ) {
2595 if ( selection==0 || ( selection==part->
sel ) || ( selection<0 && part->
sel>0 ) ) {
2597 if ( !view ) view = v;
2616 switch ( fom_type ) {
2653 switch ( fom_type ) {
2676 default: tag[0] = 0;
break;
Header file for utility functions for use in qsort calls.
int project_set_particle_path(Bproject *project, Bstring &path)
Sets the path to particle files for all the micrographs.
Blayerline * layerline_copy(Blayerline *layerlist)
Bparticle * part_find_first(Bproject *project)
Finds the first particle in a project.
int project_set_scan_sampling(Bproject *project, double sampling)
Sets the scan sampling for all the micrographs.
int string_kill(Bstring *list)
Kills a string linked list.
int project_rotate_particle_views(Bproject *project, View view)
Rotates particle views with respect to a reference view.
Bparticle ** particle_array(Bparticle *partlist, int part_select, long &npart)
Sets up an array of selected particle pointers.
Bfilament * filament_copy(Bfilament *fillist)
long kill_list(char *list, unsigned long size)
Frees all the items in a linked list.
long project_set_part_links(Bproject *project)
Sets the links from particles back to the micrographs and reconstructions.
long filament_node_count(Bfilament *fil)
Counts the number of filament nodes in a linked list of filaments.
int project_set_field_id(Bproject *project, int nseries, Bstring &field_id)
Sets the field id's according to a regular series.
int update(CTFparam *ctf)
Bframe * frame_add(Bframe **frame, int pid)
Adds a movie frame parameter structure to a linked list.
char * add_item(char **list, unsigned long size)
Adds an item to a linked list.
Vector3< double > voxel_size
Bstrucfac * structurefactor_copy(Bstrucfac *sflist)
Bproject * project_init()
Initializes a micrograph processing project parameter structure.
int project_set_tilt(Bproject *project, double tilt_axis, double tilt_angle)
Sets the tilt parameters for all the micrographs.
Bparticle ** project_mg_particle_array(Bproject *project, int part_select, long &npart)
Sets up an array of selected particle pointers.
long particle_count_selected(Bparticle *part)
Counts the number of particles in a linked list.
Bmarker * markers_copy(Bmarker *mark)
Copies a set of markers.
Bfilament * filament_add(Bfilament **fil, int pid)
Adds a filament parameter structure to a linked list.
int micrograph_kill(Bmicrograph *mg)
Frees a whole micrograph parameter structure.
Bproject * project_create(int nmg, int nrec)
Creates a micrograph processing project parameter structure.
Header file for functions for creating random images.
Bparticle * particle_add(Bparticle **part, int pid)
Adds a particle parameter structure to a linked list.
Header file for micrograph processing.
int project_equal_mg_part_files(Bproject *project)
Sets micrograph and particle files to be the same.
int project_add_origins_to_coords(Bproject *project)
Adds the particle origins to the micrograph coordinates.
Breconstruction * reconstruction_add(Breconstruction **rec, Bstring &rec_id)
Adds a reconstruction parameter structure to a linked list.
long micrograph_set_part_links(Bmicrograph *mg)
Sets the links from particles back to the micrograph.
double length(vector< T > v)
Bstring get_fom_tag(FOMType fom_type)
Returns the tag associated with a particular FOM.
int project_merge_part_parameters(Bproject *project, Bproject *partproject)
Puts particle parameters from one project into another.
long project_reset(Bproject *project, Bstring &reset)
Reset a particle parameter from its micrograph.
int mg_part_links(Bmicrograph *mg)
Sets the links from particles to micrographs.
int project_set_frame_path(Bproject *project, Bstring &path)
Sets the path to micrograph frames files for all the micrographs.
int field_kill(Bfield *field)
Frees a whole field-of-view structure.
long project_renumber_particles(Bproject *project)
Renumbers particles.
string insert(string &filename, string ins)
int project_set_part_pixel_size(Bproject *project, Vector3< double > pixel_size)
Sets the pixel size for all the particles.
long project_count_mg_part_selected(Bproject *project)
Counts the number of particles in a project.
int project_set_rec_voxel_size(Bproject *project, Vector3< double > pixel_size)
Sets the pixel size for all the reconstructions.
int project_set_micrograph_origins(Bproject *project, Vector3< double > origin)
Sets micrograph origins to the given origin.
int project_set_micrograph_path(Bproject *project, Bstring &path)
Sets the path to micrograph files for all the micrographs.
int project_set_particle_origins(Bproject *project, Vector3< double > origin)
Sets particle origins to given values.
View find_asymmetric_unit_view(Bsymmetry *sym, View theview)
Finds the corresponding view in the asymmetric unit.
int micrograph_update(Bmicrograph *mg, Bmicrograph *nu_mg, int fom_index, int flags)
Updates an existing micrograph with new information.
Tcl_Obj * part_select(Bparticle *part, int objc, Tcl_Obj *CONST objv[])
Bfilnode * filament_node_add(Bfilnode **fnode, int pid)
Adds a filament node parameter structure to a linked list.
Vector3< double > pixel_size
int project_set_dose(Bproject *project, double dose)
Sets the electron dose of all the micrographs.
long project_divide(Bproject *project, long n)
Divides a project into a number of micrograph subsets.
Bmicrograph ** project_micrograph_array(Bproject *project, long &nmg)
Sets up an array of selected micrograph pointers.
Header file for general utilities.
ostream & tab(ostream &out)
long project_dump(Bproject *project, Bstring &filename)
Dumps particle info in the project hierarchy.
int project_set_particle_box_size(Bproject *project, Vector3< long > box_size)
Sets particle box size to the given value.
int project_set_filament_path(Bproject *project, Bstring &path)
Sets the path to filament files for all the micrographs.
Bparticle ** project_rec_particle_array(Bproject *project, int part_select, long &npart)
Sets up an array of selected particle pointers.
Bbadarea * particle_bad_copy(Bbadarea *badlist)
int project_kill(Bproject *project)
Frees a whole project.
int reconstruction_kill(Breconstruction *rec)
Frees a whole reconstruction parameter structure.
Bsymmetry * init_point_group_symmetry(Bstring symmetry_string)
Sets up a symmetry structure from a string identifier.
int project_set_magnification(Bproject *project, double mag)
Sets the magnification for all the micrographs.
int project_set_mg_pixel_size(Bproject *project, Vector3< double > pixel_size)
Sets the pixel size for all the micrographs.
long project_show_hierarchy(Bproject *project)
Shows the project hierarchy.
Header file for micrograph processing.
Bfield * field_add(Bfield **field, Bstring &field_id)
Adds a field-of-view parameter structure to a linked list.
int project_set_particle_asu_views(Bproject *project, Bstring &symmetry_asu)
Sets particle views within the asymmetric unit.
int rec_part_links(Breconstruction *rec)
Sets the links from particles to reconstructions.
int kill_symmetry(Bsymmetry *sym)
Deallocates a symmetry structure.
Header file for generalized linked list functions.
Header file for general utilities.
int project_revert_filenames(Bproject *project, Bproject *project_old, int flag)
Reverts file names to what it was in an old project.
int particle_update(Bparticle *part, Bparticle *nu_part)
Updates one existing particle with new information.
long project_show_class_averages(Bproject *project)
Shows the class averages in a project.
int project_apply_map_magnifications(Bproject *project, int mag_num, float *mag)
Change particle pixel sizes for particles based on map magnifications.
Bstring path_update(Bstring &filename, Bstring &path)
Vector3< double > pixel_size
int particle_kill(Bparticle *part)
Frees a list of particles.
int filament_kill(Bfilament *fil)
Frees a list of filaments.
int project_set_powerspectrum_path(Bproject *project, Bstring &path)
Sets the path to powerspectrum files for all the micrographs.
long filament_count(Bfilament *fil)
Counts the number of filaments in a linked list of filaments.
bool contains(const Bstring &s)
int project_update(Bproject *project, Bproject *proj_new, int fom_index)
Updates an existing project with new information.
Bmicrograph * micrograph_add(Bmicrograph **mg, Bstring &mg_id)
Adds a micrograph parameter structure to a linked list.
long particle_count(Bparticle *part)
Counts the number of particles in a linked list.
double filament_length(Bfilament *fil)
Calculates the length of a filament.
View * views_from_project(Bproject *project, int selection)
Retrieves the particle views from a project.
long reconstruction_set_part_links(Breconstruction *rec)
Sets the links from particles back to the reconstruction.
int reconstruction_update(Breconstruction *rec, Breconstruction *nu_rec, int fom_index, int flags)
Updates an existing reconstruction with new information.
int project_flip_origins(Bproject *project, int flip)
Flip origin coordinates.
Bmicrograph * micrograph_copy(Bmicrograph *mg)
Copies a micrograph.
Bparticle * particle_copy(Bparticle **partlist, Bparticle *part)
Adds one particle onto a list of particle parameters.