示例#1
0
static void sscomposite(codeint phase)
{
    char cmd[MAXSTR*2];
   shape compshape;

    sprintf(compshape.name,"cmp_1");

if((getval("arraydim") < 1.5) || (ix==1) || (isarry("pw")) || (isarry("tpwr")))
  {
   sprintf(compshape.name, "%s_%d","cmp",ix);
   sprintf(cmd, "Pbox %s -u %s -w \"square n %.2f n 65 360 n 0.4u 0.4u\" -s 0.2 -p %.0f -l %.2f -attn %.0fd -2",compshape.name,userdir,1.025/(4*pw),tpwr,pw*1.0e6,tpwr);
   system(cmd);
  }

   compshape = getRsh(compshape.name);
   pbox_pulse(&compshape,phase,rof1,rof2);
}
示例#2
0
pulsesequence()
{
  char    mixpat[MAXSTR], pshape[MAXSTR], httype[MAXSTR], sspul[MAXSTR];
  double  rg1	= 2.0e-6,
          mix	= getval("mix"),	/* mixing time */
	  mixpwr = getval("mixpwr"),	/* mixing pwr */
	  compH  = getval("compH"),
	  gt0    = getval("gt0"),	/* gradient pulse in sspul */
	  gt2    = getval("gt2"),	/* gradient pulse preceding mixing */
	  gzlvl0 = getval("gzlvl0"),	/* gradient level for gt0 */
	  gzlvl2 = getval("gzlvl2"),	/* gradient level for gt2 */
	  gstab  = getval("gstab");	/* delay for gradient recovery */
  shape   hdx;
  void    setphases();

  getstr("sspul", sspul);
  getstr("pshape", pshape);
  getstr("httype", httype);
  getstr("mixpat", mixpat);
  setlimit("mixpwr", mixpwr, 48.0);

  (void) setphases();
  if (httype[0] == 'i')
    assign(zero,v2);

  /* MAKE PBOX SHAPES */

  if (FIRST_FID)
    hhmix = pbox_mix("HHmix", mixpat, mixpwr, pw*compH, tpwr);

  /* HADAMARD stuff */
  if(httype[0] == 'e')                           /* excitation */
    hdx = pboxHT_F1e(pshape, pw*compH, tpwr);
  else if(httype[0] == 'r')                      /* refocusing */
    hdx = pboxHT_F1r(pshape, pw*compH, tpwr);
  else if(httype[0] == 'd')                      /* DPFGSE */
  {
    hdx = pboxHT_F1r(pshape, pw*compH, tpwr);
    if (FIRST_FID)
      ref180 = hdx;
  }
  else /* httype[0] == 'i' */                    /* inversion */
    hdx = pboxHT_F1i(pshape, pw*compH, tpwr);

  if (getval("htcal1") > 0.5)          /* Optional fine power calibration */
    hdx.pwr += getval("htpwr1");

 /* THE PULSE PROGRAMM STARTS HERE */

  status(A);


    delay(5.0e-5);
    zgradpulse(gzlvl0,gt0);
    if (sspul[A] == 'y')
    {
      rgpulse(pw,zero,rof1,rof1);
      zgradpulse(gzlvl0,gt0);
    }

    pre_sat();
      
    if (getflag("wet"))
      wet4(zero,one);
      
    delay(1.0e-5);

    obspower(tpwr);
    delay(1.0e-5);

  status(B);

    if (httype[0] == 'i')           /* longitudinal encoding */
    {
      ifzero(v1);
        delay(2.0*(pw+rg1));
        zgradpulse(gzlvl2,gt2);
        delay(gstab);
      elsenz(v1);
        rgpulse(2.0*pw,v3,rg1,rg1);
        zgradpulse(gzlvl2,gt2);
        delay(gstab);
      endif(v1);

      pbox_pulse(&hdx, zero, rg1, rg1);
      zgradpulse(gzlvl2,gt2);
      delay(gstab);
    }
    else                            /* transverse encoding */
    {
      if (httype[0] == 'e')
        pbox_pulse(&hdx, oph, rg1, rg1);
      else
      {
        rgpulse(pw,oph,rg1,rg1);
        if (httype[0] == 'd')       /* DPFGSE */
        {
          zgradpulse(2.0*gzlvl2,gt2);
          delay(gstab);
          pbox_pulse(&ref180, oph, rg1, rg1);
          zgradpulse(2.0*gzlvl2,gt2);
          delay(gstab);
        }
        zgradpulse(gzlvl2,gt2);
        delay(gstab);
        pbox_pulse(&hdx, v2, rg1, rof2);
        zgradpulse(gzlvl2,gt2);
        delay(gstab - POWER_DELAY);
      }
    }

    if (mix)
      pbox_spinlock(&hhmix, mix, v2);

    if (httype[0] == 'i')
    {
      zgradpulse(0.87*gzlvl2,gt2);
      delay(gstab);
      obspower(tpwr);
      txphase(v3);
      rgpulse(pw,v3,rg1,rof2);
    }

  status(C);
}
示例#3
0
void pulsesequence()
{
	double	gzlvl0 = getval("gzlvl0"),
		gzlvl1 = getval("gzlvl1"),
		gzlvl2 = getval("gzlvl2"),
		gt0 = getval("gt0"),
		gt1 = getval("gt1"),
		gstab = getval("gstab"),
		compH = getval("compH");
	char	sspul[MAXSTR], pshape[MAXSTR];
	int	iphase;
        shape  hdx;

	getstr("sspul",sspul);
	iphase = (int)(getval("phase")+0.5);

  /* Make HADAMARD encoding waveforms */
  
        getstr("pshape", pshape);
        hdx = pboxHT_F1e(pshape, pw*compH, tpwr);

  /* Setup Phase Cycling */

	settable(t1,8,ph1);
	settable(t2,8,ph2);
	settable(t3,8,ph3);

	getelem(t1,ct,v1);
	getelem(t2,ct,v2);
	getelem(t3,ct,oph);

	initval(2.0*(double)(((int)(d2*getval("sw1")+0.5)%2)),v10);
		add(v1,v10,v1);
		add(oph,v10,oph);

  status(A);

 	delay(5.0e-5);
	zgradpulse(gzlvl0,gt0);
	if (sspul[0] == 'y')
	{
	  rgpulse(pw,zero,rof1,rof1);
	  zgradpulse(gzlvl0,gt0);
	}

        pre_sat();
      
        if (getflag("wet"))
          wet4(zero,one);

        obspower(tpwr);
      
  status(B);

       pbox_pulse(&hdx, v1, rof1, 2.0e-6);
       obspower(tpwr);

       rgpulse(pw, v2, 2.0e-6, rof1);
       delay(gt1 + gstab + 2*GRADIENT_DELAY);
       rgpulse(2*pw, v2, rof1, rof1);
       zgradpulse(-gzlvl1,gt1);
       delay(gstab);
       rgpulse(pw, v2, rof1, rof2);
       zgradpulse(gzlvl2,gt1);
       delay(gstab - 2*GRADIENT_DELAY);

  status(C);
}
示例#4
0
pulsesequence()
{
  char    pshape[MAXSTR], httype[MAXSTR];
  int     Hdim    = (int) (0.5 + getval("Hdim")); /* dimension for testing */
  double  rg1	  = 2.0e-6,
          compH   = getval("compH"),	/* compression factor for H-1 channel */
	  gt0     = getval("gt0"),	/* gradient pulse preceding d1 */
	  gt1     = getval("gt1"),	/* gradient pulse preceding mixing */
	  gt2     = getval("gt2"),	/* gradient pulse following mixing */
	  gzlvl0  = getval("gzlvl0"),	/* gradient level for gt1 */
	  gzlvl1  = getval("gzlvl1"),	/* gradient level for gt2 */
	  gzlvl2  = getval("gzlvl2"),	/* gradient level for gt3 */
	  gstab   = getval("gstab");	/* delay for gradient recovery */

  shape   hdx;

  getstr("pshape", pshape);
  getstr("httype", httype);
  add(one,oph,v1);
  
  /* MAKE PBOX SHAPES */

  if(Hdim == 0)
    hdx = pboxHT(pshape, pw*compH, tpwr, httype[0]); /* HADAMARD stuff */
  else /* if(Hdim == 1) */
    hdx = pboxHT_F1(pshape, pw*compH, tpwr, httype[0]);

/* Optional stuff to enable manual power calibration */

  if ((Hdim == 0) && (getval("htcal") > 0.5)) hdx.pwr = getval("htpwr");
  if ((Hdim == 1) && (getval("htcal1") > 0.5)) hdx.pwr = getval("htpwr1");

/* THE PULSE PROGRAMM STARTS HERE */

  status(A);
    delay(1.0e-4);
    zgradpulse(gzlvl0,gt0);

    pre_sat();
    if (getflag("wet"))
      wet4(zero,one);

    obspower(tpwr);
    delay(1.0e-5);

  status(B);

    if ((httype[0] == 'i') || (httype[0] == 's'))  /* inversion and sequential inversion */
    {
      pbox_pulse(&hdx, zero, rof1, rof1);
      zgradpulse(gzlvl2,gt2);
      obspower(tpwr);
      delay(gstab);
      rgpulse(pw,oph,rg1,rof2);
    }
    else if (httype[0] == 'r')              /* gradient echo */
    {
      obspower(tpwr);
      rgpulse(pw,oph,rg1,rg1);
      zgradpulse(gzlvl1,gt1);
      delay(gstab);
      pbox_pulse(&hdx, oph, rg1, rof2);
      zgradpulse(gzlvl1,gt1);
      delay(gstab);
    }
    else /* if (httype[0] == 'e') */        /* selective excitation */
      pbox_pulse(&hdx, oph, rof1, rof1);

  status(C);
}
示例#5
0
pulsesequence()
{
   char   CT_flg[MAXSTR],	/* Constant time flag */
	  f1180[MAXSTR],
          shname1[MAXSTR],      /* First pulse: name or 'vap' for
                                   automatic VAP(Variable angle pulse) */
	  ab_flg[MAXSTR];	/* inversion of 15N for coupling*/
	  
   int    t1_counter,
          phase;

   double d2_init=0.0, pwNa = 0.0,
   	  adjust = getval("adjust"),
          ref_pwr = getval("ref_pwr"),
          ref_pw90 = getval("ref_pw90"),
          fla = getval("fla"),             /* flip-angle */
          gzlvl1 = getval("gzlvl1"),
          gzlvl2 = getval("gzlvl2"), 
          gt1 = getval("gt1"),
          gt2 = getval("gt2"),
          gstab = getval("gstab"),
          pwNlvl = getval("pwNlvl"),
          pwN = getval("pwN"),
          dpwr2 = getval("dpwr2"),
          d2 = getval("d2"),
          tau1 = getval("tau1"),
          taunh = 1/(2.0*getval("JNH"));

   void   compo_pulse(), make_shapes();

   getstr("CT_flg", CT_flg);
   getstr("f1180",f1180);
   getstr("shname1",shname1);
   getstr("ab_flg",ab_flg);

   if(ab_flg[A] == 'a' || ab_flg[A] == 'b')
     pwNa = pwN;
  
   phase = (int) (getval("phase") + 0.5); 

   if(FIRST_FID) 
     make_shapes(shname1, ref_pw90, ref_pwr, fla);
   
   tau1 = d2;
   if((f1180[A] == 'y') && (ni > 1.0))
   { 
     tau1 += ( 1.0 / (2.0*sw1) ); 
     if(tau1 < 0.2e-6) 
       tau1 = 0.0; 
   }
  
   if (f1180[0] == 'y')  
     tau1 = tau1-pwN*4.0/3.0;

   if(ix == 1) d2_init = d2;

   dbl(ct,v1);  /* v1 = 0202 */
   t1_counter = (int) ((d2-d2_init)*sw1 + 0.5);
   if(t1_counter % 2)
     add(two,v1,v1); 
   assign(v1,oph);
   if (phase == 2) 
     incr(v1);   

   status(A);

   dec2power(pwNlvl);

   zgradpulse(gzlvl2, gt2);
     delay(gstab);
     delay(d1-gt2);

   pbox_pulse(&sh1,zero,2.0e-4,2.0e-6);
           zgradpulse(gzlvl1, gt1);
           delay(gstab);
     
  if (ni == 0)
  {
     delay(taunh-gt1-gstab-WFG_START_DELAY+pwN*4.0-adjust);
     pbox_pulse(&sh2,zero,2.0e-6,2.0e-6);
     dec2rgpulse(pwN,v1,0.0,0.0);
     dec2rgpulse(pwN*2.0,zero,0.0,0.0);
     dec2rgpulse(pwN,zero,0.0,0.0);
  }
  else
  {
    delay(taunh-gt1-gstab-adjust);
    obspower(sh2dec.pwr);
    compo_pulse(pwN,v1,tau1);
  }

  zgradpulse(gzlvl1, gt1);
  delay(taunh*0.5-gt1-pwNa);

  if(ab_flg[A] == 'a' || ab_flg[A] == 'b')
  {
    dec2rgpulse(pwNa,zero,0.0,0.0); 
    if (ab_flg[0] == 'b')      /*INVERSION OR FLIP BACK*/
      dec2rgpulse(pwNa,two,0.0,0.0);
    else
      dec2rgpulse(pwNa,zero,0.0,0.0);
  }

  delay(taunh*0.5-pwNa-POWER_DELAY); 
  dec2power(dpwr2);
  
/*  obsoffset(tof+3.3*sfrq);  */

	status(C);
}
示例#6
0
pulsesequence()
{
        double rg1 = 2.0e-6,
	       compH = getval("compH"),
	       gt0=getval("gt0"),
	       gzlvl0=getval("gzlvl0"),
	       gt1=getval("gt1"),
	       gzlvl1=getval("gzlvl1"),
	       qlvl=getval("qlvl"),
	       grise=getval("grise"),
	       gstab=getval("gstab"),
	       taud2=getval("taud2"),
	       tau1=getval("tau1");
	int    icosel, iphase;
        char   pshape[MAXSTR], xptype[MAXSTR];
        shape  hdx;

  getstr("pshape", pshape);

  iphase = (int) (0.5 + getval("phase"));
  qlvl++ ; 
  icosel=1;    /* Default to N-type experiment */
  strcpy(xptype, "N-type");
  if (iphase == 2) 
  { 
    icosel=-1;
    strcpy(xptype, "P-type"); 
  }
  if (FIRST_FID) fprintf(stdout,"%s COSY\n", xptype);

  /* Make HADAMARD encoding waveforms */
  
    hdx = pboxHT_F1e(pshape, pw*compH, tpwr);

     status(A);
     
       delay(1.0e-4);
       zgradpulse(gzlvl0,gt0);

       pre_sat();
       if (getflag("wet"))
         wet4(zero,one);

       obspower(tpwr);
       delay(1.0e-5);

  status(B);

       pbox_pulse(&hdx, oph, rg1, rg1);
       obspower(tpwr);

       zgradpulse(gzlvl1,gt1);
       delay(grise); 
          
       rgpulse(pw, oph, rg1, rg1);
       delay(taud2);

       zgradpulse(gzlvl1,gt1);
       delay(grise+taud2); 

       rgpulse(pw,oph,rg1,rof2);
       delay(tau1);

       zgradpulse(gzlvl1*qlvl*(double)icosel,gt1);
       delay(grise+gstab); 

     status(C);
}