Skip to content

Write image orientation to MRD file#148

Draft
h3lg3 wants to merge 2 commits intomainfrom
write_image_orientation_to_mrd
Draft

Write image orientation to MRD file#148
h3lg3 wants to merge 2 commits intomainfrom
write_image_orientation_to_mrd

Conversation

@h3lg3
Copy link
Collaborator

@h3lg3 h3lg3 commented Feb 3, 2026

The raw_data/kspace orientation is based on the channel assignment for RO, PE1 and PE2 gradients of the PyPulseq sequence. This information is written to the MRD file, such that during later image reconstruction, the image can be properly saved to DICOM or Nifti using the correct orientation.
A remaining issue might be that the implemented mapping from console channel to physical orientation depends on the cabling of the console and can vary between different setups. One could add the "console-channel - physical gradient" mapping to the system configuration "system_info" in

system_info = get_nexus_acquisition_system(

Also note that the proposed change adds a new parameter to write_acquisition_to_mrd why the tests currently fail.

@github-actions
Copy link

github-actions bot commented Feb 3, 2026

Coverage

Coverage Report
FileStmtsMissCoverMissing
src/console
   __init__.py10190%11
src/console/interfaces
   acquisition_data.py1232580%96–99, 110–111, 129–130, 145–148, 158–159, 188–189, 193–199, 216–217, 228, 232, 250
   acquisition_parameter.py107496%126, 163, 178, 213
   device_configuration.py721086%34–36, 38, 46–47, 55–56, 83–85, 87
   dimensions.py962277%45–46, 67–68, 71, 79, 89, 95, 101, 107, 113–115, 125–127, 137–139, 149–151
   rx_data.py791482%66–70, 78, 90, 94, 96, 104, 115, 123, 126, 129
src/console/pulseq_interpreter
   sequence_provider.py2875083%155, 160, 174–176, 307–308, 395–396, 475–518, 551, 601–602, 671, 696–697, 713, 722, 726
src/console/spcm_control
   abstract_device.py79790%2–149
   acquisition_control.py1461460%3–342
   rx_device.py2052050%2–484
   tx_device.py1791790%2–468
src/console/spcm_control/spcm
   pyspcm.py1611610%3–295
   tools.py54540%3–128
src/console/utilities
   json_encoder.py8362%22–24
   load_configuration.py20670%18–20, 28–30
   plot.py17170%2–26
src/console/utilities/data
   mrd_helper.py43881%37, 43, 49, 52, 60, 63, 68, 71
   write_acquisition_to_mrd.py52590%69–70, 89, 107, 112
src/console/utilities/sequences/calibration
   fid_tx_adjust.py22195%66
   se_tx_adjust.py29293%62–64
src/console/utilities/sequences/spectrometry
   fid.py15150%2–75
   se_spectrum.py25292%51, 85
src/console/utilities/sequences/tse
   tse_3d.py2417569%108–109, 111–112, 114–115, 122–123, 125–127, 129–132, 143–146, 151–154, 161–172, 189, 211–218, 224, 255, 318–335, 342–343, 410, 413–425, 533–544
TOTAL5322108480% 

Tests Skipped Failures Errors Time
190 0 💤 6 ❌ 0 🔥 15.355s ⏱️

@h3lg3 h3lg3 marked this pull request as draft February 3, 2026 14:23
@h3lg3 h3lg3 requested a review from schote February 3, 2026 14:24
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