/* MathLib routines
/***************************************************************************
*	MathLib.h - Part of ImgLib
* Please note last saved date below:
*  $Date: 2008/05/16 16:05:58 $

* A set of primitives for use in image processing. * c 1996-2002 Mark S. Cohen * This software is distributed as is with no guarantees. * Please report any errors or bug fixes to mscohen@ucla.edu * * For academic use only. Commercial users should contact * Mark Cohen for licensing information. * function definitions */ /* N.B. call this once before using any of the Fourier library routines */ void GetMathLibVer( char *buff ); OSErr TwoDGauss( float *data, float xwidth, float ywidth, short xs, short ys ); OSErr Complex2DGauss( float *data, float xwidth, float ywidth, short xs, short ys ); OSErr Complex3DGauss( float *data, float xwidth, float ywidth, float zwidth, short xs, short ys, short zs ); OSErr vconvolve1D( float *invec, int vlength, float *outvec, float *kernel, int kernelLength ); /* from Numerical recipes. May not be re-used without permission */ Boolean fft_bitrev_sincos_lut_init(); OSErr bitreverse(int nsize, COMPLEX *pptr_cf, int *ppbitrev); OSErr bitrev_norm(int nsize, COMPLEX *pptr_cf, int *ppbitrev); OSErr cfft(float *data, int size, char flag); OSErr cfft2d(float *data, int nx, int ny, char direction); OSErr cfft3d(float *data, int nx, int ny, int nz, char direction); void exch_quad( float *inbuf, short xsize, short ysize ); OSErr exch_quad3d( float *inbuf, short xsize, short ysize, short zsize ); void RealToComplex( float *vec, long npts ); OSErr vreal( float *inbuf, float *outbuf, long nPairs ); OSErr vimag( float *inbuf, float *outbuf, long nPairs ); OSErr vmagphas( float *inbuf, float *outbuf, long nPairs ); OSErr vmag( float *in, short inStride, float *out, short outStride, long nPairs ); OSErr vphase( float *in, short inStride, float *out, short outStride, long nPairs ); OSErr vdegree( float *in, short inStride, float *out, short outStride, long nPairs ); OSErr PadVolume( void *inVol, void *outVol, IMAGE *im, int PadXS, int PadYS, int PadZS, int direction ); /* functions used by gaussSmooth */ typedef struct { long ImSize, VolSize; int PaddedXS, PaddedYS, PaddedZS; // sizes of the padded data volume long DataVolSize; // number of complex pairs float ySmooth, zSmooth, xSmooth; // in pixels! Boolean VolumeMode; } SmoothGlobal; OSErr gaussSmooth( IMAGE *im, void *vin, void *vout, float *xSmooth, float *ySmooth, float *zSmooth ); OSErr FirstFT( float *imData, SmoothGlobal g ); OSErr CalcDimensions( IMAGE *im, SmoothGlobal g ); OSErr gaussMultiply( float *imData, float *gaussKernel, IMAGE *im, SmoothGlobal g ); OSErr Linfit( float *xvals, float *yvals, int nx, float *slope, float *intercept, float *chi2 ); /* Statistical functions, based on Numerical Recipes. May not be used without permission */ OSErr correlation( float *X, float *Y, double *r, double *slope, long npairs ); OSErr pcorr( double r, double slope, double *p, double *conf95, long npairs ); float gasdev(long *idum); float gammln(float xx); float betacf(float a, float b, float x); float betai(float a, float b, float x); #endif /*

*/