00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020 #ifndef __volume
00021 #define __volume
00022
00023 #include <stdio.h>
00024
00025
00026 #define ALL 0
00027 #define ONE 1
00028 #define MANY 2
00029
00030 #define DECAL_LGTRACE 4
00031 #define DECAL_NBTRACE 8
00032 #define DECAL_NBPLAN 12
00033 #define DECAL_NBOCTET 36
00034 #define DECAL_LGTETE 72
00035
00036 #define LVF_MAGIC_NUMBER 0x00000080
00037 #define LVF_MAGIC_NUMBER_INV 0x80000000
00038
00039
00040
00041 typedef struct
00042 {
00043 int dimx, dimy, dimz;
00044 int lgtete, dept;
00045 short *** data;
00046 }ima3Ds2;
00047
00048 typedef struct
00049 {
00050 int dimx, dimy, dimz;
00051 int lgtete, dept;
00052 unsigned char *** data;
00053 int sequence_number;
00054 int sequence_width;
00055 FILE * f;
00056 }ima3Du1;
00057
00058
00059 typedef struct
00060 {
00061 int dimx, dimy, dimz;
00062 int lgtete, dept;
00063 unsigned int *** data;
00064 }ima3Du4;
00065
00066 typedef struct
00067 {
00068 int dimx, dimy, dimz;
00069 int lgtete, dept;
00070 unsigned long int *** data;
00071 }ima3Du8;
00072
00073 typedef struct
00074 {
00075 int dimx, dimy, dimz;
00076 int lgtete, dept;
00077 double *** data;
00078 }ima3Dd;
00079
00080
00081 void lire_longueur_trace(FILE * fin, int * long_trace);
00082 void ecr_longueur_trace( FILE * fout, int long_trace);
00083 void lire_nb_trace(FILE * fin, int * nb_trace);
00084 void ecr_nb_trace(FILE * fout, int nb_trace);
00085 void lire_nb_plan( FILE * fin, int * nb_plan);
00086 void ecr_nb_plan( FILE * fout, int nb_plan);
00087 void lire_nb_octet(FILE * fin, int * nb_octet);
00088 void ecr_nb_octet(FILE * fout, int nb_octet);
00089 void lire_longueur_entete(FILE * fin, int *long_entete);
00090 void ecr_longueur_entete( FILE * fout, int long_entete);
00091 void copie_entete( FILE *fin, FILE *fout, int nb_plan, int nb_octet);
00092 FILE *lect_ima3Ds2(char * nomfich, ima3Ds2 * image, int type, ...);
00093 FILE *lect_ima3Du1(char * nomfich, ima3Du1 * image, int type, ...);
00094 FILE *lect_ima3Dd(char * nomfich, ima3Dd * image, int type, ...);
00095 void ecr_ima3Du1(char * nomfich, ima3Du1 *image);
00096 void ecr_ima3Ds2(char * nomfich, ima3Ds2 *image);
00097 void ecr_ima3Dd(char * nomfich, ima3Dd *image);
00098 void liberer_ima3Ds2(ima3Ds2 * image);
00099 void liberer_ima3Du1(ima3Du1 * image);
00100 void liberer_ima3Dd(ima3Dd * image);
00101 void allouer_ima3Du1(ima3Du1 * ImaOut);
00102 void allouer_ima3Du4(ima3Du4 * ImaOut);
00103 void allouer_ima3Du8(ima3Du8 * ImaOut);
00104 void allouer_ima3Ds2(ima3Ds2 * ImaOut);
00105 void allouer_ima3Dd(ima3Dd * ImaOut);
00106
00107
00108
00109 int lect_volume_u1(char * nomfich, ima3Du1 * pt_image);
00110 int write_volume_u1(char * nomfich, ima3Du1 * pt_image);
00111
00112 int copie_entete_ima3du1(ima3Du1 * ptImaSrc, ima3Du1 * ptImaDst);
00113 int ecriture_entete_lvf( char * nomfich, ima3Du1 * pt_image);
00114 int lecture_entete_lvf(char * nomfich, ima3Du1 * pt_image);
00115 int lect_volume_u1_sequence_first(char * nomfich, ima3Du1 * pt_image, int sw);
00116 int lect_volume_u1_sequence_next(ima3Du1 * pt_image);
00117 int lect_volume_u1_sequence_previous(ima3Du1 * pt_image);
00118 int lect_volume_u1_sequence_number(ima3Du1 * pt_image);
00119 int write_part_of_volume_u1(char * nomfich, ima3Du1 * pt_image,
00120 unsigned int x1, unsigned int y1, unsigned int z1,
00121 unsigned int x2, unsigned int y2, unsigned int z2);
00122 int write_volume_u1_sequence_preparation( char * nomfich, ima3Du1 * pt_image, int nb_section_avant);
00123 int write_volume_u1_sequence_next(ima3Du1 * pt_image);
00124 int write_volume_u1_sequence_fermeture(ima3Du1 * pt_image, int nb_section_apres);
00125
00126
00127
00128
00129 #endif