# 1 "/opt/PV4.0/exp/stan/nmr/lists/pp/RARE.ppg"
;****************************************************************
;
; Copyright (c) 2002
; Bruker BioSpin MRI GmbH
; D-76275 Ettlingen, Germany
;
; All Rights Reserved
;
; a RARE imaging experiment
;
;****************************************************************
;
;
; d0 - TR padding
; d1, d2  - TE padding
; d3 = PVM_GradDelayTime
; d4 = PVM_RampTime
; d8 = CONFIG_amplifier_enable

# 1 "/opt/PV4.0/exp/stan/nmr/lists/pp/Avance.incl" 1
;Avance2.incl
;   for 1
;
;avance-version (03/02/17)





















































































































;$Id: Avance2.incl,v 1.10 2003/02/25 14:46:08 ber Exp $
# 20 "/opt/PV4.0/exp/stan/nmr/lists/pp/RARE.ppg" 2

# 1 "/opt/PV4.0/exp/stan/nmr/lists/pp/DBX.include" 1
;****************************************************************
;
; $Source: /pv/CvsTree/pv/gen/src/prg/methManag/PPG/DBX.include,v $
;
; Copyright (c) 1996
; Bruker Medizintechnik GmbH
; D-76275 Ettlingen, Germany
;
; All Rights Reserved
;
;
; $Locker:  $
; $State: Exp $
; $Revision: 1.1.2.2 $
; Revision 1.2  1996/02/01  07:44:13  fe
; removed dublicated RCS header
;
; Revision 1.1  1996/01/09  10:03:28  appadmin
; Autocheckin during RCSinit
;
;
;****************************************************************
;DBX.include
define delay aqq
"aqq=dw*td"
































define delay deparx
define delay derxadc
define delay rdeadc

"deparx=derx-depa"
"derxadc=deadc-derx"
"rdeadc=de-deadc"






# 21 "/opt/PV4.0/exp/stan/nmr/lists/pp/RARE.ppg" 2

preset off

define delay denab
"denab = d4 + d3 - de +depa"

define delay d4d2m40u
"d4d2m40u = d4 + d2 - 40u"

define loopcounter lc1
"lc1 = ds"

# 1 "/opt/PV4.0/exp/stan/nmr/lists/pp/PrepModulesHead.mod" 1
;****************************************************************
;
; Copyright (c) 2003
; Bruker BioSpin MRI GmbH
; D-76275 Ettlingen, Germany
;
; All Rights Reserved
;
; Declaration of pulseprogram parameters for preparation  modules
;
;****************************************************************

;**** Fat Suppression Module ****
if(PVM_FatSupOnOff)
{
define list<frequency> modlis6 = {$PVM_FatSupFL}
}
define delay FsD0 = {$PVM_FsD0}
define delay FsD1 = {$PVM_FsD1}
define delay FsD2 = {$PVM_FsD2}

define pulse FsP0 = {$PVM_FsP0}

;**** Flow Saturation Module ****
if(PVM_InFlowSatOnOff == 1)
   {
define list<frequency> modlis4 = {$PVM_InFlowSatFL}
   }
define delay SfD0 = {$PVM_SfD0}
define delay SfD1 = {$PVM_SfD1}
define delay SfD2 = {$PVM_SfD2}

define pulse SfP0 = {$PVM_SfP0}

define loopcounter SfLp0 = {$PVM_SfLp0}

;**** Inversion Pulse Module ****
if(PVM_InvPulseOnOff == 1)
   {
define list<frequency>  modlis2= {$PVM_InvPulseOffsetHz}
   }
define delay IpD0 = {$PVM_IpD0}
define delay IpD1 = {$PVM_IpD1}
define delay IpD2 = {$PVM_IpD2}
define delay IpD3 = {$PVM_IpD3}

define pulse IpP0 = {$PVM_IpP0}

;**** Black Blood Module ****
if(PVM_BlBloodOnOff)
  {
define list<frequency> modlis8 = {$PVM_BlBloodFL}
  }
define delay BlbD0 = {$PVM_BlbD0}
define delay BlbD1 = {$PVM_BlbD1}
define delay BlbD2 = {$PVM_BlbD2}
define delay BlbD3 = {$PVM_BlbD3}

define pulse BlbP0 = {$PVM_BlbP0}

;**** Magnetisation Transfer Module ****
if(PVM_MagTransOnOff)
  {
define list<frequency> modlis3 = {$PVM_MagTransFL} 
  }
define delay MtD0 = {$PVM_MtD0}
define delay MtD1 = {$PVM_MtD1}
define delay MtD2 = {$PVM_MtD2}
define delay MtD3 = {$PVM_MtD3}

define pulse MtP0 = {$PVM_MtP0}

define loopcounter MtLp0 = {$PVM_MtLp0}

;**** Saturation Pulse Module ****
if(PVM_SatPulseOnOff == 1)
   {
define list<frequency> modlis7 = {$PVM_SatPulseOffsetHz}
   }
define delay SpD0 = {$PVM_SpD0}
define delay SpD1 = {$PVM_SpD1}
define delay SpD2 = {$PVM_SpD2}
define delay SpD3 = {$PVM_SpD3}
define delay SpD4 = {$PVM_SpD4}
define delay SpD5 = {$PVM_SpD5}
define delay SpD6 = {$PVM_SpD6}
define delay SpD7 = {$PVM_SpD7}
define delay SpD8 = {$PVM_SpD8}
define delay SpD9 = {$PVM_SpD9}
define delay SpD10 = {$PVM_SpD10}
define delay SpD11 = {$PVM_SpD11}
define delay SpD12 = {$PVM_SpD12}
define delay SpD13 = {$PVM_SpD13}

define pulse SpP0 = {$PVM_SpP0}
define pulse SpP1 = {$PVM_SpP1}
define pulse SpP2 = {$PVM_SpP2}
define pulse SpP3 = {$PVM_SpP3}

;**** Saturation Slice Module ****
if(PVM_FovSatOnOff == 1)
   {
define list<frequency> modlis5 = {$PVM_FovSatFL}
   }
define delay SatD0 = {$PVM_SatD0}
define delay SatD1 = {$PVM_SatD1}
define delay SatD2 = {$PVM_SatD2}

define pulse SatP0 = {$PVM_SatP0}

define loopcounter SatLp0 = {$PVM_SatLp0}

;**** Trigger Module ****
define delay TrigD0 = {$PVM_TrigD0}
;**** Trigger Out Module ****
define delay TrigOutD0 = {$PVM_TrigOutD0}

;**** WaterSuppression Module ****

define list<frequency> Wslist={$PVM_WsOffsetHz}
define pulse WsP0 = {$PVM_WsP0}
define pulse WsP1 = {$PVM_WsP1}
define pulse WsP2 = {$PVM_WsP2}
define delay WsNp0 
"WsNp0 = WsP0"
define delay WsNp1 
"WsNp1 = WsP1"
define delay WsNp2 
"WsNp2 = WsP2"
define list<delay> ChD1={$PVM_ChppgD1}
define list<delay> ChD2={$PVM_ChppgD2}
define list<delay> VpD1={$PVM_VpppgD1}
define list<delay> VpD2={$PVM_VpppgD2}

;**** OuterVolumeSuppression ****
if(PVM_OvsOnOff == 1)
{
define list<frequency> Ovslist={$PVM_OvsFrequencyList}
define delay OvsD0 = {$PVM_OvsD0}
define delay OvsD1 = {$PVM_OvsD1}
define pulse OvsP0 = {$PVM_OvsP0}
}
if(PVM_SelIrOnOff)
  {
define list<frequency> IrFL = {$PVM_SelIrFL} 
  }
define delay IrD0 = {$PVM_SelIrD0}
define delay IrD1 = {$PVM_SelIrD1}
define delay IrD2 = {$PVM_SelIrD2}
define delay IrD3 = {$PVM_SelIrD3}
define delay IrD4 = {$PVM_SelIrD4}

define pulse IrP0 = {$PVM_SelIrP0}

define loopcounter IrL0 = {$PVM_SelIrL0}

;*********** Decoupling ************

define delay DecD0 = {$PVM_DecD0}
define delay DecD1 = {$PVM_DecD1}

;*********** Noe *******************

define delay NoeD0 = {$PVM_NoeD0}
define delay NoeD1 = {$PVM_NoeD1}

;***********Tagging*****************
;define list<frequency> taggfreq={$PVM_TaggingFL}

define delay TaggD0 = {$PVM_TaggingD0}
define delay TaggD1 = {$PVM_TaggingD1}
define delay TaggD2 = {$PVM_TaggingD2}
define delay TaggD3 = {$PVM_TaggingD3}
define delay TaggD4 = {$PVM_TaggingD4}
define delay TaggD5 = {$PVM_TaggingD5}

define pulse TaggP0 = {$PVM_TaggingP0}
define loopcounter TaggL0 = {$PVM_TaggingLp0}

define loopcounter EvolLp0 = {$PVM_EvolLp0}
define list<delay> EvolD0 = {$PVM_EvolD0}

# 1 "/opt/PV4.0/exp/stan/nmr/lists/pp/SatSliceDef.mod" 1
;****************************************************************
;
; Copyright (c) 2002-2003
; Bruker BioSpin MRI GmbH
; D-76275 Ettlingen, Germany
;
; All Rights Reserved
;
; SatSlices.mod : Saturation Slice Module
;
;****************************************************************
;
; SaturationSlicesPulse :
;
;        sp25              DPQQ[9].name : PVM_SatSlicesPulse.Filename
;        PVM_SatP0                     : PVM_SatSlicesPulse.Length
;
;        
;        PVM_SatD1                     : CONFIG_amplifier_enable
;        PVM_SatD0                     : PVM_RampTime
;        PVM_SatD2                     : PVM_FovSatSpoilTime
;        PVM_SatLp0                    : PVM_FovSatNSlices 
;
;


 
# 183 "/opt/PV4.0/exp/stan/nmr/lists/pp/PrepModulesHead.mod" 2

# 1 "/opt/PV4.0/exp/stan/nmr/lists/pp/FlowSatDef.mod" 1
;****************************************************************
;
; Copyright (c) 2005
; Bruker BioSpin MRI GmbH
; D-76275 Ettlingen, Germany
;
; All Rights Reserved
;
; FlowSatDef.mod: subroutine for Flow Saturation 
;
;****************************************************************



# 184 "/opt/PV4.0/exp/stan/nmr/lists/pp/PrepModulesHead.mod" 2

# 33 "/opt/PV4.0/exp/stan/nmr/lists/pp/RARE.ppg" 2

# 1 "/opt/PV4.0/exp/stan/nmr/lists/pp/MEDSPEC.include" 1
;MEDSPEC.include

	if (Coil_operation == Single_Coil)
	  {
          2u setnmr3|27           ;Single-Coil-Operation
	  }
	if (Coil_operation == Cross_Coil)
	  {
          2u setnmr3^27           ;Cross-Coil-Operation
	  }


         fq1b receive	;select DDSB for receive as default

         if (CONFIG_preemp_type >= GREAT_60)
         {
            200u setnmr0|34|33|32 ; Disable blanking pulse
         }

# 34 "/opt/PV4.0/exp/stan/nmr/lists/pp/RARE.ppg" 2

# 1 "/opt/PV4.0/exp/stan/nmr/lists/pp/FlowSatinit.mod" 1
;****************************************************************
;
; Copyright (c) 2002-2003
; Bruker BioSpin MRI GmbH
; D-76275 Ettlingen, Germany
;
; All Rights Reserved
;
; FlowSatinit.mod :Init Flow Saturation Module PulseProgram
;
;****************************************************************



if(PVM_InFlowSatOnOff == 1)
   {
lgrad PVM_InFlowSatGrad = PVM_InFlowSatNSlices
lgrad PVM_InFlowSatSpoiler = 1
zgrad PVM_InFlowSatGrad
zgrad PVM_InFlowSatSpoiler

        50u     modlis4.res
   }
# 35 "/opt/PV4.0/exp/stan/nmr/lists/pp/RARE.ppg" 2



if( ACQ_dim >=2 )
{
  lgrad r2d<2d> = ACQ_size[1]
  zgrad r2d
}
if( ACQ_dim >= 3)
{
  lgrad r3d<3d> = ACQ_size[2]
}
else
{
  lgrad r3d<3d> = 1
}
  zgrad r3d

lgrad slice = NSLICES
zslice
zgrad r2d

;pre-setting the r2d counter for the dummy scans:
decr,   dgrad r2d
        lo to decr times l1	;DS*ACQ_rare_factor

start,  10u	sgrad r2d

# 1 "/opt/PV4.0/exp/stan/nmr/lists/pp/TriggerPerPhaseStep.mod" 1
;****************************************************************
;
; Copyright (c) 1998-2003
; Bruker BioSpin MRI GmbH
; D-76275 Ettlingen, Germany
;
; All Rights Reserved
;
; TriggerPerPhaseStep.mod - Trigger Module
;
;****************************************************************
;
;      PVM_TrigD0               --> PVM_EcgTriggerModuleTime = ACQ_trigger_delay
;
if (PVM_TriggerMode == per_PhaseStep)
{
if (ACQ_trigger_enable == 1)
{
  10u   setnmr3|6
  10u   trigpl1
  10u   setnmr3^6
  TrigD0
}
}
# 63 "/opt/PV4.0/exp/stan/nmr/lists/pp/RARE.ppg" 2

# 1 "/opt/PV4.0/exp/stan/nmr/lists/pp/SelSliceIr.mod" 1
if(PVM_SelIrOnOff == On)
{
     50u   IrFL.res
irloop,    10u IrFL :f1
    IrD4 grad{ (0)|(0)| PVM_SelIrGradAmp(100,,no_scale)}
    IrD3 gatepulse 1
    IrP0:sp2  ph0
    IrD4 groff
    IrD0 islice IrFL.inc
    lo to irloop times IrL0
    IrD2  grad{ (0)|(0)| PVM_SelIrSpoiler(100,,no_scale)}
    IrD4  groff IrFL.res
    IrD1 zslice
}
# 64 "/opt/PV4.0/exp/stan/nmr/lists/pp/RARE.ppg" 2

	
slice,  10u	fq8b:f1

# 1 "/opt/PV4.0/exp/stan/nmr/lists/pp/TriggerPerSlice.mod" 1
;****************************************************************
;
; Copyright (c) 1998-2003
; Bruker BioSpin MRI GmbH
; D-76275 Ettlingen, Germany
;
; All Rights Reserved
;
; TriggerPerSlice.mod - Trigger Module
;
;****************************************************************
;
;     PVM_TrigD0               --> PVM_EcgTriggerModuleTime = ACQ_trigger_delay
;
if (PVM_TriggerMode == per_Slice)
{
if (ACQ_trigger_enable == 1)
{
  10u   setnmr3|6
  10u   trigpl1
  10u   setnmr3^6 
  TrigD0
}
}
# 68 "/opt/PV4.0/exp/stan/nmr/lists/pp/RARE.ppg" 2


;----------------------------------preparation modules -------------
# 1 "/opt/PV4.0/exp/stan/nmr/lists/pp/FlowSat.mod" 1
;****************************************************************
;
; Copyright (c) 2002-2003
; Bruker BioSpin MRI GmbH
; D-76275 Ettlingen, Germany
;
; All Rights Reserved
;
; FlowSat.mod : Flow Saturation Module
;
;****************************************************************
;
;      FlowSaturationPulse   
;
;       sp24                 DPQQ[8].name  : PVM_FlowSatPulse.Filename
;       PVM_SfP0                          : PVM_FlowSatPulse.Length
;
;       PVM_SfD2                          : PVM_InFlowSatSpoilTime
;       PVM_SfD0                          : PVM_RampTime
;       PVM_SfD1d29                       : CONFIG_amplifier_enable
;
;       PVM_SfLp0                         : PVM_InFlowSatNSlices








if(PVM_InFlowSatOnOff == 1)
   {

flow1,  SfD0   	modlis4:f1   	grad{(0)| (0)|PVM_InFlowSatGrad(100,,no_scale)}
        SfD1    gatepulse 1
        SfP0:sp24          
        SfD2     modlis4.inc	grad{(0)|(0)|PVM_InFlowSatSpoiler(100,,no_scale)}
        igrad PVM_InFlowSatGrad
        lo to flow1 times SfLp0
        SfD0	        	grad{(0)|(0)|(0)}
flow2,  10u
        10u     modlis4.dec
        lo to flow2 times SfLp0
}
   
# 71 "/opt/PV4.0/exp/stan/nmr/lists/pp/RARE.ppg" 2

;EXEC_begin line 708 (72) SatSlices()
 
if(PVM_FovSatOnOff == 1)  
{
lgrad PVM_FovSatGrad = PVM_FovSatNSlices
lgrad PVM_FovSatSpoiler = 1
zgrad PVM_FovSatGrad
zgrad PVM_FovSatSpoiler

        50u     modlis5.res

fov0,    SatD0 	modlis5:f1   	grad{PVM_FovSatGrad(100,,direct_scale)|(0)|(0)}
        SatD1   gatepulse 1
        SatP0:sp25          
        SatD2   modlis5.inc	grad{(0)|(0)|PVM_FovSatSpoiler(100,,no_scale)}
        igrad PVM_FovSatGrad
       lo to fov0 times SatLp0
        SatD0	        	grad{(0)|(0)|(0)}
        20u
}
   
;EXEC_end   line 708 (72) SatSlices()
# 1 "/opt/PV4.0/exp/stan/nmr/lists/pp/MagTrans.mod" 1
;****************************************************************
;
; Copyright (c) 2002-2003
; Bruker BioSpin MRI GmbH
; D-76275 Ettlingen, Germany
;
; All Rights Reserved
;
; MagTrans.mod : Magnetisation Transfer Module 
;
;****************************************************************
;
; PVM_MagTransPulse : sp27 (DPQQ[11].name ---> .Filename)
; 		      (DPQQ[11].power --> .Attenuation)
; PVM_MtP0          ---> PVM_MagTransPulse.Length)
;
; PVM_MtD1          : CONFIG_amplifier_enable
; PVM_MtD0          : PVM_RiseTime
;
; PVM_MtD3          : PVM_MagTransSpoilTime
; PVM_MtLp0         : PVM_MagTransPulsNumb
; PVM_MtD2          : PVM_MagTransInterDelay
;
;


if(PVM_MagTransOnOff)
  {
 
      50u  modlis3.res
      MtD1 gatepulse 1
  mtc,MtD2 modlis3:f1
      MtP0:sp27 ph0
      lo to mtc times MtLp0
      MtD3  		grad{(0)|(0)|PVM_MagTransSpoiler(100,,no_scale)}
      MtD0       	groff
      100u
  }



# 73 "/opt/PV4.0/exp/stan/nmr/lists/pp/RARE.ppg" 2

# 1 "/opt/PV4.0/exp/stan/nmr/lists/pp/FatSup.mod" 1
;****************************************************************
;
; Copyright (c) 2002-2003
; Bruker BioSpin MRI GmbH
; D-76275 Ettlingen, Germany
;
; All Rights Reserved
;
; FatSup.mod : Fat Suppression Module
;
;****************************************************************
;
; sp26 --> DPQQ[10].name   :   PVM_FatSupprPulse.Filename
;         DPQQ[10].Power  :   PVM_FatSupprPulse.Attenuation
;
; PVM_FsP0  -->          :   PVM_FatSupprPulse.Length
;
; PVM_FsD2  -->          :   PVM_FatSupSpoilTime
; PVM_FsD0  -->          :   PVM_RampTime
;
;


if(PVM_FatSupOnOff)
{
lgrad PVM_FatSupSpoiler = 1
zgrad PVM_FatSupSpoiler

50u       modlis6:f1
1m        gatepulse 1
FsP0:sp26    
FsD2     grad{(0)|(0)|PVM_FatSupSpoiler(100,,no_scale)}
FsD0      groff
50u
}


# 74 "/opt/PV4.0/exp/stan/nmr/lists/pp/RARE.ppg" 2


        d4	grad{(0)|(0)|(t3)}
        d5      
;----------------------------------slice selection------------------	
	d4 	grad{(0)|(0)|(t0)}
	d3	fq1:f1
        d8	gatepulse 1
	p0:sp0 	ph0
	d4 	groff
	10u
;----------------------------------slice rephase--------------------
	d4 	grad{(t4)|(0)|(t1)}
	d11 	
	d4 	groff
	d1      
;---------------------------------- refocusing group ---------------------
echo1,  d4	grad{(0)|(0)|(t3)}
	0u	rgrad r2d
	goto jump		    
echo,	d4      grad{(0)|(0)|(t3)}
jump,   d5
        d4      grad{(0)|(0)|(t2)}  gatepulse 1
        d3	
        p1:sp1 	ph1
        d3
        d4      grad{(0)|(0)|(t3)}
        d5
        d4      groff         
;----------------------------------- refocusing group - end -----------
	d2
;----------------------------------read on + phase encoding----
	d4    grad{(t5)|r2d(t6)|r3d(t7)} ; 2nd and 3rd dims
	d6
	denab    grad{(t5)|(0)|(0)} 
        deparx     adc ph0 setrtp1|2 syrec fqatofqb:f1 \n derxadc     ph1:r setrtp1|1 				\n rdeadc     setrtp1|0|8  
	aqq	cpdngs30:f1
	d3	
;----------------------------------read on + phase encoding----
	d4	grad{(t5)|r2d(t8)|r3d(t9)} ; 2nd and 3rd dims
	d6      
	d4d2m40u groff
	0u	 igrad r2d
	40u      eoscnp
lo to echo times NECHOES/PVM_NEchoImages
	3u 
lo to echo1 times PVM_NEchoImages

if( PVM_FlipBackOnOff == On)
{

	d4      grad{(0)|(0)|(t3)}
	d5
        d4      grad{(0)|(0)|(t2)}  gatepulse 1
        d3	
        p1:sp1 	ph1
        d3
        d4      grad{(0)|(0)|(t3)}
        d5
        d4      groff         
	d1  
	d4 	grad{(t4)|(0)|(t1)}
	d11 	
	d4 	groff
	10u
	d4 	grad{(0)|(0)|(t0)}  gatepulse 1
	d3	
	p0:sp0 	ph3
	d4 	groff

}	

;----------------------------------slice loop-----------------------
	islice
	d0
# 1 "/opt/PV4.0/exp/stan/nmr/lists/pp/FlowSatinc.mod" 1
;****************************************************************
;
; Copyright (c) 2002-2003
; Bruker BioSpin MRI GmbH
; D-76275 Ettlingen, Germany
;
; All Rights Reserved
;
; FlowSatinc.mod : Flow Saturation Module
; Frequency List Increment
;
;****************************************************************




if(PVM_InFlowSatOnOff == 1)
   {

flow3,    50u 	modlis4.inc 
        lo to flow3 times SfLp0
}
   
# 149 "/opt/PV4.0/exp/stan/nmr/lists/pp/RARE.ppg" 2

	lo to slice times NSLICES
	d10
    zslice  
	2.5u	ipp0
	2.5u	ipp3
;----------------------------------averaging loop-------------------
	lo to slice times NA
	2.5u	rpp0
	2.5u	rpp3
;----------------------------------2d loop--------------------------
if( ACQ_dim >= 2 )
{
	"lc1 = lc1 - 1"		; this makes
	if "lc1>=0" goto start	; dummy scans 

	lo to start times l2	;ACQ_size[1]/ACQ_rare_factor
}
;----------------------------------3d loop--------------------------
if( ACQ_dim >= 3 )
{
	igrad r3d
	lo to start times ACQ_size[2]
}
        5u
        lo to start times NAE
        5u
# 1 "/opt/PV4.0/exp/stan/nmr/lists/pp/Evolution.mod" 1
;Evolution Loop
; dwe 290605

if(PVM_EvolutionOnOff)
{
  EvolD0 
  EvolD0.inc
}
# 176 "/opt/PV4.0/exp/stan/nmr/lists/pp/RARE.ppg" 2

        5u
        lo to start times NR
if (ACQ_scan_type != Scan_Experiment) \n{ \n goto start \n}

exit

ph0 = 0 2
ph1 = 1
ph3 = 2 0

