;**********************************************************
; rag_ADC01_presat
;
; Double spin-echo sequence with bipolar gradients to
; minimize Eddy current distortion after high b-values.
; Presat water suppression.
;
; Robin A. de Graaf
; MRRC, Yale University
; March, 2013 (after upgrade)
; Jeanine J. Prompers
; UMC Utrecht
; April, 2021
;
; Parameters :
; pl9    : Power level for presat
;
; p2:sp2 : 1 ms BIR4-90 (tanh(20)/tan(20), R = 200)
; p3:sp3 : 1 ms AFP (sech(5.3)/tanh(5.3), R = 5.3)
;
; g0     : Slice selection crusher 1
; g1     : Slice selection crusher 2
; g2     : Slice selection
; g3(p10): Diffusion gradient
;
; d1     : Repetition time
; d2     : Balanced repetition time
; d3     : Duration presat water suppression
; d10    : Echo-time
; d11/12 : Balanced echo-time
; 
; Large delta = 0.5*d10+d15
;**********************************************************

#include <Avance.incl>
#include <Grad.incl>

"d11 = 0.25*d10-p10-0.5*p3-60u"		; Balanced echo-time 1
"d12 = 0.25*d10-p10-0.5*p3-50u"		; Balanced echo-time 2
"d13 = 0.25*d10-p10-0.5*p3-50u"		; Balanced echo-time 3
"d14 = 0.25*d10-p10-0.5*p3-50u-de"		; Balanced echo-time 4
"d2 = d1-aq-d10-d3"			; Balanced repetition time

1 ze					; Initialize loop counter
2 5m BLKGRAD			; Blank gradients
  d2 groff 			; Balanced repetition time
  5m UNBLKGRAD			; Unblank gradients
  1m pl9:f1			; Settling delay, pwr level presat

  d3 cw:f1 ph29			; Presat
  10u do:f1				

  (p2:sp2 ph2):f1		; Excitation

  10u
  p10:gp3		        	; Trapezoidal diffusion gradient 1
  
  d11					; Balanced TE/4
  10u gron2			; Slice selection gradient on
  40u					; Crusher gradient
  (p3:sp3 ph3):f1		; Refocusing pulse
  40u					; Crusher gradient
  10u groff			; Slice selection off
  d12					; Balanced TE/4

  p10:gp4		       	; Trapezoidal diffusion gradient 2

  20u					

  p10:gp5		        	; Trapezoidal diffusion gradient 3

  d13					; Balanced TE/4
  10u gron2			; Slice selection gradient on
  40u					; Crusher gradient
  (p3:sp3 ph4):f1		; Refocusing pulse
  40u					; Crusher gradient
  10u groff			; Slice selection off
  d14					; Balanced TE/4

  p10:gp6	    			; Trapezoidal diffusion gradient 4

  go=2 ph31
  10u wr #0			; Write data to disk
  5m BLKGRAD			; Blank gradients
  5m					; Settling delay

exit

ph1 = 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0         ; General use
ph2 = 0 2 0 2 0 2 0 2 0 2 0 2 0 2 0 2 0 2 0 2 0 2 0 2 0 2 0 2 0 2 0 2		; Excitation
ph3 = 0 0 1 1 2 2 3 3 0 0 1 1 2 2 3 3 0 0 1 1 2 2 3 3 0 0 1 1 2 2 3 3		; Refocusing 1
ph4 = 0 0 0 0 0 0 0 0 1 1 1 1 1 1 1 1 2 2 2 2 2 2 2 2 3 3 3 3 3 3 3 3		; Refocusing 2
ph29=0		; Presat
ph31 = 0 2 2 0 0 2 2 0 2 0 0 2 2 0 0 2 0 2 2 0 0 2 2 0 2 0 0 2 2 0 0 2 		; Receiver
