Initial snark14m import
[snark14.git] / src / snark / blob.h
1 /* 
2  ***********************************************************
3  $SNARK_Header: S N A R K  1 4 - A PICTURE RECONSTRUCTION PROGRAM $
4  $HeadURL: svn://dig.cs.gc.cuny.edu/snark/trunk/src/snark/blob.h $
5  $LastChangedRevision: 85 $
6  $Date: 2014-07-02 16:07:08 -0400 (Wed, 02 Jul 2014) $
7  $Author: agulati $
8  ***********************************************************
9  */
10
11 #ifndef BLOB_H
12 #define BLOB_H
13
14 #include "blkdta.h"
15 #include "blob.h"
16
17 #define samp   100000
18
19 // common blob variables
20
21 extern class Blob_class
22 {
23 private:
24
25         REAL radial(REAL dist);REAL lintegral(REAL dist);REAL dc();
26         void p2b_neighb(INTEGER k, INTEGER j, REAL* pict, REAL *nc, REAL rneigh);
27         void Correct(
28         REAL* pict,
29         REAL* blob_array,
30         REAL* u,
31         REAL* Delta,
32         REAL* Gamma,
33         INTEGER* que,
34         INTEGER count,
35         INTEGER* ncount,
36         REAL* sd,
37         REAL width,
38         REAL frelax);
39
40 public:
41         BOOLEAN pix_basis;   //true if pixel basis, false if blob basis
42         REAL support;    // support of a blob
43         REAL shape;    //  shape of a blob
44         REAL delta;    // resolution of the (hexagonal) grid
45         INTEGER area;     // M*H
46         INTEGER diag; // number of diag containing blob centers in the underlying square grid (M+H)/2
47         INTEGER M; // number of underlying square grid points in the horizontal direction
48         INTEGER H; // number of underlying square grid points in the vertical direction
49         REAL *recon;      // array of the blob coefficients
50         REAL *vtable;    // values of the blob function at distances 1e-5*k*support
51         REAL *ltable;   // values of the proj of a blob at distances 1e-5*k*support
52         INTEGER lkf, lkl, ljf, ljl;INTEGER lmf, lml;INTEGER lhf, lhl;INTEGER M2, H2;INTEGER pr;REAL sampiblob; // samp/support
53         REAL di2;        // delta/2
54         REAL di2sq3;     // sqrt3*delta/2
55
56         Blob_class();
57         void setparam();
58         void table();
59         void blob2pix(REAL *blob_array, REAL *pict);
60         void pix2blob(REAL* pict, REAL* blob_array);
61         void footp(REAL* pict, REAL* blob_array, INTEGER option);
62         void bpix(INTEGER nv, INTEGER nh, INTEGER *list, REAL* weight, INTEGER *numb, REAL *snorm);
63         void bwray(INTEGER np,INTEGER nr, INTEGER* list, REAL* weight, INTEGER* numb, REAL* snorm);
64         void bray(INTEGER np, INTEGER nr, INTEGER* list, REAL* weight, INTEGER* numb, REAL* snorm);
65         REAL bpseudo(REAL* pict,INTEGER np,INTEGER nr,INTEGER* list,REAL* weight,INTEGER* numb,REAL* snorm,BOOLEAN line,BOOLEAN constr);
66         void bbldlst(INTEGER** lbase, REAL** wbase);
67         void bsmooth(REAL* a, INTEGER H, INTEGER M, REAL thresh, REAL w1, REAL w2);
68 } Blob;
69
70 #endif