sequence.c
Go to the documentation of this file.00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020
00021
00022
00023
00024
00025
00026
00027
00028
00029
00030
00031
00032
00033
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
1.3.7