Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 5 additions & 0 deletions .devcontainer/devcontainer.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
{
"name": "ismrmrd-python conda",
"image": "condaforge/miniforge3:24.11.3-0",
"postCreateCommand": "conda install -y conda-build anaconda-client"
}
5 changes: 1 addition & 4 deletions .github/workflows/ismrmrd_python_conda.yml
Original file line number Diff line number Diff line change
Expand Up @@ -10,10 +10,7 @@ on:

jobs:
build-conda-packages:
strategy:
matrix:
os: [ubuntu-latest, macos-latest]
runs-on: ${{ matrix.os }}
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v5
- uses: conda-incubator/setup-miniconda@v3
Expand Down
3 changes: 0 additions & 3 deletions conda/conda_build_config.yaml

This file was deleted.

7 changes: 5 additions & 2 deletions conda/meta.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -7,15 +7,18 @@ package:
source:
path: ../

build:
noarch: python

requirements:
build:
- python {{ python }}
- python
- xsdata>=24.0
- setuptools
- pip

run:
- python
- python >=3.9
- numpy>=1.22.0
- h5py>=2.3
- xsdata>=24.0
Expand Down
2 changes: 1 addition & 1 deletion setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -66,7 +66,7 @@ def generate_schema(self, schema_filename, config_filename, subpackage_name, out
shutil.move(subpackage_name, destination)

setup(
version='1.14.3',
version='1.15.0',
packages=find_packages(),
cmdclass={
'generate_schema': GenerateSchemaCommand
Expand Down
2 changes: 1 addition & 1 deletion tests/end-to-end/test-reconstruction.sh
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

set -euo pipefail

ISMRMRD_IMAGE=ghcr.io/ismrmrd/ismrmrd:v1.14.2
ISMRMRD_IMAGE=ghcr.io/ismrmrd/ismrmrd:v1.15.0

SCRIPT_DIR=$(dirname "${BASH_SOURCE[0]}")
PROJECT_DIR=$(realpath "${SCRIPT_DIR}/../..")
Expand Down
53 changes: 53 additions & 0 deletions tests/test_xsd.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,53 @@
import ismrmrd.xsd
from ismrmrd.xsd.ismrmrdschema import (
ismrmrdHeader,
experimentalConditionsType,
encodingType,
encodingSpaceType,
matrixSizeType,
fieldOfViewMm,
encodingLimitsType,
trajectoryType,
)


def make_encoding_space(x, y, z, fov_x, fov_y, fov_z):
return encodingSpaceType(
matrixSize=matrixSizeType(x=x, y=y, z=z),
fieldOfView_mm=fieldOfViewMm(x=fov_x, y=fov_y, z=fov_z),
)


def make_header():
return ismrmrdHeader(
experimentalConditions=experimentalConditionsType(
H1resonanceFrequency_Hz=128000000,
),
encoding=[
encodingType(
encodedSpace=make_encoding_space(256, 256, 1, 300.0, 300.0, 6.0),
reconSpace=make_encoding_space(256, 256, 1, 300.0, 300.0, 6.0),
encodingLimits=encodingLimitsType(),
trajectory=trajectoryType.CARTESIAN,
)
],
)


def test_construct_header():
"""Constructing ismrmrdHeader and its sub-types using required keyword args should not raise."""
header = make_header()
assert header.experimentalConditions.H1resonanceFrequency_Hz == 128000000
assert len(header.encoding) == 1
enc = header.encoding[0]
assert enc.trajectory == trajectoryType.CARTESIAN
assert enc.encodedSpace.matrixSize.x == 256
assert enc.encodedSpace.fieldOfView_mm.z == 6.0


def test_header_roundtrip():
"""A header built from constructors should survive a ToXML -> CreateFromDocument round-trip."""
header = make_header()
xml = ismrmrd.xsd.ToXML(header)
reparsed = ismrmrd.xsd.CreateFromDocument(xml)
assert ismrmrd.xsd.ToXML(reparsed) == xml
Loading