refactor: consistent use of DataGrabber #226
48 changed files with 442 additions and 410 deletions
1
docs/changes/newsfragments/226.enh
Normal file
1
docs/changes/newsfragments/226.enh
Normal file
|
|
@ -0,0 +1 @@
|
|||
Adopt ``DataGrabber`` consistently throughout codebase to match with the documentation by `Synchon Mandal`_
|
||||
|
|
@ -22,7 +22,7 @@ data type including source and previous transformation steps.
|
|||
|
||||
The :ref:`Data Grabber <datagrabber>` step adds the ``path`` second-level key
|
||||
which gives the path to the file containing the data. The ``meta`` key in this
|
||||
step only contains information about the datagrabber used.
|
||||
step only contains information about the DataGrabber used.
|
||||
|
||||
.. code-block:: python
|
||||
|
||||
|
|
|
|||
|
|
@ -9,29 +9,29 @@ Description
|
|||
-----------
|
||||
|
||||
The ``DataGrabber`` is an object that can provide an interface to datasets you
|
||||
want to work with in junifer. Every concrete implementation of a datagrabber is
|
||||
want to work with in junifer. Every concrete implementation of a DataGrabber is
|
||||
aware of a particular dataset's structure and thus allows you to fetch specific
|
||||
elements of interest from the dataset. It adds the ``path`` key to each
|
||||
:ref:`data type <data_types>` in the :ref:`Data object <data_object>`.
|
||||
|
||||
Datagrabbers are intended to be used as context managers. When used within a
|
||||
context, a datagrabber takes care of any pre and post steps for interacting with
|
||||
DataGrabbers are intended to be used as context managers. When used within a
|
||||
context, a DataGrabber takes care of any pre and post steps for interacting with
|
||||
the dataset, for example, downloading and cleaning up. As the interface
|
||||
is consistent, you always use the same procedure to interact with the datagrabber.
|
||||
is consistent, you always use the same procedure to interact with the DataGrabber.
|
||||
|
||||
For example, a concrete implementation of :class:`.DataladDataGrabber` can
|
||||
provide junifer with data from a Datalad dataset. Of course, datagrabbers are not
|
||||
provide junifer with data from a Datalad dataset. Of course, DataGrabbers are not
|
||||
only meant to work with Datalad datasets but any dataset.
|
||||
|
||||
If you are interested in using already provided datagrabbers, please go to
|
||||
:doc:`../builtin`. And, if you want to implement your own datagrabber, you need
|
||||
If you are interested in using already provided DataGrabbers, please go to
|
||||
:doc:`../builtin`. And, if you want to implement your own DataGrabber, you need
|
||||
to provide concrete implementations of base classes already provided.
|
||||
|
||||
Base Classes
|
||||
------------
|
||||
|
||||
In this section, we showcase different abstract base classes you might want to
|
||||
use to implement your own datagrabber.
|
||||
use to implement your own DataGrabber.
|
||||
|
||||
.. list-table::
|
||||
:widths: auto
|
||||
|
|
@ -41,16 +41,16 @@ use to implement your own datagrabber.
|
|||
- Description
|
||||
* - :class:`.BaseDataGrabber`
|
||||
- | The abstract base class providing you an interface to implement your
|
||||
| own datagrabber. You should try to avoid using this directly and
|
||||
| own DataGrabber. You should try to avoid using this directly and
|
||||
| instead use :class:`.PatternDataGrabber` or
|
||||
| :class:`.DataladDataGrabber`. To build your own custom *low-level*
|
||||
| datagrabber, you need to override the ``get_elements_keys``,
|
||||
| DataGrabber, you need to override the ``get_elements_keys``,
|
||||
| ``get_elements`` and ``get_item`` methods, and most of the time you
|
||||
| should also override other existing methods like ``__enter__`` and
|
||||
| ``__exit__``.
|
||||
* - :class:`.PatternDataGrabber`
|
||||
- | It implements functionality to help you define the pattern of the
|
||||
| dataset you want to get. For example, you know that T1 images are
|
||||
| dataset you want to get. For example, you know that T1w images are
|
||||
| found in a directory following the pattern:
|
||||
| ``{subject}/anat/{subject}_T1w.nii.gz`` inside of the dataset. Now you
|
||||
| can provide this to the :class:`.PatternDataGrabber` and it will be
|
||||
|
|
|
|||
|
|
@ -75,10 +75,10 @@ Data Grabber
|
|||
^^^^^^^^^^^^
|
||||
|
||||
The ``datagrabber`` section must be configured using the ``kind`` key to specify
|
||||
the datagrabber to use. Additional keys correspond to the parameters of the
|
||||
datagrabber.
|
||||
the DataGrabber to use. Additional keys correspond to the parameters of the
|
||||
DataGrabber constructor.
|
||||
|
||||
For example, to use the :class:`.DataladAOMICPIOP1` datagrabber, we just need to
|
||||
For example, to use the :class:`.DataladAOMICPIOP1` DataGrabber, we just need to
|
||||
specify its name as the ``kind`` key.
|
||||
|
||||
.. code-block:: yaml
|
||||
|
|
@ -86,8 +86,9 @@ specify its name as the ``kind`` key.
|
|||
datagrabber:
|
||||
kind: DataladAOMICPIOP1
|
||||
|
||||
However, it is also possible to pass parameters to the datagrabber. In this case,
|
||||
we can restrict the datagrabber to fetch only the ``restingstate`` task.
|
||||
However, it is also possible to pass parameters to the DataGrabber constructor.
|
||||
In this case, we can restrict the DataGrabber to fetch only the ``restingstate``
|
||||
task.
|
||||
|
||||
.. code-block:: yaml
|
||||
|
||||
|
|
|
|||
|
|
@ -1,8 +1,8 @@
|
|||
"""
|
||||
Generic BIDS datagrabber for datalad.
|
||||
Generic BIDS DataGrabber for datalad.
|
||||
=====================================
|
||||
|
||||
This example uses a generic BIDS datagraber to get the data from a BIDS dataset
|
||||
This example uses a generic BIDS DataGraber to get the data from a BIDS dataset
|
||||
store in a datalad remote sibling.
|
||||
|
||||
Authors: Federico Raimondo
|
||||
|
|
@ -20,9 +20,9 @@ configure_logging(level="INFO")
|
|||
|
||||
|
||||
###############################################################################
|
||||
# The BIDS datagrabber requires three parameters: the types of data we want,
|
||||
# The BIDS DataGrabber requires three parameters: the types of data we want,
|
||||
# the specific pattern that matches each type, and the variables that will be
|
||||
# replaced int he patterns.
|
||||
# replaced in the patterns.
|
||||
types = ["T1w", "BOLD"]
|
||||
patterns = {
|
||||
"T1w": "{subject}/anat/{subject}_T1w.nii.gz",
|
||||
|
|
@ -30,15 +30,15 @@ patterns = {
|
|||
}
|
||||
replacements = ["subject"]
|
||||
###############################################################################
|
||||
# Additionally, a datalad datagrabber requires the URI of the remote sibling
|
||||
# and the location of the dataset within the remote sibling.
|
||||
# Additionally, a datalad-based DataGrabber requires the URI of the remote
|
||||
# sibling and the location of the dataset within the remote sibling.
|
||||
repo_uri = "https://gin.g-node.org/juaml/datalad-example-bids"
|
||||
rootdir = "example_bids"
|
||||
|
||||
###############################################################################
|
||||
# Now we can use the datagrabber within a `with` context
|
||||
# One thing we can do with any datagrabber is iterate over the elements.
|
||||
# In this case, each element of the datagrabber is one session.
|
||||
# Now we can use the DataGrabber within a `with` context.
|
||||
# One thing we can do with any DataGrabber is iterate over the elements.
|
||||
# In this case, each element of the DataGrabber is one session.
|
||||
with PatternDataladDataGrabber(
|
||||
rootdir=rootdir,
|
||||
types=types,
|
||||
|
|
@ -50,9 +50,9 @@ with PatternDataladDataGrabber(
|
|||
print(elem)
|
||||
|
||||
###############################################################################
|
||||
# Another feature of the datagrabber is the ability to get a specific
|
||||
# Another feature of the DataGrabber is the ability to get a specific
|
||||
# element by its name. In this case, we index `sub-01` and we get the file
|
||||
# paths for the two types of data we want (T1w and bold).
|
||||
# paths for the two types of data we want (T1w and BOLD).
|
||||
with PatternDataladDataGrabber(
|
||||
rootdir=rootdir,
|
||||
types=types,
|
||||
|
|
|
|||
|
|
@ -25,7 +25,7 @@ from junifer.utils import configure_logging
|
|||
configure_logging(level="INFO")
|
||||
|
||||
##############################################################################
|
||||
# Define the datagrabber interface
|
||||
# Define the DataGrabber interface
|
||||
datagrabber = {
|
||||
"kind": "SPMAuditoryTestingDataGrabber",
|
||||
}
|
||||
|
|
|
|||
|
|
@ -11,20 +11,24 @@ from ..pipeline.registry import register
|
|||
|
||||
|
||||
def register_datagrabber(klass: Type) -> Type:
|
||||
"""Datagrabber registration decorator.
|
||||
"""Register DataGrabber.
|
||||
|
||||
Registers the datagrabber so it can be used by name.
|
||||
Registers the DataGrabber so it can be used by name.
|
||||
|
||||
Parameters
|
||||
----------
|
||||
klass: class
|
||||
The class of the datagrabber to register.
|
||||
The class of the DataGrabber to register.
|
||||
|
||||
Returns
|
||||
-------
|
||||
klass: class
|
||||
The unmodified input class.
|
||||
|
||||
Notes
|
||||
-----
|
||||
It should only be used as a decorator.
|
||||
|
||||
"""
|
||||
register(
|
||||
step="datagrabber",
|
||||
|
|
|
|||
|
|
@ -24,17 +24,17 @@ from .utils import yaml
|
|||
|
||||
|
||||
def _get_datagrabber(datagrabber_config: Dict) -> BaseDataGrabber:
|
||||
"""Get datagrabber.
|
||||
"""Get DataGrabber.
|
||||
|
||||
Parameters
|
||||
----------
|
||||
datagrabber_config : dict
|
||||
The config to get the datagrabber using.
|
||||
The config to get the DataGrabber using.
|
||||
|
||||
Returns
|
||||
-------
|
||||
dict
|
||||
The datagrabber.
|
||||
object
|
||||
The DataGrabber.
|
||||
|
||||
"""
|
||||
datagrabber_params = datagrabber_config.copy()
|
||||
|
|
@ -90,8 +90,8 @@ def run(
|
|||
workdir : str or pathlib.Path
|
||||
Directory where the pipeline will be executed.
|
||||
datagrabber : dict
|
||||
Datagrabber to use. Must have a key ``kind`` with the kind of
|
||||
datagrabber to use. All other keys are passed to the datagrabber
|
||||
DataGrabber to use. Must have a key ``kind`` with the kind of
|
||||
DataGrabber to use. All other keys are passed to the DataGrabber
|
||||
init function.
|
||||
markers : list of dict
|
||||
List of markers to extract. Each marker is a dict with at least two
|
||||
|
|
@ -108,7 +108,7 @@ def run(
|
|||
preprocessor to use. All other keys are passed to the preprocessor
|
||||
init function (default None).
|
||||
elements : str or tuple or list of str or tuple, optional
|
||||
Element(s) to process. Will be used to index the datagrabber
|
||||
Element(s) to process. Will be used to index the DataGrabber
|
||||
(default None).
|
||||
|
||||
"""
|
||||
|
|
@ -220,7 +220,7 @@ def queue(
|
|||
overwrite : bool, optional
|
||||
Whether to overwrite if job directory already exists (default False).
|
||||
elements : str or tuple or list of str or tuple, optional
|
||||
Element(s) to process. Will be used to index the datagrabber
|
||||
Element(s) to process. Will be used to index the DataGrabber
|
||||
(default None).
|
||||
**kwargs : dict
|
||||
The keyword arguments to pass to the job queue system.
|
||||
|
|
@ -339,7 +339,7 @@ def _queue_condor(
|
|||
yaml_config : pathlib.Path
|
||||
The path to the YAML config file.
|
||||
elements : list of str or tuple
|
||||
Element(s) to process. Will be used to index the datagrabber.
|
||||
Element(s) to process. Will be used to index the DataGrabber.
|
||||
config : dict
|
||||
The configuration to be used for queueing the job.
|
||||
env : dict, optional
|
||||
|
|
@ -559,7 +559,7 @@ def _queue_slurm(
|
|||
yaml_config : pathlib.Path
|
||||
The path to the YAML config file.
|
||||
elements : str or tuple or list[str or tuple], optional
|
||||
Element(s) to process. Will be used to index the datagrabber
|
||||
Element(s) to process. Will be used to index the DataGrabber
|
||||
(default None).
|
||||
config : dict
|
||||
The configuration to be used for queueing the job.
|
||||
|
|
|
|||
|
|
@ -1,4 +1,4 @@
|
|||
"""Provide class for AOMIC1000 VBM juseless datalad datagrabber."""
|
||||
"""Provide concrete implementation for AOMIC ID1000 VBM DataGrabber."""
|
||||
|
||||
# Authors: Felix Hoffstaedter <f.hoffstaedter@fz-juelich.de>
|
||||
# Synchon Mandal <s.mandal@fz-juelich.de>
|
||||
|
|
@ -13,13 +13,13 @@ from ....datagrabber import PatternDataladDataGrabber
|
|||
|
||||
@register_datagrabber
|
||||
class JuselessDataladAOMICID1000VBM(PatternDataladDataGrabber):
|
||||
"""Juseless AOMICID1000 VBM Data Grabber class.
|
||||
"""Concrete implementation for Juseless AOMIC ID1000 VBM data fetching.
|
||||
|
||||
Implements a Data Grabber to access the AOMICID1000 VBM data in Juseless.
|
||||
Implements a DataGrabber to access the AOMIC ID1000 VBM data in Juseless.
|
||||
|
||||
Parameters
|
||||
----------
|
||||
datadir : str or pathlib.Path, optional
|
||||
datadir : str or pathlib.Path or None, optional
|
||||
The directory where the datalad dataset will be cloned. If None,
|
||||
the datalad dataset will be cloned into a temporary directory
|
||||
(default None).
|
||||
|
|
|
|||
|
|
@ -1,4 +1,4 @@
|
|||
"""Provide class for CamCAN VBM juseless datalad datagrabber."""
|
||||
"""Provide concrete implementation for CamCAN VBM DataGrabber."""
|
||||
|
||||
# Authors: Federico Raimondo <f.raimondo@fz-juelich.de>
|
||||
# Leonard Sasse <l.sasse@fz-juelich.de>
|
||||
|
|
@ -14,13 +14,13 @@ from ....datagrabber import PatternDataladDataGrabber
|
|||
|
||||
@register_datagrabber
|
||||
class JuselessDataladCamCANVBM(PatternDataladDataGrabber):
|
||||
"""Juseless CamCAN VBM Data Grabber class.
|
||||
"""Concrete implementation for Juseless CamCAN VBM data fetching.
|
||||
|
||||
Implements a Data Grabber to access the CamCAN VBM data in Juseless.
|
||||
Implements a DataGrabber to access the CamCAN VBM data in Juseless.
|
||||
|
||||
Parameters
|
||||
----------
|
||||
datadir : str or pathlib.Path, optional
|
||||
datadir : str or pathlib.Path or None, optional
|
||||
The directory where the datalad dataset will be cloned. If None,
|
||||
the datalad dataset will be cloned into a temporary directory
|
||||
(default None).
|
||||
|
|
|
|||
|
|
@ -1,4 +1,4 @@
|
|||
"""Provide class for IXI VBM juseless datalad datagrabber."""
|
||||
"""Provide concrete implementation for IXI VBM DataGrabber."""
|
||||
|
||||
# Authors: Federico Raimondo <f.raimondo@fz-juelich.de>
|
||||
# Leonard Sasse <l.sasse@fz-juelich.de>
|
||||
|
|
@ -15,19 +15,20 @@ from ....utils import raise_error
|
|||
|
||||
@register_datagrabber
|
||||
class JuselessDataladIXIVBM(PatternDataladDataGrabber):
|
||||
"""Juseless IXI VBM Data Grabber class.
|
||||
"""Concrete implementation for Juseless IXI VBM data fetching.
|
||||
|
||||
Implements a Data Grabber to access the IXI VBM data in Juseless.
|
||||
Implements a DataGrabber to access the IXI VBM data in Juseless.
|
||||
|
||||
Parameters
|
||||
----------
|
||||
datadir : str or pathlib.Path, optional
|
||||
datadir : str or pathlib.Path or None, optional
|
||||
The directory where the datalad dataset will be cloned. If None,
|
||||
the datalad dataset will be cloned into a temporary directory
|
||||
(default None).
|
||||
sites : {"Guys", "HH", "IOP"} or list of the options, optional.
|
||||
sites : {"Guys", "HH", "IOP"} or list of the options or None, optional
|
||||
Which sites to access data from. If None, all available sites are
|
||||
selected (default None).
|
||||
|
||||
"""
|
||||
|
||||
def __init__(
|
||||
|
|
|
|||
|
|
@ -1,4 +1,4 @@
|
|||
"""Provide tests for AOMICID1000 VBM juseless datagrabber."""
|
||||
"""Provide tests for JuselessDataladAOMICID1000VBM."""
|
||||
|
||||
# Authors: Felix Hoffstaedter <f.hoffstaedter@fz-juelich.de>
|
||||
# Synchon Mandal <s.mandal@fz-juelich.de>
|
||||
|
|
@ -19,8 +19,8 @@ if socket.gethostname() != "juseless":
|
|||
configure_logging(level="DEBUG")
|
||||
|
||||
|
||||
def test_juselessdataladaomicid1000vbm_datagrabber() -> None:
|
||||
"""Test datalad AOMICID1000VBM datagrabber."""
|
||||
def test_JuselessDataladAOMICID1000VBM() -> None:
|
||||
"""Test JuselessDataladAOMICID1000VBM."""
|
||||
with JuselessDataladAOMICID1000VBM() as dg:
|
||||
all_elements = dg.get_elements()
|
||||
test_element = all_elements[0]
|
||||
|
|
|
|||
|
|
@ -1,4 +1,4 @@
|
|||
"""Provide tests for CamCAN VBM juseless datagrabber."""
|
||||
"""Provide tests for JuselessDataladCamCANVBM."""
|
||||
|
||||
# Authors: Federico Raimondo <f.raimondo@fz-juelich.de>
|
||||
# Leonard Sasse <l.sasse@fz-juelich.de>
|
||||
|
|
@ -20,8 +20,8 @@ if socket.gethostname() != "juseless":
|
|||
configure_logging(level="DEBUG")
|
||||
|
||||
|
||||
def test_juselessdataladcamcanvbm_datagrabber() -> None:
|
||||
"""Test datalad CamCANVBM datagrabber."""
|
||||
def test_JuselessDataladCamCANVBM() -> None:
|
||||
"""Test JuselessDataladCamCANVBM."""
|
||||
with JuselessDataladCamCANVBM() as dg:
|
||||
all_elements = dg.get_elements()
|
||||
test_element = all_elements[0]
|
||||
|
|
|
|||
|
|
@ -1,4 +1,4 @@
|
|||
"""Provide tests for IXI VBM juseless datagrabber."""
|
||||
"""Provide tests for JuselessDataladIXIVBM."""
|
||||
|
||||
# Authors: Federico Raimondo <f.raimondo@fz-juelich.de>
|
||||
# Leonard Sasse <l.sasse@fz-juelich.de>
|
||||
|
|
@ -20,8 +20,8 @@ if socket.gethostname() != "juseless":
|
|||
configure_logging(level="DEBUG")
|
||||
|
||||
|
||||
def test_juselessdataladixivbm_datagrabber() -> None:
|
||||
"""Test datalad IXIVBM datagrabber."""
|
||||
def test_JuselessDataladIXIVBM() -> None:
|
||||
"""Test JuselessDataladIXIVBM."""
|
||||
with JuselessDataladIXIVBM() as dg:
|
||||
all_elements = dg.get_elements()
|
||||
test_element = all_elements[0]
|
||||
|
|
@ -33,8 +33,8 @@ def test_juselessdataladixivbm_datagrabber() -> None:
|
|||
assert out["VBM_GM"]["path"].exists()
|
||||
|
||||
|
||||
def test_juselessdataladixivbm_datagrabber_invalid_site() -> None:
|
||||
"""Test datalad IXIVBM datagrabber with invalid site."""
|
||||
def test_JuselessDataladIXIVBM_invalid_site() -> None:
|
||||
"""Test JuselessDataladIXIVBM with invalid site."""
|
||||
with pytest.raises(ValueError, match="notavalidsite not a valid site"):
|
||||
with JuselessDataladIXIVBM(sites="notavalidsite"):
|
||||
pass
|
||||
|
|
|
|||
|
|
@ -1,4 +1,4 @@
|
|||
"""Provide tests for UCLA juseless datagrabber."""
|
||||
"""Provide tests for JuselessUCLA."""
|
||||
|
||||
# Authors: Federico Raimondo <f.raimondo@fz-juelich.de>
|
||||
# Leonard Sasse <l.sasse@fz-juelich.de>
|
||||
|
|
@ -21,8 +21,8 @@ if socket.gethostname() != "juseless":
|
|||
configure_logging(level="DEBUG")
|
||||
|
||||
|
||||
def test_juseless_ucla_datagrabber() -> None:
|
||||
"""Test juseless ucla datagrabber."""
|
||||
def test_JuselessUCLA() -> None:
|
||||
"""Test JuselessUCLA."""
|
||||
with JuselessUCLA() as dg:
|
||||
all_elements = dg.get_elements()
|
||||
test_element = all_elements[0]
|
||||
|
|
@ -46,8 +46,8 @@ def test_juseless_ucla_datagrabber() -> None:
|
|||
"tasks",
|
||||
[None, "rest", ["rest", "stopsignal"]],
|
||||
)
|
||||
def test_juseless_ucla_datagrabber_task_params(tasks: Optional[str]) -> None:
|
||||
"""Test juseless ucla datagrabber with different task parameters.
|
||||
def test_JuselessUCLA_task_params(tasks: Optional[str]) -> None:
|
||||
"""Test JuselessUCLA with different task parameters.
|
||||
|
||||
Parameters
|
||||
----------
|
||||
|
|
@ -81,8 +81,8 @@ def test_juseless_ucla_datagrabber_task_params(tasks: Optional[str]) -> None:
|
|||
assert el[1] in ["rest", "stopsignal"]
|
||||
|
||||
|
||||
def test_juseless_ucla_datagrabber_invalid_tasks() -> None:
|
||||
"""Test juseless ucla datagrabber with invalid task parameters."""
|
||||
def test_JuselessUCLA_invalid_tasks() -> None:
|
||||
"""Test JuselessUCLA with invalid task parameters."""
|
||||
with pytest.raises(
|
||||
ValueError, match="invalid is not a valid task in the UCLA"
|
||||
):
|
||||
|
|
|
|||
|
|
@ -1,4 +1,4 @@
|
|||
"""Provide tests for juseless datagrabber."""
|
||||
"""Provide tests for JuselessDataladUKBVBM."""
|
||||
|
||||
# Authors: Federico Raimondo <f.raimondo@fz-juelich.de>
|
||||
# Leonard Sasse <l.sasse@fz-juelich.de>
|
||||
|
|
@ -20,8 +20,8 @@ if socket.gethostname() != "juseless":
|
|||
configure_logging(level="DEBUG")
|
||||
|
||||
|
||||
def test_juselessdataladukbvbm_datagrabber() -> None:
|
||||
"""Test datalad UKBVBM datagrabber."""
|
||||
def test_JuselessDataladUKBVBM() -> None:
|
||||
"""Test JuselessDataladUKBVBM."""
|
||||
with JuselessDataladUKBVBM() as dg:
|
||||
all_elements = dg.get_elements()
|
||||
test_element = all_elements[0]
|
||||
|
|
|
|||
|
|
@ -1,4 +1,4 @@
|
|||
"""Provide a concrete implementation for UCLA dataset."""
|
||||
"""Provide concrete implementation for UCLA DataGrabber."""
|
||||
|
||||
# Authors: Federico Raimondo <f.raimondo@fz-juelich.de>
|
||||
# Leonard Sasse <l.sasse@fz-juelich.de>
|
||||
|
|
@ -14,16 +14,18 @@ from ....utils import raise_error
|
|||
|
||||
@register_datagrabber
|
||||
class JuselessUCLA(PatternDataGrabber):
|
||||
"""Concrete implementation for pattern-based data fetching of UCLA data.
|
||||
"""Concrete implementation for Juseless UCLA data fetching.
|
||||
|
||||
Implements a DataGrabber to access the UCLA data in Juseless.
|
||||
|
||||
Parameters
|
||||
----------
|
||||
datadir : str or Path, optional
|
||||
datadir : str or pathlib.Path, optional
|
||||
The directory where the dataset is stored
|
||||
(default '/data/project/psychosis_thalamus/data/fmriprep').
|
||||
(default "/data/project/psychosis_thalamus/data/fmriprep").
|
||||
tasks : {"rest", "bart", "bht", "pamenc", "pamret", \
|
||||
"scap", "taskswitch", "stopsignal"} or \
|
||||
list of the options, optional
|
||||
list of the options or None, optional
|
||||
UCLA task sessions. If None, all available task sessions are
|
||||
selected (default None).
|
||||
|
||||
|
|
@ -118,5 +120,6 @@ class JuselessUCLA(PatternDataGrabber):
|
|||
elements : list
|
||||
The list of elements that can be grabbed in the dataset after
|
||||
imposing constraints based on specified tasks.
|
||||
|
||||
"""
|
||||
return [x for x in super().get_elements() if x[1] in self.tasks]
|
||||
|
|
|
|||
|
|
@ -1,4 +1,4 @@
|
|||
"""Provide class for juseless datalad datagrabber."""
|
||||
"""Provide concrete implementation for UKB VBM DataGrabber."""
|
||||
|
||||
# Authors: Federico Raimondo <f.raimondo@fz-juelich.de>
|
||||
# Leonard Sasse <l.sasse@fz-juelich.de>
|
||||
|
|
@ -14,13 +14,13 @@ from ....datagrabber import PatternDataladDataGrabber
|
|||
|
||||
@register_datagrabber
|
||||
class JuselessDataladUKBVBM(PatternDataladDataGrabber):
|
||||
"""Juseless UKB VBM Data Grabber class.
|
||||
"""Concrete implementation for Juseless UKB VBM data fetching.
|
||||
|
||||
Implements a Data Grabber to access the UKB VBM data in Juseless.
|
||||
Implements a DataGrabber to access the UKB VBM data in Juseless.
|
||||
|
||||
Parameters
|
||||
----------
|
||||
datadir : str or pathlib.Path, optional
|
||||
datadir : str or pathlib.Path or None, optional
|
||||
The directory where the datalad dataset will be cloned. If None,
|
||||
the datalad dataset will be cloned into a temporary directory
|
||||
(default None).
|
||||
|
|
|
|||
|
|
@ -1,32 +0,0 @@
|
|||
"""Provide tests for juseless datagrabber."""
|
||||
|
||||
# Authors: Federico Raimondo <f.raimondo@fz-juelich.de>
|
||||
# Leonard Sasse <l.sasse@fz-juelich.de>
|
||||
# Synchon Mandal <s.mandal@fz-juelich.de>
|
||||
# License: AGPL
|
||||
|
||||
import socket
|
||||
|
||||
import pytest
|
||||
|
||||
from junifer.datagrabber.hcp import DataladHCP1200
|
||||
from junifer.utils.logging import configure_logging
|
||||
|
||||
|
||||
# Check if the test is running on juseless
|
||||
if socket.gethostname() != "juseless":
|
||||
pytest.skip("These tests are only for juseless", allow_module_level=True)
|
||||
|
||||
configure_logging(level="DEBUG")
|
||||
|
||||
|
||||
def test_juselessdataladhcp_datagrabber() -> None:
|
||||
"""Test datalad HCP datagrabber."""
|
||||
with DataladHCP1200() as dg:
|
||||
all_elements = dg.get_elements()
|
||||
test_element = all_elements[0]
|
||||
|
||||
out = dg[test_element]
|
||||
|
||||
assert out["BOLD"]["path"].exists()
|
||||
assert out["BOLD"]["path"].isfile()
|
||||
|
|
@ -2,6 +2,7 @@
|
|||
|
||||
# Authors: Federico Raimondo <f.raimondo@fz-juelich.de>
|
||||
# Leonard Sasse <l.sasse@fz-juelich.de>
|
||||
# Synchon Mandal <s.mandal@fz-juelich.de>
|
||||
# License: AGPL
|
||||
|
||||
|
||||
|
|
@ -12,5 +13,5 @@ from .pattern import PatternDataGrabber
|
|||
from .pattern_datalad import PatternDataladDataGrabber
|
||||
|
||||
from .aomic import DataladAOMICID1000, DataladAOMICPIOP1, DataladAOMICPIOP2
|
||||
from .hcp import HCP1200, DataladHCP1200
|
||||
from .hcp1200 import HCP1200, DataladHCP1200
|
||||
from .multiple import MultipleDataGrabber
|
||||
|
|
|
|||
Some files were not shown because too many files have changed in this diff Show more
Loading…
Reference in a new issue