Skip to content

fix: add 2pi² to z-state diffusion computation - #195

Merged
J-Endres merged 2 commits into
mainfrom
fix-diffusion
Oct 6, 2026
Merged

J-Endres merged 2 commits into
mainfrom
fix-diffusion

Conversation

@J-Endres

@J-Endres J-Endres commented Oct 6, 2026

Copy link
Copy Markdown
Collaborator

the diffusion computation for z-states was missing a 2pi when computing the b-value from the k-dephasing. k has unit 1/m while the formula expects rad/m. For + states this error was not present.

The effect is minor for most sequences.

@github-actions

github-actions Bot commented Oct 6, 2026

Copy link
Copy Markdown

Simulation test: main (before) vs. this PR (after)

Sequence Status max mag NRMSE max phase RMSE max runtime Δ
mr0_DREAM_STE_seq ❌ 3.05e-02 6.05e-01 +0.8%
mr0_DWI_SE_EPI ✅ 0.00e+00 0.00e+00 +2.2%
mr0_EPI_2D_seq ✅ 0.00e+00 0.00e+00 -1.6%
mr0_FID_seq ✅ 0.00e+00 0.00e+00 +1.3%
mr0_FLASH_2D_seq ❌ 7.10e-02 5.74e-01 +4.7%
mr0_GRE_to_FLASH ⚠️ – – –
mr0_RARE_2D_seq ❌ 3.20e-01 4.67e-01 +2.3%
mr0_SE_CPMG_seq ✅ 0.00e+00 0.00e+00 +1.1%
mr0_STE_3pulses_5echoes_seq ✅ 6.86e-09 1.49e-08 +4.2%
mr0_TSE_2D_multi_shot_seq ❌ 2.42e-02 1.90e-01 +1.6%
mr0_bSSFP_2D_seq ✅ 0.00e+00 0.00e+00 +5.6%
mr0_diffusion_prep_STEAM_2D_seq ❌ 1.64e-02 2.86e-01 +9.0%
❌ mr0_DREAM_STE_seq: Mag RMSE too high (0.03046) at acc=0.50000

mr0_DREAM_STE_seq

✅ mr0_DWI_SE_EPI: All tests passed.

mr0_DWI_SE_EPI

✅ mr0_EPI_2D_seq: All tests passed.

mr0_EPI_2D_seq

✅ mr0_FID_seq: All tests passed.

mr0_FID_seq

❌ mr0_FLASH_2D_seq: Phase RMSE too high (0.11352) at acc=0.10000

mr0_FLASH_2D_seq

⚠️ mr0_GRE_to_FLASH: No comparison possible: [Errno 2] No such file or directory: '/home/runner/work/MRzero-Core/MRzero-Core/tests/simulation_test/ref_files/mr0_GRE_to_FLASH.seq.npz'
❌ mr0_RARE_2D_seq: Mag RMSE too high (0.01109) at acc=0.60000

mr0_RARE_2D_seq

✅ mr0_SE_CPMG_seq: All tests passed.

mr0_SE_CPMG_seq

✅ mr0_STE_3pulses_5echoes_seq: All tests passed.

mr0_STE_3pulses_5echoes_seq

❌ mr0_TSE_2D_multi_shot_seq: Mag RMSE too high (0.02420) at acc=0.01000

mr0_TSE_2D_multi_shot_seq

✅ mr0_bSSFP_2D_seq: All tests passed.

mr0_bSSFP_2D_seq

❌ mr0_diffusion_prep_STEAM_2D_seq: Mag RMSE too high (0.01070) at acc=0.60000

mr0_diffusion_prep_STEAM_2D_seq

Workflow run — raw .npz data is attached as artifacts.

@J-Endres
J-Endres merged commit f6fe1e5 into main Oct 6, 2026
28 of 33 checks passed
@J-Endres
J-Endres deleted the fix-diffusion branch October 6, 2026 12:05
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant