//#ifndef __DISPORE_ALL_H__ //#define __DISPORE_ALL_H__ #pragma once #include<stdio.h> #include<stddef.h> #include<stdlib.h> #include<malloc.h> #include<iostream> #include<fstream> //#include "cDS_lib.h" #include "DS_1b_cube.h" #include "DS_slice.h" //#include "DS_header.h" #include "photoinfo.h" #include "mytemplate.h" //#include "PorositySSADialog.h" /*Error Codes:*/ #define BAD_IMAGE_SIZE 100 #define OUT_OF_STORAGE 101 #define CANNOT_OPEN_FILE 102 #define BAD_DESCRIPTOR1 103 #define BAD_NR_NC 104 #define FILE_TOO_SHORT 105 #define BAD_DESCRIPTOR2 106 #define NO_REGION 107 #define REGION_INT_BOUND 108 #define INTERNAL_1 109 #define BAD_IMAGE_COORD 110 #define NO_RESULT 111 #define IMPOSSIBLE_CLASS 112 #define TOO_MANY_CLASSES 113 #define TOO_MANY_EDGES 114 #define BAD_COLOR_MAP 115 #define IO_ERROR 116 #define SQRT2 1.414213562 #define PI 3.1415926535 #define BACKGROUND 255 class Dispore_All { public: Dispore_All(DS_1b_cube* input_cube); ~Dispore_All(); int run_dispore_all(char* out_prefix, char* plane, CProgressCtrl *pbar_ptr, bool *stop_req); private: bool range(unsigned short int i, unsigned short int j); void mark4_speed(unsigned short int yseed, unsigned short int xseed); void mark4_mem(unsigned short int yseed, unsigned short int xseed); void region_4(int *error_code); void del_reg(); unsigned long int area(); unsigned char nay4(unsigned short int i, unsigned short int j); unsigned long int boundary(); //not yet used //void mark8(struct image *x,int value,int iseed,int jseed); //void region_8(struct image *x,int value,int *error_code); //int nay8(struct image *x,int i,int j,int val); //float perimeter(struct image *x,int val,int *error_code); private: //compressed input cube pointer DS_1b_cube * cDS_cube; //currently active slice pointer DS_slice * slice; unsigned long int * porearea, * porebdry; float * Rh_pore; //these are limits to speed up del_reg(), area(), and boundary() functions unsigned short int min_X, max_X, min_Y, max_Y, ns_X; //for convenience unsigned short int wX, wY, wZ; unsigned char mark_val; };