lessai.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 /* **************************** lessai.c ******************************/
00020 /*                                                                    */
00021 /* ********************************************************************/
00022 
00041 #include "volume.h"
00042 #include "proto2D.h"
00043 #include "essai.h"
00044 #include <stdlib.h>
00045 #include <string.h>
00046 
00047 /* *************************  LECTURE  *******************************/
00062 param *essai_lect( essai_t *des, param *ptp, char *debq){
00063   char question[500];
00064 
00065   sprintf(question, "%s dimX (entier)", debq); 
00066   lec_param(question, ptp);
00067   des->dimX = atoi(ptp->rep);
00068   ptp = ptp->next;
00069 
00070   sprintf(question, "%s dimY (entier)", debq); 
00071   lec_param(question, ptp);
00072   des->dimY = atoi(ptp->rep);
00073   ptp = ptp->next;
00074 
00075   sprintf(question, "%s gain (reel)", debq); 
00076   lec_param(question, ptp);
00077   des->gain = (float)atof(ptp->rep);
00078   ptp = ptp->next;
00079 
00080   sprintf(question, "%s forme (nom)", debq); 
00081   lec_param(question, ptp);
00082   strcpy(des->forme, ptp->rep);
00083   ptp = ptp->next;
00084 
00085   return(ptp);
00086 }
00087 
00088 /* *************************  INITIALISATION  ***************************/
00102 int essaiu1_init(essai_t *des, ima3Du1 imaIn, ima3Du1 *imaOut){
00103   int i, j;
00104  
00105   /* Copie des dimensions de l'image */ 
00106   imaOut->dimx = imaIn.dimx;
00107   imaOut->dimy = imaIn.dimy;
00108   imaOut->dimz = imaIn.dimz;
00109   allouer_ima3Du1 (imaOut);
00110 
00111   /* calcul du masque selon la forme */
00112   des->msq = des->dimX *des->dimY + des->gain;
00113 }
00114 
00115 
00116 /* *************************  CALCUL  ***************************/
00129 int essaiu1_calc(essai_t *des, ima3Du1 imaIn, ima3Du1 *imaOut){
00130   register int x, y, z;
00131       
00132 
00133   /*traitement simple pour l'exemple*/
00134   for(z=0; z<imaIn.dimz; z++)
00135     for(y=0; y<imaIn.dimy; y++)
00136       for(x=0; x<imaIn.dimx; x++)
00137           imaOut->data[z][y][x] = imaIn.data[z][y][x] + des->msq;
00138 
00139 }
00140 

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