Main Page | Modules | Alphabetical List | Data Structures | File List | Data Fields | Globals

simri.c

Go to the documentation of this file.
00001 /************************************************************************* 00002 * $Id: simri.c,v 1.47 2005/09/30 08:07:53 yougz Exp $ 00003 ************************************************************************** 00004 This software is governed by the CeCILL license under French law and 00005 abiding by the rules of distribution of free software. You can use, 00006 modify and/ or redistribute the software under the terms of the CeCILL 00007 license as circulated by CEA, CNRS and INRIA at the following URL 00008 "http://www.cecill.info". 00009 00010 As a counterpart to the access to the source code and rights to copy, 00011 modify and redistribute granted by the license, users are provided only 00012 with a limited warranty and the software's author, the holder of the 00013 economic rights, and the successive licensors have only limited 00014 liability. 00015 00016 In this respect, the user's attention is drawn to the risks associated 00017 with loading, using, modifying and/or developing or reproducing the 00018 software by the user in light of its specific status of free software, 00019 that may mean that it is complicated to manipulate, and that also 00020 therefore means that it is reserved for developers and experienced 00021 professionals having in-depth computer knowledge. Users are therefore 00022 encouraged to load and test the software's suitability as regards their 00023 requirements in conditions enabling the security of their systems and/or 00024 data to be ensured and, more generally, to use and operate it in the 00025 same conditions as regards security. 00026 00027 The fact that you are presently reading this means that you have had 00028 knowledge of the CeCILL license and that you accept its terms. 00029 00030 Copyright (c) CREATIS (Centre de Recherche et d'Applications en Traitement de 00031 l'Image). All rights reserved. See License.txt for details. 00032 00033 Version 1.0 05/09/2005 00034 *************************************************************************/ 00035 #include "test-rmn.h" 00036 #include "test-sequence.h" 00037 00038 #include <kernel.h> 00039 #include <idarg.h> 00040 #include <stdio.h> 00041 00042 00043 #ifdef HAVE_MPI 00044 #include <mpi.h> 00045 #endif 00046 00047 #if 0 00048 START_USAGE (usage) 00049 "Starts SIMRI MRI simulator with different test parameters ", 00050 "", 00051 "Appel:simri test= predefined test number, if 0 the object ad size parameters are used", 00052 " object= Number of the object to use", 00053 " 1 : a circle, a square and an ellipse", 00054 " 2 : a circle with a chemical shift", 00055 " 3 : an aire bubble within water > susceptibility artifact", 00056 " 4 : a brain slice", 00057 " 5 : an homogeneous sphere", 00058 " size = Voxel number per dimension for the virtual object and the MRI image as well", 00059 " tacq = Acquisition time in ms (default value : 10)", 00060 " TE = Echo time in ms (default value : 20 )", 00061 " TR = Repetition time in ms (default value : 400 )", 00062 " teta = Flip angle for gradient echo sequences in degree (default value : 90°)", 00063 " b0 = Main satic field BO in Tesla (Default value : 1 T)", 00064 " db0 = Intra-voxel inhomogenity >> weight of the T2* effect (default value : 0)", 00065 " b0def = Max value of the parabolic main static field default in tesla (default value : 0)", 00066 " flagres = 1 for RF pulse considered ON-resonance, 0 for OFF (1 par defaut)", 00067 " flagdech = 0 No field default, 1 takes into account precomputed object satic field default (susceptibility),", 00068 " 2 takes into account the B0 parabolic static field default", 00069 " 3 takes 1+2 (2 is the default value)", 00070 " filter = 1 for an hamming filtering of the K-space, 0 sinon (default value :1)", 00071 " fileout = name of the MRI module image", 00072 " seqname = MRI sequence abbreviation (default value : SE2D)", 00073 " display = 1 to display the reconstructed image (default value=1)", 00074 "", 00075 " test = 0 -> Full test", 00076 "", 00077 " test = 1 -> Test RMN : Free Induction Decay en T2*", 00078 " test = 2 -> Test RMN : Echo de Spin du au T2* ", 00079 " test = 5 -> Test Brain ", 00080 00081 "", 00082 " test = 210 -> Spin Echo 2D, 1 component, object and image 32", 00083 " test = 211 -> Spin Echo 2D, 1 component, object and image 64", 00084 " test = 212 -> Spin Echo 2D, 1 component, object and image 128", 00085 " test = 213 -> Spin Echo 2D, 1 component, object and image 256", 00086 " test = 214 -> Spin Echo 2D, 1 component, object and image 512", 00087 " test = 215 -> Spin Echo 2D, 1 component, object and image 1024", 00088 " test = 216 -> Spin Echo 2D, 1 component, object 1024 and image 256", 00089 "", 00090 " test = 220 -> Spin Echo 2D, 2 components, object and image 32", 00091 " test = 221 -> Spin Echo 2D, 2 components, object and image 64", 00092 " test = 222 -> Spin Echo 2D, 2 components, object and image 128", 00093 " test = 223 -> Spin Echo 2D, 2 components, object and image 256", 00094 " test = 224 -> Spin Echo 2D, 2 components, object and image 512", 00095 " test = 225 -> Spin Echo 2D, 2 components, object and image 1024", 00096 " test = 226 -> Spin Echo 2D, 2 components, object 1024 and image 256", 00097 "", 00098 " test = 250 -> Gradient Echo 2D, 1 component, object and image 32", 00099 " test = 251 -> Gradient Echo 2D, 1 component, object and image 64", 00100 " test = 252 -> Gradient Echo 2D, 1 component, object and image 128", 00101 "", 00102 " test = 260 -> Spin Echo 2D on a brain 256x256 ", 00103 "", 00104 " test = 310 -> Spin Echo 3D, 1 component, object and image 16", 00105 " test = 311 -> Spin Echo 3D, 1 component, object and image 32", 00106 " test = 312 -> Spin Echo 3D, 1 component, object and image 64", 00107 " test = 313 -> Spin Echo 3D, 1 component, object and image 128", 00108 " test = 314 -> Spin Echo 3D, 1 component, object 128 and image 64", 00109 "", 00110 " test = 320 -> Spin Echo 3D, 2 components, object and image 16", 00111 " test = 321 -> Spin Echo 3D, 2 components, object and image 32", 00112 " test = 322 -> Spin Echo 3D, 2 components, object and image 64", 00113 " test = 323 -> Spin Echo 3D, 2 components, object and image 128", 00114 " test = 324 -> Spin Echo 3D, 2 components, object 128 and image 64", 00115 00116 "", 00117 "Exemple: simri test=220", 00118 "", 00119 FINISH_USAGE 00120 #endif 00121 00122 int 00123 main(int argc, char *argv[]) 00124 { 00125 int test; 00126 double tacq,TE,TR,teta,b0,db0,b0def; 00127 int flagres,flagdech,filter,object,size,display; 00128 char * fileout,*seqname; 00129 00130 #ifdef HAVE_MPI 00131 MPI_Init(&argc,&argv); 00132 MPIL_Trace_on(); 00133 #endif 00134 00135 /* Gestion des parametres passes au main */ 00136 IdArgInit(argc,argv); 00137 test = IdArgGetInt("test",0); 00138 tacq =(double) IdArgGetFloat("tacq",10); 00139 TE = (double) IdArgGetFloat("TE",20); 00140 TR = (double) IdArgGetFloat("TR",400); 00141 teta = (double) IdArgGetFloat("teta",90.); 00142 b0 = (double) IdArgGetFloat("b0",1.); 00143 db0 = (double) IdArgGetFloat("db0",0.); 00144 b0def = (double) IdArgGetFloat("b0def",0.); 00145 flagres = IdArgGetInt("flagres",1); 00146 flagdech = IdArgGetInt("flagdech",2); 00147 filter = IdArgGetInt("filter",1); 00148 object = IdArgGetInt("object",1); 00149 size = IdArgGetInt("size",32); 00150 fileout = IdArgGetString("fileout","recimage.acr"); 00151 seqname = IdArgGetString("seqname","SE2D"); 00152 display = IdArgGetInt("display",1); 00153 printf("seq=%s fileout=%s \n",seqname,fileout); 00154 00155 00156 switch(test) 00157 { 00158 /* Test de sequence à valider */ 00159 case 0: 00160 { 00161 TestSequence2D(object,size,size,tacq,TE,TR,teta,b0,db0,b0def,flagres,flagdech,filter,fileout,seqname,display); 00162 break; 00163 } 00164 /* Test RMN */ 00165 case 1: 00166 { 00167 TestFID1D(2048,512); 00168 break; 00169 } 00170 case 2: 00171 { 00172 TestEchoSpin1D(2048,512); 00173 break; 00174 } 00175 case 3: 00176 { 00177 TestTrainEchoSpin1D(1024,512,8); 00178 break; 00179 } 00180 /* Test Brain */ 00181 case 5: 00182 { 00183 TestSequence2D(4,size,size,tacq,TE,TR,teta,b0,db0,b0def,flagres,flagdech,filter,fileout,seqname,display); 00184 break; 00185 } 00186 00187 /* Test Defaut de champ */ 00188 case 10: 00189 { 00190 TestSequence2D(3,64,64,tacq,TE,TR,teta,b0,db0,b0def,flagres,flagdech,filter,fileout,seqname,display); 00191 break; 00192 } 00193 /* Test SE 2D */ 00194 case 210: 00195 { 00196 TestSequence2D(1,32,32,tacq,TE,TR,teta,b0,db0,b0def,flagres,flagdech,filter,fileout,"SE2D",display); 00197 break; 00198 } 00199 case 211: 00200 { 00201 TestSequence2D(1,64,64,tacq,TE,TR,teta,b0,db0,b0def,flagres,flagdech,filter,fileout,"SE2D",display); 00202 break; 00203 } 00204 case 212: 00205 { 00206 TestSequence2D(1,128,128,tacq,TE,TR,teta,b0,db0,b0def,flagres,flagdech,filter,fileout,"SE2D",display); 00207 break; 00208 } 00209 case 213: 00210 { 00211 TestSequence2D(1,256,256,tacq,TE,TR,teta,b0,db0,b0def,flagres,flagdech,filter,fileout,"SE2D",display); 00212 break; 00213 } 00214 case 214: 00215 { 00216 TestSequence2D(1,512,512,tacq,TE,TR,teta,b0,db0,b0def,flagres,flagdech,filter,fileout,"SE2D",display); 00217 break; 00218 } 00219 case 215: 00220 { 00221 TestSequence2D(1,1024,1024,tacq,TE,TR,teta,b0,db0,b0def,flagres,flagdech,filter,fileout,"SE2D",display); 00222 break; 00223 } 00224 case 216: 00225 { 00226 TestSequence2D(1,1024,256,tacq,TE,TR,teta,b0,db0,b0def,flagres,flagdech,filter,fileout,"SE2D",display); 00227 break; 00228 } 00229 case 220: 00230 { 00231 TestSequence2D(2,32,32,tacq,TE,TR,teta,b0,db0,b0def,flagres,flagdech,filter,fileout,"SE2D",display); 00232 break; 00233 } 00234 case 221: 00235 { 00236 TestSequence2D(2,64,64,tacq,TE,TR,teta,b0,db0,b0def,flagres,flagdech,filter,fileout,"SE2D",display); 00237 break; 00238 } 00239 case 222: 00240 { 00241 TestSequence2D(2,128,128,tacq,TE,TR,teta,b0,db0,b0def,flagres,flagdech,filter,fileout,"SE2D",display); 00242 break; 00243 } 00244 case 223: 00245 { 00246 TestSequence2D(2,256,256,tacq,TE,TR,teta,b0,db0,b0def,flagres,flagdech,filter,fileout,"SE2D",display); 00247 break; 00248 } 00249 case 224: 00250 { 00251 TestSequence2D(2,512,512,tacq,TE,TR,teta,b0,db0,b0def,flagres,flagdech,filter,fileout,"SE2D",display); 00252 break; 00253 } 00254 case 225: 00255 { 00256 TestSequence2D(2,1024,1024,tacq,TE,TR,teta,b0,db0,b0def,flagres,flagdech,filter,fileout,"SE2D",display); 00257 break; 00258 } 00259 case 226: 00260 { 00261 TestSequence2D(2,1024,256,tacq,TE,TR,teta,b0,db0,b0def,flagres,flagdech,filter,fileout,"SE2D",display); 00262 break; 00263 } 00264 case 260: 00265 { 00266 TestSequence2D(4,256,256,tacq,TE,TR,teta,b0,db0,b0def,flagres,flagdech,filter,fileout,seqname,display); 00267 break; 00268 } 00269 00270 /*Test Gradient Echo */ 00271 case 250: 00272 { 00273 TestSequence2D(2,32,32,tacq,TE,TR,teta,b0,db0,b0def,flagres,flagdech,filter,fileout,"GE2D",display); 00274 break; 00275 } 00276 case 251: 00277 { 00278 TestSequence2D(2,64,64,tacq,TE,TR,teta,b0,db0,b0def,flagres,flagdech,filter,fileout,"GE2D",display); 00279 break; 00280 } 00281 case 252: 00282 { 00283 TestSequence2D(2,128,128,tacq,TE,TR,teta,b0,db0,b0def,flagres,flagdech,filter,fileout,"GE2D",display); 00284 break; 00285 } 00286 00287 /* Test SE 3D */ 00288 case 310: 00289 { 00290 TestSequence3D(1,16,16,tacq,TE,TR,teta,b0,db0,b0def,flagres,flagdech,filter,fileout,"GE2D",display); 00291 break; 00292 } 00293 case 311: 00294 { 00295 TestSequence3D(1,32,32,tacq,TE,TR,teta,b0,db0,b0def,flagres,flagdech,filter,fileout,"GE2D",display); 00296 break; 00297 } 00298 case 312: 00299 { 00300 TestSequence3D(1,64,64,tacq,TE,TR,teta,b0,db0,b0def,flagres,flagdech,filter,fileout,"GE2D",display); 00301 break; 00302 } 00303 case 313: 00304 { 00305 TestSequence3D(1,128,128,tacq,TE,TR,teta,b0,db0,b0def,flagres,flagdech,filter,fileout,"GE2D",display); 00306 break; 00307 } 00308 case 314: 00309 { 00310 TestSequence3D(1,128,64,tacq,TE,TR,teta,b0,db0,b0def,flagres,flagdech,filter,fileout,"GE2D",display); 00311 break; 00312 } 00313 case 320: 00314 { 00315 TestSequence3D(2,16,16,tacq,TE,TR,teta,b0,db0,b0def,flagres,flagdech,filter,fileout,"GE2D",display); 00316 break; 00317 } 00318 case 321: 00319 { 00320 TestSequence3D(2,32,32,tacq,TE,TR,teta,b0,db0,b0def,flagres,flagdech,filter,fileout,"GE2D",display); 00321 break; 00322 } 00323 case 322: 00324 { 00325 TestSequence3D(2,64,64,tacq,TE,TR,teta,b0,db0,b0def,flagres,flagdech,filter,fileout,"GE2D",display); 00326 break; 00327 } 00328 case 323: 00329 { 00330 TestSequence3D(2,128,128,tacq,TE,TR,teta,b0,db0,b0def,flagres,flagdech,filter,fileout,"GE2D",display); 00331 break; 00332 } 00333 case 324: 00334 { 00335 TestSequence3D(2,128,64,tacq,TE,TR,teta,b0,db0,b0def,flagres,flagdech,filter,fileout,"GE2D",display); 00336 break; 00337 } 00338 default: 00339 { 00340 break; 00341 } 00342 } 00343 00344 #ifdef HAVE_MPI 00345 MPI_Finalize(); 00346 #endif 00347 return 0; 00348 }

Generated on Wed Oct 19 09:28:34 2005 for SIMRI3D by doxygen 1.3.7