From 5c24c32b64b1a769a11ed863a514002983bd53cd Mon Sep 17 00:00:00 2001 From: Tom Close Date: Fri, 27 Oct 2023 18:14:16 +1100 Subject: [PATCH 1/3] updated import location for fileformats applications --- conftest.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/conftest.py b/conftest.py index 8b777ad..8b9532c 100644 --- a/conftest.py +++ b/conftest.py @@ -25,7 +25,7 @@ from fileformats.medimage import NiftiGzX, NiftiGz, DicomSet, NiftiX from fileformats.text import Plain as Text from fileformats.image import Png -from fileformats.serialization import Json +from fileformats.application import Json from fileformats.generic import Directory from arcana.xnat.data.api import Xnat from arcana.xnat.utils.testing import ( From 24d714d5637d83bf6134f2aaf4392ebce1913d99 Mon Sep 17 00:00:00 2001 From: Tom Close Date: Fri, 27 Oct 2023 18:14:16 +1100 Subject: [PATCH 2/3] changed hash_single calls to hash_object --- arcana/xnat/data/tests/test_store.py | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/arcana/xnat/data/tests/test_store.py b/arcana/xnat/data/tests/test_store.py index ba1b322..3a0d0ff 100644 --- a/arcana/xnat/data/tests/test_store.py +++ b/arcana/xnat/data/tests/test_store.py @@ -8,7 +8,7 @@ from functools import reduce import itertools import pytest -from pydra.utils.hash import hash_single, Cache +from pydra.utils.hash import hash_object from fileformats.generic import File from fileformats.field import Text as TextField from arcana.common import Clinical @@ -183,6 +183,6 @@ def test_provenance_roundtrip(datatype: type, value: str, simple_dataset: Datase def test_dataset_bytes_hash(static_dataset): - hsh = hash_single(static_dataset, Cache({})) + hsh = hash_object(static_dataset) # Check hashing is stable - assert hash_single(static_dataset, Cache({})) == hsh + assert hash_object(static_dataset) == hsh From 7f877ae98d5d18096be893ef784d7f49a8958470 Mon Sep 17 00:00:00 2001 From: Tom Close Date: Fri, 27 Oct 2023 18:14:16 +1100 Subject: [PATCH 3/3] updated DicomSet to DicomSeries --- arcana/xnat/cli/tests/test_cli_dataset_export.py | 6 +++--- arcana/xnat/data/api.py | 4 ++-- conftest.py | 4 ++-- 3 files changed, 7 insertions(+), 7 deletions(-) diff --git a/arcana/xnat/cli/tests/test_cli_dataset_export.py b/arcana/xnat/cli/tests/test_cli_dataset_export.py index df3968c..79b5bfb 100644 --- a/arcana/xnat/cli/tests/test_cli_dataset_export.py +++ b/arcana/xnat/cli/tests/test_cli_dataset_export.py @@ -6,7 +6,7 @@ import requests from docker.errors import ContainerError import pytest -from fileformats.medimage import DicomSet +from fileformats.medimage import DicomSeries import medimages4tests.dummy.dicom.mri.t1w.siemens.skyra.syngo_d13c import medimages4tests.dummy.dicom.mri.fmap.siemens.skyra.syngo_d13c from arcana.core.cli.dataset import export @@ -56,7 +56,7 @@ def test_bids_export( [ FileBP( path="DICOM", - datatype=DicomSet, + datatype=DicomSeries, filenames=["dicom/t1w/*"], ) ], @@ -77,7 +77,7 @@ def test_bids_export( ) original.add_source( name="anat/T1w", - datatype=DicomSet, + datatype=DicomSeries, path="mprage", ) original.save() diff --git a/arcana/xnat/data/api.py b/arcana/xnat/data/api.py index b8d317e..db4e088 100644 --- a/arcana/xnat/data/api.py +++ b/arcana/xnat/data/api.py @@ -12,7 +12,7 @@ import attrs import xnat.session from fileformats.core import FileSet, Field -from fileformats.medimage import DicomSet +from fileformats.medimage import DicomSeries from fileformats.core.exceptions import FormatRecognitionError from arcana.core.utils.misc import ( path2varname, @@ -127,7 +127,7 @@ def populate_row(self, row: DataRow): for xresource in xscan.resources.values(): uri = self._get_resource_uri(xresource) if xresource.label in ("DICOM", "secondary"): - datatype = DicomSet + datatype = DicomSeries item_metadata = self.get_dicom_header(uri) else: datatype = FileSet diff --git a/conftest.py b/conftest.py index 8b9532c..3ecedf5 100644 --- a/conftest.py +++ b/conftest.py @@ -22,7 +22,7 @@ from arcana.core.deploy.image.base import BaseImage from arcana.common import Clinical from arcana.core.data.set import Dataset -from fileformats.medimage import NiftiGzX, NiftiGz, DicomSet, NiftiX +from fileformats.medimage import NiftiGzX, NiftiGz, DicomSeries, NiftiX from fileformats.text import Plain as Text from fileformats.image import Png from fileformats.application import Json @@ -171,7 +171,7 @@ def arcana_home(work_dir): resources=[ FileBP( path="DICOM", - datatype=DicomSet, + datatype=DicomSeries, filenames=[ "dicom/fmap/1.dcm", "dicom/fmap/2.dcm",