fdhwlib  2.0.25
/home/kopmann/git-mirror/fdhwlib/fdhwlib/akutil/analysematrix.h
Go to the documentation of this file.
00001 /***************************************************************************
00002     analyseMatrix.h  -  description
00003 
00004     begin                : Tue Apr 18 2006
00005     copyright            : (C) 2006 by Andreas Kopmann
00006     email                : kopmann@hpe.fzk.de
00007  ***************************************************************************/
00008 
00009 
00010 #ifndef ANALYSEMATRIX_H
00011 #define ANALYSEMATRIX_H
00012 
00013 #include <cstdio>
00014 
00015 
00022 class analyseMatrix {
00023 public: 
00024   analyseMatrix();
00025   ~analyseMatrix();
00026 
00033   void filterBy2x2(int filter[2][2], int col, int row, 
00034            double matrix[20][22], double res[20][22], int mask[20][22]);
00035 
00037   void displayMatrix(FILE *fout, double matrix[20][22], const char *title);
00038 
00044   void displayMatrix(FILE *fout, int matrix[20][22], const char *title, int norm = 0, 
00045                       int value = 0, const char *tag = 0);
00046 
00049   int displayPixelList(FILE *fout, int matrix[20][22]);
00050 
00057   void classifyByThreshold(double thresh, double matrix[20][22], int res[20][22], int up = 1);
00058 
00060   void setMatrix(double value, double matrix[20][22]);
00061   void setMatrix(int value, int matrix[20][22]);
00062 
00064   void multMatrix(double value, double matrix[20][22]);  
00065 
00067   void multMask(int value, int mask[20][22]);
00068   
00070   void divMatrix(double res[20][22], double matrix[20][22]);
00071   
00073   void divMatrix(double res[20][22], int matrix[20][22]);
00074   
00077   void meanMatrix(double matrix[20][22], 
00078               double *mean, double *var, int *n, int mask[20][22]);
00079 
00080   void meanMatrix(double matrix[20][22], 
00081               double *mean, double *var, int *n, int mask[20][22], int err[20][22]);
00082 
00084   void addMask(int res[20][22], int mask[20][22]);
00085 
00087   void addMatrix(double res[20][22], double matrix[20][22]);
00088   
00090   void copyMatrix(double res[20][22], double matrix[20][22]);
00091   
00092     
00094   void orMask(int res[20][22], int mask[20][22]);
00095 
00097   void invertMask(int mask[20][22]); 
00098 
00100   int nMask(int mask[20][22]);
00101 
00103   void copyMask(int res[20][22], int mask[20][22]);
00104 
00106   void maxMask(int max, int mask[20][22]);
00107 
00109   void minMask(int min, int mask[20][22]);
00110 
00111   
00126   void findHighNoise1(FILE *fout, double matrix[20][22], int res[20][22], int err[20][22]);
00127 
00147   void findHighNoise2(FILE *fout, double matrix[20][22], int res[20][22], int err[20][22]);
00148   
00149   // ======= Function working with the local arrays ============
00150         
00152   void clearNoisyPixel(); 
00153   
00155   void clearFaultyPixel();
00156 
00158   void  addNoisyPixel(int mask[20][22]);
00159   
00161   void findHighNoise(FILE *fout, double matrix[20][22]);
00162 
00165   void meanOfNormalPixel(double matrix[20][22], 
00166               double *mean, double *var, int *n);
00167       
00170   void meanOfNoisyPixel(double matrix[20][22], 
00171               double *mean, double *var, int *n);
00172 
00174   int nNoisyPixel();      
00175   
00177   void displayNoisyPixelList(FILE *fout);       
00178 
00179                   
00180   // ========== Local arrays =======
00181       
00185   int noisyPixel[20][22];
00186 
00188   int noisyPixelLast[20][22];
00189   
00193   int faultyPixel[20][22];
00194 
00196   int noisyRuns;
00197 
00198 
00202   double noisyNVariances;
00203 
00206   int noisyMinVariance;
00207 
00209   double noisyNeighborDiff;
00210  
00212   double noisyAbsThresh; 
00213 
00216   double noisyLowThresh;  
00217 
00218   
00220   int debug;
00221   
00222 };
00223 
00224 #endif