 |
Bsoft
2.1.0
Bernard's software package
|
Go to the documentation of this file.
56 char order[12] =
"xyz";
70 if (type == 1 || type == 3)
74 cout <<
"Forward radon transform:" << endl;
78 cout <<
"Kernel size and power: " << nkernel <<
" " << kernel_power << endl;
79 cout <<
"Type: " << type << endl;
80 cout <<
"Number of angles: " << ntheta << endl;
81 cout <<
"Padding: " << padd << endl;
83 cout <<
"Transform size: PI x PI\n" << endl;
85 cout <<
"Transform size: 2 PI x 2 PI\n" << endl;
93 ntheta = prad->
sizeZ();
98 strcpy (order,
"zxy");
102 prad =
sin_gal (p, nang, shift, ker, padd, ntheta);
104 strcpy (order,
"xzy");
110 prad2 =
sin_gal (prad, nang, shift, ker, padd, ntheta);
111 if (prad != p)
delete prad;
114 strcpy (order,
"yzx");
143 char order[12] =
"xyz";
152 cout <<
"Backward radon transform:" << endl;
156 cout <<
"Kernel size and power: " << nkernel <<
" " << kernel_power << endl;
157 cout <<
"Type: " << type << endl;
158 cout <<
"Padding: " << padd << endl << endl;
173 strcpy (order,
"zxy");
176 pinv2 =
gal_ricoI (pinv, type, ker, padd);
177 if ( p != pinv )
delete pinv;
184 strcpy (order,
"xzy");
187 pinv2 =
gal_ricoI (pinv, type, ker, padd);
188 if (p != pinv)
delete pinv;
191 strcpy (order,
"yzx");
223 char order[12] =
"xyz";
231 cout <<
"POCS filtering of a radon transform:" << endl;
235 cout <<
"Outer and inner cycles: " << n_cyc_out <<
" " << n_cyc_in << endl;
236 cout <<
"Limiting radii, 3D and plane: " << rad_3D <<
" " << rad_plane << endl;
237 cout <<
"Finiteness support: " << support << endl << endl;
241 for (i = 0; i < n_cyc_out; i++)
248 strcpy (order,
"zxy");
254 strcpy (order,
"xzy");
260 strcpy (order,
"zyx");
295 double x, y, z, f, t, t1;
303 cout <<
"No particle image file name given!" << endl << endl;
317 ntheta = rec_size * 2;
319 if ( origin[0] < 1 ) origin[0] = rec_size / 2;
320 if ( origin[1] < 1 ) origin[1] = rec_size / 2;
321 if ( origin[2] < 1 ) origin[2] = rec_size / 2;
324 cout <<
"Radon transform reconstruction from particle images:" << endl;
328 cout <<
"Reconstruction size: " << ntheta / 2 <<
" " << ntheta / 2 <<
" " << rec_size << endl;
329 cout <<
"Symmetry: " << sym->
label << endl;
330 cout <<
"Kernel size and power: " << nkernel <<
" " << kernel_power << endl;
331 cout <<
"Number of angles: " << ntheta << endl;
332 cout <<
"Threshold: " << threshold << endl;
334 cout <<
"Mask file: " << file_mask << endl << endl;
347 cout <<
"Reconstruction dimensions: " << prec->
size() << endl;
350 if ((priga = (
float *) calloc (prec->
sizeZ(), sizeof (
float))) == 0)
352 perror (
"img_radon_reconstruction: priga error calloc");
356 char order[12] =
"yxz";
363 for (i = 0; i < sym->
n; i++)
368 for (mg = field->
mg; mg; mg = mg->
next)
370 for (part = mg->
part; part; part = part->
next)
375 if (part->
fom[0] >= threshold)
388 cerr <<
"Error: Image file " << mg->
fpart <<
" not read!" << endl;
399 prad =
sin_gal (p, 180, d, ker, padd, ntheta);
405 for ( v=view; v; v=v->
next )
408 for (i = 0; i < ntheta / 2; i++)
410 t1 = (float) i *2. *
M_PI / ntheta;
420 write_line (prad, prec, i, f, t, pmask, lut, priga);
467 if ( newsize[0] == p->
sizeX() && newsize[1] == p->
sizeY() && newsize[2] == p->
sizeZ() )
474 p->
resize(newsize, translate, fill_type, fill);
View * symmetry_get_all_views(Bsymmetry *sym, View asu_view)
Get all symmetry-related views of one given view.
Bimage * img_radon_reconstruction(Bproject *project, Bsymmetry *sym, Bstring &file_mask, int rec_size, int ntheta, int table_size, double threshold, Vector3< double > origin, int nkernel, int kernel_power)
Reconstructs a Radon transform from a set of projections.
long kill_list(char *list, unsigned long size)
Frees all the items in a linked list.
void reslice(const char *order)
Bimage * img_radon_transform(Bimage *p, int type, int nkernel, int kernel_power, int padd, int ntheta)
Calculates the Radon transform of an image.
int rotZ_cart(double x, double y, double z, double ang, double *xx, double *yy, double *zz)
Rotates a vector of cartesian coordinates along the Z axis.
Header file for general symmetry functions.
double background(long nn)
Vector3< long > size() const
int img_radon_pocs_filter(Bimage *p, int n_cyc_out, int n_cyc_in, double rad_3D, double rad_plane, int support, Bimage *pmask)
Filters a radon transform using the POCS method.
int mean_to_0(Bimage *p)
Set each value equal to old_value-(first image pixel)
kernel * kernel_prep(int nk, int power)
Bimage * read_img(char *filename, int readdata, int img_select)
General driver function to read multiple image formats.
void origin(double x, double y, double z)
int write_img(const char *filename, Bimage *p, int compression)
General driver function to write multiple image formats.
Bimage * sin_gal(Bimage *p, int tipo, Vector3< float > shift, kernel *ker, int padd, int n_theta)
Bimage * copy_I_part_rad(Bimage *p)
int img_resize_to_next_power2(Bimage *p, int fill_type, double fill)
Resizes without interpolation or rescaling to the next power of 2.
General image parameter class.
Header file for image class.
Header file for general utilities.
int rotY_cart(double x, double y, double z, double ang, double *xx, double *yy, double *zz)
Rotates a vector of cartesian coordinates along the Y axis.
void change_type(char letter)
Get the data type indicated by a single letter code.
Generalized matrix class.
Header file for micrograph processing.
Header file for generalized linked list functions.
Bimage * img_radon_inverse_transform(Bimage *p, int type, int nkernel, int kernel_power, int padd)
Calculates a 3D image from a Radon transform.
Bimage * gal_ricoI(Bimage *p, int tipo, kernel *ker, int padd)
Reconstruct an image from a sinogram.
int copy_II_part_rad(Bimage *p)
int findNextPowerOf(int startNumber, int powerOf)
Finds the next greatest number that is a power of a given number.
int resize(Vector3< long > nusize, Vector3< long > translate, int fill_type=0, double fill=0)
Resizes without interpolation or rescaling.