 |
Bsoft
2.1.0
Bernard's software package
|
Go to the documentation of this file.
39 double alpha,
double alpha_step,
double hires,
double lores,
Bimage* pmask,
double threshold)
42 long i, n = 0, nviews;
44 double alpha_max =
TWOPI - alpha_step/2;
50 alpha_min = alpha - alpha_step;
51 alpha_max = alpha + alpha_step;
52 }
else if ( alpha_step >= 1.999*
M_PI ) mode = 2;
54 if ( !p )
return NULL;
65 if ( p->
sizeZ() == 1 ) origin[2] = 0;
67 if ( origin.
sum() == 0 ) {
72 for ( nviews=0, v=view; v; v=v->
next )
73 for ( a=alpha_min; a<=alpha_max; a+=alpha_step ) nviews++;
78 for ( n=0, v=view; v; v=v->
next )
79 for ( a=alpha_min; a<=alpha_max; a+=alpha_step, n++ ) {
81 if ( mode < 2 ) view_arr[n][3] = a;
85 cout <<
"Finding a template in a map:" << endl;
86 cout <<
"Number of views: " << nviews << endl;
87 cout <<
"Alpha step size: " << alpha_step*180.0/
M_PI << endl;
88 cout <<
"Origin: " << origin << endl;
102 cout <<
"#\tx\ty\tz\tvx\tvy\tvz\tva\tCC" << endl;
105 for ( n=0; n<nviews; n++ ) {
107 for ( comp = mod_arr[n]->comp; comp; comp = comp->
next ) {
115 double fommin = 1, fommax = 0, fomavg = 0, fomstd = 0;
116 for ( n=i=0; n<nviews; n++ ) {
117 for ( comp = mod_arr[n]->comp; comp; comp = comp->
next ) {
122 if ( fommin > comp->
fom ) fommin = comp->
fom;
123 if ( fommax < comp->fom ) fommax = comp->
fom;
125 fomstd += comp->
fom*comp->
fom;
133 mod_arr[n]->
comp = NULL;
143 fomstd = fomstd/i - fomavg*fomavg;
144 if ( fomstd > 0 ) fomstd = sqrt(fomstd);
147 cout <<
"FOM minimum and maximum: " << fommin <<
" " << fommax << endl;
148 cout <<
"FOM average: " << fomavg << endl;
149 cout <<
"FOM standard deviation: " << fomstd << endl << endl;
172 double hires,
double lores,
Bimage* pmask,
double threshold)
213 if ( pfom->
maximum() <= 0 )
return NULL;
215 if ( threshold <= 0 ) threshold = pfom->
maximum()/2;
217 long i, j, x, y, z, n;
230 for ( i=j=n=0; n<p->
images(); n++ ) {
232 for ( z=0; z<p->
sizeZ(); z++ ) {
233 for ( y=0; y<p->
sizeY(); y++ ) {
234 for ( x=0; x<p->
sizeX(); x++, i++ ) {
235 if ( (*pfom)[i] >= threshold ) {
242 if ( comp->
loc[0] > h[0] ) comp->
loc[0] -= p->
sizeX();
243 if ( comp->
loc[1] > h[1] ) comp->
loc[1] -= p->
sizeY();
244 if ( comp->
loc[2] > h[2] ) comp->
loc[2] -= p->
sizeZ();
248 comp->
fom = (*pfom)[i];
258 cout <<
"Components generated: " << j << endl << endl;
Bmodel * model_from_peaks(Bimage *p, double threshold, int wrap)
Generates a model from peaks in a map.
Bimage * find_peaks(long kernelsize)
Finds peaks in a map with periodic boundaries.
Header file for reading and writing atomic model files.
Bimage * cross_correlate(Bimage *p, double hires, double lores, fft_plan planf, fft_plan planb)
Calculates a cross-correlation map by Fast Fourier transformation.
Bcomponent * component_add(Bcomponent **comp, Bstring &id)
Adds a component to a linked list.
Header file for general symmetry functions.
Vector3< long > size() const
int calculate_background(long nn, int flag)
Calculates the background for one sub-image.
Bmodel * model_init(Bstring &id)
Initializes a model structure.
void origin(double x, double y, double z)
Bimage * project(char axis, int flags=1)
Projects a 3D image to a 2D image down one of the three major axes.
int rotate()
Rotates an image using parameters defined in the image in place.
int model_kill(Bmodel *model)
Deallocates all memory in the list.
General image parameter class.
Bmodel * model_from_densities_for_view(Bimage *p, Bimage *ptemp, View view, double hires, double lores, Bimage *pmask, double threshold)
Searches a 2D/3D density map for a template using a specific view.
Bmodel * model_from_densities(Bimage *p, Bimage *ptemp, View *view, double alpha, double alpha_step, double hires, double lores, Bimage *pmask, double threshold)
Searches a 2D/3D density map for a template.
Header file for searching for a template in a map and returning multiple hits in a model.
Header file for general utilities.
ostream & tab(ostream &out)
void origin(double ox, double oy, double oz)
void change_type(char letter)
Get the data type indicated by a single letter code.
Header file for 2D and 3D image I/O.
Generalized matrix class.
Header file for generalized linked list functions.
Bcomptype * model_add_type_by_id(Bmodel *model, Bstring &id)
Add a type to a model if the identifier does not exist already.
void sampling(long nn, Vector3< double > u)
void view(double vx, double vy, double vz, double va)
int rescale_to_avg_std(double nuavg, double nustd)
Rescales the image data to a given average and standard deviation.