#pragma once #include <afxcmn.h> #include <fstream> #include "DS_slice.h" #include "photoinfo.h" #include "file_IO_lib.h" #include "vect3usi.h" #include "LinkedList.h" using namespace std; // Template cube access #include "DSt_cube.h" ///////////////////////////////////////////////////////////////////////////////////////////// // UNSIGNED CHAR CUBE ///////////////////////////////////////////////////////////////////////////////////////////// class DS_cube { public: DS_cube(unsigned short int nwZ, unsigned short int nwY, unsigned short int nwX); DS_cube(Photoinfo* info, void * dlg_share); ~DS_cube(void); //functions void clear(); DS_cube* DS_cube::duplicate(); void to_DS_slice(DS_slice* slice, unsigned short int z_index); void to_DS_slicex(DS_slice* slice, unsigned short int x_index); void to_DS_slicey(DS_slice* slice, unsigned short int y_index); void copy_DS_slice(DS_slice* slice, unsigned short int z_index); void copy_DS_slicex(DS_slice* slice, unsigned short int x_index); void copy_DS_slicey(DS_slice* slice, unsigned short int y_index); void to_DS_slicez_float(DS_slice_f* slice, unsigned short int z_index); void copy_DS_slicez_float(DS_slice_f* slice, unsigned short int z_index); void resize_enveloppe(unsigned short int z_index, unsigned short int y_index, unsigned short int x_index); void resize_ends(unsigned short int z_index, unsigned short int y_index, unsigned short int x_index); void resize_multiple(unsigned char multiple); int mark_a_line(Vect3usi &start_coord, Vect3usi &end_coord, unsigned char mark_val); bool write_to_RAW_STACK(char* file_name); bool read_from_RAW_STACK(char* file_name); bool read_slice_from_RAW_STACK(char *file_name, unsigned short z_index_src, unsigned short z_index_dst); //public variables unsigned short int wZ; unsigned short int wY; unsigned short int wX; unsigned char *** data; //this is a 3d array unsigned char ** rows; //this is memory for each slice pointers unsigned char * memory; //this is memory for actual data //inlined unsigned char datac(Vect3usi &coord) { return (this->data[coord.z][coord.y][coord.x]); }; }; ///////////////////////////////////////////////////////////////////////////////////////////// // SIGNED SHORT INT CUBE ///////////////////////////////////////////////////////////////////////////////////////////// class DS_si_cube { public: DS_si_cube(unsigned short int nwZ, unsigned short int nwY, unsigned short int nwX); ~DS_si_cube(void); void clear(); bool write_to_siRAW_STACK(char* file_name); unsigned short int wZ; unsigned short int wY; unsigned short int wX; short int *** data; short int ** rows; //this is memory for each slice pointers short int * memory; //this is memory for actual data //inlined short int datac(Vect3usi &coord) { return (this->data[coord.z][coord.y][coord.x]); }; }; ///////////////////////////////////////////////////////////////////////////////////////////// // UNSIGNED SHORT INT CUBE ///////////////////////////////////////////////////////////////////////////////////////////// class DS_usi_cube { public: DS_usi_cube(unsigned short int nwZ, unsigned short int nwY, unsigned short int nwX); ~DS_usi_cube(void); void clear(); void flood_with_new_val(unsigned short sZ, unsigned short sY, unsigned short sX, unsigned short new_val); bool write_to_usiRAW_STACK(char* file_name); unsigned short int wZ; unsigned short int wY; unsigned short int wX; unsigned short int *** data; //this is a 3d array unsigned short int ** rows; //this is memory for each slice pointers unsigned short int * memory; //this is memory for actual data //inlined unsigned short int datac(Vect3usi &coord) { return (this->data[coord.z][coord.y][coord.x]); }; }; ///////////////////////////////////////////////////////////////////////////////////////////// // FLOAT CUBE ///////////////////////////////////////////////////////////////////////////////////////////// class DS_f_cube { public: DS_f_cube(unsigned short int nwZ, unsigned short int nwY, unsigned short int nwX); ~DS_f_cube(void); void clear(); unsigned short int wZ; unsigned short int wY; unsigned short int wX; float *** data; //this is a 3d array float ** rows; //this is memory for each slice pointers float * memory; //this is memory for actual data //inlined float datac(Vect3usi &coord) { return (this->data[coord.z][coord.y][coord.x]); }; }; ///////////////////////////////////////////////////////////////////////////////////////////// // UNsigned LONG LONG CUBE ///////////////////////////////////////////////////////////////////////////////////////////// class DS_ull_cube { public: DS_ull_cube(unsigned short int nwZ, unsigned short int nwY, unsigned short int nwX); ~DS_ull_cube(void); void clear(); unsigned short int wZ; unsigned short int wY; unsigned short int wX; unsigned long long *** data; //this is a 3d array unsigned long long ** rows; //this is memory for each slice pointers unsigned long long * memory; //this is memory for actual data //inlined unsigned long long datac(Vect3usi &coord) { return (this->data[coord.z][coord.y][coord.x]); }; }; ///////////////////////////////////////////////////////////////////////////////////////////// // SIGNED CHAR CUBE ///////////////////////////////////////////////////////////////////////////////////////////// class DS_c_cube { public: DS_c_cube(unsigned short int nwZ, unsigned short int nwY, unsigned short int nwX); ~DS_c_cube(void); void clear(); unsigned short int wZ; unsigned short int wY; unsigned short int wX; signed char *** data; signed char ** rows; //this is memory for each slice pointers signed char * memory; //this is memory for actual data //inlined signed char datac(Vect3usi &coord) { return (this->data[coord.z][coord.y][coord.x]); }; }; ///////////////////////////////////////////////////////////////////////////////////////////// // INT CUBE ///////////////////////////////////////////////////////////////////////////////////////////// class DS_i_cube { public: DS_i_cube(unsigned short int nwZ, unsigned short int nwY, unsigned short int nwX); ~DS_i_cube(void); void clear(); unsigned short int wZ; unsigned short int wY; unsigned short int wX; int *** data; int ** rows; //this is memory for each slice pointers int * memory; //this is memory for actual data //inlined int datac(Vect3usi &coord) { return (this->data[coord.z][coord.y][coord.x]); }; };