From d749bb29a9734f71a4cc49ffe5f63016ef116a2e Mon Sep 17 00:00:00 2001 From: Ebrahim Ebrahim Date: Wed, 31 Jul 2024 10:50:58 -0400 Subject: [PATCH] Add placeholders for IO setup (#35) --- src/abcdmicro/dwi.py | 23 +++++++++++++++++++++++ src/abcdmicro/event.py | 23 +++++++++++++++++++++++ src/abcdmicro/io.py | 15 +++++++++++++++ src/abcdmicro/resource.py | 29 +++++++++++++++++++++++++++++ 4 files changed, 90 insertions(+) create mode 100644 src/abcdmicro/dwi.py create mode 100644 src/abcdmicro/event.py create mode 100644 src/abcdmicro/io.py create mode 100644 src/abcdmicro/resource.py diff --git a/src/abcdmicro/dwi.py b/src/abcdmicro/dwi.py new file mode 100644 index 0000000..4d5cb62 --- /dev/null +++ b/src/abcdmicro/dwi.py @@ -0,0 +1,23 @@ +from __future__ import annotations + +from dataclasses import dataclass + +from abcdmicro.event import AbcdEvent +from abcdmicro.resource import BvalResource, BvecResource, VolumeResource + + +@dataclass +class Dwi: + """An ABCD diffusion weighted image.""" + + event: AbcdEvent + """The ABCD event associated with this DWI.""" + + volume: VolumeResource + """The DWI image volume.""" + + bval: BvalResource + """The DWI b-values""" + + bvec: BvecResource + """The DWI b-vectors""" diff --git a/src/abcdmicro/event.py b/src/abcdmicro/event.py new file mode 100644 index 0000000..b83c4d5 --- /dev/null +++ b/src/abcdmicro/event.py @@ -0,0 +1,23 @@ +from __future__ import annotations + +from dataclasses import dataclass +from pathlib import Path + + +@dataclass +class AbcdEvent: + """An ABCD event -- a particular subject and time point.""" + + subject_id: str + """The subject GUID defined in the NIMH Data Archive, for example 'NDAR_INV00U4FTRU'""" + + eventname: str + """The ABCD Study event name, for example 'baseline_year_1_arm_1'""" + + image_download_path: Path + """Path to the ABCD image download root directory. This would be the directory that + contains `fmriresults01/abcd-mproc-release5/` with some compressed images in there""" + + tabular_data_path: Path + """Path to the extracted ABCD tabular data directory. This would contain subdirectories + like `core/mental-health/` with csv tables inside them.""" diff --git a/src/abcdmicro/io.py b/src/abcdmicro/io.py new file mode 100644 index 0000000..f095f67 --- /dev/null +++ b/src/abcdmicro/io.py @@ -0,0 +1,15 @@ +from __future__ import annotations + +from abcdmicro.resource import BvalResource, BvecResource, VolumeResource + + +class NiftiVolumeResrouce(VolumeResource): + pass + + +class FslBvalResource(BvalResource): + pass + + +class FslBvecResource(BvecResource): + pass diff --git a/src/abcdmicro/resource.py b/src/abcdmicro/resource.py new file mode 100644 index 0000000..2168570 --- /dev/null +++ b/src/abcdmicro/resource.py @@ -0,0 +1,29 @@ +from __future__ import annotations + + +class Resource: + pass + + +class VolumeResource(Resource): + pass + + +class InMemoryVolumeResource(VolumeResource): + pass + + +class BvalResource(Resource): + pass + + +class InMemoryBvalResource(BvalResource): + pass + + +class BvecResource(Resource): + pass + + +class InMemoryBvecResource(BvecResource): + pass