From 181801a15dd870a7eccb80e92f29def0b49fd4cb Mon Sep 17 00:00:00 2001 From: J-Endres Date: Tue, 26 May 2026 13:26:04 +0200 Subject: [PATCH 1/4] fix sig_to_mrd --- CHANGELOG.md | 2 + Cargo.lock | 2 +- Cargo.toml | 2 +- python/MRzeroCore/simulation/sig_to_mrd.py | 51 +++++++++++----------- 4 files changed, 29 insertions(+), 28 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 2e833a1..1d91233 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,3 +1,5 @@ +- 0.4.9 + - Fix ismrmrd export - 0.4.8 - New `backend="pulseq_rs"` option on `Sequence.import_file` that parses `.seq` files through [pulseq-rs](https://github.com/pulseq-frame/pulseq-rs) diff --git a/Cargo.lock b/Cargo.lock index 2575ddb..e6e0008 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -65,7 +65,7 @@ dependencies = [ [[package]] name = "mrzero_core" -version = "0.4.6" +version = "0.4.9" dependencies = [ "num-complex", "pulseq-rs", diff --git a/Cargo.toml b/Cargo.toml index 9a96944..0483c21 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -1,6 +1,6 @@ [package] name = "mrzero_core" -version = "0.4.6" +version = "0.4.9" edition = "2021" # See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html diff --git a/python/MRzeroCore/simulation/sig_to_mrd.py b/python/MRzeroCore/simulation/sig_to_mrd.py index 36b2aed..9e664ae 100644 --- a/python/MRzeroCore/simulation/sig_to_mrd.py +++ b/python/MRzeroCore/simulation/sig_to_mrd.py @@ -264,32 +264,33 @@ def s_to_ms(x_in_s): seq_fov = [m_to_mm(val) for val in seq.definitions.get("FOV", [1, 1, 1])] seq_labels = seq.evaluate_labels(evolution="adc") - mrd_enc_params = ismrmrd.xsd.encodingType() - - mrd_enc_params.encodedSpace = ismrmrd.xsd.encodingSpaceType( - matrixSize=ismrmrd.xsd.matrixSizeType( - x=seq_res[0], - y=seq_res[1], - z=seq_res[2], - ), - fieldOfView_mm=ismrmrd.xsd.fieldOfViewMm( - x=seq_fov[0], - y=seq_fov[1], - z=seq_fov[2], - ), - ) - - mrd_enc_params.reconSpace = ismrmrd.xsd.encodingSpaceType( - matrixSize=ismrmrd.xsd.matrixSizeType( - x=seq_res[0], - y=seq_res[1], - z=seq_res[2], + mrd_enc_params = ismrmrd.xsd.encodingType( + encodedSpace=ismrmrd.xsd.encodingSpaceType( + matrixSize=ismrmrd.xsd.matrixSizeType( + x=seq_res[0], + y=seq_res[1], + z=seq_res[2], + ), + fieldOfView_mm=ismrmrd.xsd.fieldOfViewMm( + x=seq_fov[0], + y=seq_fov[1], + z=seq_fov[2], + ), ), - fieldOfView_mm=ismrmrd.xsd.fieldOfViewMm( - x=seq_fov[0], - y=seq_fov[1], - z=seq_fov[2], + reconSpace=ismrmrd.xsd.encodingSpaceType( + matrixSize=ismrmrd.xsd.matrixSizeType( + x=seq_res[0], + y=seq_res[1], + z=seq_res[2], + ), + fieldOfView_mm=ismrmrd.xsd.fieldOfViewMm( + x=seq_fov[0], + y=seq_fov[1], + z=seq_fov[2], + ), ), + encodingLimits=_labels_to_encodinglimits(seq_labels), + trajectory=ismrmrd.xsd.trajectoryType.OTHER ) if verbose > 4: @@ -299,8 +300,6 @@ def s_to_ms(x_in_s): print( f"Wrote encode/recon RES to mrd header with {mrd_enc_params.encodedSpace.fieldOfView_mm}/{mrd_enc_params.reconSpace.fieldOfView_mm}" ) - - mrd_enc_params.encodingLimits = _labels_to_encodinglimits(seq_labels) # The Lamour frequency is a required field in the ISMRMRD header exp = ismrmrd.xsd.experimentalConditionsType() From 7c7fb73cc0ddfbee036b63ab105a940d4b5359bc Mon Sep 17 00:00:00 2001 From: J-Endres Date: Tue, 26 May 2026 13:49:00 +0200 Subject: [PATCH 2/4] re-trigger ci From 9cb40d7dae73b217bf9631f7dcc55d66ed603201 Mon Sep 17 00:00:00 2001 From: J-Endres Date: Tue, 26 May 2026 16:04:30 +0200 Subject: [PATCH 3/4] update pyproject version number --- pyproject.toml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pyproject.toml b/pyproject.toml index 1cb906a..49312c6 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -4,7 +4,7 @@ build-backend = "maturin" [project] name = "mrzerocore" -version = "0.4.8" +version = "0.4.9" description = "Core functionality of MRzero" authors = [ {name = "Jonathan Endres", email = "jonathan.endres@uk-erlangen.de"}, From abf934c0b859c180b5a9dd0d114afdfc9db3556f Mon Sep 17 00:00:00 2001 From: J-Endres Date: Tue, 26 May 2026 16:43:54 +0200 Subject: [PATCH 4/4] fix ismrmrd v2 --- CHANGELOG.md | 2 +- Cargo.lock | 2 +- Cargo.toml | 2 +- pyproject.toml | 2 +- python/MRzeroCore/simulation/sig_to_mrd.py | 9 ++++++--- 5 files changed, 10 insertions(+), 7 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 1d91233..15070bc 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,4 +1,4 @@ -- 0.4.9 +- 0.4.9 & 0.4.10 - Fix ismrmrd export - 0.4.8 - New `backend="pulseq_rs"` option on `Sequence.import_file` that parses diff --git a/Cargo.lock b/Cargo.lock index e6e0008..4001cb5 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -65,7 +65,7 @@ dependencies = [ [[package]] name = "mrzero_core" -version = "0.4.9" +version = "0.4.10" dependencies = [ "num-complex", "pulseq-rs", diff --git a/Cargo.toml b/Cargo.toml index 0483c21..62804fa 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -1,6 +1,6 @@ [package] name = "mrzero_core" -version = "0.4.9" +version = "0.4.10" edition = "2021" # See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html diff --git a/pyproject.toml b/pyproject.toml index 49312c6..c4b8a45 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -4,7 +4,7 @@ build-backend = "maturin" [project] name = "mrzerocore" -version = "0.4.9" +version = "0.4.10" description = "Core functionality of MRzero" authors = [ {name = "Jonathan Endres", email = "jonathan.endres@uk-erlangen.de"}, diff --git a/python/MRzeroCore/simulation/sig_to_mrd.py b/python/MRzeroCore/simulation/sig_to_mrd.py index 9e664ae..45aec2b 100644 --- a/python/MRzeroCore/simulation/sig_to_mrd.py +++ b/python/MRzeroCore/simulation/sig_to_mrd.py @@ -302,12 +302,15 @@ def s_to_ms(x_in_s): ) # The Lamour frequency is a required field in the ISMRMRD header - exp = ismrmrd.xsd.experimentalConditionsType() - exp.H1resonanceFrequency_Hz = int(seq.system.B0 * 42.5764 * 1e6) + exp = ismrmrd.xsd.experimentalConditionsType( + H1resonanceFrequency_Hz=int(seq.system.B0 * 42.5764 * 1e6) + ) mrd_head = ismrmrd.xsd.ismrmrdHeader( experimentalConditions=exp, - measurementInformation=ismrmrd.xsd.measurementInformationType(), + measurementInformation=ismrmrd.xsd.measurementInformationType( + patientPosition=ismrmrd.xsd.patientPositionType.HFS + ), acquisitionSystemInformation=ismrmrd.xsd.acquisitionSystemInformationType(), sequenceParameters=mrd_seq_params, encoding=[mrd_enc_params],