JuliaHealth / KomaMRI.jl

Koma is a Pulseq-compatible framework to efficiently simulate Magnetic Resonance Imaging (MRI) acquisitions. The main focus of this package is to simulate general scenarios that could arise in pulse sequence development.
https://JuliaHealth.github.io/KomaMRI.jl
MIT License
117 stars 21 forks source link

Multi-slice acquisition with 3D phantom #474

Open aTrotier opened 2 months ago

aTrotier commented 2 months ago

What happened?

Hi, I would like to create a simultaneous multi-slice (SMS) example for a course.

First, I created with pypulseq a standard Multi-slice GRE sequence with long TR=1000ms in order to not worry about the spoiling.

The images are ok but with signal / contrast variation along the slice dimension

image

With phantom2D i have the same issue :

image

If I try with the EPI_MS from the example repository I think I have the same issue (hard to tell with only 3 slices, I think it happens when I go further away from isocenter)

image

In order to change the slice position I am using this line of code in pulseq :

    rf_1.freq_offset = gz_1.amplitude * slice_gap * (sl - round((NSlices - 1) / 2))

Any idea ?

Environment

OS x86_64-linux-gnu
Julia 1.10.3
KomaMRIPlots 0.8.3
KomaMRIFiles 0.8.2
KomaMRI 0.8.2
KomaMRICore 0.8.3
KomaMRIBase 0.8.5
cncastillo commented 2 months ago

Hi! Hard to say. What do the different images mean? 20 slices are acquired simultaneously? or are the slices acquired sequentially?

Interestingly, the problem is also observed for the EPI_MS example; at least when simulating independently, the slice profiles have the same magnitude. Maybe a larger delay must be included between acquisitions for the magnetization to recover.

I will try running the MS EPI example using the development branch in #458, which should more precisely simulate RF pulses to discard a simulation accuracy problem

aTrotier commented 2 months ago

The slice are acquired sequentially. I also tried to acquire each slice in different sequence en get the same results :

Screenshot 2024-09-05 at 10 04 23

If needed you can find attach the sequence (.ipynb and .seq) and reco (.jl) GRE_MS.zip

aTrotier commented 6 days ago

@cncastillo do you still observe this on the dev branch ?

I finally have some time to create the SMS example

cncastillo commented 6 days ago

Hi!, sorry for not looking at this earlier. Thanks for the patience, I was submitting my thesis and I was quite busy.

In the latest version Koma v0.9 I get this:

GRE_SMS_slX.seq X = 0, 1, 2, 3, 4 image

Is this more similar to what you expected?

aTrotier commented 5 days ago

Not really we still see the signal variation along the slice direction.

Le jeu. 31 oct. 2024, 23:25, Carlos Castillo Passi @.***> a écrit :

Hi, in the latest version Koma v0.9 I get this:

GRE_SMS_slX.seq X = 0, 1, 2, 3, 4 image.png (view on web) https://github.com/user-attachments/assets/55e37837-5a4d-4fbe-be67-f577291d19ea

Is this more similar to what you expected?

— Reply to this email directly, view it on GitHub https://github.com/JuliaHealth/KomaMRI.jl/issues/474#issuecomment-2450938532, or unsubscribe https://github.com/notifications/unsubscribe-auth/AC5P7O2NMNIDMTFL6B6LP23Z6KU33AVCNFSM6AAAAABNUKAZOKVHI2DSMVQWIX3LMV43OSLTON2WKQ3PNVWWK3TUHMZDINJQHEZTQNJTGI . You are receiving this because you authored the thread.Message ID: @.***>

cncastillo commented 5 days ago

Upon further examination, it seems that the phantom could be the problem. By default, brain_phantom3D is a thin slab of 2cm (z from -1cm to 1cm). The slice thickness (3mm) and slice gaps (10mm) of the sequence make it so the excitation goes beyond the phantom (x-axis in cm):

image

By modifying the phantom to

obj = brain_phantom3D(;start_end=[120, 240]) # z from -3 cm to 3 cm

I get:

image

Which looks a lot more uniform (XZ view vol[64,:,:]):

image

aTrotier commented 5 days ago

Great !

Do you already mention that in the documentation ?

Maybe I should add a literate example about 2d multi slice or 3d with a large fov ?

Le ven. 1 nov. 2024, 15:07, Carlos Castillo Passi @.***> a écrit :

Upon further examination, it seems that the phantom could be the problem. By default, phantom_3D is a thin slab of 2cm (z from -1cm to 1cm). The slice thickness (3mm) and slice gaps (10mm) of the sequence make it so the excitation goes beyond the phantom (x-axis in cm):

image.png (view on web) https://github.com/user-attachments/assets/1925e91c-c028-4f4b-9016-9618f2bf4960

By modifying the phantom to

obj = brain_phantom3D(;start_end=[130, 230]) # z from -2.5 cm to 2.5 cm

I get:

image.png (view on web) https://github.com/user-attachments/assets/b575583e-acaf-45d1-9900-652c6bf65c7f

— Reply to this email directly, view it on GitHub https://github.com/JuliaHealth/KomaMRI.jl/issues/474#issuecomment-2451932130, or unsubscribe https://github.com/notifications/unsubscribe-auth/AC5P7O42YMWLV6H3YWWEKUTZ6ODIXAVCNFSM6AAAAABNUKAZOKVHI2DSMVQWIX3LMV43OSLTON2WKQ3PNVWWK3TUHMZDINJRHEZTEMJTGA . You are receiving this because you authored the thread.Message ID: @.***>

cncastillo commented 5 days ago

The docstring for brain_phantom3D does not mention it, so that needs to be better explained. But it is mentioned here: https://juliahealth.org/KomaMRI.jl/stable/tutorial/04-3DSliceSelective/

A section at the end of that tutorial could be helpful, but ...

... even I forgot that brain_phantom3D was not the whole head. So maybe we can remove the start_end thing and always do the complete head. If a smaller slab is needed, the user can do obj[abs.(obj.z) .< 3e-2] (z from -3cm to 3 cm), for example. What do you think?

aTrotier commented 5 days ago

Or you can let the start_end but the default will be the whole brain ?

Le ven. 1 nov. 2024, 19:09, Carlos Castillo Passi @.***> a écrit :

The docstring for brain_phantom3D does not mention it, so that needs to be better explained. But it is mentioned here: https://juliahealth.org/KomaMRI.jl/stable/tutorial/04-3DSliceSelective/

A section at the end of that tutorial could be helpful.

Now ... even I forgot that brain_phantom3D was not the whole head. So maybe we can remove the start_end thing and always do the complete head. If a smaller slab is needed, the user can do obj[abs.(obj.z) .< 3e-2] (z from -3cm to 3 cm), for example. What do you think?

— Reply to this email directly, view it on GitHub https://github.com/JuliaHealth/KomaMRI.jl/issues/474#issuecomment-2452346643, or unsubscribe https://github.com/notifications/unsubscribe-auth/AC5P7O4MG4OA2XUDMWFO23TZ6O7V5AVCNFSM6AAAAABNUKAZOKVHI2DSMVQWIX3LMV43OSLTON2WKQ3PNVWWK3TUHMZDINJSGM2DMNRUGM . You are receiving this because you authored the thread.Message ID: @.***>

cncastillo commented 5 days ago

Yeah it sounds reasonable. I will do that now, and update the tutorial accordingly.

Off course, If you have any cool example I would be glad to put it in the tutorials as well.