54 unsigned long i, j, n;
56 double maxrad, scale, x, y, z;
58 maxrad = p->
sizeX()/2;
59 if ( maxrad < p->sizeY()/2 ) maxrad = p->
sizeY()/2;
60 if ( maxrad < p->sizeZ()/2 ) maxrad = p->
sizeZ()/2;
62 if ( nannuli < 0 )
return -1;
63 if ( nannuli < 1 ) nannuli = (long) maxrad;
64 if ( nphi < 1 ) nphi = 90;
65 if ( p->
sizeY() < 2 ) nphi = 1;
66 if ( ntheta < 1 ) ntheta = 50;
67 if ( p->
sizeZ() < 2 ) ntheta = 1;
69 double dannulus = maxrad*1.0/nannuli;
70 double dphi =
TWOPI/nphi;
71 double dtheta =
M_PI/ntheta;
72 double cos_phi, sin_phi, cos_theta, sin_theta;
74 unsigned long datasize = nannuli*nphi*ntheta;
76 float* sphdata =
new float[datasize];
79 cout <<
"Spherical image size: " <<
80 nannuli <<
" " << nphi <<
" " << ntheta << endl;
81 cout <<
"Step sizes: " << dannulus*p->
sampling().x() <<
" A "
82 << dphi*180.0/
M_PI <<
" degree " << dtheta*180.0/
M_PI <<
" degree" << endl;
84 cout <<
"Converting to spherical coordinates" << endl << endl;
88 cout <<
"Image\tOrigin" << endl;
89 for ( n=0; n<p->
images(); n++ ) {
93 for ( theta=0; theta<ntheta; theta++ ) {
94 cos_theta = dannulus*
bcos(dtheta*theta);
95 sin_theta = dannulus*
bsin(dtheta*theta);
96 for ( phi=0; phi<nphi; phi++ ) {
97 cos_phi =
bcos(dphi*phi);
98 sin_phi = -
bsin(dphi*phi);
99 for ( ann=0; ann<nannuli; ann++ ) {
100 j = ((n*ntheta + theta)*nphi + phi)*nannuli + ann;
101 scale = ann*sin_theta;
112 if (
verbose & VERB_PROCESS ) cout << endl;
114 p->
size(nannuli, nphi, ntheta);
120 cout <<
"DEBUG img_cartesian_to_spherical: Calculating statistics" << endl;
156 unsigned long i, j, n, x, y, z;
157 long ann, phi, xx, yy;
158 double maxrad, xpoint, ypoint;
161 maxrad = p->
sizeX()/2;
162 if ( maxrad < p->sizeY()/2 ) maxrad = p->
sizeY()/2;
164 if ( nannuli < 0 )
return -1;
165 if ( nannuli < 1 ) nannuli = (long) maxrad;
166 if ( nphi < 1 ) nphi = 90;
167 if ( p->
sizeY() < 2 ) nphi = 1;
169 double dannulus = maxrad*1.0/nannuli;
170 double dphi =
TWOPI/nphi;
171 double cos_phi, sin_phi;
173 unsigned long datasize = nannuli*nphi*p->
sizeZ();
175 float* cyldata =
new float[datasize];
177 for ( i=0; i<datasize; i++ ) cyldata[i] = 0;
180 cout <<
"Cylindrical image size: " <<
181 nannuli <<
" " << nphi <<
" " << p->
sizeZ() << endl;
182 cout <<
"Step sizes: " << dannulus*p->
sampling().x() <<
" A "
183 << dphi*180.0/
M_PI <<
" degree" << endl;
185 cout <<
"Converting to cylindrical coordinates" << endl << endl;
189 cout <<
"Image\tOrigin" << endl;
190 for ( n=0; n<p->
images(); n++ ) {
194 for ( z=0; z<p->
sizeZ(); z++ ) {
195 for ( phi=0; phi<nphi; phi++ ) {
196 cos_phi =
bcos(dphi*phi);
197 sin_phi = -
bsin(dphi*phi);
198 for ( ann=0; ann<nannuli; ann++ ) {
199 j = ((n*p->
sizeZ() + z)*nphi + phi)*nannuli + ann;
205 for ( yy=y; yy<y+2 && yy<p->
sizeY(); yy++ ) {
208 if ( yy >= 0 )
for ( xx=x; xx<x+2 && xx<p->
sizeX(); xx++ ) {
212 i = p->
index(0,xx,yy,z,n);
214 cyldata[j] += w*(*p)[i];
224 if (
verbose & VERB_PROCESS ) cout << endl;
226 p->
size(nannuli, nphi, p->
size().z());
231 cout <<
"DEBUG img_cartesian_to_cylindrical: Calculating statistics" << endl;
256 unsigned long i, j, n, x, y, z;
258 double dx2, dy2, dz, dz2, d2, oldz, fraction;
261 float* shell =
new float[datasize];
264 cout <<
"Converting to radial shells" << endl << endl;
268 cout <<
"Image\tOrigin" << endl;
269 for ( j=n=0; n<p->
images(); n++ ) {
273 for ( z=0; z<p->
sizeZ(); z++ ) {
276 for ( y=0; y<p->
sizeY(); y++ ) {
279 for ( x=0; x<p->
sizeX(); x++, j++ ) {
282 d2 = dz2 - dy2 - dx2;
284 if ( dz < 0 ) oldz = p->
image[n].
origin().z() - sqrt(d2);
287 if ( zz >= 0 && zz < p->sizeZ() ) {
288 fraction = 1 + zz - oldz;
289 i = p->
index(0,x,y,zz,n);
290 shell[j] = fraction*(*p)[i];
292 if ( zz < p->sizeZ() ) {
293 fraction = 1 - fraction;
294 i += p->sizeY()*p->sizeX();
295 shell[j] += fraction*(*p)[i];
304 if (
verbose & VERB_FULL ) cout <<
"" << endl;
331 unsigned long i, j, n, x, y, z;
333 double dx, dy, dx2, dy2, d2, oldy, fraction;
336 float* shell =
new float[datasize];
339 cout <<
"Converting to cylindrical shells" << endl << endl;
343 cout <<
"Image\tOrigin" << endl;
344 for ( j=n=0; n<p->
images(); n++ ) {
348 for ( z=0; z<p->
sizeZ(); z++ ) {
351 for ( y=0; y<p->
sizeY(); y++ ) {
354 for ( x=0; x<p->
sizeX(); x++, j++ ) {
359 if ( dy < 0 ) oldy = p->
image[n].
origin().y() - sqrt(d2);
362 if ( yy >= 0 && yy < p->sizeY() ) {
363 fraction = 1 + yy - oldy;
365 i = p->
index(0,x,yy,z,n);
366 shell[j] = fraction*(*p)[i];
368 if ( yy < p->sizeY() ) {
369 fraction = 1 - fraction;
371 shell[j] += fraction*(*p)[i];
380 if (
verbose & VERB_FULL ) cout << endl;
396 for ( i=0; i<ns; i++ ) {
398 if ( rmax < r ) rmax = r;
408 unsigned long i, x, y, z, n;
415 if ( !vs )
return -1;
417 if ( ns < 2 ) spherical_fraction = 1;
420 cout <<
"Calculating radial distances:" << endl;
421 cout <<
"Symmetry: " << sym->
label <<
" (" << ns <<
")" << endl;
422 cout <<
"Spherical fraction: " << spherical_fraction << endl;
429 for ( i=n=0; n<p->
images(); n++ ) {
430 for ( z=0; z<p->
sizeZ(); z++ ) {
432 for ( y=0; y<p->
sizeY(); y++ ) {
434 for ( x=0; x<p->
sizeX(); x++, i++ ) {
440 rf = rf + spherical_fraction*(1 - rf);
458 long zr,
double rad_start,
double rad_step)
460 unsigned long j, j1, x, y, z, zj;
461 unsigned long slice_size = p->
sizeX()*p->
sizeY();
462 unsigned long image_size = slice_size*p->
sizeZ();
463 unsigned long i = (
unsigned long) (n*prad->
size().volume() + zr*slice_size);
464 double r = rad_step*zr + rad_start;
466 float* fom = (
float *) p->
FOM();
468 for ( y=0; y<prad->
sizeY(); y++ ) {
469 for ( x=0; x<prad->
sizeX(); x++, i++ ) {
470 j = n*image_size + y*p->
sizeX() + x;
471 for ( z=0, zj=p->
sizeZ()+1, drp=1; z<p->
sizeZ() && zj>=p->
sizeZ(); z++, j+=slice_size ) {
473 if ( dr > 0 && drp <= 0 ) zj = z;
476 if ( zj < p->sizeZ() ) {
477 j1 = n*image_size + zj*slice_size + y*p->
sizeX() + x;
479 dr = (fom[j1] - r)/(fom[j1] - fom[j]);
480 prad->
set(i, dr*(*p)[j]);
482 prad->
set(i, (*prad)[i] + dr*(*p)[j1]);
510 double spherical_fraction,
Bstring& symmetry_string)
512 if ( rad_start < 0 ) rad_start = 0;
513 if ( rad_start >= p->
sizeZ()/2 ) rad_start = p->
sizeZ()/2;
514 if ( rad_end <= 0 ) rad_end = p->
sizeZ()/2;
515 if ( rad_end >= p->
sizeZ()/2 ) rad_end = p->
sizeZ()/2 - 1;
516 if ( rad_end < rad_start ) rad_end = rad_start;
517 if ( rad_step <= 0 ) rad_step = 1;
523 unsigned long nz = (
unsigned long) ((rad_end - rad_start)/rad_step + 1);
526 cout <<
"Calculating radial shells:" << endl;
527 cout <<
"Radial range: " << rad_start <<
" - " << rad_end << endl;
528 cout <<
"Radial step size: " << rad_step << endl;
529 cout <<
"New image size: " << p->
sizeX() <<
" x " << p->
sizeY() <<
" x " << nz <<
" x " << p->
images() << endl << endl;
535 for ( n=0; n<p->
images(); n++ ) {
539 dispatch_apply(nz, dispatch_get_global_queue(0, 0), ^(
size_t z){
543 #pragma omp parallel for
544 for (
long z=0; z<nz; z++ )
577 int i, j, n, x, y, z, xx, yy, ix, iy, iz, iyn, izn, ann, ipsi, maxrad, num = 0;
578 double dann, dpsi, cos_psi, sin_psi, xpoint, ypoint, wx, wy, sum = 0, sqsum = 0;
580 if ( ann_min > ann_max ) swap(ann_min, ann_max);
581 if ( ann_min < 0 ) ann_min = 0;
582 if ( ann_max >= nannuli ) ann_max = nannuli - 1;
583 if ( ann_min == ann_max ) {
585 ann_max = nannuli - 1;
589 if ( maxrad < p->sizeY() ) maxrad = p->
sizeY();
591 dann = maxrad*1.0/nannuli;
592 dpsi =
M_PI*2.0/nangles;
597 cout <<
"Calculating a polar image:" << endl;
598 cout <<
"Annular step size: " << dann <<
" pixels" <<endl;
599 cout <<
"Angular step size: " << dpsi*180/
M_PI <<
" degrees" << endl;
600 cout <<
"Annular range: " << ann_min <<
" - " << ann_max << endl << endl;
602 cout <<
"Calculating a polar image" << endl << endl;
604 for ( n=0; n<pp->
images(); n++ ) {
606 cout <<
"Origin: " << p->
image[n].
origin() << endl;
607 for ( z=0; z<pp->
sizeZ(); z++ ) {
608 iz = n*pp->
sizeZ() + z;
610 for ( ipsi=0; ipsi<nangles; ipsi++ ) {
611 cos_psi = dann*
bcos(dpsi*ipsi);
612 sin_psi = dann*
bsin(dpsi*ipsi);
613 for ( ann=ann_min; ann<=ann_max; ann++ ) {
614 j = (iz*nannuli + ann)*nangles + ipsi;
617 while ( xpoint < 0 ) xpoint += p->
sizeX();
618 while ( ypoint < 0 ) ypoint += p->
sizeY();
619 while ( xpoint >= p->
sizeX() ) xpoint -= p->
sizeX();
620 while ( ypoint >= p->
sizeY() ) ypoint -= p->
sizeY();
625 for ( yy=y; yy<y+2; yy++ ) {
627 iy = ( yy >= p->
sizeY() )? iy = yy - p->
sizeY(): yy;
628 iyn = izn + iy*p->
sizeX();
629 for ( xx=x; xx<x+2; xx++ ) {
631 ix = ( xx >= p->
sizeX() )? ix = xx - p->
sizeX(): xx;
633 pp->
set(j, (*pp)[j] + wx*wy*(*p)[i]);
638 sqsum += (*pp)[j]*(*pp)[j];
645 cout <<
"DEBUG img_polar_transform: Calculating statistics" << endl;
674 int transform_flag,
int norm_flag)
679 if ( transform_flag ) pps->
fft();
685 unsigned long i, j, n, x, y;
686 long xx, yy, ix, iy, iann, ipsi, maxrad, ilarge;
687 long nlarge = npsi * ((long) (
M_PI*pps->
sizeX()*1.0/npsi + 1));
688 double psi_ratio = npsi*1.0/nlarge;
689 double dlarge =
M_PI*2.0/nlarge;
690 double dpsi =
M_PI*2.0/npsi;
691 double dann, xpoint, ypoint, wx, wy, max;
693 maxrad = pps->
sizeX();
694 if ( maxrad < pps->sizeY() ) maxrad = pps->
sizeY();
696 dann = maxrad*1.0/nannuli;
698 unsigned long datasize = (
unsigned long) pps->
images()*nannuli*npsi;
700 float* pdata =
new float[datasize];
701 for ( i=0; i<datasize; i++ ) pdata[i] = 0;
703 float* avg =
new float[nannuli];
707 cout <<
"Calculating a polar power spectrum:" << endl;
708 cout <<
"Origin: " << pps->
image[0].
origin() << endl;
709 cout <<
"Fourier transform size: " << pps->
sizeX() <<
" x " << pps->
sizeY() <<
" pixels" << endl;
710 cout <<
"Polar power spectrum size: " << nannuli <<
" annuli x " << npsi <<
" angles" << endl;
711 cout <<
"Annular step size: " << dann <<
" pixels" << endl;
712 cout <<
"Angular step size: " << dpsi*180/
M_PI <<
" degrees" << endl << endl;
714 cout <<
"Calculating a polar power spectrum" << endl << endl;
717 cout <<
"DEBUG img_polar_power_spectrum: nlarge=" << nlarge <<
" psi_ratio=" << psi_ratio << endl;
719 for ( n=0; n<pps->
images(); n++ ) {
720 for ( j=0; j<nannuli; j++ ) avg[j] = 0;
721 for ( iann=0; iann<nannuli; iann++ ) {
722 for ( ilarge=0; ilarge<nlarge; ilarge++ ) {
723 ipsi = (long) (ilarge*psi_ratio + 0.5);
724 if ( ipsi >= npsi ) ipsi -= npsi;
725 j = (n*nannuli + iann)*npsi + ipsi;
729 if ( xpoint < 0 ) xpoint += pps->
sizeX();
730 if ( ypoint < 0 ) ypoint += pps->
sizeY();
731 if ( xpoint >= pps->
sizeX() ) xpoint -= pps->
sizeX();
732 if ( ypoint >= pps->
sizeY() ) ypoint -= pps->
sizeY();
733 x = (long) floor(xpoint);
734 y = (long) floor(ypoint);
735 for ( xx=x; xx<x+2; xx++ ) {
736 wx = 1.0 - fabs(xx - xpoint);
739 for ( yy=y; yy<y+2; yy++ ) {
740 wy = 1.0 - fabs(yy - ypoint);
744 pdata[j] += wx*wy*(*pps)[i];
749 for ( ipsi=0; ipsi<npsi; ipsi++ ) {
750 j = (n*nannuli + iann)*npsi + ipsi;
751 pdata[j] *= psi_ratio;
752 if ( max < pdata[j] ) max = pdata[j];
753 avg[iann] += pdata[j];
756 if ( norm_flag & 0x01 ) {
758 for ( ipsi=0; ipsi<npsi; ipsi++ ) {
759 j = (n*nannuli + iann)*npsi + ipsi;
766 if ( norm_flag & 0x02 ) {
768 for ( iann=0; iann<nannuli; iann++ ) {
769 for ( ipsi=0; ipsi<npsi; ipsi++ ) {
770 j = (n*nannuli + iann)*npsi + ipsi;
771 pdata[j] -= mov_avg[iann];
782 pps->
size(npsi, nannuli, 1);
788 cout <<
"DEBUG img_polar_power_spectrum: Calculating statistics" << endl;
810 if ( resolution < 2*p->sampling().x() ) resolution = 2*p->
sampling().x();
812 unsigned long max_rad = (
unsigned long) (p->
sizeX()*p->
sampling().x()/resolution);
813 if ( max_rad > p->
sizeX()/2 ) max_rad = p->
sizeX()/2;
814 unsigned long max_ang = num_angle*max_rad;
817 unsigned long i, j, n, r, a;
818 long ix, ix1, iy, iy1;
819 double ang, x, y, fx, fy;
820 double v00, v01, v10, v11;
823 cout <<
"Calculating a radial power spectrum: " << max_rad <<
" annuli x " << max_ang <<
" angles" << endl;
825 for ( n=0; n<pps->
images(); n++ ) {
826 for ( r=1; r<max_rad; r++ ) {
827 max_ang = num_angle*r;
828 for ( a=0; a<max_ang; a++ ) {
831 ang = a*
TWOPI/max_ang;
834 ix = (long) floor(x);
835 iy = (long) floor(y);
840 if ( ix < 0 ) ix += p->
sizeX();
841 if ( ix1 < 0 ) ix1 += p->
sizeX();
842 if ( iy < 0 ) iy += p->
sizeY();
843 if ( iy1 < 0 ) iy1 += p->
sizeY();
852 pps->
set(j, (v00 - fx*(v00 - v01) - fy*(v00 - v10) + fx*fy*(v00 - v01 - v10 + v11)) * r);
880 unsigned long i, j, n, x, y, z;
881 long nz, np, iann, iseg;
882 double ann, fraction;
883 double xx, yy, x2, y2, z2, dann = 1, angle;
886 if ( nseg < 1 ) nseg = 1;
887 if ( nseg > 360 ) nseg = 360;
888 if ( nannuli < 1 || nannuli > p->
sizeX()/2 ) nannuli = p->
sizeX()/2;
889 if ( p->
sizeX() > 1 ) dann = realsize.x()/(2.0*nannuli);
890 if ( p->
sizeY() > 1 && dann > p->
sampling().y() ) dann = realsize.y()/(2.0*nannuli);
891 if ( p->
sizeZ() > 1 && dann > p->
sampling().z() ) dann = realsize.z()/(2.0*nannuli);
893 double dseg =
M_PI*2.0/nseg;
895 unsigned long datasize = (
unsigned long) ppol->
images()*ppol->
sizeZ()*nseg*nannuli;
897 float* pdata =
new float[datasize];
898 float* num =
new float[datasize];
900 for ( i=0; i<datasize; i++ ) pdata[i] = num[i] = 0;
902 ppol->
size(nannuli, nseg, 1);
907 cout <<
"Calculating radial segments:" << endl;
908 cout <<
"First image origin: " << ppol->
image[0].
origin() << endl;
909 cout <<
"Number of annuli: " << nannuli << endl;
910 cout <<
"Number of segments: " << nseg << endl;
911 cout <<
"Annular step size: " << dann <<
" A" << endl;
912 cout <<
"Segment width: " << dseg*180.0/
M_PI <<
" degrees" << endl << endl;
914 cout <<
"Calculating radial segments" << endl << endl;
916 for ( n=0; n<ppol->
images(); n++ ) {
917 if ( ppol->
sizeZ() < 2 )
919 for ( z=0; z<ppol->
sizeZ(); z++ ) {
923 np = (n*ppol->
sizeZ() + z)*nseg;
924 for ( y=0; y<ppol->
sizeY(); y++ ) {
927 for ( x=0; x<ppol->
sizeX(); x++ ) {
930 ann = sqrt(x2 + y2 + z2)/dann;
932 if ( iann < nannuli ) {
933 angle = atan2(yy,xx);
934 if ( angle < 0 ) angle +=
TWOPI;
935 iseg = (long) floor(angle/dseg);
936 if ( iseg >= nseg ) iseg = nseg - 1;
937 j = (nz + y)*ppol->
sizeX() + x;
938 i = (np + iseg)*nannuli + iann;
939 fraction = 1.0 - ann + iann;
941 pdata[i] += fraction*(*ppol)[j];
942 if ( iann < nannuli - 1 ) {
943 fraction = 1.0 - fraction;
946 pdata[i] += fraction*(*ppol)[j];
955 for ( i=0; i<datasize; i++ )
956 if ( num[i] ) pdata[i] /= num[i];
963 float* seg =
new float[nseg*2];
965 for ( i=0; i<nseg*2; i++ ) seg[i] = 0;
968 for ( n=0; n<ppol->
images(); n++ ) {
969 for ( z=0; z<ppol->
sizeZ(); z++ ) {
970 np = (n*ppol->
sizeZ() + z)*nseg;
971 for ( iann=0; iann<nannuli; iann++ ) {
972 i0 = i1 = i2 = i3 = -1;
973 for ( iseg=0; iseg<nseg; iseg++ ) {
974 i = (np + iseg)*nannuli + iann;
975 seg[iseg] = seg[iseg+nseg] = pdata[i];
976 if ( i1 < 0 && num[i] > 1e-30 ) i0 = i1 = iseg;
977 if ( num[i] > 1e-30 ) i3 = iseg + nseg;
980 for ( i2=i1+1; fabs(seg[i2]) < 1e-30 && i2 < 2*nseg-1; i2++ ) ;
982 for ( i=i1+1; i<i2; i++ )
983 seg[i] = ((i2 - i)*seg[i1] + (i - i1)*seg[i2])*di;
986 for ( iseg=0; iseg<nseg; iseg++ ) {
987 i = (np + iseg)*nannuli + iann;
988 if ( iseg < i0 ) pdata[i] = seg[iseg+nseg];
989 else pdata[i] = seg[iseg];
void change_type(char letter)
Get the data type indicated by a single letter code.
Bimage * img_polar_transform(Bimage *p, int nannuli, int nangles, int ann_min, int ann_max)
Transforms a cartesian image to polar or cylindrical coordinates.
Header file moving average calculations.
double bcos(double x)
Avoid non-zero values for cos(PI/2) and cos(-PI/2).
Header file for general utilities.
CompoundType compound_type()
Bimage * img_polar2D(Bimage *p, int nannuli, int nseg)
Calculates radial segment averages from an image.
Generalized matrix class.
int kill_symmetry(Bsymmetry *sym)
Deallocates a symmetry structure.
size_t index(size_t nx, size_t ny)
int img_set_radial_distances(Bimage *p, double spherical_fraction, Bstring &symmetry_string)
double interpolate(size_t cc, double xx, double yy, double zz, size_t nn, double fill) const
Interpolates using a given location.
size_t statistics()
Calculates the statistics for an image.
double bsin(double x)
Avoid non-zero values for sin(PI) and sin(-PI).
General image parameter class.
float * moving_average(int number, float *x, int window)
Calculates a moving average over an array of data.
Vector3< double > real_size()
float * FOM_initialize()
Allocates and initializes the FOM block.
Complex< double > complex(size_t j)
Returns a complex value at the given index.
int img_radial_shells(Bimage *p)
Calculates an image with slices representing radial shell projections.
unsigned char * data_assign(unsigned char *nudata)
Assign image data.
General FFT for n-dimensional data.
Bsymmetry * init_point_group_symmetry(Bstring symmetry_string)
Sets up a symmetry structure from a string identifier.
double scalar(const Vector3 &v) const
void complex_to_intensities()
The intensities from a complex image is written to a simple image.
Library routines for polar and spherical transformations and calculations.
Header file for trigonometry functions.
void origin(double x, double y, double z)
void set(size_t j, double v)
Sets a single value at the given index.
Bimage * img_radial_sections(Bimage *p, double rad_start, double rad_end, double rad_step, double spherical_fraction, Bstring &symmetry_string)
Calculates an image with slices giving the radial section projections.
int write_img(const char *filename, Bimage *p)
General driver function to write multiple image formats This is the only image writing function that ...
Vector3< float > * symmetry_get_axes(Bsymmetry *sym, int *n)
Get all symmetry axes.
Bimage * copy()
Copies the header information and data of an image into a new image structure.
int img_cartesian_to_spherical(Bimage *p, int nannuli, int nphi, int ntheta)
Calculates an image with spherical coordinates.
double radius_wrt_sym_axes(Vector3< float > c, int ns, Vector3< float > *vs)
int img_cylindrical_shells(Bimage *p)
Calculates an image with slices representing cylindrical shell projections.
Vector3< size_t > page_size()
Bimage * img_polar_power_spectrum(Bimage *p, int nannuli, int npsi, int transform_flag, int norm_flag)
Calculates the polar power spectrum from a Fourier transform.
int img_radial_section(Bimage *p, Bimage *prad, unsigned long n, long zr, double rad_start, double rad_step)
int img_cartesian_to_cylindrical(Bimage *p, int nannuli, int nphi)
Calculates an image with cylindrical coordinates.
ostream & tab(ostream &out)