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

seq-ge.c

Go to the documentation of this file.
00001 /************************************************************************* 00002 * $Id: seq-ge.c,v 1.7 2005/09/07 07:13:32 yougz Exp $ 00003 ************************************************************************** 00004 Fonctions that implement grient echo sequence 00005 This sequence runs the following events 00006 - Pulse with teta angle. Teta optimal if cos(teta)=exp(-Tr/T1) 00007 - Waiting 00008 - Phase gradient 00009 - Waiting 00010 - Bipolar gradient: half negative lobe before acquisition 00011 - Acquisition with a positive gradient to get an echo in the center of the acquisition window 00012 - Waiting until TR 00013 To avoid a call to the magnetisation kernel, and earn time 00014 We apply simultaneously the phase gradients and the negative gradient before acquisition 00015 ************************************************************************** 00016 This software is governed by the CeCILL license under French law and 00017 abiding by the rules of distribution of free software. You can use, 00018 modify and/ or redistribute the software under the terms of the CeCILL 00019 license as circulated by CEA, CNRS and INRIA at the following URL 00020 "http://www.cecill.info". 00021 00022 As a counterpart to the access to the source code and rights to copy, 00023 modify and redistribute granted by the license, users are provided only 00024 with a limited warranty and the software's author, the holder of the 00025 economic rights, and the successive licensors have only limited 00026 liability. 00027 00028 In this respect, the user's attention is drawn to the risks associated 00029 with loading, using, modifying and/or developing or reproducing the 00030 software by the user in light of its specific status of free software, 00031 that may mean that it is complicated to manipulate, and that also 00032 therefore means that it is reserved for developers and experienced 00033 professionals having in-depth computer knowledge. Users are therefore 00034 encouraged to load and test the software's suitability as regards their 00035 requirements in conditions enabling the security of their systems and/or 00036 data to be ensured and, more generally, to use and operate it in the 00037 same conditions as regards security. 00038 00039 The fact that you are presently reading this means that you have had 00040 knowledge of the CeCILL license and that you accept its terms. 00041 00042 Copyright (c) CREATIS (Centre de Recherche et d'Applications en Traitement de 00043 l'Image). All rights reserved. See License.txt for details. 00044 00045 Version 1.0 05/09/2005 00046 *************************************************************************/ 00047 00048 #include "seq-ge.h" 00049 00050 #include "event-rfpulse.h" 00051 #include "event-precession.h" 00052 #include "event-acquisition.h" 00053 #include "experience.h" 00054 #include "seq-mpi.h" 00055 00056 void SeqGradientEcho1D_0(SEQPARAM *seqparam,EXPERIENCE3D* expr); 00057 void SeqGradientEcho2D_0(SEQPARAM *seqparam,EXPERIENCE3D* expr); 00058 void SeqGradientEcho3D_0(SEQPARAM *seqparam,EXPERIENCE3D* expr); 00059 00069 PPPVOLUME_COMPLEX_DOUBLE SeqGradientEcho1D(SEQPARAM *seqparam,EXPERIENCE3D* expr) 00070 { 00071 mpi_job(seqparam, expr, SeqGradientEcho1D_0); 00072 NormalizeRFSignal(expr); 00073 return(GetSignalRFComplexFromExperience(expr)); 00074 } 00075 00085 PPPVOLUME_COMPLEX_DOUBLE SeqGradientEcho2D(SEQPARAM *seqparam,EXPERIENCE3D* expr) 00086 { 00087 mpi_job(seqparam, expr, SeqGradientEcho2D_0); 00088 NormalizeRFSignal(expr); 00089 return(GetSignalRFComplexFromExperience(expr)); 00090 } 00091 00101 PPPVOLUME_COMPLEX_DOUBLE SeqGradientEcho3D(SEQPARAM *seqparam,EXPERIENCE3D* expr) 00102 { 00103 mpi_job(seqparam, expr, SeqGradientEcho3D_0); 00104 NormalizeRFSignal(expr); 00105 return(GetSignalRFComplexFromExperience(expr)); 00106 } 00107 00116 void CheckTimesGE(double tacq,double te,double tr) 00117 { 00118 int f=0; 00119 if((tacq<te)&&(tr>te+tacq/2.0))f=1; 00120 if(f==0){ 00121 FPRINTF(stderr,"Bad values for your sequence GE: Tacq=%g, Te=%g, Tr=%g\n",tacq, te, tr); 00122 exit(0); 00123 } 00124 } 00133 void SeqGradientEcho1D_0(SEQPARAM *seqparam,EXPERIENCE3D* expr) 00134 { 00135 int ntx; 00136 int npy,npz; 00137 double fovx; 00138 double te,tr,tacq,timp,acq_delay,tg; /* ms */ 00139 double gx; 00140 double teta; /* degree */ 00141 int i; 00142 EVENT* entre, entre_r; 00143 entre = &entre_r; 00144 00145 printf("Starting SeqGradientEcho2D \n"); 00146 ntx = expr->ntx; 00147 tacq = expr->readout_time*1.e+3; 00148 fovx = expr->fovx; 00149 te = seqparam->te; 00150 tr = seqparam->tr; 00151 teta = seqparam->teta; 00152 00153 CheckTimesGE(tacq,te,tr); 00154 timp=0.3;/*RF pulse duration in ms */ 00155 acq_delay = 0; 00156 tg=tacq/2.0; 00157 gx=(ntx-1.)/tacq/G_kHz_G/fovx; 00158 npy=0; 00159 npz=0; 00160 00161 SetSpoilingFlag(entre,ACTIVE); /* XY Spoiling after acquisition */ 00162 DoWaiting(expr,entre,ATT_INIT); /* To get an initial magnetisation M0 */ 00163 00164 for(i=0;i<10;i++) /* Repetition to get a TR effect */ 00165 { 00166 DoPulseRect(expr,entre,teta,timp); 00167 DoWaiting(expr,entre,tr); 00168 } 00169 ResetToExperience(expr); 00170 DoPulseRect(expr,entre,teta,timp); 00171 DoWaiting(expr,entre,te-tacq); 00172 // Application of the negative gradient before reading (-gx) 00173 DoGradient( expr,entre,tg,-gx,0,0.0); 00174 // Readout with application of a positive gradient (gx) 00175 DoAcqFrequenceX(expr,entre, gx, npy, npz,acq_delay,MINUS); 00176 00177 printf("Ending SeqGradientEcho1D \n"); 00178 } 00179 00180 00189 void SeqGradientEcho2D_0(SEQPARAM *seqparam,EXPERIENCE3D* expr) 00190 { 00191 int ntx,nty; 00192 double fovx,fovy; 00193 double te,tr,tacq,timp,acq_delay,tg; /* ms */ 00194 double gx,gy,gz,gp; 00195 double teta; /* degree */ 00196 int npy, npz; 00197 EVENT* entre, entre_r; 00198 entre = &entre_r; 00199 00200 printf("Starting SeqGradientEcho2D \n"); 00201 ntx = expr->ntx; 00202 nty = expr->nty; 00203 tacq = expr->readout_time*1.e+3; 00204 fovx = expr->fovx; 00205 fovy = expr->fovy; 00206 00207 te = seqparam->te; 00208 tr = seqparam->tr; 00209 teta = seqparam->teta; 00210 00211 CheckTimesGE(tacq,te,tr); 00212 timp=0.3;/*RF pulse duration in ms */ 00213 acq_delay = 0; 00214 tg=tacq/2.0; 00215 gx=(ntx-1.)/tacq/G_kHz_G/fovx; 00216 gy=2*M_PI*(nty-1)/G_rad_G/fovy/(tg/1000); 00217 gz=0.0; 00218 npz=0; 00219 00220 SetSpoilingFlag(entre,ACTIVE); /* XY Spoiling after acquisition */ 00221 DoWaiting(expr,entre,ATT_INIT); /* To get an initial magnetisation M0 */ 00222 00223 for (npy = 0; npy < expr->nty; npy++) 00224 { 00225 ResetToExperience(expr); 00226 DoPulseRect(expr,entre,teta,timp); 00227 DoWaiting(expr,entre,te-tacq); 00228 gp = (gy) * (npy - nty / 2.) / nty; 00229 // Simultaneous application of the negative gradient before reading (-gx) and the phase gradient gp 00230 DoGradient( expr,entre,tg,-gx,-gp,0.0); 00231 // Readout with application of a positive gradient (gx) 00232 DoAcqFrequenceX(expr,entre, gx, npy, npz,acq_delay,MINUS); 00233 // Waiting before next line 00234 DoWaiting(expr,entre,tr-te-tacq/2.0); 00235 } 00236 00237 printf("Ending SeqGradientEcho2D \n"); 00238 } 00239 00248 void SeqGradientEcho3D_0(SEQPARAM *seqparam,EXPERIENCE3D* expr) 00249 { 00250 int ntx,nty,ntz; 00251 double fovx,fovy,fovz; 00252 double te,tr,tacq,timp,acq_delay,tg; /* ms */ 00253 double gx,gy,gz,gpy,gpz; 00254 double teta; /* degree */ 00255 int npy,npz; 00256 EVENT* entre, entre_r; 00257 entre = &entre_r; 00258 00259 printf("Starting SeqGradientEcho3D \n"); 00260 ntx = expr->ntx; 00261 nty = expr->nty; 00262 ntz = expr->ntz; 00263 tacq = expr->readout_time*1.e+3; 00264 fovx = expr->fovx; 00265 fovy = expr->fovy; 00266 fovz = expr->fovz; 00267 te = seqparam->te; 00268 tr = seqparam->tr; 00269 teta = seqparam->teta; 00270 00271 CheckTimesGE(tacq,te,tr); 00272 timp=0.3;/*RF pulse duration in ms */ 00273 acq_delay = 0; 00274 tg=tacq/2.0; 00275 gx=(ntx-1.)/tacq/G_kHz_G/fovx; 00276 gy=2*M_PI*(nty-1)/G_rad_G/fovy/(tg/1000); 00277 gz=2*M_PI*(ntz-1)/G_rad_G/fovz/(tg/1000); 00278 00279 SetSpoilingFlag(entre,ACTIVE); /* XY Spoiling after acquisition */ 00280 DoWaiting(expr,entre,ATT_INIT); /* To get an initial magnetisation M0 */ 00281 00282 for (npy = 0; npy < expr->nty; npy++) { 00283 for (npz = 0; npz < expr->ntz; npz++) { 00284 ResetToExperience(expr); 00285 DoPulseRect(expr,entre,teta,timp); 00286 DoWaiting(expr,entre,te-tacq); 00287 gpy = (gy) * (npy - nty / 2.) / nty; 00288 gpz = (gz) * (npz - ntz / 2.) / ntz; 00289 // Simultaneous application of the negative gradient before reading (-gx) and the phase gradients gpy,gpz 00290 DoGradient( expr,entre,tg,-gx,-gpy,-gpz); 00291 // Readout with application of a positive gradient (gx) 00292 DoAcqFrequenceX(expr,entre, gx,npy,npz,acq_delay,MINUS); 00293 // Waiting before next line 00294 DoWaiting(expr,entre,tr-te-tacq/2.0); 00295 }} 00296 00297 printf("Ending SeqGradientEcho3D \n"); 00298 }

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