Skip to content

SLR pulse #934

Description

@aTrotier

What happened?

Hi,

I am playing with the SLR implementation for a course but I get some weird effect when using different SLR filter.

With :ms it seems to work correctly

Image

but with :pm / :min / :max I have some peaks at the beginning and end of the waveform that generates weird results ->

Image Image Image

If I remove the first point for :max I get something better (still a lot of ripple but I don't really know what I am suppose to get :

Image

and for :pm without the first and last point it is correct :
Image

The code used to generate that :

function SINC_vs_SLR(;alpha=pi/2,filter_type = :ms)
	sys = Scanner() #hide
	sys.Smax = 50; #hide
		
	Trf = 3.2e-3
	zmax = 2e-2
	fmax = 5e3
	thickness = 0.05

	z = range(4*-zmax, 4*zmax, 400)	

	# Build sinc sequence
	rf_sinc, gz_sinc, gzr_sinc = KomaMRI.PulseDesigner.make_sinc_pulse(alpha; 
						  duration=Trf, 
						  slice_thickness=thickness, 
						  apodization=0.5, 
						  time_bw_product=8, sys)
	seq_sinc = Sequence(sys)
	addblock!(seq_sinc, rf_sinc; z=gz_sinc)
    seq_sinc.DUR[end] = ceil_to_raster(dur(seq_sinc[end], sys), sys.DUR_Δt)
    addblock!(seq_sinc; z=gzr_sinc)
		
	sim_params = Dict{String, Any}("Δt_rf" => Trf / length(seq.RF.A[1]))
	M_sinc =  simulate_slice_profile(seq_sinc; z=z, sim_params)

		## SLR parts

	rf_slr, gz_slr, gzr_slr = KomaMRI.PulseDesigner.make_slr_pulse(alpha; 
											 duration=Trf, 
											 slice_thickness=thickness, 
											 time_bw_product=8,
											 passband_ripple=0.01,
    										 stopband_ripple=0.01, 
											 filter_type=filter_type, sys) #:ms,:pm, :min, :max, :ls
	rf_slr.A=rf_slr.A[2:end-1]
	seq_slr = Sequence(sys)
	addblock!(seq_slr, rf_slr; z=gz_slr)
    seq_slr.DUR[end] = ceil_to_raster(dur(seq_slr[end], sys), sys.DUR_Δt)
    addblock!(seq_slr; z=gzr_slr)

	sim_params = Dict{String, Any}("Δt_rf" => Trf / length(seq.RF.A[1]))
	M_slr =  simulate_slice_profile(seq_slr; z=z, sim_params)

	############# Figure
	f = Figure()
	ax=Axis(f[1,1])
	lines!(ax,abs.(rf_sinc.A),label = "SINC")
	lines!(ax,abs.(rf_slr.A),label = "SLR filter = :$filter_type")
	axislegend(ax)
		
	ax=Axis(f[2,1],xlabel = "z position [mm]")
	lines!(ax,z*1000,abs.(M_sinc.xy),label = "SINC")
	lines!(ax,z*1000,abs.(M_slr.xy),label = "SLR filter = :$filter_type")
	axislegend(ax)
	f
        return f
end

SINC_vs_SLR(alpha = pi/2,filter_type = :max)

Environment

OS arm64-apple-darwin24.0.0
Julia 1.12.5
KomaMRIPlots 0.13.0
KomaMRIFiles 0.11.5
KomaMRI 0.13.1
KomaMRICore 0.12.5
KomaMRIBase 0.13.4

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions