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

seq-ir.c

Go to the documentation of this file.
00001 /************************************************************************* 00002 * $Id: seq-ir.c,v 1.3 2005/09/07 07:13:32 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-ir.h" 00036 #include "seq-mpi.h" 00037 #include "event-acquisition.h" 00038 #include "experience.h" 00039 #include "event.h" 00040 #include "event-rfpulse.h" 00041 #include "event-precession.h" 00042 00043 void SeqInversionRecuperation1D_0(SEQPARAM *seqparam,EXPERIENCE3D*expr); 00044 void SeqInversionRecuperation2D_0(SEQPARAM *seqparam,EXPERIENCE3D*expr); 00045 void SeqInversionRecuperation3D_0(SEQPARAM *seqparam,EXPERIENCE3D*expr); 00046 00056 PPPVOLUME_COMPLEX_DOUBLE SeqInversionRecuperation1D(SEQPARAM *seqparam,EXPERIENCE3D*expr) 00057 { 00058 mpi_job(seqparam, expr, SeqInversionRecuperation1D_0); 00059 NormalizeRFSignal(expr); 00060 return(GetSignalRFComplexFromExperience(expr)); 00061 } 00062 00072 PPPVOLUME_COMPLEX_DOUBLE SeqInversionRecuperation2D(SEQPARAM *seqparam,EXPERIENCE3D*expr) 00073 { 00074 mpi_job(seqparam , expr, SeqInversionRecuperation2D_0); 00075 NormalizeRFSignal(expr); 00076 return(GetSignalRFComplexFromExperience(expr)); 00077 } 00078 00088 PPPVOLUME_COMPLEX_DOUBLE SeqInversionRecuperation3D(SEQPARAM *seqparam,EXPERIENCE3D*expr) 00089 { 00090 mpi_job(seqparam, expr, SeqInversionRecuperation3D_0); 00091 NormalizeRFSignal(expr); 00092 return(GetSignalRFComplexFromExperience(expr)); 00093 } 00094 00104 void CheckTimesIR(double tacq,double te,double tr,double ti) 00105 { 00106 int f=0; 00107 if((tacq<te)&&(tr>te+tacq/2.0))f=1; 00108 if(f==0){ 00109 FPRINTF(stderr,"Bad values for your sequence SE: Tacq=%g, Te=%g, Tr=%g\n",tacq, te, tr); 00110 exit(0); 00111 } 00112 } 00113 00122 void SeqInversionRecuperation1D_0(SEQPARAM *seqparam,EXPERIENCE3D*expr) 00123 { 00124 int ntx; 00125 double fovx; 00126 double te,tr,tacq,ti; /* in ms */ 00127 double gx,gy,gz; 00128 double acq_delay,timp; /* in ms */ 00129 int npy, npz; 00130 int i; 00131 EVENT* event, event_r; 00132 event = &event_r; 00133 00134 printf("Starting SeqInversionRecuperation1D\n"); 00135 ntx = expr->ntx; 00136 tacq = expr->readout_time*1.e+3; 00137 fovx = expr->fovx; 00138 00139 te = seqparam->te; 00140 tr = seqparam->tr; 00141 ti = seqparam->ti; 00142 00143 CheckTimesIR(tacq,te,tr,ti); 00144 00145 acq_delay = (te/2) - (tacq/2. + tacq/2./(ntx-1)); 00146 timp=0.3; /*RF pulse duration in ms */ 00147 00148 gx=(ntx-2.)/tacq/G_kHz_G/fovx; 00149 gy=0.0; 00150 gz=0.0; 00151 npy=0;npz=0; 00152 00153 SetSpoilingFlag(event,ACTIVE); /* XY Spoiling after each line acquisition */ 00154 DoWaiting(expr,event,ATT_INIT); /* To get an initial Magnetization M0 */ 00155 ResetToExperience(expr); 00156 00157 for(i=0;i<10;i++) /* Repetition cycle to take TR into account */ 00158 { 00159 DoPulseRect(expr,event, 180.,timp); 00160 DoWaiting(expr,event,ti); 00161 DoPulseRect(expr,event, 90., timp); 00162 DoGradient(expr,event, te/2.,gx,gy,gz); 00163 DoPulseRect(expr,event,180.,timp); 00164 DoGradient(expr,event, acq_delay+tacq,gx,gy,gz); 00165 DoWaiting(expr,event,tr-te-tacq/2.0); 00166 } 00167 00168 DoPulseRect(expr,event, 180.,timp); 00169 DoWaiting(expr,event,ti); 00170 DoPulseRect(expr,event, 90.,timp); 00171 DoGradient(expr,event, te/2.,gx,gy,gz); 00172 DoPulseRect(expr,event,180.,timp); 00173 DoAcqFrequenceX( expr,event, gx, npy, npz,acq_delay, MINUS); 00174 00175 printf("Ending SeqInversionRecuperation1D\n"); 00176 } 00177 00186 void SeqInversionRecuperation2D_0(SEQPARAM *seqparam,EXPERIENCE3D*expr) 00187 { 00188 int ntx,nty; 00189 double fovx,fovy; 00190 double te,tr,ti,tacq,timp,acq_delay,tg; /* ms */ 00191 double gx,gy,gz,gp; 00192 int npy, npz; 00193 EVENT* event, event_r; 00194 event = &event_r; 00195 00196 printf("Starting SeqInversionRecuperation2D \n"); 00197 ntx = expr->ntx; 00198 nty = expr->nty; 00199 tacq = expr->readout_time*1.e+3; 00200 fovx = expr->fovx; 00201 fovy = expr->fovy; 00202 00203 ti = seqparam->ti; 00204 te = seqparam->te; 00205 tr = seqparam->tr; 00206 00207 CheckTimesIR(tacq,te,tr,ti); 00208 timp=0.3; /* Pulse duration in ms */ 00209 acq_delay = (te/2) - (tacq/2. + tacq/2./(ntx-1)); 00210 tg = te/2.; 00211 gx = (ntx-2.)/tacq/G_kHz_G/fovx; 00212 gy = 2*M_PI*(nty-1)/G_rad_G/fovy/(tg/1000); 00213 gz = 0.0; 00214 npz= 0; 00215 00216 SetSpoilingFlag(event,ACTIVE); /* XY Spoiling after each line acquisition */ 00217 00218 DoWaiting(expr,event,ATT_INIT); /* To get an initial Magnetization M0 */ 00219 for (npy = 0; npy < expr->nty; npy++) 00220 { 00221 ResetToExperience(expr); 00222 DoPulseRect(expr,event, 180.,timp); 00223 DoWaiting(expr,event,ti); 00224 00225 DoPulseRect(expr,event, 90.,timp); 00226 gp = (gy) * (npy - (nty) / 2) / (nty); 00227 DoGradient(expr,event,tg,gx,gp,gz); 00228 00229 DoPulseRect(expr,event,180.,timp); 00230 00231 DoAcqFrequenceX( expr,event, gx, npy, npz,acq_delay, MINUS); 00232 00233 DoWaiting(expr,event,tr-te-tacq/2.0); 00234 } 00235 printf("Ending SeqInversionRecuperation2D\n"); 00236 } 00237 00238 00247 void SeqInversionRecuperation3D_0(SEQPARAM *seqparam,EXPERIENCE3D*expr) 00248 { 00249 int ntx,nty,ntz; 00250 double fovx,fovy,fovz; 00251 double te,tr,tacq,ti; /* ms */ 00252 double gx,gy,gz; 00253 double acq_delay,timp; /* ms */ 00254 int npy,npz; 00255 EVENT* event, event_r; 00256 event = &event_r; 00257 00258 printf("Starting SeqInversionRecuperation3D\n"); 00259 ntx = expr->ntx; 00260 nty = expr->nty; 00261 ntz = expr->ntz; 00262 tacq = expr->readout_time*1.e+3; 00263 fovx = expr->fovx; 00264 fovy = expr->fovy; 00265 fovz = expr->fovz; 00266 00267 te = seqparam->te; 00268 tr = seqparam->tr; 00269 ti = seqparam->ti; 00270 00271 CheckTimesIR(tacq,te,tr,ti); 00272 00273 acq_delay = (te/2) - (tacq/2. + tacq/2./(ntx-1)); 00274 00275 gx=(ntx-2.)/tacq/G_kHz_G/fovx; 00276 gy=2*M_PI*(nty-1)/G_rad_G/fovy/(te/2./1000); 00277 gz=2*M_PI*(ntz-1)/G_rad_G/fovz/(te/2./1000); 00278 timp=0.3; /* Pulse duration in ms */ 00279 00280 SetSpoilingFlag(event,ACTIVE); /* XY Spoiling after each line acquisition */ 00281 00282 DoWaiting(expr,event,ATT_INIT); /* To get an initial Magnetization M0 */ 00283 for (npy = 0; npy < expr->nty; npy++) { 00284 for (npz = 0; npz < expr->ntz; npz++) { 00285 ResetToExperience(expr); 00286 DoPulseRect(expr,event, 180.,timp); 00287 DoWaiting(expr,event,ti); 00288 DoPulseRect(expr,event, 90., timp); 00289 DoGradient( expr,event, te/2.,gx, 00290 (gy) * (npy - nty / 2) / nty, 00291 (gz) * (npz - ntz / 2) / ntz); 00292 DoPulseRect(expr,event,180.,timp); 00293 DoAcqFrequenceX( expr,event, gx, npy, npz,acq_delay, MINUS); 00294 DoWaiting(expr,event,tr-te-tacq/2.0); 00295 }} 00296 printf("Ending SeqInversionRecuperation3D\n"); 00297 00298 } 00299

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