blochsimulator 2.6.4__tar.gz → 2.7.0__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.6.4/src/blochsimulator.egg-info → blochsimulator-2.7.0}/PKG-INFO +13 -2
- {blochsimulator-2.6.4 → blochsimulator-2.7.0}/README.md +12 -1
- {blochsimulator-2.6.4 → blochsimulator-2.7.0}/pyproject.toml +1 -1
- {blochsimulator-2.6.4 → blochsimulator-2.7.0}/src/blochsimulator/__init__.py +12 -1
- {blochsimulator-2.6.4 → blochsimulator-2.7.0}/src/blochsimulator/b1_fields.py +20 -19
- {blochsimulator-2.6.4 → blochsimulator-2.7.0}/src/blochsimulator/bloch_wrapper.c +194 -194
- {blochsimulator-2.6.4 → blochsimulator-2.7.0}/src/blochsimulator/dynamic_bloch_wrapper.c +194 -194
- {blochsimulator-2.6.4 → blochsimulator-2.7.0}/src/blochsimulator/dynamic_metal_backend.py +55 -0
- {blochsimulator-2.6.4 → blochsimulator-2.7.0}/src/blochsimulator/dynamic_phantom.py +527 -102
- blochsimulator-2.7.0/src/blochsimulator/metabolite_presets.py +672 -0
- blochsimulator-2.7.0/src/blochsimulator/mouse_phantom.py +1019 -0
- {blochsimulator-2.6.4 → blochsimulator-2.7.0}/src/blochsimulator/notebook_exporter.py +1758 -379
- {blochsimulator-2.6.4 → blochsimulator-2.7.0}/src/blochsimulator/phantom_design.py +186 -1
- {blochsimulator-2.6.4 → blochsimulator-2.7.0}/src/blochsimulator/phantom_widget.py +61 -4
- {blochsimulator-2.6.4 → blochsimulator-2.7.0}/src/blochsimulator/project_io.py +5 -2
- {blochsimulator-2.6.4 → blochsimulator-2.7.0}/src/blochsimulator/pulse_loader.py +28 -4
- {blochsimulator-2.6.4 → blochsimulator-2.7.0}/src/blochsimulator/sequence/__init__.py +2 -0
- {blochsimulator-2.6.4 → blochsimulator-2.7.0}/src/blochsimulator/sequence/acquisition.py +1 -1
- {blochsimulator-2.6.4 → blochsimulator-2.7.0}/src/blochsimulator/sequence/advanced_bssfp_builders.py +22 -9
- {blochsimulator-2.6.4 → blochsimulator-2.7.0}/src/blochsimulator/sequence/pulseq_builders.py +557 -23
- {blochsimulator-2.6.4 → blochsimulator-2.7.0}/src/blochsimulator/sequence/result.py +165 -0
- {blochsimulator-2.6.4 → blochsimulator-2.7.0}/src/blochsimulator/sequence/rf_pulses.py +52 -28
- {blochsimulator-2.6.4 → blochsimulator-2.7.0}/src/blochsimulator/simulator.py +4 -4
- {blochsimulator-2.6.4 → blochsimulator-2.7.0}/src/blochsimulator/ui/b1_widgets.py +4 -1
- {blochsimulator-2.6.4 → blochsimulator-2.7.0}/src/blochsimulator/ui/dialogs.py +137 -9
- {blochsimulator-2.6.4 → blochsimulator-2.7.0}/src/blochsimulator/ui/main_window.py +98 -16
- blochsimulator-2.7.0/src/blochsimulator/ui/mouse_phantom_designer.py +854 -0
- {blochsimulator-2.6.4 → blochsimulator-2.7.0}/src/blochsimulator/ui/parameter_sweep.py +36 -14
- {blochsimulator-2.6.4 → blochsimulator-2.7.0}/src/blochsimulator/ui/phantom_designer.py +140 -16
- {blochsimulator-2.6.4 → blochsimulator-2.7.0}/src/blochsimulator/ui/probe_viewers.py +125 -18
- {blochsimulator-2.6.4 → blochsimulator-2.7.0}/src/blochsimulator/ui/reconstruction_explorer.py +25 -5
- {blochsimulator-2.6.4 → blochsimulator-2.7.0}/src/blochsimulator/ui/rf_pulse_designer.py +32 -24
- {blochsimulator-2.6.4 → blochsimulator-2.7.0}/src/blochsimulator/ui/sequence_designer.py +48 -19
- {blochsimulator-2.6.4 → blochsimulator-2.7.0}/src/blochsimulator/ui/sequence_simulation_widget.py +827 -63
- blochsimulator-2.7.0/src/blochsimulator/ui/styles.py +49 -0
- {blochsimulator-2.6.4 → blochsimulator-2.7.0}/src/blochsimulator/ui/volume_viewer.py +46 -0
- blochsimulator-2.7.0/src/blochsimulator/ui/widgets.py +205 -0
- {blochsimulator-2.6.4 → blochsimulator-2.7.0/src/blochsimulator.egg-info}/PKG-INFO +13 -2
- {blochsimulator-2.6.4 → blochsimulator-2.7.0}/src/blochsimulator.egg-info/SOURCES.txt +7 -0
- {blochsimulator-2.6.4 → blochsimulator-2.7.0}/tests/test_advanced_bssfp_builders.py +86 -1
- {blochsimulator-2.6.4 → blochsimulator-2.7.0}/tests/test_b1_fields.py +9 -6
- {blochsimulator-2.6.4 → blochsimulator-2.7.0}/tests/test_dynamic_phantom.py +173 -1
- {blochsimulator-2.6.4 → blochsimulator-2.7.0}/tests/test_ernst_angle.py +13 -0
- {blochsimulator-2.6.4 → blochsimulator-2.7.0}/tests/test_gui_smoke.py +178 -0
- blochsimulator-2.7.0/tests/test_metabolite_presets.py +58 -0
- blochsimulator-2.7.0/tests/test_mouse_phantom.py +303 -0
- {blochsimulator-2.6.4 → blochsimulator-2.7.0}/tests/test_notebook_export.py +230 -6
- blochsimulator-2.7.0/tests/test_notebook_reproduction.py +174 -0
- {blochsimulator-2.6.4 → blochsimulator-2.7.0}/tests/test_probe_frequency_tracking.py +86 -1
- {blochsimulator-2.6.4 → blochsimulator-2.7.0}/tests/test_project_io.py +12 -0
- {blochsimulator-2.6.4 → blochsimulator-2.7.0}/tests/test_pulseq_builders.py +221 -3
- {blochsimulator-2.6.4 → blochsimulator-2.7.0}/tests/test_reconstruction_explorer.py +17 -1
- {blochsimulator-2.6.4 → blochsimulator-2.7.0}/tests/test_rf_pulses.py +50 -1
- {blochsimulator-2.6.4 → blochsimulator-2.7.0}/tests/test_sequence_gui.py +318 -3
- {blochsimulator-2.6.4 → blochsimulator-2.7.0}/tests/test_sequence_simulation.py +150 -22
- {blochsimulator-2.6.4 → blochsimulator-2.7.0}/tests/test_spectral_phantom_design.py +89 -1
- blochsimulator-2.7.0/tests/test_spinbox_wheel.py +89 -0
- {blochsimulator-2.6.4 → blochsimulator-2.7.0}/tests/test_ssfp_sequence.py +56 -0
- blochsimulator-2.6.4/src/blochsimulator/ui/styles.py +0 -11
- blochsimulator-2.6.4/src/blochsimulator/ui/widgets.py +0 -104
- {blochsimulator-2.6.4 → blochsimulator-2.7.0}/LICENSE +0 -0
- {blochsimulator-2.6.4 → blochsimulator-2.7.0}/MANIFEST.in +0 -0
- {blochsimulator-2.6.4 → blochsimulator-2.7.0}/examples/spin_echo_analysis.ipynb +0 -0
- {blochsimulator-2.6.4 → blochsimulator-2.7.0}/examples/spin_echo_analysis_data.h5 +0 -0
- {blochsimulator-2.6.4 → blochsimulator-2.7.0}/examples/spin_echo_reproduction.ipynb +0 -0
- {blochsimulator-2.6.4 → blochsimulator-2.7.0}/requirements.txt +0 -0
- {blochsimulator-2.6.4 → blochsimulator-2.7.0}/rfpulses/.DS_Store +0 -0
- {blochsimulator-2.6.4 → blochsimulator-2.7.0}/rfpulses/AHP_5ms_Hsn.dat +0 -0
- {blochsimulator-2.6.4 → blochsimulator-2.7.0}/rfpulses/SLR_sharpness_1.txt +0 -0
- {blochsimulator-2.6.4 → blochsimulator-2.7.0}/rfpulses/SLR_sharpness_5.txt +0 -0
- {blochsimulator-2.6.4 → blochsimulator-2.7.0}/rfpulses/bruker/13C_Ultimate_SPSP_Pulse_QuEMRT.exc +0 -0
- {blochsimulator-2.6.4 → blochsimulator-2.7.0}/setup.cfg +0 -0
- {blochsimulator-2.6.4 → blochsimulator-2.7.0}/setup.py +0 -0
- {blochsimulator-2.6.4 → blochsimulator-2.7.0}/src/blochsimulator/bloch_core.h +0 -0
- {blochsimulator-2.6.4 → blochsimulator-2.7.0}/src/blochsimulator/bloch_core_modified.c +0 -0
- {blochsimulator-2.6.4 → blochsimulator-2.7.0}/src/blochsimulator/bloch_wrapper.pyx +0 -0
- {blochsimulator-2.6.4 → blochsimulator-2.7.0}/src/blochsimulator/dynamic_metal_probe_wrapper.pyx +0 -0
- {blochsimulator-2.6.4 → blochsimulator-2.7.0}/src/blochsimulator/gui.py +0 -0
- {blochsimulator-2.6.4 → blochsimulator-2.7.0}/src/blochsimulator/gui_phantom_integration.py +0 -0
- {blochsimulator-2.6.4 → blochsimulator-2.7.0}/src/blochsimulator/kspace.py +0 -0
- {blochsimulator-2.6.4 → blochsimulator-2.7.0}/src/blochsimulator/kspace_widget.py +0 -0
- {blochsimulator-2.6.4 → blochsimulator-2.7.0}/src/blochsimulator/memory.py +0 -0
- {blochsimulator-2.6.4 → blochsimulator-2.7.0}/src/blochsimulator/metal/__init__.py +0 -0
- {blochsimulator-2.6.4 → blochsimulator-2.7.0}/src/blochsimulator/metal/dynamic_bloch_precision.metal +0 -0
- {blochsimulator-2.6.4 → blochsimulator-2.7.0}/src/blochsimulator/metal/dynamic_metal_probe.h +0 -0
- {blochsimulator-2.6.4 → blochsimulator-2.7.0}/src/blochsimulator/metal/dynamic_metal_probe.mm +0 -0
- {blochsimulator-2.6.4 → blochsimulator-2.7.0}/src/blochsimulator/paths.py +0 -0
- {blochsimulator-2.6.4 → blochsimulator-2.7.0}/src/blochsimulator/phantom.py +0 -0
- {blochsimulator-2.6.4 → blochsimulator-2.7.0}/src/blochsimulator/rfpulses/SLR_sharpness_1.txt +0 -0
- {blochsimulator-2.6.4 → blochsimulator-2.7.0}/src/blochsimulator/rfpulses/SLR_sharpness_5.txt +0 -0
- {blochsimulator-2.6.4 → blochsimulator-2.7.0}/src/blochsimulator/rfpulses/__init__.py +0 -0
- {blochsimulator-2.6.4 → blochsimulator-2.7.0}/src/blochsimulator/sequence/bruker_export.py +0 -0
- {blochsimulator-2.6.4 → blochsimulator-2.7.0}/src/blochsimulator/sequence/bssfp_phase.py +0 -0
- {blochsimulator-2.6.4 → blochsimulator-2.7.0}/src/blochsimulator/sequence/compiler.py +0 -0
- {blochsimulator-2.6.4 → blochsimulator-2.7.0}/src/blochsimulator/sequence/convergence.py +0 -0
- {blochsimulator-2.6.4 → blochsimulator-2.7.0}/src/blochsimulator/sequence/convergence_suite.py +0 -0
- {blochsimulator-2.6.4 → blochsimulator-2.7.0}/src/blochsimulator/sequence/encoding.py +0 -0
- {blochsimulator-2.6.4 → blochsimulator-2.7.0}/src/blochsimulator/sequence/flip_angles.py +0 -0
- {blochsimulator-2.6.4 → blochsimulator-2.7.0}/src/blochsimulator/sequence/model.py +0 -0
- {blochsimulator-2.6.4 → blochsimulator-2.7.0}/src/blochsimulator/sequence/probe.py +0 -0
- {blochsimulator-2.6.4 → blochsimulator-2.7.0}/src/blochsimulator/sequence/pulseq.py +0 -0
- {blochsimulator-2.6.4 → blochsimulator-2.7.0}/src/blochsimulator/sequence/reconstruction.py +0 -0
- {blochsimulator-2.6.4 → blochsimulator-2.7.0}/src/blochsimulator/sequence/reference.py +0 -0
- {blochsimulator-2.6.4 → blochsimulator-2.7.0}/src/blochsimulator/sequence/scanner.py +0 -0
- {blochsimulator-2.6.4 → blochsimulator-2.7.0}/src/blochsimulator/sequence/spin_sampling.py +0 -0
- {blochsimulator-2.6.4 → blochsimulator-2.7.0}/src/blochsimulator/sequence/spoiling.py +0 -0
- {blochsimulator-2.6.4 → blochsimulator-2.7.0}/src/blochsimulator/slice_explorer.py +0 -0
- {blochsimulator-2.6.4 → blochsimulator-2.7.0}/src/blochsimulator/spectral_phantom.py +0 -0
- {blochsimulator-2.6.4 → blochsimulator-2.7.0}/src/blochsimulator/ui/__init__.py +0 -0
- {blochsimulator-2.6.4 → blochsimulator-2.7.0}/src/blochsimulator/ui/controls.py +0 -0
- {blochsimulator-2.6.4 → blochsimulator-2.7.0}/src/blochsimulator/ui/default_settings.py +0 -0
- {blochsimulator-2.6.4 → blochsimulator-2.7.0}/src/blochsimulator/ui/magnetization_viewer.py +0 -0
- {blochsimulator-2.6.4 → blochsimulator-2.7.0}/src/blochsimulator/ui/plot_interaction.py +0 -0
- {blochsimulator-2.6.4 → blochsimulator-2.7.0}/src/blochsimulator/ui/project_explorer.py +0 -0
- {blochsimulator-2.6.4 → blochsimulator-2.7.0}/src/blochsimulator/ui/simulation_explorer.py +0 -0
- {blochsimulator-2.6.4 → blochsimulator-2.7.0}/src/blochsimulator/ui/threads.py +0 -0
- {blochsimulator-2.6.4 → blochsimulator-2.7.0}/src/blochsimulator/ui/tissue_parameters.py +0 -0
- {blochsimulator-2.6.4 → blochsimulator-2.7.0}/src/blochsimulator/ui/tutorial_manager.py +0 -0
- {blochsimulator-2.6.4 → blochsimulator-2.7.0}/src/blochsimulator/ui/tutorial_overlay.py +0 -0
- {blochsimulator-2.6.4 → blochsimulator-2.7.0}/src/blochsimulator/units.py +0 -0
- {blochsimulator-2.6.4 → blochsimulator-2.7.0}/src/blochsimulator/visualization.py +0 -0
- {blochsimulator-2.6.4 → blochsimulator-2.7.0}/src/blochsimulator.egg-info/dependency_links.txt +0 -0
- {blochsimulator-2.6.4 → blochsimulator-2.7.0}/src/blochsimulator.egg-info/entry_points.txt +0 -0
- {blochsimulator-2.6.4 → blochsimulator-2.7.0}/src/blochsimulator.egg-info/not-zip-safe +0 -0
- {blochsimulator-2.6.4 → blochsimulator-2.7.0}/src/blochsimulator.egg-info/requires.txt +0 -0
- {blochsimulator-2.6.4 → blochsimulator-2.7.0}/src/blochsimulator.egg-info/top_level.txt +0 -0
- {blochsimulator-2.6.4 → blochsimulator-2.7.0}/tests/test_benchmarks.py +0 -0
- {blochsimulator-2.6.4 → blochsimulator-2.7.0}/tests/test_cartesian_acquisition.py +0 -0
- {blochsimulator-2.6.4 → blochsimulator-2.7.0}/tests/test_csi_acquisition.py +0 -0
- {blochsimulator-2.6.4 → blochsimulator-2.7.0}/tests/test_csi_sequence.py +0 -0
- {blochsimulator-2.6.4 → blochsimulator-2.7.0}/tests/test_dependencies.py +0 -0
- {blochsimulator-2.6.4 → blochsimulator-2.7.0}/tests/test_dynamic_3d_bssfp.py +0 -0
- {blochsimulator-2.6.4 → blochsimulator-2.7.0}/tests/test_encoding_frame.py +0 -0
- {blochsimulator-2.6.4 → blochsimulator-2.7.0}/tests/test_export.py +0 -0
- {blochsimulator-2.6.4 → blochsimulator-2.7.0}/tests/test_export_simple.py +0 -0
- {blochsimulator-2.6.4 → blochsimulator-2.7.0}/tests/test_flash_flip_angle_sweep.py +0 -0
- {blochsimulator-2.6.4 → blochsimulator-2.7.0}/tests/test_frequency_offsets.py +0 -0
- {blochsimulator-2.6.4 → blochsimulator-2.7.0}/tests/test_input_shapes.py +0 -0
- {blochsimulator-2.6.4 → blochsimulator-2.7.0}/tests/test_memory_limits.py +0 -0
- {blochsimulator-2.6.4 → blochsimulator-2.7.0}/tests/test_notebook_examples.py +0 -0
- {blochsimulator-2.6.4 → blochsimulator-2.7.0}/tests/test_plot_interaction.py +0 -0
- {blochsimulator-2.6.4 → blochsimulator-2.7.0}/tests/test_project_explorer.py +0 -0
- {blochsimulator-2.6.4 → blochsimulator-2.7.0}/tests/test_pulseq_import.py +0 -0
- {blochsimulator-2.6.4 → blochsimulator-2.7.0}/tests/test_scanner_settings.py +0 -0
- {blochsimulator-2.6.4 → blochsimulator-2.7.0}/tests/test_sequence_convergence_suite.py +0 -0
- {blochsimulator-2.6.4 → blochsimulator-2.7.0}/tests/test_sequence_model.py +0 -0
- {blochsimulator-2.6.4 → blochsimulator-2.7.0}/tests/test_sequence_reference.py +0 -0
- {blochsimulator-2.6.4 → blochsimulator-2.7.0}/tests/test_sequence_workspace_features.py +0 -0
- {blochsimulator-2.6.4 → blochsimulator-2.7.0}/tests/test_session_simulation_explorer.py +0 -0
- {blochsimulator-2.6.4 → blochsimulator-2.7.0}/tests/test_slice_explorer_memory.py +0 -0
- {blochsimulator-2.6.4 → blochsimulator-2.7.0}/tests/test_spectral_selective_3d_bssfp.py +0 -0
- {blochsimulator-2.6.4 → blochsimulator-2.7.0}/tests/test_spoiler_train_analysis.py +0 -0
- {blochsimulator-2.6.4 → blochsimulator-2.7.0}/tests/test_spoiling_validation.py +0 -0
- {blochsimulator-2.6.4 → blochsimulator-2.7.0}/tests/test_timestep_convergence.py +0 -0
- {blochsimulator-2.6.4 → blochsimulator-2.7.0}/tests/test_variable_flip_angle.py +0 -0
- {blochsimulator-2.6.4 → blochsimulator-2.7.0}/tests/test_visualization_export.py +0 -0
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
Metadata-Version: 2.4
|
|
2
2
|
Name: blochsimulator
|
|
3
|
-
Version: 2.
|
|
3
|
+
Version: 2.7.0
|
|
4
4
|
Summary: High-performance Bloch equation simulator for MRI
|
|
5
5
|
Author: Luca Nagel
|
|
6
6
|
License: GPL-3.0-only
|
|
@@ -78,7 +78,8 @@ A mode that lets you load, generate and simulate [Pulseq
|
|
|
78
78
|
|
|
79
79
|
*Features:*
|
|
80
80
|
|
|
81
|
-
- **Interactive generation of Pulseq** EPI, centre-out 2D
|
|
81
|
+
- **Interactive generation of Pulseq** bipolar or flyback EPI, centre-out 2D
|
|
82
|
+
spiral, 2D EPSI/MGE, 2D CSI,
|
|
82
83
|
spoiled 2D FLASH,
|
|
83
84
|
Cartesian 3D bSSFP, alternating-frequency [spectrally selective 3D bSSFP](https://doi.org/10.1002/mrm.29676), and
|
|
84
85
|
Cartesian or [spiral-phyllotaxis radial 3D multi-echo bSSFP sequences](https://doi.org/10.1002/mrm.30614), with
|
|
@@ -236,6 +237,16 @@ sim.plot_magnetization()
|
|
|
236
237
|
<details>
|
|
237
238
|
<summary><strong>More Python API examples</strong></summary>
|
|
238
239
|
|
|
240
|
+
#### Load a saved project
|
|
241
|
+
|
|
242
|
+
```python
|
|
243
|
+
from blochsimulator.project_io import load_project
|
|
244
|
+
|
|
245
|
+
project = load_project("simulation.blochproj")
|
|
246
|
+
phantom = project["phantom"]
|
|
247
|
+
result = project["sequence_result"]
|
|
248
|
+
```
|
|
249
|
+
|
|
239
250
|
#### Spin echo sequence
|
|
240
251
|
|
|
241
252
|
```python
|
|
@@ -47,7 +47,8 @@ A mode that lets you load, generate and simulate [Pulseq
|
|
|
47
47
|
|
|
48
48
|
*Features:*
|
|
49
49
|
|
|
50
|
-
- **Interactive generation of Pulseq** EPI, centre-out 2D
|
|
50
|
+
- **Interactive generation of Pulseq** bipolar or flyback EPI, centre-out 2D
|
|
51
|
+
spiral, 2D EPSI/MGE, 2D CSI,
|
|
51
52
|
spoiled 2D FLASH,
|
|
52
53
|
Cartesian 3D bSSFP, alternating-frequency [spectrally selective 3D bSSFP](https://doi.org/10.1002/mrm.29676), and
|
|
53
54
|
Cartesian or [spiral-phyllotaxis radial 3D multi-echo bSSFP sequences](https://doi.org/10.1002/mrm.30614), with
|
|
@@ -205,6 +206,16 @@ sim.plot_magnetization()
|
|
|
205
206
|
<details>
|
|
206
207
|
<summary><strong>More Python API examples</strong></summary>
|
|
207
208
|
|
|
209
|
+
#### Load a saved project
|
|
210
|
+
|
|
211
|
+
```python
|
|
212
|
+
from blochsimulator.project_io import load_project
|
|
213
|
+
|
|
214
|
+
project = load_project("simulation.blochproj")
|
|
215
|
+
phantom = project["phantom"]
|
|
216
|
+
result = project["sequence_result"]
|
|
217
|
+
```
|
|
218
|
+
|
|
208
219
|
#### Spin echo sequence
|
|
209
220
|
|
|
210
221
|
```python
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
__version__ = "2.
|
|
1
|
+
__version__ = "2.7.0"
|
|
2
2
|
|
|
3
3
|
from .simulator import (
|
|
4
4
|
BlochSimulator,
|
|
@@ -44,6 +44,17 @@ from .dynamic_phantom import ( # noqa: F401
|
|
|
44
44
|
rasterize_kpl_regions,
|
|
45
45
|
simulate_two_pool_kinetics,
|
|
46
46
|
)
|
|
47
|
+
from .mouse_phantom import ( # noqa: F401
|
|
48
|
+
INJECTION_COMPOUNDS,
|
|
49
|
+
MOUSE_TISSUE_LABELS,
|
|
50
|
+
MousePerfusionConfig,
|
|
51
|
+
MousePerfusionPhantom,
|
|
52
|
+
VascularEdge,
|
|
53
|
+
VascularGraph,
|
|
54
|
+
VascularNode,
|
|
55
|
+
build_reference_mouse_anatomy,
|
|
56
|
+
reference_mouse_vascular_graph,
|
|
57
|
+
)
|
|
47
58
|
from . import pulse_loader # noqa: F401
|
|
48
59
|
from .sequence import ( # noqa: F401
|
|
49
60
|
ADCEvent,
|
|
@@ -172,12 +172,13 @@ def _circular_loop_vector_field(
|
|
|
172
172
|
def _surface_loop_field(
|
|
173
173
|
xyz: Sequence[np.ndarray], fov_m: Sequence[float], kind: str
|
|
174
174
|
) -> np.ndarray:
|
|
175
|
+
"""Return the field of a loop above the FOV at +y, facing inward."""
|
|
175
176
|
virtual_z = fov_m[2] if len(fov_m) == 3 else min(fov_m[:2])
|
|
176
|
-
radius = 0.30 * min(fov_m[
|
|
177
|
+
radius = 0.30 * min(fov_m[0], virtual_z)
|
|
177
178
|
field = _circular_loop_vector_field(
|
|
178
179
|
xyz,
|
|
179
|
-
center=(
|
|
180
|
-
normal=(
|
|
180
|
+
center=(0.0, 0.56 * fov_m[1], 0.0),
|
|
181
|
+
normal=(0.0, -1.0, 0.0),
|
|
181
182
|
radius=radius,
|
|
182
183
|
)
|
|
183
184
|
return field[0] + 1j * field[1] if kind == "transmit" else field[0] - 1j * field[1]
|
|
@@ -461,8 +462,9 @@ def create_b1_preset(
|
|
|
461
462
|
"""Generate a normalized complex 2D/3D B1 preset.
|
|
462
463
|
|
|
463
464
|
Coil fields use a finite-rung quadrature birdcage or circular-loop
|
|
464
|
-
Biot-Savart model.
|
|
465
|
-
|
|
465
|
+
Biot-Savart model. Transmit presets are normalized so their global maximum
|
|
466
|
+
magnitude equals ``magnitude``. Receive presets use the global maximum of
|
|
467
|
+
their root-sum-of-squares magnitude, preserving relative channel gains.
|
|
466
468
|
"""
|
|
467
469
|
preset = str(preset).strip().lower()
|
|
468
470
|
kind = "receive" if str(kind).lower() in {"rx", "receive"} else "transmit"
|
|
@@ -516,27 +518,26 @@ def create_b1_preset(
|
|
|
516
518
|
normalized = 2.0 * xyz[axis] / fov_m[axis]
|
|
517
519
|
mode = str(ramp_mode).strip().lower()
|
|
518
520
|
if mode == "magnitude":
|
|
519
|
-
values =
|
|
521
|
+
values = 1.0 + 0.5 * normalized
|
|
520
522
|
name = f"Linear magnitude ramp {axis_name.upper()}"
|
|
521
523
|
elif mode == "phase":
|
|
522
|
-
values =
|
|
523
|
-
1j * (np.deg2rad(phase_deg) + np.pi * normalized)
|
|
524
|
-
)
|
|
524
|
+
values = np.exp(1j * np.pi * normalized)
|
|
525
525
|
name = f"Linear phase ramp {axis_name.upper()}"
|
|
526
526
|
else:
|
|
527
527
|
raise ValueError("ramp mode must be 'magnitude' or 'phase'")
|
|
528
|
-
if kind == "receive":
|
|
529
|
-
values = values[None, ...]
|
|
530
|
-
return B1Field(
|
|
531
|
-
data=values,
|
|
532
|
-
fov_m=fov_m,
|
|
533
|
-
kind=kind,
|
|
534
|
-
spatial_ndim=len(shape),
|
|
535
|
-
name=name,
|
|
536
|
-
)
|
|
537
528
|
|
|
538
529
|
values = np.asarray(values, dtype=np.complex128)
|
|
539
|
-
|
|
530
|
+
center_reference = _center_reference(values, axes)
|
|
531
|
+
if kind == "receive" and values.ndim == len(shape) + 1:
|
|
532
|
+
reference_magnitude = np.sqrt(np.sum(np.abs(values) ** 2, axis=0))
|
|
533
|
+
else:
|
|
534
|
+
reference_magnitude = np.abs(values)
|
|
535
|
+
peak = float(np.max(reference_magnitude))
|
|
536
|
+
if not np.isfinite(peak) or peak <= np.finfo(float).eps:
|
|
537
|
+
raise ValueError(f"{kind} B1 preset has no positive finite magnitude")
|
|
538
|
+
# Retain the established convention that ``phase_deg`` is the phase at the
|
|
539
|
+
# field centre while making the amplitude reference unambiguous.
|
|
540
|
+
values = values * np.exp(-1j * np.angle(center_reference)) / peak
|
|
540
541
|
values *= magnitude * global_phase
|
|
541
542
|
return B1Field(
|
|
542
543
|
data=values,
|