M_coocur.h

Go to the documentation of this file.
00001 /*
00002 *    Copyright (c) 2007. The BATI team. All right reserved.
00003 *
00004 *    This file is part of BATI library.
00005 *
00006 *    BATI library is free software: you can redistribute it and/or modify
00007 *    it under the terms of the GNU General Public License as published by
00008 *    the Free Software Foundation, either version 3 of the License, or
00009 *    (at your option) any later version.
00010 *
00011 *    BATI library  is distributed in the hope that it will be useful,
00012 *    but WITHOUT ANY WARRANTY; without even the implied warranty of
00013 *    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
00014 *    GNU General Public License for more details.
00015 *
00016 *    You should have received a copy of the GNU General Public License
00017 *    along with BATI library.  If not, see <http://www.gnu.org/licenses/>.
00018 */
00019 /* *************************M_coocur.h  ********************************/
00020 /*                                                                   */
00021 /*descripteurs et prototypes associes a l'operateur de la matrice de coocurence*/
00022 /*                                                                   */
00023 /*  Derniere modif : G. Selaru, 29.04.05                          */
00024 /* *******************************************************************/
00025 /*pas de code avant cette ligne */
00026 
00027 #ifndef __Mcoocur
00028 #define __Mcoocur
00029 
00030 #include "volume.h"   /* descripteurs et prototypes des fonctions de ima3D */
00031 #include "image.h"
00032 
00033 enum attribute_index {a_contrast, a_correlation, a_directivity, a_entropy, a_homogenity, a_local_homogenity, a_sum_average, a_sum_entropy, a_uniformity};
00034 
00035 #define total_attributes 9
00036 
00037 typedef struct
00038 {
00039     int Matcoocur[256][256];
00040     int nonZeros;
00041 //     double moyenne_x, moyenne_y, variance_x, variance_y;
00042     
00043     unsigned int contrast; // will overflow for a window larger than 40x40x40, 1 color
00044     unsigned int x_y_m; // for correlation; will overflow for a window larger than 40x40x40, 1 color
00045     unsigned int x_m; // for correlation; will overflow for a window larger than 40x40x40, 1 color
00046     unsigned int y_m; // for correlation
00047     unsigned int directivity; // will overflow for a window larger than 1625x1625x1625
00048     double m_log_m; // for entropy
00049     unsigned int sum; // for entropy and correlation; will overflow for a window larger than 1625x1625x1625
00050     unsigned int homogeneity; // will overflow for a window larger than 40x40x40, 1 color
00051     double localHomogeneity;
00052     unsigned int sumAverage; // will overflow for a window larger than 203x203x203, 1 color
00053     unsigned int anti_diagonals_sums[256 * 2 - 1]; // for sum entropy; will overflow for a window larger than 1625x1625x1625
00054     unsigned int uniformity; // will overflow for a window larger than 40x40x40, 1 color
00055 } GlcmData;
00056 
00057 typedef struct
00058 {
00059     char name[20];
00060     char short_name[3];
00061     void (*update)(int row, int col, int oldValue, int NewValue, GlcmData *glcmData);
00062     double (*finalize)(GlcmData *glcmData);
00063 } GlcmAttribute;
00064 
00065 typedef struct
00066 {
00067   int winx,winy,winz;//dimensions du voisinage
00068   int dx,dy,dz;//vecteur de direction
00069   int do_output[total_attributes];
00070 } Mcoocur_t;
00071 
00072 param* Mcoocur_lect(Mcoocur_t* des, param* ptp, char* debq);
00073 int Mcoocur_init(Mcoocur_t* des, ima3Du1* im0, ima3Dd *imres[]);
00074 int Mcoocur_calc(Mcoocur_t *des, ima3Du1* im0, ima3Dd *imres[]);
00075 
00076 /*pas de code apr� cette ligne*/
00077 #endif

Generated on Tue Apr 22 13:31:06 2008 for volume by  doxygen 1.5.3