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

sequence.c

Go to the documentation of this file.
00001 /************************************************************************* 00002 * $Id: sequence.c,v 1.25 2005/09/22 11:42:36 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 "sequence.h" 00036 #include <idvol.h> 00037 #include <string.h> 00038 #include "event-rfpulse.h" 00039 #include "event-precession.h" 00040 #include "event-acquisition.h" 00041 00050 PSEQ GetSequenceByName (char *seqname) 00051 { 00052 int i; 00053 int ok; 00054 00055 #define NSEQ 14 00056 SEQFUNC seqlist[NSEQ]={ 00057 {13,"TS2D",SeqTurboSpinEcho2D}, 00058 {12,"FID1",SeqFreeInduction1D}, 00059 {11,"IR3D",SeqInversionRecuperation3D}, 00060 {10,"IR2D",SeqInversionRecuperation2D}, 00061 {9,"IR1D",SeqInversionRecuperation1D}, 00062 {8,"TF3D",SeqTrueFisp3D}, 00063 {7,"TF2D",SeqTrueFisp2D}, 00064 {6,"TF1D",SeqTrueFisp1D}, 00065 {5,"GE3D",SeqGradientEcho3D}, 00066 {4,"GE2D",SeqGradientEcho2D}, 00067 {3,"GE1D",SeqGradientEcho1D}, 00068 {2,"SE3D",SeqSpinEcho3D}, 00069 {1,"SE2D",SeqSpinEcho2D}, 00070 {0,"SE1D",SeqSpinEcho1D} 00071 }; 00072 i=0; 00073 ok=-1; 00074 00075 while ((i<NSEQ)&&(ok==-1)) 00076 { 00077 if (strcmp(seqname,seqlist[i].seqname)==0) 00078 ok=i; 00079 i++; 00080 } 00081 printf("ok=%d\n",ok); 00082 return (seqlist[ok].pseq); 00083 } 00084 00096 PPPVOLUME_COMPLEX_DOUBLE 00097 RunSequence(char * seqname, SEQPARAM *seqparam, OBJECT3D * objet, EXPERIENCE3D* expr) 00098 { 00099 int i,j,k; 00100 PPPVOLUME_COMPLEX_DOUBLE volrf,volrfacu; 00101 PSEQ pseq; 00102 00103 pseq = GetSequenceByName(seqname); 00104 00105 00106 volrfacu = (PPPVOLUME_COMPLEX_DOUBLE) IdVolAlloc(expr->ntx,expr->nty,expr->ntz,VOL_COMPLEX_DOUBLE); 00107 if (!volrfacu) 00108 { 00109 FPRINTF(stderr,"Unable to allocate volrfacu!!\n"); 00110 exit(0); 00111 } 00112 for(i=0;i<expr->ntx;i++) for (j=0;j<expr->nty;j++) for (k=0;k<expr->ntz;k++) 00113 { 00114 volrfacu[k][j][i].re = 0.0; 00115 volrfacu[k][j][i].im = 0.0; 00116 } 00117 00118 for (i=0;i<objet->nbcomponent;i++) 00119 { 00120 SetObjectActiveComponent(objet,i); 00121 SetObjectExperienceComponent(expr,objet,i,expr->FLAG_DECH); 00122 volrf = pseq(seqparam,expr); 00123 AddComplexVolRF(volrfacu,volrf); 00124 IdVolFree(volrf); 00125 } 00126 00127 return(volrfacu); 00128 } 00129 00138 void SetSeqParamTE(SEQPARAM *seqparam,double te) 00139 { 00140 seqparam->te = te; 00141 } 00142 00151 void SetSeqParamTR(SEQPARAM *seqparam,double tr) 00152 { 00153 seqparam->tr = tr; 00154 } 00155 00164 void SetSeqParamTI(SEQPARAM *seqparam,double ti) 00165 { 00166 seqparam->ti = ti; 00167 } 00168 00177 void SetSeqParamTeta(SEQPARAM *seqparam,double teta) 00178 { 00179 seqparam->teta = teta; 00180 } 00181 00190 void SetSeqParamTfact(SEQPARAM *seqparam,double tfact) 00191 { 00192 seqparam->tfact = tfact; 00193 }

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