00001 #ifndef _MQSEGMENT_ATTRIBUTES_H_
00002 #define _MQSEGMENT_ATTRIBUTES_H_
00003
00004
00005
00006
00007
00008
00018 struct MQSegmentAttributes
00019 {
00020 int nLabel;
00021 Rectangle4i rRect;
00022 int nArea;
00023 int nPeaks;
00024 Peak2i seed;
00025
00026 float dTIC;
00027 float dMaxAbundance;
00028 };
00029
00030 typedef struct MQSegmentAttributes MQSegmentAttributes;
00031
00032 int MQSegmentAttributes_init(MQSegmentAttributes* attr);
00033 int MQSegmentAttributes_cmpByNPeaks(const void *p1, const void *p2);
00034 MQSegmentAttributes MQSegmentAttributes_readline(char* line);
00035 int MQSegmentAttributes_updateRectangle(MQSegmentAttributes* attr, Map2D* map, Peak2i peak);
00036
00037 void MQSegmentAttributes_fprint (FILE* fp, MQSegmentAttributes *attr);
00038 void MQSegmentAttributes_fprintWithPeaks(FILE* fp, MQSegmentAttributes *attr);
00039
00040 int MQSegmentAttributesArray_init(MQSegmentAttributes* attr, int nattr);
00041 MQSegmentAttributes* MQSegmentAttributesArray_load(char* filename, int* size);
00042 void MQSegmentAttributesArray_sortByNPeaks(MQSegmentAttributes* attr, long nsize);
00043 MQSegmentAttributes* MQSegmentAttributesArray_create(int size);
00044
00045 void MQSegmentAttributesArray_fprint (FILE* fp, MQSegmentAttributes *attr, int nsize);
00046 void MQSegmentAttributesArray_fprintWithPeaks (FILE* fp, MQSegmentAttributes *attr, int nsize);
00047
00048 Rectangle4i* MQSegmentAttributesArray_getRectangleArray(MQSegmentAttributes* attr, int nAttr, struct Map2D* map);
00049 int* MQSegmentAttributesArray_getLabelArray(MQSegmentAttributes* attr, int nAttr);
00050 MQString* MQSegmentAttributesArray_toStringArray(MQSegmentAttributes* attr, int nAttr, const char* format);
00051
00052 #endif
00053