mreggr3d.c

Go to the documentation of this file.
00001 /*
00002 *    Copyright (c) 2007. The BATI team. All right reserved.
00003 *
00004 *    This file is part of BATI library.
00005 *
00006 *    BATI library is free software: you can redistribute it and/or modify
00007 *    it under the terms of the GNU General Public License as published by
00008 *    the Free Software Foundation, either version 3 of the License, or
00009 *    (at your option) any later version.
00010 *
00011 *    BATI library  is distributed in the hope that it will be useful,
00012 *    but WITHOUT ANY WARRANTY; without even the implied warranty of
00013 *    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
00014 *    GNU General Public License for more details.
00015 *
00016 *    You should have received a copy of the GNU General Public License
00017 *    along with BATI library.  If not, see <http://www.gnu.org/licenses/>.
00018 */
00028 //#include "image.h"    /* types des donnees utilises */
00029 //#include "volume.h"   /* descripteurs et prototypes des fonctions de ima3D */
00030 #include "reggr3d.h"    /* complement pour les operateurs en cours de developpement */ 
00031 #include <stdlib.h>
00032 #include <math.h>
00033 #include <string.h>
00034 
00035 #include "permut.h"
00036 #include "volume.h"
00037 
00038 
00052 int main(int argc, char *argv[])
00053 {
00054   /* DECLARATIONS */
00055 
00056   /* images */ 
00057   ima3Du1 imscr;
00058   ima3Du4 imres;
00059 
00060   reggr3d_t des;
00061  // write_ima_t wri;   
00062   /* main : variables et parametres propres au main*/
00063   param par0, *ptp;      /* tete et pointeur pour la chaine de parametres */
00064   
00065   char NomFicSortant [50];
00066   char NomFicEntrant[50];
00067 
00068 /* LECTURE PARAMETRES */
00069 
00070   /* debut: OBLIGATOIRE pour compatibilite avec les 3 modes de lecture de param */
00071   param_debut(argc, argv, &par0); 
00072   ptp = &par0;      /* regle : ptp pointe sur la structure du parametre suivant */
00073 
00074   /* operateurs: ptp est passe en argument, return fournit la nouvelle position */
00075   ptp = reggr3d_lect(&des, ptp, ">>reggr3d question :");
00076 
00077   /* main : en cas de parametres lus dans le main */
00078 
00079   lec_param(">>entrer le chemin et le nom de l'image a traiter", ptp);
00080   strcpy(NomFicEntrant, ptp->rep);
00081   ptp = ptp->next;  
00082   lec_param(">>entrer le chemin et le nom de l'image resulat", ptp);
00083   strcpy(NomFicSortant, ptp->rep);
00084   ptp = ptp->next; 
00085   /* fin: sauvegarde des parametres utilises en mode MANUEL ou FICHIER */
00086   param_fin(argc, argv, &par0);
00087 
00088 
00089 /* INITIALISATION  */
00090   
00091   /* operateur */
00092   printf("\n fichier source %s",NomFicEntrant);
00093   printf("\n fichier dest %s\n",NomFicSortant);
00094   lect_ima3Du1 (NomFicEntrant, &imscr,ALL);
00095   //lect_imaSis(NomFicEntrant, &imscr, ALL);
00096   printf (" format de l'image source %d %d %d\n",imscr.dimx,imscr.dimy,imscr.dimz);
00097 
00098 
00099   reggr3d_init(&des, &imscr,&imres);
00100   /* main : en cas de variable a allouer/initialiser dans le main  */ 
00101   // printf("\n fin init\n");
00102   /* CALCUL */
00103 
00104   //printf("ima1 x=%d, ima2 x=%d\n", imscr.dimx, imres.dimx);
00105   reggr3d_calc(&des,&imscr,&imres);
00106   printf("Fin du calcul\n");
00107 
00108   /* FREMETURE */
00109   //ecr_ima3Du1( NomFicSortant, &imres);
00110   printf("Ecriture fichier \n");
00111   ecr_ima3Du1( NomFicSortant, &imscr);
00112   printf("ok \n");
00113 }
00114 
00115 
00116 
00117 

Generated on Tue Apr 22 13:31:06 2008 for volume by  doxygen 1.5.3