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

seq-special.c

Go to the documentation of this file.
00001 /************************************************************************* 00002 * $Id: seq-special.c,v 1.6 2005/09/22 11:42:36 yougz Exp $ 00003 ************************************************************************** 00004 * This file contains some specific tests that have been done 00005 * No header for this file, since these "old" functions have 00006 * not the vocation to be called in their actual design. They 00007 * are given as memory of certain tests or exemples 00008 ************************************************************************** 00009 This software is governed by the CeCILL license under French law and 00010 abiding by the rules of distribution of free software. You can use, 00011 modify and/ or redistribute the software under the terms of the CeCILL 00012 license as circulated by CEA, CNRS and INRIA at the following URL 00013 "http://www.cecill.info". 00014 00015 As a counterpart to the access to the source code and rights to copy, 00016 modify and redistribute granted by the license, users are provided only 00017 with a limited warranty and the software's author, the holder of the 00018 economic rights, and the successive licensors have only limited 00019 liability. 00020 00021 In this respect, the user's attention is drawn to the risks associated 00022 with loading, using, modifying and/or developing or reproducing the 00023 software by the user in light of its specific status of free software, 00024 that may mean that it is complicated to manipulate, and that also 00025 therefore means that it is reserved for developers and experienced 00026 professionals having in-depth computer knowledge. Users are therefore 00027 encouraged to load and test the software's suitability as regards their 00028 requirements in conditions enabling the security of their systems and/or 00029 data to be ensured and, more generally, to use and operate it in the 00030 same conditions as regards security. 00031 00032 The fact that you are presently reading this means that you have had 00033 knowledge of the CeCILL license and that you accept its terms. 00034 00035 Copyright (c) CREATIS (Centre de Recherche et d'Applications en Traitement de 00036 l'Image). All rights reserved. See License.txt for details. 00037 00038 Version 1.0 05/09/2005 00039 *************************************************************************/ 00040 #include "event-rfpulse.h" 00041 #include "event-precession.h" 00042 #include "event-acquisition.h" 00043 #include "seq-mpi.h" 00044 #include "output.h" 00045 #include <idima.h> 00046 00054 PPPVOLUME_COMPLEX_DOUBLE SequenceSE2D_sel(SEQPARAM *seqparam, EXPERIENCE3D* expr, OBJECT3D * objet,double epaisseur_coupe) 00055 { 00056 double Tacq; 00057 double gx_phase,gx_frequence,dgy,agz; 00058 double timp; /* en micros */ 00059 double tp; /*en ms : duree d'application du gradient de phase */ 00060 double angle_rf1,angle_rf2; /*en degre*/ 00061 double t_avant_tp, t_apres_tp, t_avant_acquisition,tech,t_comp_gradz,t_crusher; /*en ms*/ 00062 double te,tr; 00063 int npy, npz; 00064 int ntx, nty, ntz; /* taille du volume RF acquis */ 00065 double fovx,fovy;/* taille du fov en m */ 00066 EVENT* entre, entre_r; 00067 double gamma_hg,gamma_rt; 00068 int ecrit; 00069 int nb_lobs,nb_pts_rf; 00070 00071 nb_lobs=3; 00072 nb_pts_rf = 128; 00073 gamma_hg = G/2/M_PI/1000/10000; /* G en kHz/gauss # 4,26kHz/G */ 00074 gamma_rt = G/10000; /* G en rad/sec/gauss #26000 */ 00075 ecrit= 0; 00076 entre = &entre_r; 00077 00078 ntx = expr->ntx; 00079 nty = expr->nty; 00080 ntz = expr->ntz; 00081 Tacq = expr->readout_time*1e3; // duree d'acquisition en ms 00082 fovx = expr->fovx; 00083 fovy = expr->fovy; 00084 00085 te = seqparam->te; 00086 tr = seqparam->tr; 00087 00088 /********************* 00089 * Sequence Spin-Echo 2D 00090 * Pas de gradient de phase en z 00091 **********************/ 00092 timp = 2.560; /* temps d'impulsion en ms */ 00093 angle_rf1 = 90.; /* angle de bascule de la premiere impulsion rf */ 00094 angle_rf2 = 180.; /* angle de bascule de la secondesion rf */ 00095 tp = 4.34; /* temps d'application du gradient de phase en ms */ 00096 tech = expr->pt*1e3; /* temps d'échantillonnage en ms */ 00097 00098 // gx_frequence = gradient en x applique pendant la lecture 00099 // gx_phase = gradient en x applique en meme temps que le gradient de phase. Ce predephasage en x 00100 // permet d'avoir ensuite un echo centre pendant l'acquisition. Cet echo sera centre a condition 00101 // que gx_phase et gx_frequence soient reliés par la relation suivante : 00102 00103 gx_frequence = 2*M_PI/(fovx*G*tech*1e-3)*1e4; 00104 gx_phase = gx_frequence/tp*(ntx+1)/2.*tech; 00105 dgy=2*M_PI*(nty-1)/nty/(G*fovy*tp*1e-3)*1e4; /* pas du gradient de phase */ 00106 00107 // Gradient de sélection de coupe 00108 // il est calculé soit a partir du nombre de lobes, de la durée d'impulsion et de l'épaisseur de coupe 00109 // soit à partir de données issues de la doc Siemens (facteur 2.4 ci-après) qui correspond 00110 // au fichier rf utilisé 00111 00112 // dans le cas d'une utilsation d'une impulsion en sinus cardinal 00113 //delta_f=2*nb_lobs/(timp*1e-6); 00114 //agz = 2*M_PI*delta_f/(G*epaisseur_coupe)*1e4; 00115 00116 // dans le cas de l'utilisation du fichier de sequence siemens 00117 agz=2.4*10.0/(epaisseur_coupe*1e3)*10; 00118 00119 // après la première impulsion rf on attend un certain temps avant d'appliquer le gradient de phase et 00120 // le gradient en x. On attend le meme temps ensuite avant d'appliquer la seconde impulsion rf 00121 t_avant_tp = 0.5*(te/2-tp-timp); 00122 t_apres_tp = 0.5*(te/2-tp-timp); 00123 00124 t_comp_gradz = 0.5175*timp; 00125 t_crusher = 1; 00126 // temps d'attente entre la seconde impulsion rf et l'acquisition 00127 t_avant_acquisition = te/2-(ntx+1)/2.*tech-t_comp_gradz; 00128 00129 npz=0; 00130 DoWaiting(expr,entre,ATT_INIT); /* Pour avoir une aimantation initiale */ 00131 for (npy = 0; npy < expr->nty; npy++) 00132 { 00133 if(npy==0) MagstateWatch(expr,"etat_0.txt"); 00134 printf("npy=%d\n",npy); 00135 printf("rf1\n"); 00136 entre->agz=agz; 00137 //DoPulseSinc(expr,entre,angle_rf1,timp,nb_pts_rf,nb_lobs); 00138 DoPulseFile(expr,entre,angle_rf1,timp,"..\\data\\rf\\rf90_2.4_20mm_128_points.txt"); 00139 DoWaiting(expr,entre,t_avant_tp); /*attente */ 00140 DoGradient(expr,entre,(tp-t_comp_gradz)/2,gx_phase,dgy*(npy-nty/2),0.0); 00141 DoGradient(expr,entre,t_comp_gradz,gx_phase,dgy*(npy-nty/2),-agz); 00142 DoGradient(expr,entre,(tp-t_comp_gradz)/2,gx_phase,dgy*(npy-nty/2),0.0); /*gradient de phase + lobe dephaseur en x (pour le centrage de l'echo) */ 00143 DoWaiting(expr,entre,t_apres_tp-t_crusher); /*attente */ 00144 DoGradient(expr,entre,t_crusher,0,0,3*agz); /*gradient de crusher*/ 00145 00146 printf("rf2\n"); 00147 entre->agz=agz; 00148 //DoPulseSinc(expr,entre,angle_rf2,timp,nb_pts_rf,nb_lobs); 00149 DoPulseFile(expr,entre,angle_rf2,timp,"..\\data\\rf\\rf180_2.4_20mm_128_points.txt"); 00150 DoGradient(expr,entre,t_crusher,0,0,3*agz); /*gradient de crusher*/ 00151 DoWaiting(expr,entre,t_avant_acquisition-t_crusher); /* attente avant acquisition */ 00152 DoAcqFrequenceX( expr,entre, gx_frequence, npy, npz,tech/2., MINUS); /*acquisition */ 00153 DoGradient(expr,entre,tp,10*agz,0.0,10*agz); /* spoiler */ 00154 DoWaiting(expr,entre,tr); 00155 } 00156 return(GetSignalRFComplexFromExperience(expr)); 00157 }

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