blochsimulator 2.9.0__tar.gz → 2.9.2__tar.gz
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- {blochsimulator-2.9.0 → blochsimulator-2.9.2}/CHANGELOG.md +239 -0
- {blochsimulator-2.9.0 → blochsimulator-2.9.2}/MANIFEST.in +1 -0
- {blochsimulator-2.9.0/src/blochsimulator.egg-info → blochsimulator-2.9.2}/PKG-INFO +42 -1
- {blochsimulator-2.9.0 → blochsimulator-2.9.2}/README.md +38 -0
- {blochsimulator-2.9.0 → blochsimulator-2.9.2}/pyproject.toml +12 -2
- {blochsimulator-2.9.0 → blochsimulator-2.9.2}/requirements.txt +2 -0
- blochsimulator-2.9.2/rfpulses/AHP_5ms_Hsn.json +1 -0
- {blochsimulator-2.9.0 → blochsimulator-2.9.2}/src/blochsimulator/__init__.py +1 -1
- {blochsimulator-2.9.0 → blochsimulator-2.9.2}/src/blochsimulator/b1_fields.py +19 -5
- {blochsimulator-2.9.0 → blochsimulator-2.9.2}/src/blochsimulator/bloch_core.h +5 -1
- {blochsimulator-2.9.0 → blochsimulator-2.9.2}/src/blochsimulator/bloch_core_modified.c +10 -3
- {blochsimulator-2.9.0 → blochsimulator-2.9.2}/src/blochsimulator/bloch_wrapper.c +3748 -3411
- {blochsimulator-2.9.0 → blochsimulator-2.9.2}/src/blochsimulator/bloch_wrapper.pyx +18 -2
- {blochsimulator-2.9.0 → blochsimulator-2.9.2}/src/blochsimulator/bloch_wrapper_strict.c +3749 -3412
- blochsimulator-2.9.2/src/blochsimulator/default_phantoms.py +183 -0
- {blochsimulator-2.9.0 → blochsimulator-2.9.2}/src/blochsimulator/dynamic_bloch_wrapper.c +3703 -2527
- {blochsimulator-2.9.0 → blochsimulator-2.9.2}/src/blochsimulator/dynamic_bloch_wrapper.pyx +119 -3
- {blochsimulator-2.9.0 → blochsimulator-2.9.2}/src/blochsimulator/dynamic_execution.py +17 -1
- {blochsimulator-2.9.0 → blochsimulator-2.9.2}/src/blochsimulator/dynamic_phantom.py +1123 -121
- blochsimulator-2.9.2/src/blochsimulator/dynamic_spin_major.c +1965 -0
- blochsimulator-2.9.2/src/blochsimulator/dynamic_spin_major.h +178 -0
- {blochsimulator-2.9.0 → blochsimulator-2.9.2}/src/blochsimulator/dynamic_spin_major_wrapper.c +6039 -3299
- {blochsimulator-2.9.0 → blochsimulator-2.9.2}/src/blochsimulator/dynamic_spin_major_wrapper.pyx +194 -33
- blochsimulator-2.9.2/src/blochsimulator/gradient_lobes.py +168 -0
- {blochsimulator-2.9.0 → blochsimulator-2.9.2}/src/blochsimulator/kernel_capabilities.py +15 -2
- blochsimulator-2.9.2/src/blochsimulator/mouse_phantom.py +1981 -0
- {blochsimulator-2.9.0 → blochsimulator-2.9.2}/src/blochsimulator/notebook_exporter.py +128 -47
- {blochsimulator-2.9.0 → blochsimulator-2.9.2}/src/blochsimulator/phantom_design.py +45 -16
- blochsimulator-2.9.2/src/blochsimulator/phantom_loop.py +249 -0
- blochsimulator-2.9.2/src/blochsimulator/phantom_polarization.py +66 -0
- {blochsimulator-2.9.0 → blochsimulator-2.9.2}/src/blochsimulator/phantom_widget.py +17 -7
- blochsimulator-2.9.2/src/blochsimulator/position_sampling.py +267 -0
- {blochsimulator-2.9.0 → blochsimulator-2.9.2}/src/blochsimulator/project_io.py +1 -0
- {blochsimulator-2.9.0 → blochsimulator-2.9.2}/src/blochsimulator/pulse_loader.py +38 -14
- blochsimulator-2.9.2/src/blochsimulator/rfpulses/AHP_5ms_Hsn.dat +1024 -0
- blochsimulator-2.9.2/src/blochsimulator/rfpulses/AHP_5ms_Hsn.json +1 -0
- blochsimulator-2.9.2/src/blochsimulator/rfpulses/__init__.py +1 -0
- blochsimulator-2.9.2/src/blochsimulator/rfpulses/bruker/13C_Ultimate_SPSP_Pulse_QuEMRT.exc +2502 -0
- {blochsimulator-2.9.0 → blochsimulator-2.9.2}/src/blochsimulator/sequence/__init__.py +87 -1
- {blochsimulator-2.9.0 → blochsimulator-2.9.2}/src/blochsimulator/sequence/acquisition.py +59 -6
- {blochsimulator-2.9.0 → blochsimulator-2.9.2}/src/blochsimulator/sequence/advanced_bssfp_builders.py +158 -39
- blochsimulator-2.9.2/src/blochsimulator/sequence/bruker_export.py +2018 -0
- blochsimulator-2.9.2/src/blochsimulator/sequence/bruker_jcamp.py +948 -0
- blochsimulator-2.9.2/src/blochsimulator/sequence/bruker_pdata.py +670 -0
- {blochsimulator-2.9.0 → blochsimulator-2.9.2}/src/blochsimulator/sequence/compiler.py +270 -31
- blochsimulator-2.9.2/src/blochsimulator/sequence/dicom_export.py +594 -0
- {blochsimulator-2.9.0 → blochsimulator-2.9.2}/src/blochsimulator/sequence/encoding.py +47 -0
- blochsimulator-2.9.2/src/blochsimulator/sequence/export_bundle.py +297 -0
- blochsimulator-2.9.2/src/blochsimulator/sequence/image_export.py +971 -0
- blochsimulator-2.9.2/src/blochsimulator/sequence/internal_fid.py +121 -0
- blochsimulator-2.9.2/src/blochsimulator/sequence/measured_fid.py +543 -0
- blochsimulator-2.9.2/src/blochsimulator/sequence/nifti_export.py +420 -0
- blochsimulator-2.9.2/src/blochsimulator/sequence/paravision.py +365 -0
- {blochsimulator-2.9.0 → blochsimulator-2.9.2}/src/blochsimulator/sequence/pulseq.py +12 -0
- {blochsimulator-2.9.0 → blochsimulator-2.9.2}/src/blochsimulator/sequence/pulseq_builders.py +298 -64
- blochsimulator-2.9.2/src/blochsimulator/sequence/receiver.py +458 -0
- {blochsimulator-2.9.0 → blochsimulator-2.9.2}/src/blochsimulator/sequence/reconstruction.py +36 -0
- blochsimulator-2.9.2/src/blochsimulator/sequence/reference_scan.py +257 -0
- {blochsimulator-2.9.0 → blochsimulator-2.9.2}/src/blochsimulator/sequence/result.py +41 -7
- blochsimulator-2.9.2/src/blochsimulator/sequence/signal_units.py +183 -0
- blochsimulator-2.9.2/src/blochsimulator/sequence/snr_budget.py +600 -0
- {blochsimulator-2.9.0 → blochsimulator-2.9.2}/src/blochsimulator/simulator.py +192 -161
- {blochsimulator-2.9.0 → blochsimulator-2.9.2}/src/blochsimulator/ui/b1_widgets.py +336 -231
- {blochsimulator-2.9.0 → blochsimulator-2.9.2}/src/blochsimulator/ui/default_settings.py +34 -2
- {blochsimulator-2.9.0 → blochsimulator-2.9.2}/src/blochsimulator/ui/dialogs.py +78 -0
- blochsimulator-2.9.2/src/blochsimulator/ui/magnetization_viewer.py +1640 -0
- {blochsimulator-2.9.0 → blochsimulator-2.9.2}/src/blochsimulator/ui/main_window.py +1174 -266
- {blochsimulator-2.9.0 → blochsimulator-2.9.2}/src/blochsimulator/ui/mouse_phantom_designer.py +398 -79
- {blochsimulator-2.9.0 → blochsimulator-2.9.2}/src/blochsimulator/ui/parameter_sweep.py +97 -69
- {blochsimulator-2.9.0 → blochsimulator-2.9.2}/src/blochsimulator/ui/phantom_designer.py +1012 -322
- blochsimulator-2.9.2/src/blochsimulator/ui/receiver_noise.py +967 -0
- blochsimulator-2.9.2/src/blochsimulator/ui/receiver_noise_preview.py +270 -0
- {blochsimulator-2.9.0 → blochsimulator-2.9.2}/src/blochsimulator/ui/reconstruction_explorer.py +337 -111
- {blochsimulator-2.9.0 → blochsimulator-2.9.2}/src/blochsimulator/ui/rf_pulse_designer.py +6 -3
- {blochsimulator-2.9.0 → blochsimulator-2.9.2}/src/blochsimulator/ui/sequence_designer.py +537 -276
- blochsimulator-2.9.2/src/blochsimulator/ui/sequence_diagram.py +678 -0
- blochsimulator-2.9.2/src/blochsimulator/ui/sequence_export_dialog.py +613 -0
- blochsimulator-2.9.2/src/blochsimulator/ui/sequence_geometry_viewer.py +1376 -0
- {blochsimulator-2.9.0 → blochsimulator-2.9.2}/src/blochsimulator/ui/sequence_simulation_widget.py +2408 -506
- {blochsimulator-2.9.0 → blochsimulator-2.9.2}/src/blochsimulator/ui/volume_viewer.py +20 -6
- {blochsimulator-2.9.0 → blochsimulator-2.9.2}/src/blochsimulator/ui/widgets.py +34 -0
- {blochsimulator-2.9.0 → blochsimulator-2.9.2}/src/blochsimulator/units.py +53 -0
- {blochsimulator-2.9.0 → blochsimulator-2.9.2}/src/blochsimulator/visualization.py +38 -6
- {blochsimulator-2.9.0 → blochsimulator-2.9.2/src/blochsimulator.egg-info}/PKG-INFO +42 -1
- {blochsimulator-2.9.0 → blochsimulator-2.9.2}/src/blochsimulator.egg-info/SOURCES.txt +47 -0
- {blochsimulator-2.9.0 → blochsimulator-2.9.2}/src/blochsimulator.egg-info/requires.txt +4 -0
- {blochsimulator-2.9.0 → blochsimulator-2.9.2}/tests/test_advanced_bssfp_builders.py +228 -1
- {blochsimulator-2.9.0 → blochsimulator-2.9.2}/tests/test_b1_fields.py +50 -0
- {blochsimulator-2.9.0 → blochsimulator-2.9.2}/tests/test_csi_acquisition.py +2 -2
- blochsimulator-2.9.2/tests/test_custom_pulse.py +85 -0
- blochsimulator-2.9.2/tests/test_default_phantoms.py +90 -0
- blochsimulator-2.9.2/tests/test_dynamic_chemical_shift_maps.py +181 -0
- {blochsimulator-2.9.0 → blochsimulator-2.9.2}/tests/test_dynamic_native_plan.py +53 -0
- {blochsimulator-2.9.0 → blochsimulator-2.9.2}/tests/test_dynamic_phantom.py +24 -3
- {blochsimulator-2.9.0 → blochsimulator-2.9.2}/tests/test_dynamic_spin_major.py +109 -23
- blochsimulator-2.9.2/tests/test_dynamic_spin_major_multi_pool.py +438 -0
- blochsimulator-2.9.2/tests/test_dynamic_spin_major_rf_cache_multi_pool.py +425 -0
- {blochsimulator-2.9.0 → blochsimulator-2.9.2}/tests/test_ernst_angle.py +4 -0
- blochsimulator-2.9.2/tests/test_gradient_lobes.py +114 -0
- blochsimulator-2.9.2/tests/test_gui_smoke.py +2338 -0
- blochsimulator-2.9.2/tests/test_internal_fid.py +199 -0
- blochsimulator-2.9.2/tests/test_measured_fid.py +381 -0
- blochsimulator-2.9.2/tests/test_mouse_phantom.py +1005 -0
- {blochsimulator-2.9.0 → blochsimulator-2.9.2}/tests/test_notebook_export.py +140 -1
- {blochsimulator-2.9.0 → blochsimulator-2.9.2}/tests/test_notebook_reproduction.py +43 -1
- {blochsimulator-2.9.0 → blochsimulator-2.9.2}/tests/test_parameter_loop_disk.py +1 -0
- blochsimulator-2.9.2/tests/test_phantom_display_units.py +386 -0
- blochsimulator-2.9.2/tests/test_phantom_loop.py +78 -0
- blochsimulator-2.9.2/tests/test_position_sampling.py +123 -0
- blochsimulator-2.9.2/tests/test_probe_longitudinal_equilibrium.py +255 -0
- blochsimulator-2.9.2/tests/test_pulse_loader.py +106 -0
- {blochsimulator-2.9.0 → blochsimulator-2.9.2}/tests/test_pulseq_builders.py +638 -1
- blochsimulator-2.9.2/tests/test_receiver_noise.py +908 -0
- blochsimulator-2.9.2/tests/test_receiver_noise_gui.py +1012 -0
- {blochsimulator-2.9.0 → blochsimulator-2.9.2}/tests/test_reconstruction_explorer.py +44 -0
- blochsimulator-2.9.2/tests/test_reference_scan.py +280 -0
- blochsimulator-2.9.2/tests/test_sequence_edit_confirmation.py +231 -0
- blochsimulator-2.9.2/tests/test_sequence_export_formats.py +1021 -0
- blochsimulator-2.9.2/tests/test_sequence_geometry_viewer.py +708 -0
- {blochsimulator-2.9.0 → blochsimulator-2.9.2}/tests/test_sequence_gui.py +685 -24
- {blochsimulator-2.9.0 → blochsimulator-2.9.2}/tests/test_sequence_model.py +66 -0
- {blochsimulator-2.9.0 → blochsimulator-2.9.2}/tests/test_sequence_parameter_loop.py +106 -0
- {blochsimulator-2.9.0 → blochsimulator-2.9.2}/tests/test_sequence_simulation.py +52 -7
- {blochsimulator-2.9.0 → blochsimulator-2.9.2}/tests/test_sequence_workspace_features.py +85 -39
- {blochsimulator-2.9.0 → blochsimulator-2.9.2}/tests/test_session_simulation_explorer.py +15 -0
- blochsimulator-2.9.2/tests/test_signal_units.py +156 -0
- {blochsimulator-2.9.0 → blochsimulator-2.9.2}/tests/test_slice_selection.py +28 -0
- {blochsimulator-2.9.0 → blochsimulator-2.9.2}/tests/test_spectral_phantom_design.py +115 -9
- {blochsimulator-2.9.0 → blochsimulator-2.9.2}/tests/test_spectral_spatial_pulses.py +54 -0
- {blochsimulator-2.9.0 → blochsimulator-2.9.2}/tests/test_ssfp_sequence.py +143 -2
- blochsimulator-2.9.0/src/blochsimulator/dynamic_spin_major.c +0 -1122
- blochsimulator-2.9.0/src/blochsimulator/dynamic_spin_major.h +0 -115
- blochsimulator-2.9.0/src/blochsimulator/mouse_phantom.py +0 -1185
- blochsimulator-2.9.0/src/blochsimulator/rfpulses/__init__.py +0 -1
- blochsimulator-2.9.0/src/blochsimulator/sequence/bruker_export.py +0 -1251
- blochsimulator-2.9.0/src/blochsimulator/ui/magnetization_viewer.py +0 -606
- blochsimulator-2.9.0/tests/test_gui_smoke.py +0 -1008
- blochsimulator-2.9.0/tests/test_mouse_phantom.py +0 -460
- {blochsimulator-2.9.0 → blochsimulator-2.9.2}/LICENSE +0 -0
- {blochsimulator-2.9.0 → blochsimulator-2.9.2}/examples/spin_echo_analysis.ipynb +0 -0
- {blochsimulator-2.9.0 → blochsimulator-2.9.2}/examples/spin_echo_analysis_data.h5 +0 -0
- {blochsimulator-2.9.0 → blochsimulator-2.9.2}/examples/spin_echo_reproduction.ipynb +0 -0
- {blochsimulator-2.9.0 → blochsimulator-2.9.2}/rfpulses/.DS_Store +0 -0
- {blochsimulator-2.9.0 → blochsimulator-2.9.2}/rfpulses/AHP_5ms_Hsn.dat +0 -0
- {blochsimulator-2.9.0 → blochsimulator-2.9.2}/rfpulses/SLR_sharpness_1.txt +0 -0
- {blochsimulator-2.9.0 → blochsimulator-2.9.2}/rfpulses/SLR_sharpness_5.txt +0 -0
- {blochsimulator-2.9.0 → blochsimulator-2.9.2}/rfpulses/bruker/13C_Ultimate_SPSP_Pulse_QuEMRT.exc +0 -0
- {blochsimulator-2.9.0 → blochsimulator-2.9.2}/setup.cfg +0 -0
- {blochsimulator-2.9.0 → blochsimulator-2.9.2}/setup.py +0 -0
- {blochsimulator-2.9.0 → blochsimulator-2.9.2}/src/blochsimulator/adaptive.py +0 -0
- {blochsimulator-2.9.0 → blochsimulator-2.9.2}/src/blochsimulator/bloch_core_strict.c +0 -0
- {blochsimulator-2.9.0 → blochsimulator-2.9.2}/src/blochsimulator/bloch_wrapper_strict.pyx +0 -0
- {blochsimulator-2.9.0 → blochsimulator-2.9.2}/src/blochsimulator/gui.py +0 -0
- {blochsimulator-2.9.0 → blochsimulator-2.9.2}/src/blochsimulator/gui_phantom_integration.py +0 -0
- {blochsimulator-2.9.0 → blochsimulator-2.9.2}/src/blochsimulator/kspace.py +0 -0
- {blochsimulator-2.9.0 → blochsimulator-2.9.2}/src/blochsimulator/kspace_widget.py +0 -0
- {blochsimulator-2.9.0 → blochsimulator-2.9.2}/src/blochsimulator/memory.py +0 -0
- {blochsimulator-2.9.0 → blochsimulator-2.9.2}/src/blochsimulator/metabolite_presets.py +0 -0
- {blochsimulator-2.9.0 → blochsimulator-2.9.2}/src/blochsimulator/paths.py +0 -0
- {blochsimulator-2.9.0 → blochsimulator-2.9.2}/src/blochsimulator/phantom.py +0 -0
- {blochsimulator-2.9.0 → blochsimulator-2.9.2}/src/blochsimulator/project_naming.py +0 -0
- {blochsimulator-2.9.0 → blochsimulator-2.9.2}/src/blochsimulator/rfpulses/SLR_sharpness_1.txt +0 -0
- {blochsimulator-2.9.0 → blochsimulator-2.9.2}/src/blochsimulator/rfpulses/SLR_sharpness_5.txt +0 -0
- {blochsimulator-2.9.0 → blochsimulator-2.9.2}/src/blochsimulator/sequence/bssfp_phase.py +0 -0
- {blochsimulator-2.9.0 → blochsimulator-2.9.2}/src/blochsimulator/sequence/convergence.py +0 -0
- {blochsimulator-2.9.0 → blochsimulator-2.9.2}/src/blochsimulator/sequence/convergence_suite.py +0 -0
- {blochsimulator-2.9.0 → blochsimulator-2.9.2}/src/blochsimulator/sequence/flip_angles.py +0 -0
- {blochsimulator-2.9.0 → blochsimulator-2.9.2}/src/blochsimulator/sequence/model.py +0 -0
- {blochsimulator-2.9.0 → blochsimulator-2.9.2}/src/blochsimulator/sequence/parameter_loop.py +0 -0
- {blochsimulator-2.9.0 → blochsimulator-2.9.2}/src/blochsimulator/sequence/probe.py +0 -0
- {blochsimulator-2.9.0 → blochsimulator-2.9.2}/src/blochsimulator/sequence/reference.py +0 -0
- {blochsimulator-2.9.0 → blochsimulator-2.9.2}/src/blochsimulator/sequence/rf_pulses.py +0 -0
- {blochsimulator-2.9.0 → blochsimulator-2.9.2}/src/blochsimulator/sequence/scanner.py +0 -0
- {blochsimulator-2.9.0 → blochsimulator-2.9.2}/src/blochsimulator/sequence/spectral_spatial.py +0 -0
- {blochsimulator-2.9.0 → blochsimulator-2.9.2}/src/blochsimulator/sequence/spin_sampling.py +0 -0
- {blochsimulator-2.9.0 → blochsimulator-2.9.2}/src/blochsimulator/sequence/spoiling.py +0 -0
- {blochsimulator-2.9.0 → blochsimulator-2.9.2}/src/blochsimulator/slice_explorer.py +0 -0
- {blochsimulator-2.9.0 → blochsimulator-2.9.2}/src/blochsimulator/spectral_phantom.py +0 -0
- {blochsimulator-2.9.0 → blochsimulator-2.9.2}/src/blochsimulator/ui/__init__.py +0 -0
- {blochsimulator-2.9.0 → blochsimulator-2.9.2}/src/blochsimulator/ui/controls.py +0 -0
- {blochsimulator-2.9.0 → blochsimulator-2.9.2}/src/blochsimulator/ui/metabolite_excitation_plan.py +0 -0
- {blochsimulator-2.9.0 → blochsimulator-2.9.2}/src/blochsimulator/ui/plot_interaction.py +0 -0
- {blochsimulator-2.9.0 → blochsimulator-2.9.2}/src/blochsimulator/ui/probe_viewers.py +0 -0
- {blochsimulator-2.9.0 → blochsimulator-2.9.2}/src/blochsimulator/ui/project_explorer.py +0 -0
- {blochsimulator-2.9.0 → blochsimulator-2.9.2}/src/blochsimulator/ui/project_export_dialog.py +0 -0
- {blochsimulator-2.9.0 → blochsimulator-2.9.2}/src/blochsimulator/ui/simulation_explorer.py +0 -0
- {blochsimulator-2.9.0 → blochsimulator-2.9.2}/src/blochsimulator/ui/spectral_spatial_designer.py +0 -0
- {blochsimulator-2.9.0 → blochsimulator-2.9.2}/src/blochsimulator/ui/styles.py +0 -0
- {blochsimulator-2.9.0 → blochsimulator-2.9.2}/src/blochsimulator/ui/threads.py +0 -0
- {blochsimulator-2.9.0 → blochsimulator-2.9.2}/src/blochsimulator/ui/tissue_parameters.py +0 -0
- {blochsimulator-2.9.0 → blochsimulator-2.9.2}/src/blochsimulator/ui/tutorial_manager.py +0 -0
- {blochsimulator-2.9.0 → blochsimulator-2.9.2}/src/blochsimulator/ui/tutorial_overlay.py +0 -0
- {blochsimulator-2.9.0 → blochsimulator-2.9.2}/src/blochsimulator.egg-info/dependency_links.txt +0 -0
- {blochsimulator-2.9.0 → blochsimulator-2.9.2}/src/blochsimulator.egg-info/entry_points.txt +0 -0
- {blochsimulator-2.9.0 → blochsimulator-2.9.2}/src/blochsimulator.egg-info/not-zip-safe +0 -0
- {blochsimulator-2.9.0 → blochsimulator-2.9.2}/src/blochsimulator.egg-info/top_level.txt +0 -0
- {blochsimulator-2.9.0 → blochsimulator-2.9.2}/tests/test_benchmarks.py +0 -0
- {blochsimulator-2.9.0 → blochsimulator-2.9.2}/tests/test_cartesian_acquisition.py +0 -0
- {blochsimulator-2.9.0 → blochsimulator-2.9.2}/tests/test_csi_sequence.py +0 -0
- {blochsimulator-2.9.0 → blochsimulator-2.9.2}/tests/test_dependencies.py +0 -0
- {blochsimulator-2.9.0 → blochsimulator-2.9.2}/tests/test_dynamic_3d_bssfp.py +0 -0
- {blochsimulator-2.9.0 → blochsimulator-2.9.2}/tests/test_dynamic_chunking.py +0 -0
- {blochsimulator-2.9.0 → blochsimulator-2.9.2}/tests/test_dynamic_execution_plan.py +0 -0
- {blochsimulator-2.9.0 → blochsimulator-2.9.2}/tests/test_dynamic_precision_validator.py +0 -0
- {blochsimulator-2.9.0 → blochsimulator-2.9.2}/tests/test_encoding_frame.py +0 -0
- {blochsimulator-2.9.0 → blochsimulator-2.9.2}/tests/test_export.py +0 -0
- {blochsimulator-2.9.0 → blochsimulator-2.9.2}/tests/test_export_simple.py +0 -0
- {blochsimulator-2.9.0 → blochsimulator-2.9.2}/tests/test_flash_flip_angle_sweep.py +0 -0
- {blochsimulator-2.9.0 → blochsimulator-2.9.2}/tests/test_free_mode_sampling.py +0 -0
- {blochsimulator-2.9.0 → blochsimulator-2.9.2}/tests/test_frequency_offsets.py +0 -0
- {blochsimulator-2.9.0 → blochsimulator-2.9.2}/tests/test_input_shapes.py +0 -0
- {blochsimulator-2.9.0 → blochsimulator-2.9.2}/tests/test_kernel_capabilities.py +0 -0
- {blochsimulator-2.9.0 → blochsimulator-2.9.2}/tests/test_memory_limits.py +0 -0
- {blochsimulator-2.9.0 → blochsimulator-2.9.2}/tests/test_metabolite_excitation_plan.py +0 -0
- {blochsimulator-2.9.0 → blochsimulator-2.9.2}/tests/test_metabolite_presets.py +0 -0
- {blochsimulator-2.9.0 → blochsimulator-2.9.2}/tests/test_notebook_examples.py +0 -0
- {blochsimulator-2.9.0 → blochsimulator-2.9.2}/tests/test_numerical_contracts.py +0 -0
- {blochsimulator-2.9.0 → blochsimulator-2.9.2}/tests/test_plot_interaction.py +0 -0
- {blochsimulator-2.9.0 → blochsimulator-2.9.2}/tests/test_probe_frequency_tracking.py +0 -0
- {blochsimulator-2.9.0 → blochsimulator-2.9.2}/tests/test_project_explorer.py +0 -0
- {blochsimulator-2.9.0 → blochsimulator-2.9.2}/tests/test_project_io.py +0 -0
- {blochsimulator-2.9.0 → blochsimulator-2.9.2}/tests/test_project_naming.py +0 -0
- {blochsimulator-2.9.0 → blochsimulator-2.9.2}/tests/test_pulseq_import.py +0 -0
- {blochsimulator-2.9.0 → blochsimulator-2.9.2}/tests/test_rf_pulses.py +0 -0
- {blochsimulator-2.9.0 → blochsimulator-2.9.2}/tests/test_scanner_settings.py +0 -0
- {blochsimulator-2.9.0 → blochsimulator-2.9.2}/tests/test_sequence_convergence_suite.py +0 -0
- {blochsimulator-2.9.0 → blochsimulator-2.9.2}/tests/test_sequence_reference.py +0 -0
- {blochsimulator-2.9.0 → blochsimulator-2.9.2}/tests/test_slice_explorer_memory.py +0 -0
- {blochsimulator-2.9.0 → blochsimulator-2.9.2}/tests/test_spatial_magnetization_viewer.py +0 -0
- {blochsimulator-2.9.0 → blochsimulator-2.9.2}/tests/test_spectral_selective_3d_bssfp.py +0 -0
- {blochsimulator-2.9.0 → blochsimulator-2.9.2}/tests/test_spectral_spatial_schedule.py +0 -0
- {blochsimulator-2.9.0 → blochsimulator-2.9.2}/tests/test_spinbox_wheel.py +0 -0
- {blochsimulator-2.9.0 → blochsimulator-2.9.2}/tests/test_spoiler_train_analysis.py +0 -0
- {blochsimulator-2.9.0 → blochsimulator-2.9.2}/tests/test_spoiling_validation.py +0 -0
- {blochsimulator-2.9.0 → blochsimulator-2.9.2}/tests/test_timestep_convergence.py +0 -0
- {blochsimulator-2.9.0 → blochsimulator-2.9.2}/tests/test_variable_flip_angle.py +0 -0
- {blochsimulator-2.9.0 → blochsimulator-2.9.2}/tests/test_visualization_export.py +0 -0
|
@@ -6,6 +6,245 @@ The project follows [Semantic Versioning](https://semver.org/).
|
|
|
6
6
|
|
|
7
7
|
## [Unreleased]
|
|
8
8
|
|
|
9
|
+
## [2.9.2] - 2026-10-22
|
|
10
|
+
|
|
11
|
+
### Added
|
|
12
|
+
|
|
13
|
+
- Receiver noise calibration and SNR budget with a reference scan model
|
|
14
|
+
(saturation, T2* decay, coil fields) and loading of measured FID and noise
|
|
15
|
+
scans.
|
|
16
|
+
- Reconstruction Explorer: larger layout, geometry sections, designer starting
|
|
17
|
+
from a default sphere, voxel Spectrum/FID/time-course view.
|
|
18
|
+
- Geometry tab: live preview from the form, ETA and contrast, draggable FOV and
|
|
19
|
+
slice package, read/phase FOV offsets for all generated sequences.
|
|
20
|
+
- Free Mode: repetitions, global B1/gradient field arrows, gradient integral
|
|
21
|
+
of extra lobes, Labels checkbox in the 3D vector view.
|
|
22
|
+
- Dynamic simulations on the native RF raster.
|
|
23
|
+
|
|
24
|
+
### Changed
|
|
25
|
+
|
|
26
|
+
- The RF pulse library ships as package data.
|
|
27
|
+
|
|
28
|
+
### Fixed
|
|
29
|
+
|
|
30
|
+
- Mouse designer polarization for legacy values and rebased nuclei.
|
|
31
|
+
- Simulation ETA, AHP library pulse amplitude units, decimal pulse durations
|
|
32
|
+
in amp/phase file names, CustomPulse duration/flip angle on resampling.
|
|
33
|
+
|
|
34
|
+
### Added
|
|
35
|
+
|
|
36
|
+
- The Mouse Phantom Designer accepts absolute polarization in percent, with
|
|
37
|
+
the thermal multiple shown alongside it using nucleus, B0 and a saved
|
|
38
|
+
temperature; mouse injections use mM × µl with a derived µmol dose and
|
|
39
|
+
polarized amount, and legacy dose-only files retain their amount without an
|
|
40
|
+
inferred recipe. The spectral Phantom Designer keeps "× thermal" and gains
|
|
41
|
+
a sample temperature with the thermal polarization it stands for. Calibrated
|
|
42
|
+
noise and physical signal display use the phantom's explicit temperature
|
|
43
|
+
when available.
|
|
44
|
+
- Settings → Interface offers persistent Sequence signal units: physical
|
|
45
|
+
fully polarized amounts (mol with SI prefixes, by default) or SNR units
|
|
46
|
+
(noise σ = 1 per quadrature). Existing results redraw immediately across
|
|
47
|
+
signal, Cartesian frame/volume, CSI and split views; spiral images use a
|
|
48
|
+
labelled per-frame noise estimate. The reference FID follows SNR units with
|
|
49
|
+
±1 noise lines. Missing calibration/noise metadata falls back explicitly to
|
|
50
|
+
simulation units; live previews retain simulation units.
|
|
51
|
+
- Sequence Mode receiver noise from a relative SNR or a `ReceiverCalibration`
|
|
52
|
+
from a measured phantom FID (concentration in mM, volume in ml, averages,
|
|
53
|
+
bandwidth, flip angle, enrichment, temperatures and a loading noise factor),
|
|
54
|
+
reproducible seeds, and new realizations without rerunning Bloch
|
|
55
|
+
simulation. Relative SNR is the single-scan SNR of the ideal 90° FID of the
|
|
56
|
+
whole object (initial magnetization plus any delivered bolus dose) at a
|
|
57
|
+
reference bandwidth, so it is independent of grid and signal weighting; runs
|
|
58
|
+
record that amplitude as `receiver_acquisition["ideal_fid_amplitude"]`.
|
|
59
|
+
Noise scales with √(bandwidth) per ADC event; calibrated noise also with
|
|
60
|
+
√(averages) of the reference scan. Projects and result exports retain the
|
|
61
|
+
clean ADC stream and receiver settings.
|
|
62
|
+
- `units.thermal_polarization(nucleus, field_strength_t, temperature_k)`
|
|
63
|
+
returns the Boltzmann polarization for spin-1/2 and higher-spin nuclei.
|
|
64
|
+
- Receiver / Noise has its own tab between Phantom + B1 and Simulations with
|
|
65
|
+
an SNR budget instead of example images: reference phantom (nuclei,
|
|
66
|
+
polarization, sensitivity per µmol), ideal whole-object FID SNR, SNR per
|
|
67
|
+
readout bandwidth, image-voxel shares of the object and, after a run, the
|
|
68
|
+
matched-filter SNR (also per species) with a sum-rule estimate for the
|
|
69
|
+
brightest voxel. A reference FID draws the setting with ±σ. Entered
|
|
70
|
+
calibration values are previewed before they are set.
|
|
71
|
+
- The relative SNR and measured noise std support adaptive spin-box arrows and
|
|
72
|
+
scientific notation.
|
|
73
|
+
- An optional reference scan model in the receiver calibration describes how
|
|
74
|
+
the phantom FID was measured: T1 saturation from TR, dummy scans and
|
|
75
|
+
averages, T2* decay until the measured point, and the B1 workspace coil
|
|
76
|
+
sampled over a sphere or cylinder at the phantom position. Its amplitude per
|
|
77
|
+
ideal 90° FID (`ReceiverCalibration.signal_efficiency`, from
|
|
78
|
+
`reference_signal_efficiency`) replaces sin α, so a saturated, decayed or
|
|
79
|
+
off-centre reference no longer reads as lower receiver sensitivity. The SNR
|
|
80
|
+
budget lists the factor and its inputs; runs reject a coil-dependent
|
|
81
|
+
calibration for an object without B1 maps.
|
|
82
|
+
- **Load FID…** and **Load noise scan…** fill the receiver calibration from
|
|
83
|
+
measured data. They read ParaVision 1-D raw data (`fid` or `rawdata.job0`
|
|
84
|
+
with `acqp`, integer or float, either byte order) or complex arrays
|
|
85
|
+
(`.npy`, `.txt`, `.csv`, `.dat`). The FID amplitude is extrapolated through
|
|
86
|
+
the digital-filter group delay with T2*. The noise std comes from a
|
|
87
|
+
matching 0° noise scan (same NA, receiver gain and bandwidth) or the FID
|
|
88
|
+
tail. Averages, bandwidth, flip angle, TR, dummy scans and the amplitude
|
|
89
|
+
delay come from the scan parameters, and warnings flag a non-white tail or
|
|
90
|
+
low SNR (`sequence.measured_fid`). **Set calibration** refuses a loaded FID
|
|
91
|
+
of another nucleus or field strength.
|
|
92
|
+
- The Geometry tab colours the object by the phantom property with the
|
|
93
|
+
largest spatial differences: anatomy labels or dominant species regions
|
|
94
|
+
first, otherwise the widest map (concentration, T1/T2, kPL, delivery,
|
|
95
|
+
shifts, B0, ...). A selector overrides the automatic choice and the summary
|
|
96
|
+
shows a legend.
|
|
97
|
+
- The Geometry tab follows FOV, matrix and slice edits in the sequence form
|
|
98
|
+
without generating the sequence; the last generated placement stays as a
|
|
99
|
+
dotted outline. A notice says that timing and k-space are not regenerated
|
|
100
|
+
yet and offers to generate the sequence.
|
|
101
|
+
- Generated FLASH takes read and phase offsets that move the FOV centre in
|
|
102
|
+
the sequence itself: the ADC frequency offset shifts the read FOV and the
|
|
103
|
+
receiver phase per phase-encoding step shifts the phase FOV, so the
|
|
104
|
+
exported `.seq` carries them too (`ReadOffset`/`PhaseOffset` definitions).
|
|
105
|
+
Image coordinates, DICOM, NIfTI and Bruker export, the Geometry tab and its
|
|
106
|
+
coverage notes follow the shifted centre.
|
|
107
|
+
- EPI, EPSI, CSI, 3D bSSFP, SS-bSSFP and ME-bSSFP take read and phase offsets
|
|
108
|
+
the same way: Cartesian readouts shift the ADC frequency (reversed lobes
|
|
109
|
+
with the opposite sign) and the receiver phase, CSI ramps the phase of its
|
|
110
|
+
encoding steps. Spiral and 3D radial readouts store the offsets with
|
|
111
|
+
`OffsetEncoding = reconstruction`; their reconstruction applies the
|
|
112
|
+
matching k-space phase ramp before gridding. Every sequence form has Read
|
|
113
|
+
offset and Phase offset fields, and the Geometry tab previews them.
|
|
114
|
+
- The FOV and slice package can be dragged in the Geometry tab views: the
|
|
115
|
+
drag maps to read, phase and slice offsets through the sequence frame,
|
|
116
|
+
snaps to 0.1 mm, shows the shift while dragging and fills the sequence form
|
|
117
|
+
(the live preview follows). Shift keeps the largest axis only, a right
|
|
118
|
+
click cancels, and dragging outside the FOV still pans the view.
|
|
119
|
+
|
|
120
|
+
### Changed
|
|
121
|
+
|
|
122
|
+
- Sequence-mode ETA now uses cumulative post-compilation throughput, preventing
|
|
123
|
+
individual uneven work chunks from causing abrupt remaining-time changes.
|
|
124
|
+
|
|
125
|
+
### Fixed
|
|
126
|
+
|
|
127
|
+
- 3D radial image coordinates and exported positions sat half a voxel off:
|
|
128
|
+
voxel N // 2 holds the FOV centre, as the reconstruction places it.
|
|
129
|
+
- The Sequence-mode ETA counts completed voxels instead of a misscaled chunk
|
|
130
|
+
count and gets an early run rate from a small first chunk, so it no longer
|
|
131
|
+
jumps or stalls. Progress, elapsed and remaining time share one line.
|
|
132
|
+
- `CustomPulse.compile` keeps the duration and flip angle of loaded pulses on
|
|
133
|
+
any raster (a 1 ms hard pulse resampled to 3 us rotated by 89.4 instead of
|
|
134
|
+
90 deg) and resamples custom gradients together with B1.
|
|
135
|
+
- Dynamic sequence simulations with `simulation_timestep_s=None` (native RF
|
|
136
|
+
raster) no longer fail while writing the result metadata.
|
|
137
|
+
- Library pulse names such as `load_pulse("bruker/13C_Ultimate_SPSP_Pulse_QuEMRT")`
|
|
138
|
+
and `CustomPulse("AHP_5ms_Hsn")` resolve in source checkouts and pip
|
|
139
|
+
installs. The `.exc`/`.dat` pulses now ship as package data; before, only
|
|
140
|
+
the PyInstaller app contained them.
|
|
141
|
+
- `load_amp_phase_dat` reads decimal durations from file names: `pulse_2.5ms.dat`
|
|
142
|
+
lasted 5 ms and `HS_0.25MS.dat` 25 ms. The GUI import dialog always passes
|
|
143
|
+
its own duration and was not affected.
|
|
144
|
+
- The library pulse `AHP_5ms_Hsn` stores its amplitudes in percent and now
|
|
145
|
+
peaks at `max_b1_gauss` (1 G) instead of 100 G, by name and by file path.
|
|
146
|
+
A JSON file next to an amp/phase pulse (`AHP_5ms_Hsn.json`) records its
|
|
147
|
+
import options; `load_pulse_from_file` uses them for options it is not
|
|
148
|
+
given. The GUI import dialog asks for the unit and rescales to the flip
|
|
149
|
+
angle, so it was not affected.
|
|
150
|
+
|
|
151
|
+
## [2.9.1] - 2026-10-21
|
|
152
|
+
|
|
153
|
+
### Added
|
|
154
|
+
|
|
155
|
+
- Sequence results export as Bruker ParaVision studies
|
|
156
|
+
(`export_bruker_dataset`): `subject`, scan folder with `acqp`, `method`,
|
|
157
|
+
`fid` and/or `rawdata.job0`, and reconstructed `pdata/1` (`2dseq`,
|
|
158
|
+
`visu_pars`, `reco`, ...). ParaVision 7.0.0 (default) and 6.0.1 are checked
|
|
159
|
+
against scanner data, 5.1 and 360 V3.6 against public example datasets
|
|
160
|
+
(BrukerAPI test data, PV360_StdData). The method
|
|
161
|
+
(FLASH, MGE, EPI, CSI, SPIRAL, NSPECT) is suggested from the acquisition, a new
|
|
162
|
+
study is created by default, and a scan can be appended to an existing study.
|
|
163
|
+
- Real ParaVision datasets can serve as templates (`load_bruker_template`):
|
|
164
|
+
owner, operator, station, subject, study, coils and reference frequencies
|
|
165
|
+
flow into the exported study and can be edited or anonymized
|
|
166
|
+
(`anonymize_template`) before export.
|
|
167
|
+
- DICOM export (`export_dicom`, MR Image Storage, one file per image) with
|
|
168
|
+
scanner geometry, echo/repetition indices, separate pool and phase series,
|
|
169
|
+
and CSI metabolite maps. NIfTI export (`export_nifti`) writes one RAS-oriented
|
|
170
|
+
volume per series with a BIDS-style JSON sidecar. Both share the subject and
|
|
171
|
+
study of a Bruker export from the same run and need the new `export` extra
|
|
172
|
+
(`pip install blochsimulator[export]` for pydicom and nibabel).
|
|
173
|
+
- One export dialog for sequence results (File → Export and the sequence
|
|
174
|
+
workspace) selects NetCDF, notebook, HDF5, NPZ, Bruker, DICOM and NIfTI
|
|
175
|
+
together, with ParaVision version, raw files, method, scan name, geometry,
|
|
176
|
+
template preview/editing, anonymization and new-study/append options. Raw
|
|
177
|
+
data are stored complex-conjugated by default, like measured ParaVision data
|
|
178
|
+
(`RECO_qopts = COMPLEX_CONJUGATE`); the option can be switched off.
|
|
179
|
+
- Free Mode samples positions along a line (x, y or z) or on an xy, xz or yz
|
|
180
|
+
grid. The Spatial tab shows planes as |Mxy|, phase and Mz maps with
|
|
181
|
+
row/column profiles, the 3D view lays positions out as rows and floor
|
|
182
|
+
lattices, and sweeps, notebooks and spatial exports record the geometry.
|
|
183
|
+
- Free Mode sequence design has a slice-axis selector, extra gradient lobes on
|
|
184
|
+
any axis and an internal FID sequence. The sequence diagram shows one lane
|
|
185
|
+
per channel on a shared time axis, and the preview has an overview strip with
|
|
186
|
+
optional timing markers.
|
|
187
|
+
- Dynamic phantoms gain per-voxel washout (clearance, renal excretion into
|
|
188
|
+
ureters and bladder) and voxelwise per-pool chemical-shift maps (ppm) with
|
|
189
|
+
co-labelled pyruvate inflow. The mouse phantom uses them for urinary
|
|
190
|
+
transport and pH-dependent shifts.
|
|
191
|
+
- The Sequence workspace falls back to an on-resonance default sphere per
|
|
192
|
+
nucleus when no phantom is loaded and shows a Geometry tab (object, simulated
|
|
193
|
+
grid, FOV, slice package) before the run. The parameter loop can sweep
|
|
194
|
+
phantom parameters.
|
|
195
|
+
- The spin probe offers hyperpolarized or thermal longitudinal equilibrium and
|
|
196
|
+
declared ideal spoiling.
|
|
197
|
+
|
|
198
|
+
### Changed
|
|
199
|
+
|
|
200
|
+
- The spin-major kernel (executor API 5) runs two to six pools with delayed
|
|
201
|
+
per-voxel inflow, caches RF propagators for N-pool phantoms and RF-spoiling
|
|
202
|
+
phase, supports per-pool frequency offsets and folds washout into its cached
|
|
203
|
+
coefficients. Repeated RF pulses compile identically in a pulse-local frame,
|
|
204
|
+
so all repeats share one cache key. The three-pool `dyn_epsi_test` run drops
|
|
205
|
+
from ~115 s to ~84 s, and the mouse washout case is ~18x faster than the
|
|
206
|
+
optimized kernel. The native multi-pool plan applies washout too.
|
|
207
|
+
- FLASH is the default sequence and the CSI matrix defaults to 16x16. The mouse
|
|
208
|
+
phantom defaults to a 32x32x105 mm FOV.
|
|
209
|
+
- Mouse perfusion pools decay with T2* by default (switchable to T2), and the
|
|
210
|
+
injection is specified by concentration and volume.
|
|
211
|
+
- The phantom designer shows inherited peak values, polarization as "x thermal"
|
|
212
|
+
and has a dedicated B0 tab.
|
|
213
|
+
- EPSI / MGE parameters now resolve against each other as you edit them. The
|
|
214
|
+
sampling bandwidth snaps to the nearest ADC/RF-raster-compatible value
|
|
215
|
+
(fixing the ADC-delay raster error at e.g. 150 kHz), and echo spacing, TE1,
|
|
216
|
+
TR and the measurement interval are raised when a change pushes them below
|
|
217
|
+
their shortest possible value. Values are never lowered automatically, and a
|
|
218
|
+
status line under "Timing" lists the adjustments and the current minima.
|
|
219
|
+
`make_pulseq_epsi_mge(timing_only=True)` returns these limits without
|
|
220
|
+
building a sequence.
|
|
221
|
+
- FLASH uses the same automatic timing resolution: bandwidth, TE, TR and the
|
|
222
|
+
acquisition interval are raised to the shortest feasible values (per RF pulse
|
|
223
|
+
of an SPSP schedule), with a status line under the timing fields.
|
|
224
|
+
`make_pulseq_flash(timing_only=True)` returns the limits.
|
|
225
|
+
- Cartesian EPI resolves bandwidth, TE and the acquisition interval the same way
|
|
226
|
+
(`make_pulseq_epi(timing_only=True)` returns the limits); spiral is unchanged.
|
|
227
|
+
- The timing fields that are resolved automatically (bandwidth, TE, TR, echo
|
|
228
|
+
spacing, acquisition interval) apply typed values on Enter or focus loss, so a
|
|
229
|
+
half-typed number such as the "3" of "3000" is never corrected.
|
|
230
|
+
- The sampling-bandwidth field of FLASH and Cartesian EPI is now rounded up when
|
|
231
|
+
it shows the bandwidth the builder achieved, so repeated generation no longer
|
|
232
|
+
lowers the bandwidth step by step (150 → 142.9 → 133.3 → 125 kHz).
|
|
233
|
+
|
|
234
|
+
### Fixed
|
|
235
|
+
|
|
236
|
+
- RF designer flip angles are exact (a 90 deg hard pulse no longer rotates by
|
|
237
|
+
90.9 deg), and spin echo, inversion recovery and similar builders keep pulse
|
|
238
|
+
area when resampling custom pulses.
|
|
239
|
+
- bSSFP builders use the realised alpha/2 spacings, lock multi-echo receiver
|
|
240
|
+
phase to the exciting pulse and centre radial echo trains. SSFP startup
|
|
241
|
+
spacing follows the Pulseq centre-to-centre convention.
|
|
242
|
+
- Hyperpolarized spin probes relax toward the thermal level from above instead
|
|
243
|
+
of toward zero.
|
|
244
|
+
- The sequence preview can no longer be zoomed or panned before time 0.
|
|
245
|
+
- SS-bSSFP receiver/phantom matching refreshes when the reference or field
|
|
246
|
+
changes.
|
|
247
|
+
|
|
9
248
|
## [2.9.0] - 2026-10-17
|
|
10
249
|
|
|
11
250
|
### Added
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
Metadata-Version: 2.4
|
|
2
2
|
Name: blochsimulator
|
|
3
|
-
Version: 2.9.
|
|
3
|
+
Version: 2.9.2
|
|
4
4
|
Summary: High-performance Bloch equation simulator for MRI
|
|
5
5
|
Author: Luca Nagel
|
|
6
6
|
License: GPL-3.0-only
|
|
@@ -28,6 +28,9 @@ Requires-Dist: pyqtgraph>=0.12.0; extra == "gui"
|
|
|
28
28
|
Requires-Dist: PyOpenGL>=3.1.0; extra == "gui"
|
|
29
29
|
Provides-Extra: pulseq
|
|
30
30
|
Requires-Dist: pypulseq<1.5.1,>=1.5.0; extra == "pulseq"
|
|
31
|
+
Provides-Extra: export
|
|
32
|
+
Requires-Dist: pydicom>=2.4; extra == "export"
|
|
33
|
+
Requires-Dist: nibabel>=5.0; extra == "export"
|
|
31
34
|
Dynamic: license-file
|
|
32
35
|
|
|
33
36
|
# Bloch Equation Simulator for Python
|
|
@@ -87,6 +90,14 @@ A mode that lets you load, generate and simulate [Pulseq
|
|
|
87
90
|
|
|
88
91
|
*Features:*
|
|
89
92
|
|
|
93
|
+
- **Internal FID** with configurable Block, Sinc, Gaussian, SLR, or imported
|
|
94
|
+
RF Designer pulses, flip angle, RF duration, phase and carrier offset.
|
|
95
|
+
Set the complex FID points per repetition, sampling bandwidth, ADC delay,
|
|
96
|
+
receiver offset, repetition count and TR. TR is measured from RF start to
|
|
97
|
+
RF start; **Shortest possible** fits the pulse, delay and complete FID.
|
|
98
|
+
Magnetization evolves continuously between repetitions, without resetting,
|
|
99
|
+
averaging or spoiling. The sequence ends after the final FID. Use
|
|
100
|
+
**Generate sequence** or **Live preview** to refresh the timeline.
|
|
90
101
|
- **RF + Slice Selection** for full 3D excitation volumes immediately after
|
|
91
102
|
a pulse and its slice gradient, with optional rephasing and direct
|
|
92
103
|
$|M_{xy}|$, $M_z$, and phase inspection. See
|
|
@@ -136,6 +147,36 @@ The time-resolved bevahiour of spins during and after RF Pulse can be visualized
|
|
|
136
147
|
|
|
137
148
|
**Sequence Mode**
|
|
138
149
|
|
|
150
|
+
- Mouse Phantom Designer polarization inputs use absolute percent with the
|
|
151
|
+
thermal multiple alongside them, based on nucleus, B0 and temperature. Mouse
|
|
152
|
+
injections use mM × µl and show the resulting µmol dose and fully polarized
|
|
153
|
+
equivalent. New injections start at 80 mM × 250 µl (20 µmol) and
|
|
154
|
+
10000 × thermal, 5.8 % at 7 T and 37 °C; older files retain their original
|
|
155
|
+
dose and relative-polarization values.
|
|
156
|
+
The spectral Phantom Designer keeps × thermal and shows the thermal
|
|
157
|
+
polarization at its sample temperature.
|
|
158
|
+
- **Receiver / Noise** adds reproducible complex noise from a relative SNR
|
|
159
|
+
(single-scan SNR of the ideal 90° FID of the whole object, including any
|
|
160
|
+
delivered bolus) or a calibration from a measured phantom FID: amplitude,
|
|
161
|
+
noise std, averages, bandwidth, flip angle, concentration (mM), volume (ml),
|
|
162
|
+
enrichment and temperature. Noise follows each ADC event's bandwidth, so a
|
|
163
|
+
thermal phantom scan predicts e.g. hyperpolarized in-vivo SNR. An optional
|
|
164
|
+
reference scan model corrects the calibration for T1 saturation, T2* decay
|
|
165
|
+
and the B1 workspace coil at the phantom position. **Load FID…** and
|
|
166
|
+
**Load noise scan…** read the ParaVision raw data or complex arrays of the
|
|
167
|
+
phantom FID and 0° noise scan directly. Its dedicated
|
|
168
|
+
tab between **Phantom + B1** and **Simulations** shows an SNR budget from
|
|
169
|
+
the receiver setting through the whole-object FID and each readout
|
|
170
|
+
bandwidth to the image voxels of the current object and last run. Clean ADC
|
|
171
|
+
data and noise settings are preserved in projects and result exports.
|
|
172
|
+
**Settings → Interface → Signal units** switches the current Sequence
|
|
173
|
+
plots between physical amounts (mol with automatic SI prefixes, calibrated
|
|
174
|
+
runs) and SNR units (noise σ = 1 per complex quadrature), without rerunning
|
|
175
|
+
the simulation. Cartesian/CSI FFTs preserve that noise normalization;
|
|
176
|
+
spiral images use a labelled estimate from their noise realization. Runs
|
|
177
|
+
without the required calibration or noise metadata show simulation units.
|
|
178
|
+
See [receiver calibration](docs/sequence_simulation_architecture.md#receiver-noise-and-phantom-calibration).
|
|
179
|
+
|
|
139
180
|
Loaded and generated sequences can be inspected in a sequence viewer. A 3D phantom design viewer in addition to a 3D B1 design viewer are provided.
|
|
140
181
|
|
|
141
182
|
- Experimental **export of simulated acquisitions as Bruker raw datasets**,
|
|
@@ -55,6 +55,14 @@ A mode that lets you load, generate and simulate [Pulseq
|
|
|
55
55
|
|
|
56
56
|
*Features:*
|
|
57
57
|
|
|
58
|
+
- **Internal FID** with configurable Block, Sinc, Gaussian, SLR, or imported
|
|
59
|
+
RF Designer pulses, flip angle, RF duration, phase and carrier offset.
|
|
60
|
+
Set the complex FID points per repetition, sampling bandwidth, ADC delay,
|
|
61
|
+
receiver offset, repetition count and TR. TR is measured from RF start to
|
|
62
|
+
RF start; **Shortest possible** fits the pulse, delay and complete FID.
|
|
63
|
+
Magnetization evolves continuously between repetitions, without resetting,
|
|
64
|
+
averaging or spoiling. The sequence ends after the final FID. Use
|
|
65
|
+
**Generate sequence** or **Live preview** to refresh the timeline.
|
|
58
66
|
- **RF + Slice Selection** for full 3D excitation volumes immediately after
|
|
59
67
|
a pulse and its slice gradient, with optional rephasing and direct
|
|
60
68
|
$|M_{xy}|$, $M_z$, and phase inspection. See
|
|
@@ -104,6 +112,36 @@ The time-resolved bevahiour of spins during and after RF Pulse can be visualized
|
|
|
104
112
|
|
|
105
113
|
**Sequence Mode**
|
|
106
114
|
|
|
115
|
+
- Mouse Phantom Designer polarization inputs use absolute percent with the
|
|
116
|
+
thermal multiple alongside them, based on nucleus, B0 and temperature. Mouse
|
|
117
|
+
injections use mM × µl and show the resulting µmol dose and fully polarized
|
|
118
|
+
equivalent. New injections start at 80 mM × 250 µl (20 µmol) and
|
|
119
|
+
10000 × thermal, 5.8 % at 7 T and 37 °C; older files retain their original
|
|
120
|
+
dose and relative-polarization values.
|
|
121
|
+
The spectral Phantom Designer keeps × thermal and shows the thermal
|
|
122
|
+
polarization at its sample temperature.
|
|
123
|
+
- **Receiver / Noise** adds reproducible complex noise from a relative SNR
|
|
124
|
+
(single-scan SNR of the ideal 90° FID of the whole object, including any
|
|
125
|
+
delivered bolus) or a calibration from a measured phantom FID: amplitude,
|
|
126
|
+
noise std, averages, bandwidth, flip angle, concentration (mM), volume (ml),
|
|
127
|
+
enrichment and temperature. Noise follows each ADC event's bandwidth, so a
|
|
128
|
+
thermal phantom scan predicts e.g. hyperpolarized in-vivo SNR. An optional
|
|
129
|
+
reference scan model corrects the calibration for T1 saturation, T2* decay
|
|
130
|
+
and the B1 workspace coil at the phantom position. **Load FID…** and
|
|
131
|
+
**Load noise scan…** read the ParaVision raw data or complex arrays of the
|
|
132
|
+
phantom FID and 0° noise scan directly. Its dedicated
|
|
133
|
+
tab between **Phantom + B1** and **Simulations** shows an SNR budget from
|
|
134
|
+
the receiver setting through the whole-object FID and each readout
|
|
135
|
+
bandwidth to the image voxels of the current object and last run. Clean ADC
|
|
136
|
+
data and noise settings are preserved in projects and result exports.
|
|
137
|
+
**Settings → Interface → Signal units** switches the current Sequence
|
|
138
|
+
plots between physical amounts (mol with automatic SI prefixes, calibrated
|
|
139
|
+
runs) and SNR units (noise σ = 1 per complex quadrature), without rerunning
|
|
140
|
+
the simulation. Cartesian/CSI FFTs preserve that noise normalization;
|
|
141
|
+
spiral images use a labelled estimate from their noise realization. Runs
|
|
142
|
+
without the required calibration or noise metadata show simulation units.
|
|
143
|
+
See [receiver calibration](docs/sequence_simulation_architecture.md#receiver-noise-and-phantom-calibration).
|
|
144
|
+
|
|
107
145
|
Loaded and generated sequences can be inspected in a sequence viewer. A 3D phantom design viewer in addition to a 3D B1 design viewer are provided.
|
|
108
146
|
|
|
109
147
|
- Experimental **export of simulated acquisitions as Bruker raw datasets**,
|
|
@@ -12,11 +12,17 @@ packages = [
|
|
|
12
12
|
package-dir = {"" = "src"}
|
|
13
13
|
|
|
14
14
|
[tool.setuptools.package-data]
|
|
15
|
-
blochsimulator = [
|
|
15
|
+
blochsimulator = [
|
|
16
|
+
"rfpulses/*.txt",
|
|
17
|
+
"rfpulses/*.dat",
|
|
18
|
+
"rfpulses/*.json",
|
|
19
|
+
"rfpulses/*.exc",
|
|
20
|
+
"rfpulses/bruker/*.exc",
|
|
21
|
+
]
|
|
16
22
|
|
|
17
23
|
[project]
|
|
18
24
|
name = "blochsimulator"
|
|
19
|
-
version = "2.9.
|
|
25
|
+
version = "2.9.2"
|
|
20
26
|
description = "High-performance Bloch equation simulator for MRI"
|
|
21
27
|
readme = "README.md"
|
|
22
28
|
requires-python = ">=3.9"
|
|
@@ -52,6 +58,10 @@ gui = [
|
|
|
52
58
|
pulseq = [
|
|
53
59
|
"pypulseq>=1.5.0,<1.5.1",
|
|
54
60
|
]
|
|
61
|
+
export = [
|
|
62
|
+
"pydicom>=2.4",
|
|
63
|
+
"nibabel>=5.0",
|
|
64
|
+
]
|
|
55
65
|
|
|
56
66
|
[project.urls]
|
|
57
67
|
Homepage = "https://github.com/LucaNagel/bloch_sim_gui"
|
|
@@ -22,6 +22,8 @@ h5py>=3.0.0 # For saving/loading results
|
|
|
22
22
|
numba>=0.53.0 # For JIT compilation (optional optimization)
|
|
23
23
|
jupyterlab>=3.0.0 # For interactive notebooks
|
|
24
24
|
pypulseq>=1.5.0,<1.5.1 # Pulseq .seq import in the desktop app
|
|
25
|
+
pydicom>=2.4 # DICOM image export
|
|
26
|
+
nibabel>=5.0 # NIfTI image export
|
|
25
27
|
|
|
26
28
|
# For GPU acceleration (optional)
|
|
27
29
|
# cupy>=9.0.0 # Uncomment if you have CUDA available
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"amplitude_unit": "percent"}
|
|
@@ -354,8 +354,16 @@ class B1Field:
|
|
|
354
354
|
or ("Uniform B1+" if normalized_kind == "transmit" else "Uniform B1−"),
|
|
355
355
|
)
|
|
356
356
|
|
|
357
|
-
def sample_world(
|
|
358
|
-
|
|
357
|
+
def sample_world(
|
|
358
|
+
self,
|
|
359
|
+
positions_m: np.ndarray,
|
|
360
|
+
channels: Optional[Sequence[int]] = None,
|
|
361
|
+
) -> np.ndarray:
|
|
362
|
+
"""Interpolate channels at object-space positions in metres.
|
|
363
|
+
|
|
364
|
+
All channels are returned unless ``channels`` selects a subset; the
|
|
365
|
+
result has shape ``(channel, position)``.
|
|
366
|
+
"""
|
|
359
367
|
positions = np.asarray(positions_m, dtype=float)
|
|
360
368
|
if positions.ndim != 2 or positions.shape[1] != 3:
|
|
361
369
|
raise ValueError("positions_m must have shape (position, 3)")
|
|
@@ -378,8 +386,14 @@ class B1Field:
|
|
|
378
386
|
)
|
|
379
387
|
coordinates.append(coordinate)
|
|
380
388
|
coordinates = np.asarray(coordinates)
|
|
381
|
-
|
|
382
|
-
|
|
389
|
+
selected = (
|
|
390
|
+
range(self.n_channels)
|
|
391
|
+
if channels is None
|
|
392
|
+
else [int(channel) for channel in channels]
|
|
393
|
+
)
|
|
394
|
+
sampled = np.empty((len(selected), positions.shape[0]), dtype=np.complex128)
|
|
395
|
+
for row, channel in enumerate(selected):
|
|
396
|
+
values = self.data[channel]
|
|
383
397
|
real = map_coordinates(
|
|
384
398
|
values.real,
|
|
385
399
|
coordinates,
|
|
@@ -396,7 +410,7 @@ class B1Field:
|
|
|
396
410
|
cval=0.0,
|
|
397
411
|
prefilter=False,
|
|
398
412
|
)
|
|
399
|
-
sampled[
|
|
413
|
+
sampled[row] = real + 1j * imag
|
|
400
414
|
return sampled
|
|
401
415
|
|
|
402
416
|
def resample_to_phantom(self, phantom) -> np.ndarray:
|
|
@@ -80,7 +80,9 @@ void blochsim_heterogeneous(
|
|
|
80
80
|
double *mx, double *my, double *mz,
|
|
81
81
|
int mode, int num_threads);
|
|
82
82
|
|
|
83
|
-
/* Streaming sequence simulation in canonical frequency units (Hz, Hz/m, m).
|
|
83
|
+
/* Streaming sequence simulation in canonical frequency units (Hz, Hz/m, m).
|
|
84
|
+
* T1 recovery relaxes Mz toward mz_equilibrium[spin]; pass NULL for the
|
|
85
|
+
* thermal equilibrium Mz = 1 (relative to proton density). */
|
|
84
86
|
int blochsim_sequence_streaming(
|
|
85
87
|
double *rf_real_hz, double *rf_imag_hz,
|
|
86
88
|
double *gx_hz_m, double *gy_hz_m, double *gz_hz_m,
|
|
@@ -90,6 +92,7 @@ int blochsim_sequence_streaming(
|
|
|
90
92
|
double *tx_real, double *tx_imag,
|
|
91
93
|
double *rx_real, double *rx_imag, int ncoils,
|
|
92
94
|
double *mx_init, double *my_init, double *mz_init, int nspins,
|
|
95
|
+
double *mz_equilibrium,
|
|
93
96
|
int *adc_state_indices, double *adc_demod_real, double *adc_demod_imag,
|
|
94
97
|
int nadc, int *checkpoint_state_indices, int ncheckpoints,
|
|
95
98
|
int *transverse_crush_state_indices, int ncrushes,
|
|
@@ -108,6 +111,7 @@ int blochsim_sequence_streaming_optimized(
|
|
|
108
111
|
double *tx_real, double *tx_imag,
|
|
109
112
|
double *rx_real, double *rx_imag, int ncoils,
|
|
110
113
|
double *mx_init, double *my_init, double *mz_init, int nspins,
|
|
114
|
+
double *mz_equilibrium,
|
|
111
115
|
int *adc_state_indices, double *adc_demod_real, double *adc_demod_imag,
|
|
112
116
|
int nadc, int *checkpoint_state_indices, int ncheckpoints,
|
|
113
117
|
int *transverse_crush_state_indices, int ncrushes,
|
|
@@ -736,6 +736,7 @@ static int blochsim_sequence_streaming_impl(
|
|
|
736
736
|
double *tx_real, double *tx_imag,
|
|
737
737
|
double *rx_real, double *rx_imag, int ncoils,
|
|
738
738
|
double *mx_init, double *my_init, double *mz_init, int nspins,
|
|
739
|
+
double *mz_equilibrium,
|
|
739
740
|
int *adc_state_indices, double *adc_demod_real, double *adc_demod_imag,
|
|
740
741
|
int nadc, int *checkpoint_state_indices, int ncheckpoints,
|
|
741
742
|
int *transverse_crush_state_indices, int ncrushes,
|
|
@@ -941,7 +942,11 @@ static int blochsim_sequence_streaming_impl(
|
|
|
941
942
|
: exp(-dt / t2_s[spin]);
|
|
942
943
|
magnetization[0] = rotated[0] * e2;
|
|
943
944
|
magnetization[1] = rotated[1] * e2;
|
|
944
|
-
|
|
945
|
+
/* The thermal branch keeps the historical expression unchanged so
|
|
946
|
+
* fast-math builds cannot reassociate default results. */
|
|
947
|
+
magnetization[2] = mz_equilibrium == NULL
|
|
948
|
+
? rotated[2] * e1 + (1.0 - e1)
|
|
949
|
+
: rotated[2] * e1 + mz_equilibrium[spin] * (1.0 - e1);
|
|
945
950
|
|
|
946
951
|
int state_index = interval + 1;
|
|
947
952
|
while (crush_cursor < ncrushes
|
|
@@ -1001,8 +1006,9 @@ static int blochsim_sequence_streaming_impl(
|
|
|
1001
1006
|
#define STREAMING_ARGUMENTS \
|
|
1002
1007
|
rf_real_hz, rf_imag_hz, gx_hz_m, gy_hz_m, gz_hz_m, dt_s, nintervals, \
|
|
1003
1008
|
t1_s, t2_s, df_hz, x_m, y_m, z_m, pd, tx_real, tx_imag, rx_real, \
|
|
1004
|
-
rx_imag, ncoils, mx_init, my_init, mz_init, nspins,
|
|
1005
|
-
adc_demod_real, adc_demod_imag, nadc,
|
|
1009
|
+
rx_imag, ncoils, mx_init, my_init, mz_init, nspins, mz_equilibrium, \
|
|
1010
|
+
adc_state_indices, adc_demod_real, adc_demod_imag, nadc, \
|
|
1011
|
+
checkpoint_state_indices, \
|
|
1006
1012
|
ncheckpoints, transverse_crush_state_indices, ncrushes, signal_real, \
|
|
1007
1013
|
signal_imag, mx_final, my_final, mz_final, \
|
|
1008
1014
|
mx_checkpoints, my_checkpoints, mz_checkpoints, num_threads
|
|
@@ -1017,6 +1023,7 @@ int name( \
|
|
|
1017
1023
|
double *tx_real, double *tx_imag, \
|
|
1018
1024
|
double *rx_real, double *rx_imag, int ncoils, \
|
|
1019
1025
|
double *mx_init, double *my_init, double *mz_init, int nspins, \
|
|
1026
|
+
double *mz_equilibrium, \
|
|
1020
1027
|
int *adc_state_indices, double *adc_demod_real, double *adc_demod_imag, \
|
|
1021
1028
|
int nadc, int *checkpoint_state_indices, int ncheckpoints, \
|
|
1022
1029
|
int *transverse_crush_state_indices, int ncrushes, \
|