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

seq-tf.c

Go to the documentation of this file.
00001 /************************************************************************* 00002 * $Id: seq-tf.c,v 1.7 2005/09/07 07:13:33 yougz Exp $ 00003 ************************************************************************** 00004 Functions that implement a TrueFisp Sequence 00005 This sequence chains the following events 00006 - RF pulse 00007 - Waiting 00008 - Phase Gradient 00009 - Waiting 00010 - Bipolar Gradient : Half negative lobe before acquisition 00011 - Acquisition with a positive gradient 00012 - Rewind of all the gradients (phase and readout) 00013 ****************************************************************************** 00014 This software is governed by the CeCILL license under French law and 00015 abiding by the rules of distribution of free software. You can use, 00016 modify and/ or redistribute the software under the terms of the CeCILL 00017 license as circulated by CEA, CNRS and INRIA at the following URL 00018 "http://www.cecill.info". 00019 00020 As a counterpart to the access to the source code and rights to copy, 00021 modify and redistribute granted by the license, users are provided only 00022 with a limited warranty and the software's author, the holder of the 00023 economic rights, and the successive licensors have only limited 00024 liability. 00025 00026 In this respect, the user's attention is drawn to the risks associated 00027 with loading, using, modifying and/or developing or reproducing the 00028 software by the user in light of its specific status of free software, 00029 that may mean that it is complicated to manipulate, and that also 00030 therefore means that it is reserved for developers and experienced 00031 professionals having in-depth computer knowledge. Users are therefore 00032 encouraged to load and test the software's suitability as regards their 00033 requirements in conditions enabling the security of their systems and/or 00034 data to be ensured and, more generally, to use and operate it in the 00035 same conditions as regards security. 00036 00037 The fact that you are presently reading this means that you have had 00038 knowledge of the CeCILL license and that you accept its terms. 00039 00040 Copyright (c) CREATIS (Centre de Recherche et d'Applications en Traitement de 00041 l'Image). All rights reserved. See License.txt for details. 00042 00043 Version 1.0 05/09/2005 00044 *************************************************************************/ 00045 00046 #include "seq-tf.h" 00047 #include "event-rfpulse.h" 00048 #include "event-precession.h" 00049 #include "event-acquisition.h" 00050 #include "experience.h" 00051 #include "seq-mpi.h" 00052 00053 void SeqTrueFisp1D_0(SEQPARAM *seqparam,EXPERIENCE3D* expr); 00054 void SeqTrueFisp2D_0(SEQPARAM *seqparam,EXPERIENCE3D* expr); 00055 void SeqTrueFisp3D_0(SEQPARAM *seqparam,EXPERIENCE3D* expr); 00056 00066 PPPVOLUME_COMPLEX_DOUBLE 00067 SeqTrueFisp1D(SEQPARAM *seqparam,EXPERIENCE3D* expr) 00068 { 00069 mpi_job(seqparam, expr, SeqTrueFisp1D_0); 00070 NormalizeRFSignal(expr); 00071 return(GetSignalRFComplexFromExperience(expr)); 00072 } 00073 00083 PPPVOLUME_COMPLEX_DOUBLE 00084 SeqTrueFisp2D(SEQPARAM *seqparam,EXPERIENCE3D* expr) 00085 { 00086 mpi_job(seqparam, expr, SeqTrueFisp2D_0); 00087 NormalizeRFSignal(expr); 00088 return(GetSignalRFComplexFromExperience(expr)); 00089 } 00090 00100 PPPVOLUME_COMPLEX_DOUBLE 00101 SeqTrueFisp3D(SEQPARAM *seqparam,EXPERIENCE3D* expr) 00102 { 00103 mpi_job(seqparam, expr, SeqTrueFisp3D_0); 00104 NormalizeRFSignal(expr); 00105 return(GetSignalRFComplexFromExperience(expr)); 00106 } 00107 00116 void CheckTimesTF(double tacq,double tr,double twait) 00117 { 00118 int f=0; 00119 if((tr>=2*tacq)&&(twait>=0.))f=1; 00120 if(f==0){ 00121 FPRINTF(stderr,"Bad values for your sequence TF: Tacq=%g, Tr=%g, Twait=%g, \n",tacq, tr, twait); 00122 exit(0); 00123 } 00124 } 00125 00134 void SeqTrueFisp1D_0(SEQPARAM *seqparam,EXPERIENCE3D* expr) 00135 { 00136 int i,ntx,phase,altphase; 00137 double fovx; 00138 double tr,tacq,timp,acq_delay,tgrad,twait; /* ms */ 00139 double gx; 00140 double teta; /* degree */ 00141 int npy, npz; 00142 EVENT* entre, entre_r; 00143 entre = &entre_r; 00144 00145 printf("Starting SeqTrueFisp1D \n"); 00146 00147 ntx = expr->ntx; 00148 tacq = expr->readout_time*1.e+3; 00149 fovx = expr->fovx; 00150 00151 tr = seqparam->tr; 00152 teta = seqparam->teta; 00153 00154 CheckTimesTF(tacq,tr/2.,tr); 00155 timp=0.3; /*RF pulse duration in ms */ 00156 acq_delay = 0; 00157 tgrad=(tacq)/2.; 00158 twait=(tr-2*tgrad-tacq)/2; 00159 00160 gx=(ntx-1)/tacq/G_kHz_G/fovx; 00161 npy=0;npz=0; 00162 00163 SetSpoilingFlag(entre,INACTIVE); /* No XY Spoiling after acquisition for true fisp*/ 00164 DoWaiting(expr,entre,ATT_INIT); /* To get an initial magnetisation M0 */ 00165 00166 altphase=-1;/* Phase alternance at each acquisition */ 00167 phase = 1; 00168 /* Iterated excitations to get an equilibrium state */ 00169 for (i = 0; i<10*ntx; i++) 00170 { 00171 DoPulseRect(expr,entre,teta * phase,timp); 00172 DoWaiting(expr,entre,tr); 00173 phase= phase * altphase; 00174 } 00175 ResetToExperience(expr); 00176 DoPulseRect(expr,entre,teta * phase,timp); 00177 DoWaiting(expr,entre,twait); 00178 DoGradient( expr,entre,tgrad,-gx,0.0,0.0); 00179 DoAcqFrequenceX(expr,entre, +gx, npy, npz,acq_delay, phase); 00180 00181 printf("Ending SeqTrueFisp1D \n"); 00182 } 00183 00192 void SeqTrueFisp2D_0(SEQPARAM *seqparam,EXPERIENCE3D* expr) 00193 { 00194 int ntx,nty, phase, altphase; 00195 double fovx,fovy; 00196 double tr,tacq,timp,acq_delay,tgrad,twait; /* ms */ 00197 double gx,gy,gz,gpy; 00198 double teta; /* degree */ 00199 int npy, npz; 00200 EVENT* entre, entre_r; 00201 entre = &entre_r; 00202 00203 printf("Starting SeqTrueFisp2D \n"); 00204 ntx = expr->ntx; 00205 nty = expr->nty; 00206 tacq = expr->readout_time*1.e+3; 00207 fovx = expr->fovx; 00208 fovy = expr->fovy; 00209 00210 tr = seqparam->tr; 00211 teta = seqparam->teta; 00212 00213 timp=0.3; /*RF pulse duration in ms */ 00214 acq_delay = 0; 00215 tgrad=(tacq)/2.; 00216 twait=(tr-2*tgrad-tacq)/2; 00217 00218 CheckTimesTF(tacq,tr,twait); 00219 00220 gx=(ntx-1.)/tacq/G_kHz_G/fovx; 00221 gy=2*M_PI*(nty-1)/G_rad_G/fovy/(tgrad/1000); 00222 gz=0.0; 00223 npz=0; 00224 00225 SetSpoilingFlag(entre,INACTIVE); /* No XY Spoiling after acquisition for true fisp*/ 00226 DoWaiting(expr,entre,ATT_INIT); /* To get an initial magnetisation M0 */ 00227 00228 altphase=-1; /* Phase alternance at each acquisition */ 00229 phase = 1; 00230 00231 /* Iterated excitations to get an equilibrium state */ 00232 for (npy = 0; npy < 10 * expr->nty; npy++) 00233 { 00234 DoPulseRect(expr,entre,teta * phase,timp); 00235 DoWaiting(expr,entre,tr); 00236 phase= phase * altphase; 00237 } 00238 00239 for (npy = 0; npy < expr->nty; npy++) 00240 { 00241 ResetToExperience(expr); 00242 DoPulseRect(expr,entre,teta * phase,timp); 00243 DoWaiting(expr,entre,twait); 00244 gpy = (gy) * (npy - nty / 2.) / nty; 00245 // Simultaneous application of the negative gradient before reading (-gx) and the phase gradients gpy 00246 DoGradient( expr,entre,tgrad,-gx,-gpy,0.0); 00247 DoAcqFrequenceX(expr,entre, +gx, npy, npz,acq_delay, phase); 00248 DoGradient( expr,entre,tgrad,-gx,+gpy,0.0); 00249 DoWaiting(expr,entre,twait); 00250 phase= phase * altphase; 00251 } 00252 printf("Ending SeqTrueFisp2D\n"); 00253 } 00254 00263 void SeqTrueFisp3D_0(SEQPARAM *seqparam,EXPERIENCE3D* expr) 00264 { 00265 int ntx,nty,ntz, phase, altphase; 00266 double fovx,fovy,fovz; 00267 double tr,tacq,timp,acq_delay,tgrad,twait; /* ms */ 00268 double gx,gy,gz,gpy,gpz; 00269 double teta; /* degree */ 00270 int npy,npz; 00271 EVENT* entre, entre_r; 00272 entre = &entre_r; 00273 00274 printf("Starting SeqTrueFisp3D \n"); 00275 ntx = expr->ntx; 00276 nty = expr->nty; 00277 ntz = expr->ntz; 00278 tacq = expr->readout_time*1.e+3; 00279 fovx = expr->fovx; 00280 fovy = expr->fovy; 00281 fovz = expr->fovz; 00282 00283 tr = seqparam->tr; 00284 teta = seqparam->teta; 00285 00286 timp=0.3;/*RF pulse duration in ms */ 00287 acq_delay = 0; 00288 tgrad=(tacq)/2.; 00289 twait=(tr-2*tgrad-tacq)/2; 00290 00291 CheckTimesTF(tacq,tr,twait); 00292 00293 gx=(ntx-1.)/tacq/G_kHz_G/fovx; 00294 gy=2*M_PI*(nty-1)/G_rad_G/fovy/(tgrad/1000); 00295 gz=2*M_PI*(ntz-1)/G_rad_G/fovz/(tgrad/1000); 00296 00297 SetSpoilingFlag(entre,INACTIVE); /* No XY Spoiling after acquisition for true fisp*/ 00298 DoWaiting(expr,entre,ATT_INIT); /* To get an initial magnetisation M0 */ 00299 00300 altphase=-1; /* Phase alternance at each acquisition */ 00301 phase = 1; 00302 00303 /* Iterated excitations to get an equilibrium state */ 00304 for (npy = 0; npy < 10 * expr->nty; npy++) 00305 { 00306 DoPulseRect(expr,entre,teta * phase,timp); 00307 DoWaiting(expr,entre,tr); 00308 phase= phase * altphase; 00309 } 00310 00311 for (npy = 0; npy < expr->nty; npy++) { 00312 for (npz = 0; npz < expr->ntz; npz++) 00313 { 00314 ResetToExperience(expr); 00315 DoPulseRect(expr,entre,teta * phase,timp); 00316 DoWaiting(expr,entre,twait); 00317 gpy = (gy) * (npy - nty / 2.) / nty; 00318 gpz = (gz) * (npz - ntz / 2.) / ntz; 00319 // Simultaneous application of the negative gradient before reading (-gx) and the phase gradients gpy,gpz 00320 DoGradient( expr,entre,tgrad,-gx,-gpy,-gpz); 00321 DoAcqFrequenceX(expr,entre, +gx, npy, npz,acq_delay, phase); 00322 DoGradient( expr,entre,tgrad,-gx,+gpy,+gpz); 00323 DoWaiting(expr,entre,twait); 00324 phase= phase * altphase; 00325 }} 00326 printf("Ending SeqTrueFisp3D\n"); 00327 } 00328

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