00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019 #include <stdio.h>
00020 #include <string.h>
00021
00022 #include "volume.h"
00023 #include "image.h"
00024 #include "proto2D.h"
00025
00026
00042 #define XY 1
00043 #define XZ 2
00044 #define YZ 3
00045
00046
00047
00048
00049
00050
00051
00052 main(argc,argv)
00053 int argc;
00054 char *argv[];
00055 {
00056
00057 ima3Du1 ima;
00058 imau1 out;
00059 int x, y, z, s=1, t=XY;
00060 write_ima_t wri;
00061 param par0, *ptp;
00062 char nomloc[200];
00063
00064
00065
00066 param_debut(argc, argv, &par0);
00067 ptp = &par0;
00068
00069 lec_param("fichier volume xt:", ptp);
00070 strcpy(nomloc, ptp->rep);
00071 ptp = ptp->next;
00072
00073 lec_param("Orientation [1=XY,2=XZ,3=YZ]:", ptp);
00074 t = atoi(ptp->rep);
00075 ptp = ptp->next;
00076
00077 lec_param("Numero de la section [0..dim-1]:", ptp);
00078 s = atoi(ptp->rep);
00079 ptp = ptp->next;
00080
00081 ptp = write_ima_lect(&wri, ptp, "Fichier rasterfile:");
00082 param_fin(argc, argv, &par0);
00083
00084
00085
00086 switch(t){
00087 case XY:
00088 {
00089 printf("XY\n");
00090 lect_ima3Du1( nomloc, &ima, ONE, s);
00091 out.nr=ima.dimx;
00092 out.nc=ima.dimy;
00093 alloc_imau1(&out);
00094 for(x=0; x<out.nr; x++)
00095 for(y=0; y<out.nc; y++)
00096 out.p[x][y] = ima.data[0][y][x];
00097 break;
00098 }
00099 case XZ:
00100 {
00101 lect_ima3Du1(argv[1], &ima, ALL);
00102 out.nr=ima.dimx;
00103 out.nc=ima.dimz;
00104 alloc_imau1(&out);
00105 for(x=0; x<out.nr; x++)
00106 for(z=0; z<out.nc; z++)
00107 out.p[x][z] = ima.data[z][s][x];
00108 break;
00109 }
00110 case YZ:
00111 {
00112 lect_ima3Du1(argv[1], &ima, ALL);
00113 out.nr=ima.dimy;
00114 out.nc=ima.dimz;
00115 alloc_imau1(&out);
00116 for(y=0; y<out.nr; y++)
00117 for(z=0; z<out.nc; z++)
00118 out.p[y][z] = ima.data[z][y][s];
00119 break;
00120 }
00121 }
00122
00123
00124 write_ima_init( &wri);
00125
00126
00127 write_imau1_ferm( &wri, out);
00128 liberer_ima3Du1(&ima);
00129
00130 }