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

seq-se.c

Go to the documentation of this file.
00001 /************************************************************************* 00002 * $Id: seq-se.c,v 1.8 2005/09/07 07:13:33 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 "seq-se.h" 00036 #include "event-rfpulse.h" 00037 #include "event-precession.h" 00038 #include "event-acquisition.h" 00039 #include "seq-mpi.h" 00040 00041 void SeqSpinEcho1D_0(SEQPARAM *seqparam,EXPERIENCE3D*expr); 00042 void SeqSpinEcho2D_0(SEQPARAM *seqparam,EXPERIENCE3D*expr); 00043 void SeqSpinEcho3D_0(SEQPARAM *seqparam,EXPERIENCE3D*expr); 00044 00054 PPPVOLUME_COMPLEX_DOUBLE SeqSpinEcho1D(SEQPARAM *seqparam,EXPERIENCE3D*expr) 00055 { 00056 mpi_job(seqparam, expr, SeqSpinEcho1D_0); 00057 NormalizeRFSignal(expr); 00058 return(GetSignalRFComplexFromExperience(expr)); 00059 } 00060 00070 PPPVOLUME_COMPLEX_DOUBLE SeqSpinEcho2D(SEQPARAM *seqparam,EXPERIENCE3D*expr) 00071 { 00072 mpi_job(seqparam , expr, SeqSpinEcho2D_0); 00073 NormalizeRFSignal(expr); 00074 return(GetSignalRFComplexFromExperience(expr)); 00075 } 00076 00086 PPPVOLUME_COMPLEX_DOUBLE SeqSpinEcho3D(SEQPARAM *seqparam,EXPERIENCE3D*expr) 00087 { 00088 mpi_job(seqparam, expr, SeqSpinEcho3D_0); 00089 NormalizeRFSignal(expr); 00090 return(GetSignalRFComplexFromExperience(expr)); 00091 } 00092 00101 void CheckTimesSE(double tacq,double te,double tr) 00102 { 00103 int f=0; 00104 if((tacq<te)&&(tr>te+tacq/2.0))f=1; 00105 if(f==0){ 00106 FPRINTF(stderr,"Bad values for your sequence SE: Tacq=%g, Te=%g, Tr=%g\n",tacq, te, tr); 00107 exit(0); 00108 } 00109 } 00110 00119 void SeqSpinEcho1D_0(SEQPARAM *seqparam,EXPERIENCE3D*expr) 00120 { 00121 int ntx; 00122 double fovx; 00123 double te,tr,tacq; /* in ms */ 00124 double gx,gy,gz; 00125 double acq_delay,timp; /* in ms */ 00126 int npy, npz; 00127 int i; 00128 EVENT* event, event_r; 00129 event = &event_r; 00130 00131 printf("Starting SeqSpinEcho1D\n"); 00132 ntx = expr->ntx; 00133 tacq = expr->readout_time*1.e+3; 00134 fovx = expr->fovx; 00135 00136 te = seqparam->te; 00137 tr = seqparam->tr; 00138 00139 CheckTimesSE(tacq,te,tr); 00140 00141 acq_delay = (te/2) - (tacq/2. + tacq/2./(ntx-1)); 00142 timp=0.3; /*RF pulse duration in ms */ 00143 gx=(ntx-2.)/tacq/G_kHz_G/fovx; 00144 gy=0.0; 00145 gz=0.0; 00146 npy=0;npz=0; 00147 00148 SetSpoilingFlag(event,ACTIVE); /* XY Spoiling after each line acquisition */ 00149 DoWaiting(expr,event,ATT_INIT); /* To get an initial Magnetization M0 */ 00150 ResetToExperience(expr); 00151 00152 for(i=0;i<10;i++) /* Repetition cycle to take TR into account */ 00153 { 00154 DoPulseRect(expr,event, 90., timp); 00155 DoGradient(expr,event, te/2.,gx,gy,gz); 00156 DoPulseRect(expr,event,180.,timp); 00157 DoGradient(expr,event, acq_delay+tacq,gx,gy,gz); 00158 DoWaiting(expr,event,tr-te-tacq/2.0); 00159 } 00160 00161 DoPulseRect(expr,event, 90.,timp); 00162 DoGradient(expr,event, te/2.,gx,gy,gz); 00163 DoPulseRect(expr,event,180.,timp); 00164 DoAcqFrequenceX( expr,event, gx, npy, npz,acq_delay, MINUS); 00165 00166 printf("Ending SeqSpinEcho1D\n"); 00167 } 00168 00177 void SeqSpinEcho2D_0(SEQPARAM *seqparam,EXPERIENCE3D*expr) 00178 { 00179 int ntx,nty; 00180 double fovx,fovy; 00181 double te,tr,tacq,timp,acq_delay,tg; /* ms */ 00182 double gx,gy,gz,gp; 00183 int npy, npz; 00184 EVENT* event, event_r; 00185 event = &event_r; 00186 00187 printf("Starting SeqSpinEcho2D \n"); 00188 ntx = expr->ntx; 00189 nty = expr->nty; 00190 tacq = expr->readout_time*1.e+3; 00191 fovx = expr->fovx; 00192 fovy = expr->fovy; 00193 00194 te = seqparam->te; 00195 tr = seqparam->tr; 00196 00197 CheckTimesSE(tacq,te,tr); 00198 timp=0.3; /*RF pulse duration in ms */ 00199 acq_delay = (te/2) - (tacq/2. + tacq/2./(ntx-1)); 00200 tg = te/2.; 00201 gx = (ntx-2.)/tacq/G_kHz_G/fovx; 00202 gy = 2*M_PI*(nty-1)/G_rad_G/fovy/(tg/1000); 00203 gz = 0.0; 00204 npz= 0; 00205 00206 SetSpoilingFlag(event,ACTIVE); /* XY Spoiling after each line acquisition */ 00207 00208 DoWaiting(expr,event,ATT_INIT); /* To get an initial Magnetization M0 */ 00209 for (npy = 0; npy < expr->nty; npy++) 00210 { 00211 ResetToExperience(expr); 00212 DoPulseRect(expr,event, 90.,timp); 00213 00214 gp = (gy) * (npy - (nty) / 2) / (nty); 00215 DoGradient(expr,event,tg,gx,gp,gz); 00216 00217 DoPulseRect(expr,event,180.,timp); 00218 00219 DoAcqFrequenceX( expr,event, gx, npy, npz,acq_delay, MINUS); 00220 00221 DoWaiting(expr,event,tr-te-tacq/2.0); 00222 } 00223 printf("Ending SeqSpinEcho2D\n"); 00224 } 00225 00234 void SeqSpinEcho3D_0(SEQPARAM *seqparam,EXPERIENCE3D*expr) 00235 { 00236 int ntx,nty,ntz; 00237 double fovx,fovy,fovz; 00238 double te,tr,tacq; /* ms */ 00239 double gx,gy,gz,timp; 00240 double acq_delay; /* ms */ 00241 int npy,npz; 00242 EVENT* event, event_r; 00243 event = &event_r; 00244 00245 printf("Starting SeqSpinEcho3D\n"); 00246 ntx = expr->ntx; 00247 nty = expr->nty; 00248 ntz = expr->ntz; 00249 tacq = expr->readout_time*1.e+3; 00250 fovx = expr->fovx; 00251 fovy = expr->fovy; 00252 fovz = expr->fovz; 00253 00254 te = seqparam->te; 00255 tr = seqparam->tr; 00256 00257 CheckTimesSE(tacq,te,tr); 00258 00259 acq_delay = (te/2) - (tacq/2. + tacq/2./(ntx-1)); 00260 00261 gx=(ntx-2.)/tacq/G_kHz_G/fovx; 00262 gy=2*M_PI*(nty-1)/G_rad_G/fovy/(te/2./1000); 00263 gz=2*M_PI*(ntz-1)/G_rad_G/fovz/(te/2./1000); 00264 timp=0.3; /* Pulse duration in ms */ 00265 00266 SetSpoilingFlag(event,ACTIVE); /* XY Spoiling after each line acquisition */ 00267 00268 DoWaiting(expr,event,ATT_INIT); /* To get an initial Magnetization M0 */ 00269 for (npy = 0; npy < expr->nty; npy++) { 00270 for (npz = 0; npz < expr->ntz; npz++) { 00271 ResetToExperience(expr); 00272 DoPulseRect(expr,event, 90., timp); 00273 DoGradient( expr,event, te/2.,gx, 00274 (gy) * (npy - nty / 2) / nty, 00275 (gz) * (npz - ntz / 2) / ntz); 00276 DoPulseRect(expr,event,180.,timp); 00277 DoAcqFrequenceX( expr,event, gx, npy, npz,acq_delay, MINUS); 00278 DoWaiting(expr,event,tr-te-tacq/2.0); 00279 }} 00280 printf("Ending SeqSpinEcho3D\n"); 00281 } 00282

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