void get_wsparameters2() { getstrnwarn("wss",wss); gcrushws = getvalnwarn("gcrushws"); tcrushws = getvalnwarn("tcrushws"); ws_delay = getvalnwarn("ws_delay"); wsflipf = getvalnwarn("wsflipf"); wsflipf_last = getval("wsflipf_last"); getstrnwarn("wsrf", wsrf); restol = getvalnwarn("restol"); }
void pulsesequence() { double gzlvl1,gt1; char gradaxis[MAXSTR]; getstrnwarn("gradaxis",gradaxis); if (( gradaxis[0] != 'x') && ( gradaxis[0] != 'y') && ( gradaxis[0] != 'z') ) strcpy(gradaxis,"z"); gzlvl1 = getval("gzlvl1"); gt1 = getval("gt1"); status(A); read_in_eddys(gradaxis[0]); delay(d1); status(B); rgradient(gradaxis[0],0.0); send_eddys(gradaxis[0],0.00005); delay(2e-3); shgradpulse(gzlvl1,gt1); delay(d2); status(C); pulse(pw,oph); }
pulsesequence() { double gzlvl1; double td; char gradaxis[MAXSTR]; dbl(oph,v1); mod4(v1,v1); hlv(v1,v1); hlv(ct,v2); hlv(v2,v2); mod4(v2,v2); dbl(v2,v2); add(v1,v2,v1); getstrnwarn("gradaxis",gradaxis); if (( gradaxis[0] != 'x') && ( gradaxis[0] != 'y') && ( gradaxis[0] != 'z') ) strcpy(gradaxis,"z"); gzlvl1 = getval("gzlvl1"); at = getval("at"); status(A); delay(d1); status(B); td = (d2-at/2.0)/2.0; if (td < 0.0) td = 0.0; rgpulse(p1,oph,rof1,rof2); delay(td); rgradient(gradaxis[0],gzlvl1); delay(at/2.0); rgradient(gradaxis[0],0.0); delay(td); status(C); pulse(pw,v1); delay(d2-at/2.0); rgradient(gradaxis[0],gzlvl1); delay(0.0001); /* let gradient stabilize */ /* rely on psg safety to turn off gradient */ }
void get_ovsparameters2() { getstrnwarn("ovs",ovs); ovsthk = getvalnwarn("ovsthk"); ovsgap = getvalnwarn("ovsgap"); /* convert from mm to cm */ csd_ppm = getvalnwarn("csd_ppm"); ovsflipf = getvalnwarn("ovsflipf"); tpwrdx = getval("tpwrdx"); tpwrdy = getval("tpwrdy"); tpwrdz = getval("tpwrdz"); }
void pulsesequence() { double gzlvl1,gt1; char shaped[MAXSTR],gradaxis[MAXSTR]; getstr("shaped",shaped); getstrnwarn("gradaxis",gradaxis); if (( gradaxis[A] != 'x') && ( gradaxis[A] != 'y') && ( gradaxis[A] != 'z') ) strcpy(gradaxis,"z"); gzlvl1 = getval("gzlvl1"); gt1 = getval("gt1"); status(A); delay(d1); status(B); rgpulse(p1, zero,rof1,rof2); if (shaped[A]=='y') { if (gt1<0.0002) { printf("set gradient greater than 200usec for sine shape"); psg_abort(1); } halfsineshapegrad(gradaxis[A],gzlvl1,gt1); } if (shaped[A] == 's') { zgradpulse(gzlvl1,gt1); /* automatic wurst shape (vnmrj 1.1C and later) */ } if (shaped[A] == 'n') { rgradient(gradaxis[A],gzlvl1); delay(gt1); rgradient(gradaxis[A],0.0); } delay(d2); status(C); pulse(pw,oph); }
pulsesequence() { double d3 = getval("d3"), vtcomplvl = getval("vtcomplvl"), gzlvl = getval("gzlvl"), shapedpw90 = getvalnwarn("shapedpw90"), shapedpw180 = getvalnwarn("shapedpw180"), shapedpwr90 = getvalnwarn("shapedpwr90"), shapedpwr180 = getvalnwarn("shapedpwr180"), gt,gts,lvlf; int hs_gradtype; char shaped[MAXSTR], shapename90[MAXSTR], shapename180[MAXSTR]; getstrnwarn("shaped", shaped); getstrnwarn("shapename90", shapename90); getstrnwarn("shapename180", shapename180); settmpgradtype("tmpgradtype"); hs_gradtype = ((specialGradtype == 'h') || (specialGradtype == 'a')); if ((p1==0.0) && ((vtcomplvl>0.5) || (hs_gradtype))) { p1 = 2.0*pw; } if ((vtcomplvl==2) && ((hs_gradtype) || (spin>0))) { vtcomplvl = 1; if (ix==1) { text_message("gmapz: vtcomplvl set to 1\n"); putCmd("setvalue('vtcomplvl',%.0f)\n",vtcomplvl); putCmd("setvalue('vtcomplvl',%.0f,'processed')\n",vtcomplvl); } } /* lvlf, gt, gts only used for convection compensation */ if (gradtype[2]=='l') lvlf=2.5; else lvlf=3.0; if ((hs_gradtype) || (spin>0)) lvlf=1.0; gt = (0.5*at + d2)/lvlf; gts=0.18*at/lvlf; gts = 0.2*at/lvlf; if (vtcomplvl==2) gt += gts; gt *= 2.0; settable(t1,16,ph1); settable(t2,2,ph2); settable(t3,8,ph3); settable(t4,16,ph4); sub(ct,ssctr,v12); getelem(t1,v12,v1); getelem(t2,v12,v2); getelem(t3,v12,v3); getelem(t4,v12,oph); if (vtcomplvl < 0.5) { getelem(t4,v12,v1); getelem(t1,v12,v2); } /* --- equilibration period --- */ status(A); delay(d1); /* --- initial pulse --- */ status(B); if (shaped[A] == 'y') { obspower(shapedpwr90); shaped_pulse(shapename90,shapedpw90,v1,rof1,rof2); obspower(tpwr); } else pulse(pw,v1); /* instead of hard pulse, could use shapedpulse("gauss",pw,oph,rof1,rof2); or "bir4_90_512" or other shape for selective excitation. selective inversion pulses may or may not work as well. */ /* --- shim phase encode, not during PFG recovery --- */ delay(2e-5+d3); /* First case: No convection compensation, traditional sequence */ if (vtcomplvl < 0.5) { if (p1 > 0) { zgradpulse(gzlvl,at/2+d2); delay(d2); if (shaped[A] == 'y') { obspower(shapedpwr180); shaped_pulse(shapename180,shapedpw180,v2,rof1,rof2); obspower(tpwr); } else pulse(p1,v2); delay(d2); } else { zgradpulse(-gzlvl,at/2+d2); delay(d2*2); } } else /* (vtcomplvl > 0.5) */ { /* Second case: convection compensation */ zgradpulse(gzlvl,at/2+d2); delay(d2); if (vtcomplvl==2) { zgradpulse(lvlf*gzlvl,gts); delay(d2); } if (shaped[A] == 'y') { obspower(shapedpwr180); shaped_pulse(shapename180,shapedpw180,v2,rof1,rof2); } else pulse(p1,v2); delay(d2); zgradpulse(lvlf*gzlvl,gt); delay(d2); if (shaped[A] == 'y') { shaped_pulse(shapename180,shapedpw180,v3,rof1,rof2); obspower(tpwr); } else pulse(p1,v3); delay(d2); if (vtcomplvl==2) { zgradpulse(lvlf*gzlvl,gts); delay(d2); } } /* --- acq. of echo during gradient --- */ rgradient('z',gzlvl); delay(d2); /* gradient switches off at end of acq. */ }
pulsesequence() { /* Internal variable declarations *********************/ double freq90[MAXNSLICE],freq180[MAXNSLICE]; double te_delay1,te_delay2,tr_delay,tau1,tau2,thk2fact,te_delay3=0.0,te_delay4=0.0,navTime=0.0; double crushm0,pem0,gcrushr,gcrushp,gcrushs,pecrush; double refsign=1,crushsign=1,navsign=1; int shape90,shape180,table=0,sepRefocus; char slprofile[MAXSTR]; /* sequence dependent diffusion variables */ double Gro,Gss; // "gdiff" for readout/readout refocus and slice/slice refocus double dgro,dgss; // "delta" for readout/readout refocus and slice/slice refocus double Dgro,Dgss; // "DELTA" for readout/readout refocus and slice/slice refocus double dcrush,dgss2; // "delta" for crusher and gss2 gradients double Dcrush,Dgss2; // "DELTA" for crusher and gss2 gradients int i; /* Real-time variables used in this sequence **********/ int vpe_steps = v1; // Number of PE steps int vpe_ctr = v2; // PE loop counter int vms_slices = v3; // Number of slices int vms_ctr = v4; // Slice loop counter int vpe_offset = v5; // PE/2 for non-table offset int vpe_mult = v6; // PE multiplier, ranges from -PE/2 to PE/2 int vph180 = v7; // Phase of 180 pulse int vph2 = v8; // alternate phase of 180 on odd transients int vssc = v9; // Compressed steady-states int vtrimage = v10; // Counts down from nt, trimage delay when 0 int vacquire = v11; // Argument for setacqvar, to skip steady state acquires int vtrigblock = v12; // Number of slices per trigger block /* Initialize paramaters *****************************/ init_mri(); thk2fact=getval("thk2fact"); pecrush=getval("pecrush"); sepRefocus=getvalnwarn("sepRefocus"); getstrnwarn("slprofile",slprofile); /* Check for external PE table ***********************/ init_tablepar("pelist"); // Initialize pelist parameter if (strcmp(petable,"n") && strcmp(petable,"N") && strcmp(petable,"")) { loadtable(petable); writetabletopar(t1,"pelist"); // Write t1 table to pelist parameter table = 1; } /* RF Power & Bandwidth Calculations ******************/ shape_rf(&p1_rf,"p1",p1pat,p1,flip1,rof1,rof2); shape_rf(&p2_rf,"p2",p2pat,p2,flip2,rof1,rof2); calc_rf(&p1_rf,"tpwr1","tpwr1f"); calc_rf(&p2_rf,"tpwr2","tpwr2f"); /* Initialize gradient structures *********************/ init_slice(&ss_grad,"ss",thk); init_slice(&ss2_grad,"ss2",thk*thk2fact); init_dephase(&crush_grad,"crush"); init_slice_refocus(&ssr_grad,"ssr"); if (FP_LT(tcrushro,alfa)) tcrushro=alfa; init_readout_butterfly(&ro_grad,"ro",lro,np,sw,gcrushro,tcrushro); init_readout_refocus(&ror_grad,"ror"); init_phase(&pe_grad,"pe",lpe,nv); init_generic(&spoil_grad,"spoil",gspoil,tspoil); /* Gradient calculations ******************************/ calc_readout(&ro_grad, WRITE,"gro","sw","at"); ro_grad.m0ref *= grof; calc_readout_refocus(&ror_grad,&ro_grad,NOWRITE,"gror"); calc_phase(&pe_grad,NOWRITE,"gpe","tpe"); calc_slice(&ss_grad,&p1_rf,WRITE,"gss"); calc_slice(&ss2_grad,&p2_rf,WRITE,"gss2"); calc_slice_refocus(&ssr_grad,&ss_grad,WRITE,"gssr"); calc_generic(&spoil_grad,WRITE,"",""); /* Make sure crushing in PE dimension does not refocus signal from 180 */ crushm0=fabs(gcrush*tcrush); pem0=0.0; gcrushp=0.0; if (pecrush) pem0=pe_grad.m0; calc_dephase(&crush_grad,WRITE,crushm0+pem0,"",""); gcrushr = crush_grad.amp*crushm0/crush_grad.m0; if (pecrush) gcrushp = crush_grad.amp; gcrushs = crush_grad.amp*crushm0/crush_grad.m0; /* Allow phase encode and read dephase to be separated from slice refocus */ if (sepRefocus) { /* Equalize read dephase and PE gradient durations */ calc_sim_gradient(&ror_grad,&pe_grad,&null_grad,0,WRITE); crushsign=-1; } else { if (slprofile[0] == 'y') { /* Combined slice refocusing and read dephasing, reverse gradient sign if ror > ssr integral */ refsign = (ss_grad.m0ref > ro_grad.m0ref) ? 1.0 : -1.0; ss_grad.m0ref -= ro_grad.m0ref; calc_slice_refocus(&ssr_grad,&ss_grad,NOWRITE,"gssr"); } /* Equalize both refocus and PE gradient durations */ calc_sim_gradient(&ror_grad,&pe_grad,&ssr_grad,0,WRITE); } /* Create optional prepulse events ********************/ if (fsat[0] == 'y') create_fatsat(); if (sat[0] == 'y') create_satbands(); if (mt[0] == 'y') create_mtc(); if (ir[0] == 'y') create_inversion_recovery(); if (diff[0] == 'y') init_diffusion(&diffusion,&diff_grad,"diff",gdiff,tdelta); sgl_error_check(sglerror); /* Min TE *********************************************/ te = granularity(te,2*GRADIENT_RES); /* tau1, tau2 are the sum of events in each half echo period */ /* tau1, tau2 include a GRADIENT_RES as this is minimum delay time */ tau1 = ss_grad.rfCenterBack + ssr_grad.duration + crush_grad.duration + ss2_grad.rfCenterFront + 2*GRADIENT_RES; tau2 = ss2_grad.rfCenterBack + crush_grad.duration + ro_grad.timeToEcho + GRADIENT_RES; if (sepRefocus) tau2 += ror_grad.duration; temin = 2*MAX(tau1,tau2); /* Diffusion ******************************************/ if (diff[0] == 'y') { /* granulate tDELTA */ tDELTA = granularity(tDELTA,GRADIENT_RES); /* taudiff is the duration of events between diffusion gradients */ taudiff = ss2_grad.duration + 2*crush_grad.duration + GRADIENT_RES; /* set minimum diffusion structure requirements for gradient echo: taudiff, tDELTA, te and minte[0] */ set_diffusion(&diffusion,taudiff,tDELTA,te,minte[0]); /* set additional diffusion structure requirements for spin echo: tau1 and tau2 */ set_diffusion_se(&diffusion,tau1,tau2); /* calculate the diffusion structure delays. address &temin is required in order to update temin accordingly */ calc_diffTime(&diffusion,&temin); } /* TE delays ******************************************/ if (minte[0] == 'y') { te = temin; putvalue("te",te); } if (FP_LT(te,temin)) { abort_message("TE too short, minimum TE = %.3f ms\n",temin*1000); } te_delay1 = te/2 - tau1 + GRADIENT_RES; te_delay2 = te/2 - tau2 + GRADIENT_RES; if (navigator[0] == 'y') { /* tau1, tau2 are the sum of events in each half echo period */ tau1 = ro_grad.timeFromEcho + pe_grad.duration + crush_grad.duration + ss2_grad.rfCenterFront; tau2 = ss2_grad.rfCenterBack + crush_grad.duration + ro_grad.timeToEcho; if (FP_GT(tau1,tau2)) { te_delay3 = GRADIENT_RES; te_delay4 = tau1-tau2+GRADIENT_RES; } else { te_delay3 = tau2-tau1+GRADIENT_RES; te_delay4 = GRADIENT_RES; } navTime = te_delay3 + ss2_grad.duration + 2*crush_grad.duration + ro_grad.duration + te_delay4 + 2*GRADIENT_RES; } /* Check nsblock, the number of slices blocked together (used for triggering and/or inversion recovery) */ check_nsblock(); /* Min TR *********************************************/ trmin = ss_grad.rfCenterFront + te + ro_grad.timeFromEcho + pe_grad.duration + 2*GRADIENT_RES; /* Increase TR if any options are selected ************/ if (spoilflag[0] == 'y') trmin += spoil_grad.duration; if (navigator[0] == 'y') trmin += navTime; if (sat[0] == 'y') trmin += satTime; if (fsat[0] == 'y') trmin += fsatTime; if (mt[0] == 'y') trmin += mtTime; if (ticks > 0) trmin += GRADIENT_RES; /* Adjust for all slices ******************************/ trmin *= ns; /* Inversion recovery *********************************/ if (ir[0] == 'y') { /* tauti is the additional time beyond IR component to be included in ti */ /* satTime, fsatTime and mtTime all included as those modules will be after IR */ tauti = satTime + fsatTime + mtTime + GRADIENT_RES + ss_grad.rfCenterFront; /* calc_irTime checks ti and returns the time of all IR components */ trmin += calc_irTime(tauti,trmin,mintr[0],tr,&trtype); } if (mintr[0] == 'y') { tr = trmin; putvalue("tr",tr); } if (FP_LT(tr,trmin)) { abort_message("TR too short, minimum TR = %.3f ms\n",trmin*1000); } /* TR delay *******************************************/ tr_delay = granularity((tr-trmin)/ns,GRADIENT_RES); /* Calculate B values *********************************/ if (ix == 1) { /* Calculate bvalues according to main diffusion gradients */ calc_bvalues(&diffusion,"dro","dpe","dsl"); /* Add components from additional diffusion encoding imaging gradients peculiar to this sequence */ /* Initialize variables */ dgro = 0.5*(ror_grad.duration+ro_grad.timeToEcho); Gro = ro_grad.m0ref/dgro; Dgro = dgro; if (!sepRefocus) Dgro = te-ss_grad.rfCenterBack-ro_grad.timeToEcho; dgss = 0.5*(ss_grad.rfCenterBack+ssr_grad.duration); Gss = ss_grad.m0ref/dgss; Dgss = dgss; dgss2 = ss2_grad.duration/2; Dgss2 = dgss2; dcrush = crush_grad.duration-crush_grad.tramp; Dcrush = crush_grad.duration+ss2_grad.duration; for (i = 0; i < diffusion.nbval; i++) { /* set droval, dpeval and dslval */ set_dvalues(&diffusion,&droval,&dpeval,&dslval,i); /* Readout */ diffusion.bro[i] += bval(Gro,dgro,Dgro); diffusion.bro[i] += bval(crushsign*gcrushr,dcrush,Dcrush); diffusion.bro[i] += bval_nested(gdiff*droval,tdelta,tDELTA,crushsign*gcrushr,dcrush,Dcrush); if (!sepRefocus) { diffusion.bro[i] += bval_nested(Gro,dgro,Dgro,gdiff*droval,tdelta,tDELTA); diffusion.bro[i] += bval_nested(Gro,dgro,Dgro,crushsign*gcrushr,dcrush,Dcrush); } /* Phase */ if (pecrush) { diffusion.bpe[i] += bval(gcrushp,dcrush,Dcrush); diffusion.bpe[i] += bval_nested(gdiff*dpeval,tdelta,tDELTA,gcrushp,dcrush,Dcrush); } /* Slice */ diffusion.bsl[i] += bval(Gss,dgss,Dgss); diffusion.bsl[i] += bval(gcrushs,dcrush,Dcrush); diffusion.bsl[i] += bval(ss2_grad.ssamp,dgss2,Dgss2); diffusion.bsl[i] += bval_nested(gdiff*dslval,tdelta,tDELTA,gcrushs,dcrush,Dcrush); diffusion.bsl[i] += bval_nested(gdiff*dslval,tdelta,tDELTA,ss2_grad.ssamp,dgss2,Dgss2); diffusion.bsl[i] += bval_nested(gcrushs,dcrush,Dcrush,ss2_grad.ssamp,dgss2,Dgss2); /* Readout/Phase Cross-terms */ diffusion.brp[i] += bval_cross(gdiff*dpeval,tdelta,tDELTA,crushsign*gcrushr,dcrush,Dcrush); diffusion.brp[i] += bval_cross(gdiff*dpeval,tdelta,tDELTA,crushsign*gcrushr,dcrush,Dcrush); if (pecrush) diffusion.brp[i] += bval_cross(gdiff*droval,tdelta,tDELTA,gcrushp,dcrush,Dcrush); if (!sepRefocus) { diffusion.brp[i] += bval_cross(Gro,dgro,Dgro,gdiff*dpeval,tdelta,tDELTA); if (pecrush) diffusion.brp[i] += bval_cross(Gro,dgro,Dgro,gcrushp,dcrush,Dcrush); } /* Readout/Slice Cross-terms */ diffusion.brs[i] += bval2(crushsign*gcrushr,gcrushs,dcrush,Dcrush); diffusion.brs[i] += bval_cross(gdiff*droval,tdelta,tDELTA,gcrushs,dcrush,Dcrush); diffusion.brs[i] += bval_cross(gdiff*dslval,tdelta,tDELTA,crushsign*gcrushr,dcrush,Dcrush); diffusion.brs[i] += bval_cross(gdiff*droval,tdelta,tDELTA,ss2_grad.ssamp,dgss2,Dgss2); if (!sepRefocus) { diffusion.brs[i] += bval_cross(Gro,dgro,Dgro,gdiff*dslval,tdelta,tDELTA); diffusion.brs[i] += bval_cross(Gro,dgro,Dgro,gcrushs,dcrush,Dcrush); diffusion.brs[i] += bval_cross(Gro,dgro,Dgro,ss2_grad.ssamp,dgss2,Dgss2); } /* Slice/Phase Cross-terms */ diffusion.bsp[i] += bval_cross(gdiff*dpeval,tdelta,tDELTA,gcrushs,dcrush,Dcrush); diffusion.bsp[i] += bval_cross(gdiff*dpeval,tdelta,tDELTA,ss2_grad.ssamp,dgss2,Dgss2); if (pecrush) { diffusion.bsp[i] += bval2(gcrushs,gcrushp,dcrush,Dcrush); diffusion.bsp[i] += bval_cross(gdiff*dslval,tdelta,tDELTA,gcrushp,dcrush,Dcrush); diffusion.bsp[i] += bval_cross(gcrushp,dcrush,Dcrush,ss2_grad.ssamp,dgss2,Dgss2); } } /* End for-all-directions */ /* Write the values */ write_bvalues(&diffusion,"bval","bvalue","max_bval"); } /* Generate phase-ramped pulses ***********************/ offsetlist(pss,ss_grad.ssamp,0,freq90,ns,seqcon[1]); offsetlist(pss,ss2_grad.ssamp,0,freq180,ns,seqcon[1]); shape90 = shapelist(p1_rf.pulseName,ss_grad.rfDuration,freq90,ns,ss_grad.rfFraction,seqcon[1]); shape180 = shapelist(p2_rf.pulseName,ss2_grad.rfDuration,freq180,ns,ss2_grad.rfFraction,seqcon[1]); /* Set pe_steps for profile or full image *************/ pe_steps = prep_profile(profile[0],nv,&pe_grad,&null_grad); F_initval(pe_steps/2.0,vpe_offset); /* Shift DDR for pro **********************************/ roff = -poffset(pro,ro_grad.roamp); /* Adjust experiment time for VnmrJ *******************/ if (ssc<0) { if (seqcon[2] == 'c') g_setExpTime(trmean*(ntmean*pe_steps*arraydim - ssc*arraydim)); else g_setExpTime(trmean*(ntmean*pe_steps*arraydim - ssc*pe_steps*arraydim)); } else g_setExpTime(trmean*ntmean*pe_steps*arraydim + tr*ssc); /* Slice profile **************************************/ if (slprofile[0] == 'y' && !sepRefocus) ror_grad.amp = 0; /* Set phase cycle table ******************************/ if (sepRefocus) settable(t2,1,ph180); // Phase encode is just before readout else settable(t2,2,ph180); /* PULSE SEQUENCE *************************************/ status(A); // Set status A rotate(); // Set gradient rotation according to psi, phi and theta triggerSelect(trigger); // Select trigger input 1/2/3 obsoffset(resto); // Set spectrometer frequency delay(GRADIENT_RES); // Delay for frequency setting initval(fabs(ssc),vssc); // Compressed steady-state counter if (seqcon[2]=='s') assign(zero,vssc); // Zero for standard peloop assign(one,vacquire); // real-time acquire flag setacqvar(vacquire); // Turn on acquire when vacquire is zero /* trigger */ if (ticks > 0) F_initval((double)nsblock,vtrigblock); /* Begin phase-encode loop ****************************/ peloop(seqcon[2],pe_steps,vpe_steps,vpe_ctr); if (trtype) delay(ns*tr_delay); // relaxation delay /* Compressed steady-states: 1st array & transient, all arrays if ssc is negative */ if ((ix > 1) && (ssc > 0)) assign(zero,vssc); sub(vpe_ctr,vssc,vpe_ctr); // vpe_ctr counts up from -ssc assign(zero,vssc); if (seqcon[2] == 's') assign(zero,vacquire); // Always acquire for non-compressed loop else { ifzero(vpe_ctr); assign(zero,vacquire); // Start acquiring when vpe_ctr reaches zero endif(vpe_ctr); } /* Read external kspace table if set ******************/ if (table) getelem(t1,vpe_ctr,vpe_mult); else { ifzero(vacquire); sub(vpe_ctr,vpe_offset,vpe_mult); elsenz(vacquire); sub(zero,vpe_offset,vpe_mult); // Hold PE mult at initial value for steady states endif(vacquire); } /* Phase cycle ****************************************/ getelem(t2,vpe_ctr,vph180); // For phase encoding with slice rephase add(oph,vph180,vph180); // 180 deg pulse phase alternates +/- 90 from receiver mod2(ct,vph2); dbl(vph2,vph2); add(vph180,vph2,vph180); // Alternate phase for 180 on odd transients /* Begin multislice loop ******************************/ msloop(seqcon[1],ns,vms_slices,vms_ctr); if (!trtype) delay(tr_delay); // Relaxation delay if (ticks > 0) { modn(vms_ctr,vtrigblock,vtest); ifzero(vtest); // if the beginning of an trigger block xgate(ticks); grad_advance(gpropdelay); delay(GRADIENT_RES); elsenz(vtest); delay(GRADIENT_RES); endif(vtest); } sp1on(); delay(GRADIENT_RES); sp1off(); // Scope trigger /* Prepulse options ***********************************/ if (ir[0] == 'y') inversion_recovery(); if (sat[0] == 'y') satbands(); if (fsat[0] == 'y') fatsat(); if (mt[0] == 'y') mtc(); /* Slice select RF pulse ******************************/ obspower(p1_rf.powerCoarse); obspwrf(p1_rf.powerFine); delay(GRADIENT_RES); obl_shapedgradient(ss_grad.name,ss_grad.duration,0,0,ss_grad.amp,NOWAIT); delay(ss_grad.rfDelayFront); shapedpulselist(shape90,ss_grad.rfDuration,oph,rof1,rof2,seqcon[1],vms_ctr); delay(ss_grad.rfDelayBack); /* Slice refocus gradient *****************************/ if (sepRefocus) obl_shapedgradient(ssr_grad.name,ssr_grad.duration,0,0,-ssr_grad.amp,WAIT); else /* Include phase encode and readout dephase gradient if refocus gradients not separated */ pe_shapedgradient(pe_grad.name,pe_grad.duration,ror_grad.amp,0,-ssr_grad.amp*refsign,pe_grad.increment,vpe_mult,WAIT); if (diff[0] == 'y') { delay(diffusion.d1); diffusion_dephase(&diffusion,dro,dpe,dsl); delay(diffusion.d2); } else delay(te_delay1); /* Refocusing RF pulse ********************************/ obspower(p2_rf.powerCoarse); obspwrf(p2_rf.powerFine); delay(GRADIENT_RES); obl_shapedgradient(crush_grad.name,crush_grad.duration,crushsign*gcrushr,gcrushp,gcrushs,WAIT); obl_shapedgradient(ss2_grad.name,ss2_grad.duration,0,0,ss2_grad.amp,NOWAIT); delay(ss2_grad.rfDelayFront); shapedpulselist(shape180,ss2_grad.rfDuration,vph180,rof2,rof2,seqcon[1],vms_ctr); delay(ss2_grad.rfDelayBack); obl_shapedgradient(crush_grad.name,crush_grad.duration,crushsign*gcrushr,gcrushp,gcrushs,WAIT); if (diff[0] == 'y') { delay(diffusion.d3); diffusion_rephase(&diffusion,dro,dpe,dsl); delay(diffusion.d4); } else delay(te_delay2); /* Readout dephase, phase encode & readout gradients **/ roff = -poffset(pro,ro_grad.roamp); // incase inverted navigator is acquired if (slprofile[0] == 'y') { /* Readout gradient only if refocus gradients not separated */ if (sepRefocus) obl_shapedgradient(ror_grad.name,ror_grad.duration,0,0,-ror_grad.amp,WAIT); obl_shapedgradient(ro_grad.name,ro_grad.duration,0,0,ro_grad.amp,NOWAIT); } else { /* Readout gradient only if refocus gradients not separated */ if (sepRefocus) pe_shapedgradient(pe_grad.name,pe_grad.duration,-ror_grad.amp,0,0,-pe_grad.increment,vpe_mult,WAIT); obl_shapedgradient(ro_grad.name,ro_grad.duration,ro_grad.amp,0,0,NOWAIT); } /* Acquisition ****************************************/ delay(ro_grad.atDelayFront-alfa); startacq(alfa); acquire(np,1.0/sw); delay(ro_grad.atDelayBack); endacq(); /* Rewind Phase encoding ******************************/ pe_shapedgradient(pe_grad.name,pe_grad.duration,0,0,0,pe_grad.increment,vpe_mult,WAIT); /* Navigator acquisition ******************************/ if (navigator[0] == 'y') { delay(te_delay3); obl_shapedgradient(crush_grad.name,crush_grad.duration,-crushsign*gcrushr,0,-gcrushs,WAIT); obl_shapedgradient(ss2_grad.name,ss2_grad.duration,0,0,ss2_grad.amp,NOWAIT); delay(ss2_grad.rfDelayFront); shapedpulselist(shape180,ss2_grad.rfDuration,vph180,rof2,rof2,seqcon[1],vms_ctr); delay(ss2_grad.rfDelayBack); obl_shapedgradient(crush_grad.name,crush_grad.duration,-crushsign*gcrushr,0,-gcrushs,WAIT); delay(te_delay4); obl_shapedgradient(ro_grad.name,ro_grad.duration,navsign*ro_grad.amp,0,0,NOWAIT); delay(ro_grad.atDelayFront-alfa); startacq(alfa); acquire(np,1.0/sw); delay(ro_grad.atDelayBack); endacq(); } if (spoilflag[0] == 'y') { obl_shapedgradient(spoil_grad.name,spoil_grad.duration,navsign*spoil_grad.amp,0,spoil_grad.amp,WAIT); } endmsloop(seqcon[1],vms_ctr); endpeloop(seqcon[2],vpe_ctr); /* Inter-image delay **********************************/ sub(ntrt,ct,vtrimage); decr(vtrimage); ifzero(vtrimage); delay(trimage); endif(vtrimage); /* Duty cycle *****************************************/ calc_grad_duty(tr); }
/*----------------------------------------------------------------- | initparms()/ | initializes the main variables used +------------------------------------------------------------------*/ void initparms() { double tmpval; char tmpstr[36]; int tmp, getchan; sw = getval("sw"); np = getval("np"); if ( P_getreal(CURRENT,"nf",&nf,1) < 0 ) { nf = 0.0; /* if not found assume 0 */ } if (nf < 2.0) nf = 1.0; nt = getval("nt"); sfrq = getval("sfrq"); filter = getval("filter"); /* pulse Amp filter setting */ tof = getval("tof"); bs = getval("bs"); if (!var_active("bs",CURRENT)) bs = 0.0; pw = getval("pw"); pw90 = getval("pw90"); p1 = getval("p1"); pwx = getvalnwarn("pwx"); pwxlvl = getvalnwarn("pwxlvl"); tau = getvalnwarn("tau"); satdly = getvalnwarn("satdly"); satfrq = getvalnwarn("satfrq"); satpwr = getvalnwarn("satpwr"); getstrnwarn("satmode",satmode); /* ddr */ roff=getvalnwarn("roff"); /* --- delays --- */ d1 = getval("d1"); /* delay */ d2 = getval("d2"); /* a delay: used in 2D experiments */ d3 = getvalnwarn("d3"); /* a delay: used in 3D experiments */ d4 = getvalnwarn("d4"); /* a delay: used in 4D experiments */ phase1 = (int) sign_add(getvalnwarn("phase"),0.005); phase2 = (int) sign_add(getvalnwarn("phase2"),0.005); phase3 = (int) sign_add(getvalnwarn("phase3"),0.005); rof1 = getval("rof1"); /* Time receiver is turned off before pulse */ rof2 = getval("rof2"); /* Time after pulse before receiver turned on */ alfa = getval("alfa"); /* Time after rec is turned on that acqbegins */ pad = getval("pad"); /* Pre-acquisition delay */ padactive = var_active("pad",CURRENT); hst = getval("hst"); /* HomoSpoil delay */ tpwr = getval("tpwr"); if ( P_getreal(CURRENT,"tpwrm",&tpwrf,1) < 0 ) if ( P_getreal(CURRENT,"tpwrf",&tpwrf,1) < 0 ) tpwrf = 4095.0; //getstr("rfband",rfband); /* RF band, high or low */ getstr("hs",hs); hssize = strlen(hs); /* setlockmode(); */ /* set up lockmode variable,h**o bits */ if (bgflag) { fprintf(stderr,"sw = %lf, sfrq = %10.8lf\n",sw,sfrq); fprintf(stderr,"hs='%s',%d\n",hs,hssize); } gain = getval("gain"); gainactive = var_active("gain",CURRENT); /* non arrayable */ /* InterLocks is set by go. It will have three chars. * char 0 is for lock * char 1 is for spin * char 2 is for temp */ getstr("interLocks",interLock); /* non arrayable */ spin = (int) sign_add(getval("spin"),0.005); spinactive = var_active("spin",CURRENT); /* non arrayable */ HSrotor = 0; /* high speed spinner selected */ /* spinTresh is created and set by go.c inside Vnmrbg */ if (spin >= (int) sign_add(getval("spinThresh"),0.005)) { /* Selected Solids spinner */ HSrotor = 1; } vttemp = getval("temp"); /* get vt temperature */ tempactive = var_active("temp",CURRENT); /* non arrayable */ vtwait = getval("vtwait"); /* get vt timeout setting */ vtc = getval("vtc"); /* get vt timeout setting */ if (getparm("traymax","real",GLOBAL,&tmpval,1)) { traymax=0; } else { traymax= (int) (tmpval + 0.5); } if (getparm("loc","real",GLOBAL,&tmpval,1)) psg_abort(1); loc = (int) sign_add(tmpval,0.005); if (!var_active("loc",GLOBAL) || (loc<0) ) { locActive = 0; loc = 0; tmpval = 0.0; if (setparm("loc","real",GLOBAL,&tmpval,1)) psg_abort(1); } else locActive = 1; /* if using Gilson Liquid Handler Racks then gilpar is defined * and is an array of 4 values */ if ((traymax == 96) || (traymax == (8*96))) /* test for Gilson/Hermes */ { int trayloc=1; int trayzone=1; if ( P_getreal(GLOBAL, "vrack", &tmpval, 1) >= 0 ) trayloc = (int) (tmpval + 0.5); if ( P_getreal(GLOBAL, "vzone", &tmpval, 1) >= 0 ) trayzone = (int) (tmpval + 0.5); /* rrzzllll */ loc = loc + (10000 * trayzone) + (1000000 * trayloc); if (bgflag) fprintf(stderr,"GILSON: ----- vrack: %d, vzone: %d, Encoded Loc = %d\n",trayloc,trayzone,loc); } getstr("alock",alock); getstr("wshim",wshim); getlockmode(alock,&lockmode); /* type of autolocking */ whenshim = setshimflag(wshim,&shimatanyfid); /* when to shim */ if ( ( tmp=P_getstring(CURRENT, "sampling", tmpstr, 1, 20)) >= 0) { samplingScale = 1.01; samplingAngle = 0.0; samplingTransX = 0.0; samplingTransY = 0.0; if (tmpstr[0] == 'e') { double rtmp = 0.0; sampling = SAMPLING_ELLIPTICAL; P_getreal(CURRENT, "ni", &rtmp, 1); samplingRows = (int) rtmp; rtmp = 0.0; P_getreal(CURRENT, "ni2", &rtmp, 1); samplingCols = (int) rtmp; if ((samplingRows < 2) || (samplingCols < 2)) sampling = SAMPLING_STANDARD; if (sampling == SAMPLING_ELLIPTICAL) { if ( P_getreal(CURRENT, "samplingEScale", &rtmp, 1) >= 0) samplingScale = rtmp; if ( P_getreal(CURRENT, "samplingEAngle", &rtmp, 1) >= 0) samplingAngle = rtmp; if ( P_getreal(CURRENT, "samplingETransX", &rtmp, 1) >= 0) samplingTransX = rtmp; if ( P_getreal(CURRENT, "samplingETransY", &rtmp, 1) >= 0) samplingTransY = rtmp; } } else sampling = SAMPLING_STANDARD; } else sampling = SAMPLING_STANDARD; // this looks REDUNDANT to instantiation... // but is not completely dpwrf if ( ( tmp=P_getstring(CURRENT, "dn", tmpstr, 1, 9)) >= 0) getchan = TRUE; else getchan = FALSE; /* if "dn" does not exist, don't bother with the rest of channel 2 */ getchan = (NUMch > 1) && getchan && (tmpstr[0]!='\000'); if (getchan) /* variables associated with 2nd channel */ { dfrq = getval("dfrq"); dmf = getval("dmf"); /* 1st decoupler modulation freq */ dof = getval("dof"); dres = getvalnwarn("dres"); /* prg decoupler digital resolution */ if (dres < 1.0) dres = 1.0; getstrnwarn("dseq",dseq); dpwr = getval("dpwr"); dhp = 0.0; dlp = 0.0; if ( P_getreal(CURRENT,"dpwrm",&dpwrf,1) < 0 ) if ( P_getreal(CURRENT,"dpwrf",&dpwrf,1) < 0 ) dpwrf = 4095.0; getstr("dm",dm); dmsize = strlen(dm); getstr("dmm",dmm); dmmsize = strlen(dmm); getstr("h**o",h**o); homosize = strlen(h**o); } else { dfrq = 1.0; dmf = 1000; dof = 0.0; dres = 1.0; dseq[0] = '\000'; dhp = 0.0; dlp = 0.0; dpwr = 0.0; dpwrf = 0.0; strcpy(dm,"n"); dmsize = 1; strcpy(dmm,"c"); dmmsize = 1; strcpy(h**o,"n"); homosize= 1; } if (bgflag) { if (!getchan) fprintf(stderr,"next line are default values for chan 2\n"); fprintf(stderr,"dm='%s',%d, dmm='%s',%d\n",dm,dmsize,dmm,dmmsize); fprintf(stderr,"h**o='%s',%d\n",h**o,homosize); } if ( (tmp=P_getstring(CURRENT, "dn2", tmpstr, 1, 9)) >= 0) getchan = TRUE; else getchan = FALSE; /* if "dn2" does not exist, don't bother with the rest of channel 3 */ getchan = (NUMch > 2) && getchan && (tmpstr[0]!='\000'); if (getchan) /* variables associated with 3rd channel */ { dfrq2 = getval("dfrq2"); dmf2 = getval("dmf2"); /* 2nd decoupler modulation freq */ dof2 = getval("dof2"); dres2 = getvalnwarn("dres2"); /* prg decoupler digital resolution */ if (dres2 < 1.0) dres2 = 1.0; getstrnwarn("dseq2",dseq2); dpwr2 = getval("dpwr2"); if ( P_getreal(CURRENT,"dpwrm2",&dpwrf2,1) < 0 ) if ( P_getreal(CURRENT,"dpwrf2",&dpwrf2,1) < 0 ) dpwrf2 = 4095.0; getstr("dm2",dm2); dm2size = strlen(dm2); getstr("dmm2",dmm2); dmm2size = strlen(dmm2); getstr("homo2",homo2); homo2size = strlen(homo2); } else { dfrq2 = 1.0; dmf2 = 1000; dof2 = 0.0; dres2 = 1.0; dseq2[0] = '\000'; dpwr2 = 0.0; dpwrf2 = 0.0; strcpy(dm2,"n"); dm2size = 1; strcpy(dmm2,"c"); dmm2size = 1; strcpy(homo2,"n"); homo2size= 1; } if (bgflag) { if (!getchan) fprintf(stderr,"next two lines are default values for chan 3\n"); fprintf(stderr,"dfrq2 = %10.8lf, dof2 = %10.8lf, dpwr2 = %lf\n", dfrq2,dof2,dpwr2); fprintf(stderr,"dmf2 = %10.8lf, dm2='%s',%d, dmm2='%s',%d\n", dmf2,dm2,dm2size,dmm2,dmm2size); fprintf(stderr,"homo2='%s',%d\n",homo2,homo2size); } if ( (tmp=P_getstring(CURRENT, "dn3", tmpstr, 1, 9)) >= 0) getchan = TRUE; else getchan = FALSE; /* if "dn3" does not exist, don't bother with the rest of channel 3 */ getchan = (NUMch > 3) && getchan && (tmpstr[0]!='\000'); if (getchan) /* variables associated with 3rd channel */ { dfrq3 = getval("dfrq3"); dmf3 = getval("dmf3"); /* 3nd decoupler modulation freq */ dof3 = getval("dof3"); dres3 = getvalnwarn("dres3"); /* prg decoupler digital resolution */ if (dres3 < 1.0) dres3 = 1.0; getstrnwarn("dseq3",dseq3); dpwr3 = getval("dpwr3"); if ( P_getreal(CURRENT,"dpwrm3",&dpwrf3,1) < 0 ) if ( P_getreal(CURRENT,"dpwrf3",&dpwrf3,1) < 0 ) dpwrf3 = 4095.0; getstr("dm3",dm3); dm3size = strlen(dm3); getstr("dmm3",dmm3); dmm3size = strlen(dmm3); getstr("homo3",homo3); homo3size = strlen(homo3); } else { dfrq3 = 1.0; dmf3 = 1000; dof3 = 0.0; dres3 = 1.0; dseq3[0] = '\000'; dpwr3 = 0.0; dpwrf3 = 0.0; strcpy(dm3,"n"); dm3size = 1; strcpy(dmm3,"c"); dmm3size = 1; strcpy(homo3,"n"); homo3size= 1; } if (bgflag) { if (!getchan) fprintf(stderr,"next two lines are default values for chan 3\n"); fprintf(stderr,"dfrq3 = %10.8lf, dof3 = %10.8lf, dpwr3 = %lf\n", dfrq3,dof3,dpwr3); fprintf(stderr,"dmf3 = %10.8lf, dm3='%s',%d, dmm3='%s',%d\n", dmf3,dm3,dm3size,dmm3,dmm3size); fprintf(stderr,"homo3='%s',%d\n",homo3,homo3size); } if ( (tmp=P_getstring(CURRENT, "dn4", tmpstr, 1, 9)) >= 0) getchan = TRUE; else getchan = FALSE; /* if "dn4" does not exist, don't bother with the rest of channel 4 */ getchan = (NUMch > 4) && getchan && (tmpstr[0]!='\000'); if (getchan) /* variables associated with 4th channel */ { dfrq4 = getval("dfrq4"); dmf4 = getval("dmf4"); /* 4nd decoupler modulation freq */ dof4 = getval("dof4"); dres4 = getvalnwarn("dres4"); /* prg decoupler digital resolution */ if (dres4 < 1.0) dres4 = 1.0; getstrnwarn("dseq4",dseq4); dpwr4 = getval("dpwr4"); if ( P_getreal(CURRENT,"dpwrm4",&dpwrf4,1) < 0 ) if ( P_getreal(CURRENT,"dpwrf4",&dpwrf4,1) < 0 ) dpwrf4 = 4095.0; getstr("dm4",dm4); dm4size = strlen(dm4); getstr("dmm4",dmm4); dmm4size = strlen(dmm4); getstr("homo4",homo4); homo4size = strlen(homo4); } else { dfrq4 = 1.0; dmf4 = 1000; dof4 = 0.0; dres4 = 1.0; dseq4[0] = '\000'; dpwr4 = 0.0; dpwrf4 = 0.0; strcpy(dm4,"n"); dm4size = 1; strcpy(dmm4,"c"); dmm4size = 1; strcpy(homo4,"n"); homo4size= 1; } if (bgflag) { if (!getchan) fprintf(stderr,"next two lines are default values for chan 4\n"); fprintf(stderr,"dfrq4 = %10.8lf, dof4 = %10.8lf, dpwr4 = %lf\n", dfrq4,dof4,dpwr4); fprintf(stderr,"dmf4 = %10.8lf, dm4='%s',%d, dmm4='%s',%d\n", dmf4,dm4,dm4size,dmm4,dmm4size); fprintf(stderr,"homo4='%s',%d\n",homo4,homo4size); } // end of REDUNDANT ??? }
/************************************************************** initparms_img() Read in all parameters used by the Imaging SEQD applications package. Build the array of slice positions used in multislice loops. *************************************************************/ void initparms_img() { int k; /*index for loops*/ /*------------------------------------------------------------- INITIALIZE PARAMETERS -------------------------------------------------------------*/ /*-------------------------------------- RFPULSES --------------------------------------*/ p2 = getvalnwarn("p2"); p3 = getvalnwarn("p3"); p4 = getvalnwarn("p4"); p5 = getvalnwarn("p5"); pi = getvalnwarn("pi"); psat = getvalnwarn("psat"); pmt = getvalnwarn("pmt"); pwx2 = getvalnwarn("pwx2"); psl = getvalnwarn("psl"); getstrnwarn("pwpat",pwpat); getstrnwarn("p1pat",p1pat); getstrnwarn("p2pat",p2pat); getstrnwarn("p3pat",p3pat); getstrnwarn("p4pat",p4pat); getstrnwarn("p5pat",p5pat); getstrnwarn("pipat",pipat); getstrnwarn("satpat",satpat); getstrnwarn("mtpat",mtpat); getstrnwarn("pslpat",pslpat); tpwr1 = getvalnwarn("tpwr1"); tpwr2 = getvalnwarn("tpwr2"); tpwr3 = getvalnwarn("tpwr3"); tpwr4 = getvalnwarn("tpwr4"); tpwr5 = getvalnwarn("tpwr5"); tpwri = getvalnwarn("tpwri"); mtpwr = getvalnwarn("mtpwr"); pwxlvl2 = getvalnwarn("pwxlvl2"); tpwrsl = getvalnwarn("tpwrsl"); /*-------------------------------------- DECOUPLER PULSES --------------------------------------*/ getstrnwarn("decpat",decpat); getstrnwarn("decpat1",decpat1); getstrnwarn("decpat2",decpat2); getstrnwarn("decpat3",decpat3); getstrnwarn("decpat4",decpat4); getstrnwarn("decpat5",decpat5); dpwr = getvalnwarn("dpwr"); dpwr1 = getvalnwarn("dpwr1"); dpwr4 = getvalnwarn("dpwr4"); dpwr5 = getvalnwarn("dpwr5"); /*-------------------------------------- GRADIENTS --------------------------------------*/ gradunit = getvalnwarn("gradunit"); gro = getvalnwarn("gro"); gro2 = getvalnwarn("gro2"); gro3 = getvalnwarn("gro3"); gpe = getvalnwarn("gpe"); gpe2 = getvalnwarn("gpe2"); gpe3 = getvalnwarn("gpe3"); gss = getvalnwarn("gss"); gss2 = getvalnwarn("gss2"); gss3 = getvalnwarn("gss3"); gror = getvalnwarn("gror"); gssr = getvalnwarn("gssr"); grof = getvalnwarn("grof"); gssf = getvalnwarn("gssf"); g0 = getvalnwarn("g0"); g1 = getvalnwarn("g1"); g2 = getvalnwarn("g2"); g3 = getvalnwarn("g3"); g4 = getvalnwarn("g4"); g5 = getvalnwarn("g5"); g6 = getvalnwarn("g6"); g7 = getvalnwarn("g7"); g8 = getvalnwarn("g8"); g9 = getvalnwarn("g9"); gx = getvalnwarn("gx"); gy = getvalnwarn("gy"); gz = getvalnwarn("gz"); gvox1 = getvalnwarn("gvox1"); gvox2 = getvalnwarn("gvox2"); gvox3 = getvalnwarn("gvox3"); gdiff = getvalnwarn("gdiff"); gflow = getvalnwarn("gflow"); gspoil = getvalnwarn("gspoil"); gspoil2 = getvalnwarn("gspoil2"); gcrush = getvalnwarn("gcrush"); gcrush2 = getvalnwarn("gcrush2"); gtrim = getvalnwarn("gtrim"); gtrim2 = getvalnwarn("gtrim2"); gramp = getvalnwarn("gramp"); gramp2 = getvalnwarn("gramp2"); gxscale = getvalnwarn("gxscale"); gyscale = getvalnwarn("gyscale"); gzscale = getvalnwarn("gzscale"); gpemult = getvalnwarn("gpemult"); /* Get gmax or gxmax, gymax, gzmax */ if ( P_getreal(CURRENT,"gxmax",&gxmax,1) < 0 ) { if ( P_getreal(CURRENT,"gmax",&gmax,1) < 0 ) { gmax = 0; } gxmax = gmax; } if ( P_getreal(CURRENT,"gymax",&gymax,1) < 0 ) { if ( P_getreal(CURRENT,"gmax",&gmax,1) < 0 ) { gmax = 0; } gymax = gmax; } if ( P_getreal(CURRENT,"gzmax",&gzmax,1) < 0 ) { if ( P_getreal(CURRENT,"gmax",&gmax,1) < 0 ) { gmax = 0; } gzmax = gmax; } if (gxmax < gzmax) if (gxmax < gymax) gmax = gxmax; else gmax = gymax; else if (gxmax < gymax) gmax = gxmax; else gmax = gymax; /* --- Get gradient limit parameters --- */ if ( P_getreal(CURRENT,"gtotlimit",>otlimit,1) < 0 ) gtotlimit = gxmax + gymax + gzmax; if (gtotlimit <= 0.0) gtotlimit = gxmax + gymax + gzmax; if ( P_getreal(CURRENT,"gxlimit",&gxlimit,1) < 0 ) gxlimit = gxmax; if (gxlimit <= 0.0) gxlimit = gxmax; if ( P_getreal(CURRENT,"gylimit",&gylimit,1) < 0 ) gylimit = gymax; if (gylimit <= 0.0) gylimit = gymax; if ( P_getreal(CURRENT,"gzlimit",&gzlimit,1) < 0 ) gzlimit = gzmax; if (gzlimit <= 0.0) gzlimit = gzmax; /* --- Get gradstepsz if Present --- */ /* if gradstepsz is 32767 gradient waveshaping is being used */ if ( P_getreal(GLOBAL,"gradstepsz",&gradstepsz,1) >= 0 ) { if (gradstepsz < 1.0) { if ((anygradcrwg) || (anygradwg) || (anypfga) || (anypfgw)) gradstepsz = 32767.0; else gradstepsz = 2047.0; } } else { if ((anygradcrwg) || (anygradwg) || (anypfga) || (anypfgw)) gradstepsz = 32767.0; else gradstepsz = 2047.0; } getstrnwarn("gpatup",gpatup); getstrnwarn("gpatdown",gpatdown); getstrnwarn("gropat",gropat); getstrnwarn("gpepat",gpepat); getstrnwarn("gsspat",gsspat); getstrnwarn("gpat",gpat); getstrnwarn("gpat1",gpat1); getstrnwarn("gpat2",gpat2); getstrnwarn("gpat3",gpat3); getstrnwarn("gpat4",gpat4); getstrnwarn("gpat5",gpat5); /*-------------------------------------- DELAYS --------------------------------------*/ tr = getvalnwarn("tr"); te = getvalnwarn("te"); ti = getvalnwarn("ti"); tm = getvalnwarn("tm"); at = getvalnwarn("at"); tpe = getvalnwarn("tpe"); tpe2 = getvalnwarn("tpe2"); tpe3 = getvalnwarn("tpe3"); tcrush = getvalnwarn("tcrush"); tdiff = getvalnwarn("tdiff"); tdelta = getvalnwarn("tdelta"); tDELTA = getvalnwarn("tDELTA"); tflow = getvalnwarn("tflow"); tspoil = getvalnwarn("tspoil"); hold = getvalnwarn("hold"); trise = getvalnwarn("trise"); if (trise > 10e-3) abort_message("trise: %5.0f usec is excessive!",trise*1e6); /*-------------------------------------- FREQUENCIES --------------------------------------*/ resto = getvalnwarn("resto"); wsfrq = getvalnwarn("wsfrq"); chessfrq = getvalnwarn("chessfrq"); mtfrq = getvalnwarn("mtfrq"); /*-------------------------------------- PHYSICAL POSITIONS AND FOV --------------------------------------*/ fovunit = getvalnwarn("fovunit"); pro = getvalnwarn("pro"); ppe = getvalnwarn("ppe"); ppe2 = getvalnwarn("ppe2"); ppe3 = getvalnwarn("ppe3"); pos1 = getvalnwarn("pos1"); pos2 = getvalnwarn("pos2"); pos3 = getvalnwarn("pos3"); lro = getvalnwarn("lro"); lpe = getvalnwarn("lpe"); lpe2 = getvalnwarn("lpe2"); lpe3 = getvalnwarn("lpe3"); lss = getvalnwarn("lss"); /*-------------------------------------- PHYSICAL SIZES --------------------------------------*/ thkunit = getvalnwarn("thkunit"); vox1 = getvalnwarn("vox1"); vox2 = getvalnwarn("vox2"); vox3 = getvalnwarn("vox3"); thk = getvalnwarn("thk"); /*-------------------------------------- BANDWIDTHS --------------------------------------*/ sw1 = getvalnwarn("sw1"); sw2 = getvalnwarn("sw2"); sw3 = getvalnwarn("sw3"); /*-------------------------------------- ORIENTATION PARAMETERS --------------------------------------*/ getstrnwarn("orient",orient); getstrnwarn("vorient",vorient); getstrnwarn("dorient",dorient); getstrnwarn("sorient",sorient); getstrnwarn("orient2",orient2); psi = getvalnwarn("psi"); phi = getvalnwarn("phi"); theta = getvalnwarn("theta"); vpsi = getvalnwarn("vpsi"); vphi = getvalnwarn("vphi"); vtheta = getvalnwarn("vtheta"); dpsi = getvalnwarn("dpsi"); dphi = getvalnwarn("dphi"); dtheta = getvalnwarn("dtheta"); spsi = getvalnwarn("spsi"); sphi = getvalnwarn("sphi"); stheta = getvalnwarn("stheta"); offsetx = getvalnwarn("offsetx"); offsety = getvalnwarn("offsety"); offsetz = getvalnwarn("offsetz"); gxdelay = getvalnwarn("gxdelay"); gydelay = getvalnwarn("gydelay"); gzdelay = getvalnwarn("gzdelay"); /*-------------------------------------- COUNTS AND FLAGS --------------------------------------*/ nD = getvalnwarn("nD"); ns = getvalnwarn("ns"); ne = getvalnwarn("ne"); ni = getvalnwarn("ni"); nv = getvalnwarn("nv"); nv2 = getvalnwarn("nv2"); nv3 = getvalnwarn("nv3"); ssc = getvalnwarn("ssc"); ticks = getvalnwarn("ticks"); getstrnwarn("ir",ir); getstrnwarn("ws",ws); getstrnwarn("mt",mt); getstrnwarn("pilot",pilot); getstrnwarn("seqcon",seqcon); getstrnwarn("petable",petable); getstrnwarn("acqtype",acqtype); getstrnwarn("exptype",exptype); getstrnwarn("apptype",apptype); getstrnwarn("seqfil",seqfil); getstrnwarn("rfspoil",rfspoil); getstrnwarn("verbose",verbose); /*-------------------------------------- Miscellaneous --------------------------------------*/ rfphase = getvalnwarn("rfphase"); B0 = getvalnwarn("B0"); gpropdelay = getvalnwarn("gpropdelay"); kzero = getvalnwarn("kzero"); aqtm = getvalnwarn("aqtm"); getstrnwarn("volumercv",volumercv); /*-------------------------------------- Build slice position array --------------------------------------*/ if (ns > MAXSLICE) { text_error("ns exceeds maximum limit.\n"); psg_abort(1); } for (k = 0; k < MAXSLICE; k++) { pss[k] = 0.0; } if (seqcon[1] == 's') pss[0] = getval("pss"); else if (seqcon[1] == 'c') getarray("pss",pss); else pss[0] = getvalnwarn("pss"); /* get it anyway but with no warning */ /*-------------------------------------- Old SISCO Imaging Parameters --------------------------------------*/ slcto = getvalnwarn("slcto"); /* slice selection offset */ delto = getvalnwarn("delto"); /* slice spacing frequency */ tox = getvalnwarn("tox"); toy = getvalnwarn("toy"); toz = getvalnwarn("toz"); griserate = getvalnwarn("griserate"); }