mgradient_organisation.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 */
00019 
00020 
00021 #include <string.h>
00022 #include "gradient_organisation.h"
00023 
00024 
00025 #define MAX(x,y) (((x)>(y))? (x):(y))
00026 
00027 
00028 int main(int argc, char *argv[])
00029 {
00030 
00031   param par0, *ptp;      /* tete et pointeur pour la chaine de parametres */
00032   char NomFicEntrant[50];
00033   char NomFicSortant[50];
00034   ogi_t des;
00035   ima3Du1 imsrc;
00036   ima3Du1 imres;
00037   register unsigned int z;
00038 
00039   /*lecture des paramètres*/
00040   param_debut(argc, argv, &par0); 
00041   ptp = &par0;      /* regle : ptp pointe sur la structure du parametre suivant */
00042 
00043   lec_param(">>entrer le chemin et le nom de l'image a traiter", ptp);
00044   strcpy(NomFicEntrant, ptp->rep);
00045   ptp = ptp->next;  
00046 
00047   ptp = gradient_organisation_lect( &des, ptp, ">>ogi:");
00048 
00049   lec_param(">>entrer le chemin et le nom de l'image resulat", ptp);
00050   strcpy(NomFicSortant, ptp->rep);
00051   ptp = ptp->next; 
00052 
00053   /* fin: sauvegarde des parametres utilises en mode MANUEL ou FICHIER */
00054   param_fin(argc, argv, &par0);
00055   
00056 
00057   
00058   /*chargement des premieres sections et allocation des images*/
00059   lect_volume_u1_sequence_first( NomFicEntrant, &imsrc, MAX(des.tgrad,des.az) );
00060   copie_entete_ima3du1( &imsrc, &imres); 
00061   imres.sequence_width=1; 
00062   imres.sequence_number=0; 
00063   allouer_ima3Du1_sequence(&imres); 
00064   write_volume_u1_sequence_preparation( NomFicSortant, &imres, 0);
00065 
00066 
00067   /*initialisation de l'operateur*/
00068   gradient_organisation_init( &des, &imsrc);
00069 
00070 
00071   /*calcul pour chaque section*/
00072   /*
00073   for( z=MAX(des.tgrad,des.az)/2; z < (imsrc.dimz-MAX(des.tgrad,des.az)/2); z++){
00074     printf("section %d/%d\n", z, imsrc.dimz);
00075     gradient_organisation_calc( &des, &imsrc, &imres);
00076     write_volume_u1_sequence_next( &imres);
00077     lect_volume_u1_sequence_next( &imsrc);
00078   }
00079   */
00080   
00081   gradient_organisation_calc( &des, &imsrc, &imres);
00082 
00083   /*fermeture de l'image résultat*/
00084   //write_volume_u1_sequence_fermeture(&imres, MAX(des.tgrad,des.az)/2 );
00085 
00086   /*fermerture de l'operateur*/
00087   gradient_organisation_ferm( &des);
00088 
00089 
00090 }

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