[ENH]: Shorten Sphinx references in codebase #218

Merged
synchon merged 62 commits from chore/shorten-sphinx-ref into main 2023-03-31 12:47:53 +00:00
61 changed files with 249 additions and 259 deletions

View file

@ -7,6 +7,7 @@
![PyPI - Wheel](https://img.shields.io/pypi/wheel/junifer?style=flat-square)
fraimondo commented 2023-03-31 12:09:25 +00:00 (Migrated from github.com)

There's an error here.

There's an error here.
![GitHub](https://img.shields.io/github/license/juaml/junifer?style=flat-square)
![Codecov](https://img.shields.io/codecov/c/github/juaml/junifer?style=flat-square)
[![Code style: black](https://img.shields.io/badge/code%20style-black-000000.svg?style=flat-square)](https://github.com/psf/black)
## About

View file

@ -43,55 +43,55 @@ Available
- Type/Config
- State
- Version Added
* - :class:`junifer.datagrabber.DataladHCP1200`
* - :class:`.DataladHCP1200`
- `HCP OpenAccess dataset <https://github.com/datalad-datasets/human-connectome-project-openaccess>`_
- Open with registration
- Built-in
- Done
- 0.0.1
* - :class:`junifer.configs.juseless.datagrabbers.JuselessDataladUKBVBM`
* - :class:`.JuselessDataladUKBVBM`
- UKB VBM dataset preprocessed with CAT. Available for Juseless only.
- Restricted
- ``junifer.configs.juseless``
- Done
- 0.0.1
* - :class:`junifer.configs.juseless.datagrabbers.JuselessDataladCamCANVBM`
* - :class:`.JuselessDataladCamCANVBM`
- CamCAN VBM dataset preprocessed with CAT. Available for Juseless only.
- Restricted
- ``junifer.configs.juseless``
- Done
- 0.0.1
* - :class:`junifer.datagrabber.DataladAOMICID1000`
* - :class:`.DataladAOMICID1000`
- `AOMIC 1000 dataset <https://github.com/OpenNeuroDatasets/ds003097>`_
- Open without registration
- Built-in
- Done
- 0.0.1
* - :class:`junifer.datagrabber.DataladAOMICPIOP1`
* - :class:`.DataladAOMICPIOP1`
- `AOMIC PIOP1 dataset <https://github.com/OpenNeuroDatasets/ds002785>`_
- Open without registration
- Built-in
- Done
- 0.0.1
* - :class:`junifer.datagrabber.DataladAOMICPIOP2`
* - :class:`.DataladAOMICPIOP2`
- `AOMIC PIOP2 dataset <https://github.com/OpenNeuroDatasets/ds002790>`_
- Open without registration
- Built-in
- Done
- 0.0.1
* - :class:`junifer.configs.juseless.datagrabbers.JuselessDataladAOMICID1000VBM`
* - :class:`.JuselessDataladAOMICID1000VBM`
- AOMIC ID1000 VBM dataset. Available for Juseless only.
- Restricted
- ``junifer.configs.juseless``
- Done
- 0.0.1
* - :class:`junifer.configs.juseless.datagrabbers.JuselessDataladIXIVBM`
* - :class:`.JuselessDataladIXIVBM`
- `IXI VBM dataset <https://brain-development.org/ixi-dataset/>`_. Available for Juseless only.
- Restricted
- ``junifer.configs.juseless``
- Done
- 0.0.1
* - :class:`junifer.configs.juseless.datagrabbers.JuselessUCLA`
* - :class:`.JuselessUCLA`
- UCLA fMRIPrep dataset. Available for Juseless only.
- Restricted
- ``junifer.configs.juseless``
@ -144,61 +144,61 @@ Available
- Description
- State
- Version Added
* - :class:`junifer.markers.ParcelAggregation`
* - :class:`.ParcelAggregation`
- Apply parcellation and perform aggregation function
- Done
- 0.0.1
* - :class:`junifer.markers.FunctionalConnectivityParcels`
* - :class:`.FunctionalConnectivityParcels`
- Compute functional connectivity over parcellation
- Done
- 0.0.1
* - :class:`junifer.markers.CrossParcellationFC`
* - :class:`.CrossParcellationFC`
- Compute functional connectivity across two parcellations
- Done
- 0.0.1
* - :class:`junifer.markers.SphereAggregation`
* - :class:`.SphereAggregation`
- Spherical aggregation using mean
- Done
- 0.0.1
* - :class:`junifer.markers.FunctionalConnectivitySpheres`
* - :class:`.FunctionalConnectivitySpheres`
- Compute functional connectivity over spheres placed on coordinates
- Done
- 0.0.1
* - :class:`junifer.markers.RSSETSMarker`
* - :class:`.RSSETSMarker`
- Compute root sum of squares of edgewise timeseries
- Done
- 0.0.1
* - :class:`junifer.markers.ReHoParcels`
* - :class:`.ReHoParcels`
- Calculate regional homogeneity over parcellation
- Done
- 0.0.1
* - :class:`junifer.markers.ReHoSpheres`
* - :class:`.ReHoSpheres`
- Calculate regional homogeneity over spheres placed on coordinates
- Done
- 0.0.1
* - :class:`junifer.markers.ALFFParcels`
* - :class:`.ALFFParcels`
- Calculate (f)ALFF and aggregate using parcellations
- Done
- 0.0.1
* - :class:`junifer.markers.ALFFSpheres`
* - :class:`.ALFFSpheres`
- Calculate (f)ALFF and aggregate using spheres placed on coordinates
- Done
- 0.0.1
* - :class:`junifer.markers.EdgeCentricFCParcels`
* - :class:`.EdgeCentricFCParcels`
- Calculate edge-centric functional connectivity over parcellation, as found in
`Jo et al. (2021) <https://doi.org/10.1016/j.neuroimage.2021.118204>`_
- Done
- 0.0.2
* - :class:`junifer.markers.EdgeCentricFCSpheres`
* - :class:`.EdgeCentricFCSpheres`
- Calculate edge-centric functional connectivity over spheres placed on coordinates,
as found in `Jo et al. (2021) <https://doi.org/10.1016/j.neuroimage.2021.118204>`_
- Done
- 0.0.2
* - :class:`junifer.markers.TemporalSNRParcels`
* - :class:`.TemporalSNRParcels`
- Calculate temporal signal-to-noise ratio using parcellations
- Done
- 0.0.2
* - :class:`junifer.markers.TemporalSNRSpheres`
* - :class:`.TemporalSNRSpheres`
- Calculate temporal signal-to-noise ratio using spheres placed on coordinates
- Done
- 0.0.2

View file

@ -1 +1 @@
Expose a :func:`junifer.data.parcellations.merge_parcellations` function to merge a list of parcellations by `Leonard Sasse`_
Expose a :func:`.merge_parcellations` function to merge a list of parcellations by `Leonard Sasse`_

View file

@ -1 +1 @@
Add support for HDF5 feature storage via :class:`junifer.storage.HDF5FeatureStorage` by `Synchon Mandal`_
Add support for HDF5 feature storage via :class:`.HDF5FeatureStorage` by `Synchon Mandal`_

View file

@ -1 +1 @@
Add ``confounds_format`` parameter to :class:`junifer.datagrabber.PatternDataGrabber` constructor for improved handling of confounds specified via ``BOLD_confounds`` data type by `Synchon Mandal`_
Add ``confounds_format`` parameter to :class:`.PatternDataGrabber` constructor for improved handling of confounds specified via ``BOLD_confounds`` data type by `Synchon Mandal`_

View file

@ -1 +1 @@
Allow :class:`junifer.testing.datagrabbers.PartlyCloudyTestingDataGrabber` to be accessible via ``import junifer.testing.registry`` by `Synchon Mandal`_
Allow :class:`.PartlyCloudyTestingDataGrabber` to be accessible via ``import junifer.testing.registry`` by `Synchon Mandal`_

View file

@ -1 +1 @@
Add :class:`junifer.markers.TemporalSNRParcels` and :class:`junifer.markers.TemporalSNRSpheres` by `Leonard Sasse`_
Add :class:`.TemporalSNRParcels` and :class:`.TemporalSNRSpheres` by `Leonard Sasse`_

View file

@ -1 +1 @@
Fix :class:`junifer.markers.ALFFParcels`, :class:`junifer.markers.ALFFSpheres`, :class:`junifer.markers.ReHoSpheres` and :class:`junifer.markers.ReHoParcels` pass the ``extra_input`` parameter by `Fede Raimondo`_
Fix :class:`.ALFFParcels`, :class:`.ALFFSpheres`, :class:`.ReHoSpheres` and :class:`.ReHoParcels` pass the ``extra_input`` parameter by `Fede Raimondo`_

View file

@ -1 +1 @@
Expose ``allow_overlap`` parameter in :class:`junifer.markers.SphereAggregation` and related markers by `Fede Raimondo`_
Expose ``allow_overlap`` parameter in :class:`.SphereAggregation` and related markers by `Fede Raimondo`_

View file

@ -1 +1 @@
Allow for empty spheres in :class:`junifer.external.nilearn.JuniferNiftiSpheresMasker`, that will result in NaNs. Also, modify the behaviour of the ``collect`` parameter in HTCondor ``queue`` function to run a collect job even if some of the previous jobs fail. This is useful to collect the results of a pipeline even if some of the jobs fail by `Fede Raimondo`_
Allow for empty spheres in :class:`.JuniferNiftiSpheresMasker`, that will result in NaNs. Also, modify the behaviour of the ``collect`` parameter in HTCondor ``queue`` function to run a collect job even if some of the previous jobs fail. This is useful to collect the results of a pipeline even if some of the jobs fail by `Fede Raimondo`_

View file

@ -1 +1 @@
Add aggregation function :func:`junifer.stats.count` that returns the number of elements in a given axis. This allows to count the number of voxels per sphere/parcel when used as ``method`` in markers by `Fede Raimondo`_
Add aggregation function :func:`.count` that returns the number of elements in a given axis. This allows to count the number of voxels per sphere/parcel when used as ``method`` in markers by `Fede Raimondo`_

View file

@ -1 +1 @@
Fix a bug in which :class:`junifer.markers.ParcelAggregation` could yield duplicated column names if two or more parcels were used and label names were not unique by `Fede Raimondo`_
Fix a bug in which :class:`.ParcelAggregation` could yield duplicated column names if two or more parcels were used and label names were not unique by `Fede Raimondo`_

View file

@ -1 +1 @@
Allow for empty parcels in :class:`junifer.markers.ParcelAggregation`, that will result in NaNs by `Fede Raimondo`_
Allow for empty parcels in :class:`.ParcelAggregation`, that will result in NaNs by `Fede Raimondo`_

View file

@ -1 +1 @@
Fix a bug in which :func:`junifer.stats.count` will not be correctly applied across an axis by `Fede Raimondo`_
Fix a bug in which :func:`.count` will not be correctly applied across an axis by `Fede Raimondo`_

View file

@ -1 +1 @@
Improve metadata and data I/O for :class:`junifer.storage.HDF5FeatureStorage` by `Synchon Mandal`_
Improve metadata and data I/O for :class:`.HDF5FeatureStorage` by `Synchon Mandal`_

View file

@ -1 +1 @@
Fix a bug in which :func:`junifer.data.masks.get_mask` fails for FunctionalConnectivityBase class, because of missing extra_input parameter by `Leonard Sasse`_
Fix a bug in which :func:`.get_mask` fails for FunctionalConnectivityBase class, because of missing extra_input parameter by `Leonard Sasse`_

View file

@ -1 +1 @@
Add missing ``abstractmethod`` decorators for ``get_valid_inputs`` methods of :class:`junifer.markers.BaseMarker` and :class:`junifer.preprocess.BasePreprocessor` by `Synchon Mandal`_
Add missing ``abstractmethod`` decorators for ``get_valid_inputs`` methods of :class:`.BaseMarker` and :class:`.BasePreprocessor` by `Synchon Mandal`_

View file

@ -1 +1 @@
Fix the output of :class:`junifer.markers.RSSETSMarker` to be 2D by `Synchon Mandal`_
Fix the output of :class:`.RSSETSMarker` to be 2D by `Synchon Mandal`_

View file

@ -1 +1 @@
``AmplitudeLowFrequencyFluctuationParcels`` and ``AmplitudeLowFrequencyFluctuationSpheres`` are renamed to :class:`junifer.markers.ALFFParcels` and :class:`junifer.markers.ALFFSpheres` by `Synchon Mandal`_
Rename ``AmplitudeLowFrequencyFluctuationParcels`` and ``AmplitudeLowFrequencyFluctuationSpheres`` to :class:`.ALFFParcels` and :class:`.ALFFSpheres` by `Synchon Mandal`_

View file

@ -0,0 +1 @@
Shorten Sphinx references across code and docs, and add ``black`` shield in README by `Synchon Mandal`_

View file

@ -1 +1 @@
Add :class:`junifer.markers.EdgeCentricFCParcels` and :class:`junifer.markers.EdgeCentricFCSpheres` by `Leonard Sasse`_
Add :class:`.EdgeCentricFCParcels` and :class:`.EdgeCentricFCSpheres` by `Leonard Sasse`_

View file

@ -6,11 +6,9 @@ Adding Coordinates
==================
Instead of using whole-brain parcellations to aggregate voxel-wise signals from
MR images (as for example in the
:class:`junifer.markers.parcel_aggregation.ParcelAggregation` marker), Junifer
MR images (as for example in the :class:`.ParcelAggregation` marker), Junifer
allows you to specify a set of coordinates around which to draw spheres to
aggregate (for example using the
:class:`junifer.markers.sphere_aggregation.SphereAggregation` marker) the MR
aggregate (for example using the :class:`.SphereAggregation` marker) the MR
signals from individual voxels. Now, before you start specifying your own sets
of coordinates, check the coordinates that Junifer already has
:ref:`built in <builtin>`. If you simply want to use a well known set of
@ -19,9 +17,8 @@ provides them already.
If you checked the in-built coordinates, and they are not there already (for
example if you came up with your own set of coordinates), then Junifer provides
an easy way for you to register them using the
:func:`junifer.data.coordinates.register_coordinates` function, so you can use
your own set of coordinates within a Junifer pipeline.
an easy way for you to register them using the :func:`.register_coordinates`
function, so you can use your own set of coordinates within a Junifer pipeline.
From the API reference, we can see that it has 3 positional arguments
(``name``, ``coordinates``, and ``voi_names``) as well as one
@ -30,10 +27,9 @@ optional keyword argument (``overwrite``).
The ``name`` argument takes a string indicating the name you want to give to
this set of coordinates. This ``name`` can be used to obtain and operate on a
set of coordinates in Junifer. For example, you can obtain your coordinates
after registration by providing ``name`` to
:func:`junifer.data.coordinates.load_coordinates`. We could simply call it
``"my_set_of_coordinates"``, but likely you want a more descriptive and more
informative name most of the time.
after registration by providing ``name`` to :func:`.load_coordinates`. We could
simply call it ``"my_set_of_coordinates"``, but likely you want a more
descriptive and more informative name most of the time.
The ``coordinates`` argument takes the actual coordinates as a 2-dimensional
:class:`numpy.ndarray`. It contains one row for every location, and three
@ -116,8 +112,7 @@ you can use the ``with`` keyword provided by Junifer:
Afterwards continue configuring the rest of your pipeline in this YAML file,
and you will be able to use this set of coordinates using the name you gave it
during registration (in our example "DMNCustom"). We can add a
:class:`junifer.markers.sphere_aggregation.SphereAggregation` to demonstrate
how this can be done:
:class:`.SphereAggregation` to demonstrate how this can be done:
.. code-block:: yaml

View file

@ -13,7 +13,7 @@ the structure of a dataset and provide two specific functionalities:
2) Provide the list of *elements* available in the dataset.
In this section, we will see how to create a datagrabber for a dataset. Basic
aspects of datagrabbers are covered in the
aspects of datagrabbers are covered in the
:ref:`Understanding Data Grabbers <datagrabber>` section.
.. _extending_datagrabbers_think:
@ -29,7 +29,7 @@ only one of each *data type* (see :ref:`data_types`).
For example, if we have a dataset from an fMRI study in which:
a) both T1w and fMRI was acquired
a) both T1w and fMRI was acquired
b) 20 subjects went through an experiment twice
c) the experiment included resting-stage fMRI and a task named *stroop*
@ -64,7 +64,7 @@ Junifer provides an abstract class to deal with datasets that can be thought in
terms of *patterns*. A *pattern* is a string that contains placeholders that are
replaced by the actual values of the element. In our BIDS example, the path
to the T1w image of subject `sub-01` and session `ses-01`, relative to the
dataset location, is ``sub-01/ses-01/anat/sub-01_ses-01_T1w.nii.gz``. By
dataset location, is ``sub-01/ses-01/anat/sub-01_ses-01_T1w.nii.gz``. By
replacing ``sub-01`` with ``sub-02``, we can obtain the T1w image of the first
session of the second subject. Indeed, the path to the T1w images can be
expressed as a pattern:
@ -105,7 +105,7 @@ in it.
Before creating the datagrabber, we need to define 3 variables:
* ``types``: A list with the available :ref:`data_types` in our dataset
* ``types``: A list with the available :ref:`data_types` in our dataset
* ``patterns``: A dictionary that specifies the pattern for each data type.
* ``replacements``: A list indicating which of the elements in the patterns
should be replaced by the values of the element.
@ -125,7 +125,7 @@ An additional fourth variable is the ``datadir``, which should be the path to
where the dataset is located. For example, if the dataset is located in
``/data/project/test/data``, then ``datadir`` should be
``/data/project/test/data``. Or, if we want to allow the user to specify the
location of the dataset, we can expose the variable in the constructor, as in
location of the dataset, we can expose the variable in the constructor, as in
this example
With this defined, we can now create our datagrabber, we will name it
@ -147,7 +147,7 @@ With this defined, we can now create our datagrabber, we will name it
replacements = ["subject", "session"]
super().__init__(
datadir=datadir,
types=types,
types=types,
patterns=patterns,
replacements=replacements,
)
@ -175,7 +175,7 @@ use the :py:func:`~junifer.api.decorators.register_datagrabber` decorator.
replacements = ["subject", "session"]
super().__init__(
datadir=datadir,
types=types,
types=types,
patterns=patterns,
replacements=replacements,
)
@ -186,29 +186,28 @@ in the yaml file to ``ExampleBIDSDataGrabber``. Remember that we still need to
set the ``datadir``.
fraimondo commented 2023-03-31 12:10:41 +00:00 (Migrated from github.com)

This is on purpose for educational purposes?

This is on purpose for educational purposes?
synchon commented 2023-03-31 12:18:06 +00:00 (Migrated from github.com)

What do you mean?

What do you mean?
fraimondo commented 2023-03-31 12:19:46 +00:00 (Migrated from github.com)

it has the full reference: ~junifer.datagrabber.PatternDataladDataGrabber

it has the full reference: ``~junifer.datagrabber.PatternDataladDataGrabber``
synchon commented 2023-03-31 12:21:11 +00:00 (Migrated from github.com)

Yeah missed that, good catch, thanks!

Yeah missed that, good catch, thanks!
.. code-block:: yaml
datagrabber:
kind: ExampleBIDSDataGrabber
datadir: /data/project/test/data
Optional: Using datalad
Optional: Using datalad
"""""""""""""""""""""""
If you are using `datalad`_, you can use the
:py:class:`~junifer.datagrabber.PatternDataladDataGrabber` instead of the
:py:class:`~junifer.datagrabber.PatternDataGrabber`. This class will not only
If you are using `datalad`_, you can use the :class:`.PatternDataladDataGrabber`
instead of the :class:`.PatternDataGrabber`. This class will not only
interpret patterns, but also use `datalad`_ to `clone` and `get` the data.
The main difference between the two is that the ``datadir`` is not the actual
location of the dataset, but the location where the dataset will be cloned. It
location of the dataset, but the location where the dataset will be cloned. It
can now be ``None``, which means that the data will be downloaded to a
temporary directory. To set the location of the dataset, you can use the
``uri`` argument in the constructor. Additionally, a ``rootdir`` argument can
be used to specify the path to the root directory of the dataset after doing
``datalad clone``.
In the example, the dataset is hosted in gin
In the example, the dataset is hosted in gin
(``https://gin.g-node.org/juaml/datalad-example-bids``).
When we clone this dataset, we will see the following structure:
@ -262,7 +261,7 @@ And we can create our datagrabber:
datadir=None,
uri=uri,
rootdir=rootdir,
types=types,
types=types,
patterns=patterns,
replacements=replacements,
)
@ -287,7 +286,7 @@ implement the following methods:
The ``__init__`` method could also be implemented, but it is not mandatory. This is required if the datagrabber
requires any parameter.
We will now implement our BIDS example with this method.
We will now implement our BIDS example with this method.
The first method, ``get_item``, needs to obtain a single
item from the dataset. Since this dataset requires two variables, ``subject`` and ``session``, we will use them
@ -366,11 +365,12 @@ So, to summarize, our datagrabber will look like this:
def get_element_keys(self):
return ["subject", "session"]
Optional: Using datalad
Optional: Using datalad
"""""""""""""""""""""""
If this dataset is in a datalad dataset, we can extend from :class:`junifer.datagrabber.DataladDataGrabber` instead of
:class:`junifer.datagrabber.BaseDataGrabber`. This will allow us to use the datalad API to obtain the data.
If this dataset is in a datalad dataset, we can extend from
:class:`.DataladDataGrabber` instead of :class:`.BaseDataGrabber`. This will
allow us to use the datalad API to obtain the data.
Step 4: Optional: Adding *BOLD confounds*
@ -385,7 +385,7 @@ Thus, the ``BOLD_confounds`` element is a dictionary with the following keys:
- ``format``: the format of the confounds file. Currently, this can be either ``fmriprep`` or ``adhoc``.
The ``fmriprep`` format corresponds to the format of the confounds files generated by `fMRIPrep`_. The
``adhoc`` format corresponds to a format that is not standardized.
``adhoc`` format corresponds to a format that is not standardized.
.. note::
The ``mappings`` key is only required if the ``format`` is ``adhoc``. If the ``format`` is ``fmriprep``, the
@ -393,9 +393,9 @@ The ``fmriprep`` format corresponds to the format of the confounds files generat
Currently, Junifer provides only one confound remover step
(:class:`junifer.preprocess.fMRIPrepConfoundRemover`), which relies entirely on the ``fmriprep`` confound
variable names. Thus, if the confounds are not in ``fmriprep`` format, the user will need to provide the mappings
between the *ad-hoc* variable names and the ``fmriprep`` variable names.
(:class:`.fMRIPrepConfoundRemover`), which relies entirely on the ``fmriprep`` confound
variable names. Thus, if the confounds are not in ``fmriprep`` format, the user will need to provide the mappings
between the *ad-hoc* variable names and the ``fmriprep`` variable names.
This is done by specifying the ``adhoc`` format and providing the mappings as a dictionary in the ``mappings`` key.
In the following example, the confounds file has 3 variables that are not in the ``fmriprep`` format. Thus, we will
@ -418,7 +418,6 @@ provide the mappings for these variables to the ``fmriprep`` format.
.. note::
Not all of the mappings need to be provided. For the moment, this is used only by the
:class:`junifer.preprocess.fMRIPrepConfoundRemover` step, which requires variables based on the
:class:`.fMRIPrepConfoundRemover` step, which requires variables based on the
strategy selected. However, it is recommended to provide all the mappings, as this will allow the user to
choose different strategies with the same dataset.

View file

@ -9,14 +9,14 @@ Computing a marker (a.k.a. *feature*) is the main goal of junifer. While we aim
it might be the case that the marker you are looking for is not available. In this case, you can create your own marker
by following this tutorial.
Most of the functionality of a junifer marker has been taken care by the :class:`junifer.markers.BaseMarker` class.
Most of the functionality of a junifer marker has been taken care by the :class:`.BaseMarker` class.
Thus, only a few methods are required:
1. ``get_valid_inputs``: a method to obtain the list of valid inputs for the marker. This is used to check that the
inputs provided by the user are valid. This method should return a list of strings, representing
inputs provided by the user are valid. This method should return a list of strings, representing
:ref:`data types <data_types>`
2. ``get_output_type``: a method to obtain the kind of output of the marker. This is used to check that the output
of the marker is compatible with the storage. This method should return a string, representing
of the marker is compatible with the storage. This method should return a string, representing
:ref:`storage types <storage_types>`
3. ``compute``: the method that given the data, computes the marker.
4. ``__init__``: the initialization method, where the marker is configured.
@ -57,7 +57,7 @@ Step 2: Initialize the marker
In this step we need to define the parameters of the marker. That is, all the parameters that the user can provide
to configure how the marker will behave.
The parameters of the marker are defined in the ``__init__`` method. The :class:`junifer.markers.BaseMarker` class
The parameters of the marker are defined in the ``__init__`` method. The :class:`.BaseMarker` class
requires two optional parameters:
1. ``name``: the name of the marker. This is used to identify the marker in the configuration file.
@ -71,13 +71,13 @@ In this example, the is only paramater required for the computation is the name
define the ``__init__`` method as follows:
.. code-block:: python
def __init__(self, parcellation_name, on=None, name=None):
self.parcellation_name = parcellation_name
super().__init__(on=on, name=name)
.. caution:: Parameters of the marker must be stored as object attributes without using ``_`` as prefix. This is
because any attribute that starts with ``_`` will not be considered as a parameter and not stored as
because any attribute that starts with ``_`` will not be considered as a parameter and not stored as
part of the metadata of the marker.
@ -89,7 +89,7 @@ Step 3: Compute the marker
In this step, we will define the method that computes the marker. This method will be called by junifer when needed,
using the data provided by the datagrabber, as configured by the user. The function ``compute`` has two arguments:
* ``input``: a dictionary with the data to be used to compute the marker. This will be the corresponding element in the
* ``input``: a dictionary with the data to be used to compute the marker. This will be the corresponding element in the
:ref:`Data Object<data_object>` alredy indexing. Thus, the dictionary has at least two keys: ``data`` and ``path``.
The first one contains the data, while the second one contains the path to the data. The dictionary can also contain
other keys, depending on the data type.
@ -176,7 +176,7 @@ Finally, we need to register the marker using the ``@register_marker`` decorator
def __init__(self, parcellation_name, on=None, name=None):
self.parcellation_name = parcellation_name
super().__init__(on=on, name=name)
def get_valid_inputs(self):
return ['BOLD', 'VBM_WM', 'VBM_GM']
@ -235,7 +235,7 @@ Template for a custom Marker
def __init__(self, on=None, name=None):
# TODO: add marker-specific parameters
super().__init__(on=on, name=name)
def get_valid_inputs(self):
# TODO: Complete with the valid inputs
valid = []

View file

@ -14,16 +14,16 @@ suit your needs, and you have found that they don't, you can come back here to
learn how to use your own masks.
The principle is fairly simple and quite similar to :ref:`adding_parcellations`
and :ref:`adding_coordinates`. Junifer provides a
:func:`junifer.data.masks.register_mask` function that lets you register your
own custom masks. It consists of two positional arguments (``name`` and
``mask_path``) and one optional keyword argument (``overwrite``).
and :ref:`adding_coordinates`. Junifer provides a :func:`.register_mask`
function that lets you register your own custom masks. It consists of two
positional arguments (``name`` and ``mask_path``) and one optional keyword
argument (``overwrite``).
The ``name`` argument is a string indicating the name of the mask. This name
is used to refer to that mask in Junifer internally in order to obtain the
actual mask data and perform operations on it. For example, using the name you
can load a mask after registration using the
:func:`junifer.data.masks.load_mask` function.
:func:`.load_mask` function.
The ``mask_path`` should contain the path to a valid NIfTI image with binary
voxel values (i.e. 0 or 1). This data can then be used by Junifer to mask other

View file

@ -16,9 +16,9 @@ markers to assess and validate your own parcellation. So, how can you do this?
Since both of these use-cases are quite common, and not being able to use your
favourite parcellation is of course quite a buzzkill, Junifer actually provides
the easy-to-use :func:`junifer.data.parcellations.register_parcellation`
function to do just that. Let's try to understand the API reference
and then use this function to register our own parcellation.
the easy-to-use :func:`.register_parcellation` function to do just that. Let's
try to understand the API reference and then use this function to register our
own parcellation.
From the API reference, we can see that it has 3 positional arguments
(``name``, ``parcellation_path``, and ``parcels_labels``) as well as one
@ -101,8 +101,7 @@ file, we can save the above code in a python file, say
Afterwards continue configuring the rest of the pipeline in this YAML file, and
you will be able to use this parcellation using the name you gave the
parcellation when registering it. For example, we can add a
:class:`junifer.markers.parcel_aggregation.ParcelAggregation` marker to
demonstrate how this can be done:
:class:`.ParcelAggregation` marker to demonstrate how this can be done:
.. code-block:: yaml

View file

@ -21,7 +21,7 @@ The following steps are specific to VSCode and you can choose to go with it:
2. We recommend using ``conda`` to create your virtual environment
.. code-block:: console
.. code-block:: bash
conda env create -n <your-environment-name> -f conda-env.yml python=3.9
conda activate <your-environment-name>

View file

@ -11,12 +11,13 @@ junifer is compatible with `Python`_ >= 3.8 and requires the following packages:
* ``click>=8.1.3,<8.2``
* ``numpy>=1.22,<1.24``
* ``datalad>=0.15.4,<0.18``
* ``datalad>=0.15.4,<0.19``
* ``pandas>=1.4.0,<1.6``
* ``nibabel>=3.2.0,<4.1``
* ``nilearn>=0.9.0,<1.0``
* ``nilearn>=0.9.0,<=0.10.0``
* ``sqlalchemy>=1.4.27,<= 1.5.0``
* ``pyyaml>=5.1.2,<7.0``
* ``h5py>=3.8.0,<3.9``
Depending on the installation method, these packages might be installed automatically.

View file

@ -17,7 +17,7 @@ Datagrabbers are intended to be used as context managers. When used within a con
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.
For example, a concrete implementation of :class:`junifer.datagrabber.DataladDataGrabber` can provide junifer
For example, a concrete implementation of :class:`.DataladDataGrabber` can provide junifer
with data from a Datalad dataset. Of course, datagrabbers are not only meant to work with Datalad datasets but
any dataset.
@ -36,19 +36,19 @@ In this section, we showcase different abstract base classes you might want to u
* - Name
- Description
* - :class:`junifer.datagrabber.BaseDataGrabber`
* - :class:`.BaseDataGrabber`
- | The abstract base class providing you an interface to implement your own datagrabber.
| You should try to avoid using this directly and instead use
| :class:`junifer.datagrabber.PatternDataGrabber` or :class:`junifer.datagrabber.DataladDataGrabber`.
| :class:`.PatternDataGrabber` or :class:`.DataladDataGrabber`.
| To build your own custom *low-level* datagrabber, you need to at least implement the ``get_elements`` method,
| but most of the time you should also override other existing methods like ``__enter__`` and ``__exit__``.
* - :class:`junifer.datagrabber.PatternDataGrabber`
* - :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 found in a directory following this pattern ``{subject}/anat/{subject}_T1w.nii.gz``
| inside of the dataset. Now you can provide this to the **PatternDataGrabber** and it will be able to get the file.
* - :class:`junifer.datagrabber.DataladDataGrabber`
* - :class:`.DataladDataGrabber`
- | It implements functionality to deal with Datalad datasets. Specifically, the ``__enter__`` and ``__exit__`` methods
| take care of cloning and removing the Datalad dataset.
* - :class:`junifer.datagrabber.PatternDataladDataGrabber`
- | It is a combination of :class:`junifer.datagrabber.PatternDataladDataGrabber` and
| :class:`junifer.datagrabber.DataladDataGrabber`. This is probably the class you are looking for when using Datalad.
* - :class:`.PatternDataladDataGrabber`
- | It is a combination of :class:`.PatternDataladDataGrabber` and
| :class:`.DataladDataGrabber`. This is probably the class you are looking for when using Datalad.

View file

@ -22,7 +22,7 @@ For data formats not supported by junifer yet, you can either make your own *Dat
Currently supported file-formats
--------------------------------
We already provide a concrete implementation :class:`junifer.datareader.DefaultDataReader` which knows how to
We already provide a concrete implementation :class:`.DefaultDataReader` which knows how to
read the following file formats:
.. list-table::

View file

@ -19,5 +19,5 @@ Markers are meant to be used inside the datagrabber context but you can operate
as the actual data is in the memory and the Python runtime has not garbage-collected it.
If you are interested in using already provided markers, please go to :doc:`../builtin`. And, if you want to implement
your own marker, you need to provide concrete implementation of :class:`junifer.markers.BaseMarker`. Specifically, you
your own marker, you need to provide concrete implementation of :class:`.BaseMarker`. Specifically, you
need to override ``get_output_type``, ``store`` and ``compute`` methods.

View file

@ -23,8 +23,8 @@ The *Confound Removal* step is meant to remove *confounds* from the ``BOLD`` dat
extracted from the ``BOLD_confounds`` data (must be provided by the :ref:`Data Grabber <datagrabber>`).
The confounds are then regressed out from the ``BOLD`` data using :func:`nilearn.image.clean_img`.
Currently, junifer supports only one confound removal class:
:class:`junifer.preprocess.fMRIPrepConfoundRemover`. This class is meant to remove confounds as described
Currently, junifer supports only one confound removal class:
:class:`.fMRIPrepConfoundRemover`. This class is meant to remove confounds as described
before, using the output of `fMRIPrep`_ as reference.
Strategy
@ -54,7 +54,7 @@ The *strategy* is defined as a dictionary, with the *noise components* as keys a
Example in python format:
.. code-block::
.. code-block::
strategy = {
"motion": "basic",
@ -64,8 +64,8 @@ Example in python format:
or in YAML format:
.. code-block::
.. code-block::
strategy:
motion: basic
wm_csf: full
@ -73,7 +73,7 @@ or in YAML format:
The default value is to use all the *noise components* with the ``full`` *confounds*:
.. code-block::
.. code-block::
strategy = {
"motion": "full",
@ -84,7 +84,7 @@ The default value is to use all the *noise components* with the ``full`` *confou
Other parameters
~~~~~~~~~~~~~~~~
Additionaly, the :class:`junifer.preprocess.fMRIPrepConfoundRemover` supports the following parameters:
Additionaly, the :class:`.fMRIPrepConfoundRemover` supports the following parameters:
.. list-table::
:widths: 10, 30, 5
@ -113,4 +113,4 @@ Additionaly, the :class:`junifer.preprocess.fMRIPrepConfoundRemover` supports th
- from nifti header
* - ``mask``
- If provided, signal is only cleaned from voxels inside the mask. If not, a mask is computed using :func:`nilearn.masking.compute_brain_mask`.
- compute
- compute

View file

@ -17,12 +17,12 @@ as the processed data is in the memory and the Python runtime has not garbage-co
The :ref:`Markers <marker>` are responsible for defining what *storage kind* (``matrix``, ``vector``, ``timeseries``)
they support for which :ref:`data type <data_types>` by overriding its ``store`` method. The storage object in turn
declares and provides implementation for specific *storage kind*. For example, :class:`junifer.storage.SQLiteFeatureStorage`
declares and provides implementation for specific *storage kind*. For example, :class:`.SQLiteFeatureStorage`
supports saving ``matrix``, ``vector`` and ``timeseries`` via ``store_matrix``, ``store_vector`` and ``store_timeseries``
methods respectively.
For storage interfaces not supported by junifer yet, you can either make your own ``Storage`` by providing a concrete
implementation of :class:`junifer.storage.BaseFeatureStorage` or open an issue on `junifer Github`_ and we can help you out.
implementation of :class:`.BaseFeatureStorage` or open an issue on `junifer Github`_ and we can help you out.
.. _storage_types:
@ -41,15 +41,15 @@ Currently supported storage types
* - ``matrix``
- A 2D matrix with row and column names
- ``col_names``, ``row_names``, ``matrix_kind``, ``diagonal``
- :meth:`junifer.storage.BaseFeatureStorage.store_matrix`
- :meth:`.BaseFeatureStorage.store_matrix`
* - ``vector``
- A vector of values with column names
- ``columns``, ``row_names``
- :meth:`junifer.storage.BaseFeatureStorage.store_vector`
- :meth:`.BaseFeatureStorage.store_vector`
* - ``timeseries``
- A 2D matrix of values with column names
- ``columns``, ``row_names``
- :meth:`junifer.storage.BaseFeatureStorage.store_timeseries`
- :meth:`.BaseFeatureStorage.store_timeseries`
.. _storage_interfaces:
@ -64,11 +64,11 @@ Currently supported storage interfaces
- File extension
- File type
- Storage kinds
* - :class:`junifer.storage.SQLiteFeatureStorage`
* - :class:`.SQLiteFeatureStorage`
- ``.sqlite``
- SQLite
- ``matrix``, ``vector``, ``timeseries``
* - :class:`junifer.storage.HDF5FeatureStorage`
* - :class:`.HDF5FeatureStorage`
- ``.hdf5``
- HDF5
- ``matrix``, ``vector``, ``timeseries``

View file

@ -11,7 +11,7 @@ achieved by using a configuration file that is written in YAML_. In this file, w
As a reminder, this is how the pipeline looks like:
.. mermaid::
.. mermaid::
flowchart LR
dg[Data Grabber]
@ -70,7 +70,7 @@ 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.
For example, to use the :class:`junifer.datagrabber.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
@ -99,7 +99,7 @@ Data Reader
^^^^^^^^^^^
As mentioned before, this section is entirely optional, as junifer only provides one data reader
(:class:`junifer.datareader.DefaultDataReader`), which is the default in case the section is not specified.
(:class:`.DefaultDataReader`), which is the default in case the section is not specified.
In any case, the syntax of the section is the same as for the ``datagrabber`` section, using the ``kind`` key to
specify the data reader to use, and additional keys to pass parameters to the data reader:
@ -119,7 +119,7 @@ Preprocessing is also an optional step, as it might be the case that no pre-proc
preprocessing is needed, the section must be configured using the ``kind`` key to specify the preprocessor to use,
and additional keys to pass parameters to the preprocessor.
For example, to use the :class:`junifer.preprocess.fMRIPrepConfoundRemover` preprocessor, we just need to specify its
For example, to use the :class:`.fMRIPrepConfoundRemover` preprocessor, we just need to specify its
name as the ``kind`` key, as well as its parameters.
@ -173,7 +173,7 @@ Storage
Finally, we need to define how and where the results will be stored. This is done using the ``storage`` section,
which must be configured using the ``kind`` key to specify the storage to use, and additional keys to pass parameters.
For example, to use the :class:`junifer.storage.SQLiteFeatureStorage` storage, we just need to specify where we want
For example, to use the :class:`.SQLiteFeatureStorage` storage, we just need to specify where we want
to store the results:
.. code-block:: yaml

View file

@ -11,12 +11,12 @@ voxels that contain a certain ratio of gray matter to white matter / cerebrospin
are not extracted from voxels that contain mostly white matter or cerebrospinal fluid, which could add noise to the
BOLD signal.
Junifer provides a number of built-in masks, which can be listed using the :func:`junifer.data.masks.list_masks`. Some
masks are images, while other masks can be computed using :ref:`nilearn` functions.
Junifer provides a number of built-in masks, which can be listed using the :func:`.list_masks`. Some
masks are images, while other masks can be computed using :ref:`nilearn` functions.
For markers and steps that accept ``masks`` as an argument, the mask can be specified as a string, which will be the
name of a built-in mask, or as a dictionary in which the **only** key is the built-in mask name and the value is a
dictionary of keyword arguments to pass to the mask function.
name of a built-in mask, or as a dictionary in which the **only** key is the built-in mask name and the value is a
dictionary of keyword arguments to pass to the mask function.
For example, the following is a valid mask specification that specified the ``GM_prob0.2`` mask.
@ -29,7 +29,7 @@ with a threshold of 0.5.
.. code-block:: yaml
masks:
masks:
compute_brain_mask:
threshold: 0.5
@ -39,7 +39,7 @@ is a valid mask specification that specifies the intersection of the ``GM_prob0.
.. code-block:: yaml
masks:
masks:
- GM_prob0.2
- compute_brain_mask:
threshold: 0.5
@ -50,7 +50,7 @@ following example combines the same masks as the previous one, but computing the
.. code-block:: yaml
masks:
masks:
- GM_prob0.2
- compute_brain_mask:
threshold: 0.5
@ -60,9 +60,9 @@ Alternatively, we can also compute the union, even if the voxels do not form a c
.. code-block:: yaml
masks:
masks:
- GM_prob0.2
- compute_brain_mask:
threshold: 0.5
- threshold: 0 # union
- connected: False # keep disconnected components
- connected: False # keep disconnected components

View file

@ -14,7 +14,7 @@ individual results into a single file.
Assuming that we have a configuration file named ``config.yaml``, the following commands will extract the features:
.. code-block:: console
.. code-block:: bash
junifer run config.yaml
@ -22,20 +22,20 @@ The ``run`` command accepts the following additional arguments:
* ``--help``: Show a help message.
* ``--verbose`` Set the verbosity level. Options are ``warning``, ``info``, ``debug``.
* ``--element``: The *element* to run. If not specified, all elements will be run. This parameter can be specified
* ``--element``: The *element* to run. If not specified, all elements will be run. This parameter can be specified
multiple times to run multiple elements. If the *element* requires several parameters, they can be specified
by separating them with ``,``.
Example on running two elements:
.. code-block:: console
.. code-block:: bash
junifer run config.yaml --element sub-01 --element sub-02
Example on elements with multiple parameters and verbose output:
.. code-block:: console
.. code-block:: bash
junifer run --verbose info config.yaml --element sub-01,ses-01
@ -50,7 +50,7 @@ individual results into a single file.
Assuming that we have a configuration file named ``config.yaml``, the following commands will collect the results:
.. code-block:: console
.. code-block:: bash
junifer collect config.yaml

View file

@ -20,13 +20,12 @@ API Changes
Bugfixes
^^^^^^^^
- Fix a bug in which a :class:`junifer.datagrabber.PatternDataGrabber` would
now work with relative ``datadir`` paths (reported by `Leonard Sasse`_,
fixed by `Fede Raimondo`_) (:gh:`96`, :gh:`98`)
- Fix a bug in which a :class:`.PatternDataGrabber` would now work with
relative ``datadir`` paths (reported by `Leonard Sasse`_, fixed by
`Fede Raimondo`_) (:gh:`96`, :gh:`98`)
- Fix a bug in which :class:`junifer.datagrabber.DataladAOMICPIOP2` datagrabber
did not use user input to constrain elements based on tasks by
`Leonard Sasse`_ (:gh:`105`)
- Fix a bug in which :class:`.DataladAOMICPIOP2` datagrabber did not use user
input to constrain elements based on tasks by `Leonard Sasse`_ (:gh:`105`)
- Fix a bug in which a datalad dataset could remove a user-cloned dataset by
`Fede Raimondo`_ (:gh:`53`)
@ -53,9 +52,9 @@ Improved Documentation
Enhancements
^^^^^^^^^^^^
- Add comments to :class:`junifer.datagrabber.DataladDataGrabber` datagrabber
and change to use ``datalad-clone`` instead of ``datalad-install`` by
`Benjamin Poldrack`_ (:gh:`55`)
- Add comments to :class:`.DataladDataGrabber` datagrabber and change to use
``datalad-clone`` instead of ``datalad-install`` by `Benjamin Poldrack`_
(:gh:`55`)
- Upgrade storage interface for storage-like objects by `Synchon Mandal`_
(:gh:`84`)
@ -65,65 +64,64 @@ Enhancements
- Refactor markers ``on`` attribute and ``get_valid_inputs`` to verify that the
marker can be computed on the input data types by `Fede Raimondo`_
- Add test for :class:`junifer.datagrabber.DataladHCP1200` datagrabber by
`Synchon Mandal`_ (:gh:`93`)
- Add test for :class:`.DataladHCP1200` datagrabber by `Synchon Mandal`_
(:gh:`93`)
- Refactor :class:`.DataladAOMICID1000` slightly by `Leonard Sasse`_ (:gh:`94`)
- Rename "atlas" to "parcellation" by `Fede Raimondo`_ (:gh:`116`)
- Refactor the :class:`junifer.datagrabber.BaseDataGrabber` class to allow for
easier subclassing by `Fede Raimondo`_ (:gh:`123`)
- Refactor the :class:`.BaseDataGrabber` class to allow for easier subclassing
by `Fede Raimondo`_ (:gh:`123`)
- Allow custom aggregation method for :class:`junifer.markers.SphereAggregation`
by `Synchon Mandal`_ (:gh:`102`)
- Allow custom aggregation method for :class:`.SphereAggregation` by
`Synchon Mandal`_ (:gh:`102`)
- Add support for "masks" by `Fede Raimondo`_ (:gh:`79`)
- Allow :class:`junifer.markers.ParcelAggregation` to apply multiple
parcellations at once by `Fede Raimondo`_ (:gh:`131`)
- Allow :class:`.ParcelAggregation` to apply multiple parcellations at once by
`Fede Raimondo`_ (:gh:`131`)
- Refactor :class:`junifer.pipeline.PipelineStepMixin` to improve its
implementation and validation for pipeline steps by `Synchon Mandal`_
(:gh:`152`)
- Refactor :class:`.PipelineStepMixin` to improve its implementation and
validation for pipeline steps by `Synchon Mandal`_ (:gh:`152`)
Features
^^^^^^^^
- Implement :class:`junifer.testing.datagrabbers.SPMAuditoryTestingDatagrabber`
datagrabber by `Fede Raimondo`_ (:gh:`52`)
- Implement :class:`.SPMAuditoryTestingDatagrabber` datagrabber by
`Fede Raimondo`_ (:gh:`52`)
- Implement matrix storage in SQliteFeatureStorage by `Fede Raimondo`_
(:gh:`42`)
- Implement :class:`junifer.markers.FunctionalConnectivityParcels` marker for
functional connectivity using a parcellation by `Amir Omidvarnia`_ and
- Implement :class:`.FunctionalConnectivityParcels` marker for functional
connectivity using a parcellation by `Amir Omidvarnia`_ and
`Kaustubh R. Patil`_ (:gh:`41`)
- Implement coordinate register, list and load by `Fede Raimondo`_ (:gh:`11`)
- Implement :func:`.register_coordinates`, :func:`.list_coordinates` and
:func:`.load_coordinates` by `Fede Raimondo`_ (:gh:`11`)
- Add :class:`junifer.datagrabber.DataladAOMICID1000` datagrabber for AOMIC
ID1000 dataset including tests and creation of mock dataset for testing by
- Add :class:`.DataladAOMICID1000` datagrabber for AOMIC ID1000 dataset
including tests and creation of mock dataset for testing by
`Vera Komeyer`_ and `Xuan Li`_ (:gh:`60`)
- Add support to access other input in the data object in the ``compute`` method
by `Fede Raimondo`_
- Implement :class:`junifer.markers.RSSETSMarker` marker by `Leonard Sasse`_,
`Nicolas Nieto`_ and `Sami Hamdan`_ (:gh:`51`)
- Implement :class:`.RSSETSMarker` marker by `Leonard Sasse`_, `Nicolas Nieto`_
and `Sami Hamdan`_ (:gh:`51`)
- Implement :class:`junifer.markers.SphereAggregation` marker by
`Fede Raimondo`_
- Implement :class:`.SphereAggregation` marker by `Fede Raimondo`_ (:gh:`83`)
- Implement :class:`junifer.datagrabber.DataladAOMICPIOP1` and
:class:`junifer.datagrabber.DataladAOMICPIOP2` datagrabbers for AOMIC PIOP1
and PIOP2 datasets respectively and refactor
:class:`junifer.datagrabber.DataladAOMICID1000` slightly by `Leonard Sasse`_
(:gh:`94`)
- Implement :class:`.DataladAOMICPIOP1` and :class:`.DataladAOMICPIOP2`
datagrabbers for AOMIC PIOP1 and PIOP2 datasets respectively by
`Leonard Sasse`_ (:gh:`94`)
- Implement :class:`junifer.configs.juseless.datagrabbers.JuselessDataladCamCANVBM`
datagrabber by `Leonard Sasse`_ (:gh:`99`)
- Implement :class:`.JuselessDataladCamCANVBM` datagrabber by `Leonard Sasse`_
(:gh:`99`)
- Implement :class:`junifer.configs.juseless.datagrabbers.JuselessDataladIXIVBM`
CAT output datagrabber for juseless by `Leonard Sasse`_ (:gh:`48`)
- Implement :class:`.JuselessDataladIXIVBM` CAT output datagrabber for juseless
by `Leonard Sasse`_ (:gh:`48`)
- Add ``junifer wtf`` to report environment details by `Synchon Mandal`_
(:gh:`33`)
@ -131,27 +129,27 @@ Features
- Add ``junifer selftest`` to report environment details by `Synchon Mandal`_
(:gh:`9`)
- Implement :class:`junifer.configs.juseless.datagrabbers.JuselessDataladAOMICID1000VBM`
datagrabber for accessing AOMIC ID1000 VBM from juseless by `Felix Hoffstaedter`_
and `Synchon Mandal`_ (:gh:`57`)
- Implement :class:`.JuselessDataladAOMICID1000VBM` datagrabber for accessing
AOMIC ID1000 VBM from juseless by `Felix Hoffstaedter`_ and `Synchon Mandal`_
(:gh:`57`)
- Add :class:`junifer.preprocess.fMRIPrepConfoundRemover` by `Fede Raimondo`_
and `Leonard Sasse`_ (:gh:`111`)
- Add :class:`.fMRIPrepConfoundRemover` by `Fede Raimondo`_ and `Leonard Sasse`_
(:gh:`111`)
- Implement :class:`junifer.markers.CrossParcellationFC` marker by
`Leonard Sasse`_ and `Kaustubh R. Patil`_ (:gh:`85`)
- Implement :class:`.CrossParcellationFC` marker by `Leonard Sasse`_ and
`Kaustubh R. Patil`_ (:gh:`85`)
- Add :class:`junifer.configs.juseless.datagrabbers.JuselessUCLA` datagrabber
for the UCLA dataset available on juseless by `Leonard Sasse`_ (:gh:`118`)
- Add :class:`.JuselessUCLA` datagrabber for the UCLA dataset available on
juseless by `Leonard Sasse`_ (:gh:`118`)
- Introduce a singleton decorator for marker computations by `Synchon Mandal`_
(:gh:`151`)
- Implement :class:`junifer.markers.ReHoParcels` and
:class:`junifer.markers.ReHoSpheres` markers by `Synchon Mandal`_ (:gh:`36`)
- Implement :class:`.ReHoParcels` and :class:`.ReHoSpheres` markers by
`Synchon Mandal`_ (:gh:`36`)
- Implement :class:`junifer.markers.ALFFParcels` and
:class:`junifer.markers.ALFFSpheres` markers by `Fede Raimondo`_ (:gh:`35`)
- Implement :class:`.ALFFParcels` and :class:`.ALFFSpheres` markers by
`Fede Raimondo`_ (:gh:`35`)
Misc
^^^^

View file

@ -515,10 +515,11 @@ def _queue_condor(
collect_pre_fname = jobdir / "collect_pre.sh"
dag_file.write(
f"SCRIPT PRE collect {collect_pre_fname.as_posix()} "
"$DAG_STATUS\n")
"$DAG_STATUS\n"
)
with open(collect_pre_fname, "w") as pre_file:
pre_file.write("#!/bin/bash\n\n")
pre_file.write("if [ \"${1}\" == \"4\" ]; then\n")
pre_file.write('if [ "${1}" == "4" ]; then\n')
pre_file.write(" exit 1\n")
pre_file.write("fi\n")

View file

@ -167,7 +167,7 @@ def load_parcellation(
----------
name : str
The name of the parcellation. Check valid options by calling
:func:`junifer.data.parcellations.list_parcellations`.
:func:`.list_parcellations`.
parcellations_dir : str or pathlib.Path, optional
Path where the parcellations files are stored. The default location is
"$HOME/junifer/data/parcellations" (default None).

View file

@ -25,13 +25,13 @@ class RSSETSMarker(BaseMarker):
----------
parcellation : str or list of str
The name(s) of the parcellation(s). Check valid options by calling
:func:`junifer.data.parcellations.list_parcellations`.
:func:`.list_parcellations`.
agg_method : str, optional
The method to perform aggregation using. Check valid options in
:func:`junifer.stats.get_aggfunc_by_name` (default "mean").
:func:`.get_aggfunc_by_name` (default "mean").
agg_method_params : dict, optional
Parameters to pass to the aggregation function. Check valid options in
:func:`junifer.stats.get_aggfunc_by_name` (default None).
:func:`.get_aggfunc_by_name` (default None).
masks : str, dict or list of dict or str, optional
The specification of the masks to apply to regions before extracting
signals. Check :ref:`Using Masks <using_masks>` for more details.

View file

@ -33,8 +33,8 @@ class ALFFEstimator:
by caching the voxel-wise ALFF map for a given set of file path and
computation parameters.
.. warning:: This class can only be used via
:class:`junifer.markers.falff.ALFFBase` as it serves a specific purpose.
.. warning:: This class can only be used via :class:`.ALFFBase` as it
serves a specific purpose.
Parameters
----------

View file

@ -20,7 +20,7 @@ class ALFFParcels(ALFFBase):
----------
parcellation : str or list of str
The name(s) of the parcellation(s). Check valid options by calling
:func:`junifer.data.parcellations.list_parcellations`.
:func:`.list_parcellations`.
fractional : bool
Whether to compute fractional ALFF.
highpass : positive float, optional
@ -40,10 +40,10 @@ class ALFFParcels(ALFFBase):
If None, will not apply any mask (default None).
method : str, optional
The method to perform aggregation using. Check valid options in
:func:`junifer.stats.get_aggfunc_by_name` (default "mean").
:func:`.get_aggfunc_by_name` (default "mean").
method_params : dict, optional
Parameters to pass to the aggregation function. Check valid options in
:func:`junifer.stats.get_aggfunc_by_name`.
:func:`.get_aggfunc_by_name`.
name : str, optional
The name of the marker. If None, will use the class name (default
None).

View file

@ -20,7 +20,7 @@ class ALFFSpheres(ALFFBase):
----------
coords : str
The name of the coordinates list to use. See
:func:`junifer.data.coordinates.list_coordinates` for options.
:func:`.list_coordinates` for options.
radius : float, optional
The radius of the sphere in mm. If None, the signal will be extracted
from a single voxel. See :class:`nilearn.maskers.NiftiSpheresMasker`
@ -47,10 +47,10 @@ class ALFFSpheres(ALFFBase):
If None, will not apply any mask (default None).
method : str, optional
The method to perform aggregation using. Check valid options in
:func:`junifer.stats.get_aggfunc_by_name` (default "mean").
:func:`.get_aggfunc_by_name` (default "mean").
method_params : dict, optional
Parameters to pass to the aggregation function. Check valid options in
:func:`junifer.stats.get_aggfunc_by_name`.
:func:`.get_aggfunc_by_name`.
name : str, optional
The name of the marker. If None, will use the class name (default
None).

View file

@ -20,14 +20,14 @@ class EdgeCentricFCParcels(FunctionalConnectivityBase):
----------
parcellation : str or list of str
The name(s) of the parcellation(s). Check valid options by calling
:func:`junifer.data.parcellations.list_parcellations`.
:func:`.list_parcellations`.
agg_method : str, optional
The method to perform aggregation of BOLD time series.
Check valid options in :func:`junifer.stats.get_aggfunc_by_name`
Check valid options in :func:`.get_aggfunc_by_name`
(default "mean").
agg_method_params : dict, optional
Parameters to pass to the aggregation function. Check valid options in
:func:`junifer.stats.get_aggfunc_by_name` (default None).
:func:`.get_aggfunc_by_name` (default None).
cor_method : str, optional
The method to perform correlation. Check valid options in
:class:`nilearn.connectome.ConnectivityMeasure`

View file

@ -20,7 +20,7 @@ class EdgeCentricFCSpheres(FunctionalConnectivityBase):
----------
coords : str
The name of the coordinates list to use. See
:func:`junifer.data.coordinates.list_coordinates` for options.
:func:`.list_coordinates` for options.
radius : float, optional
The radius of the sphere in mm. If None, the signal will be extracted
from a single voxel. See :class:`nilearn.maskers.NiftiSpheresMasker`
@ -30,7 +30,7 @@ class EdgeCentricFCSpheres(FunctionalConnectivityBase):
the spheres overlap (default is False).
agg_method : str, optional
The aggregation method to use.
See :func:`junifer.stats.get_aggfunc_by_name` for more information
See :func:`.get_aggfunc_by_name` for more information
(default None).
agg_method_params : dict, optional
The parameters to pass to the aggregation method (default None).

View file

@ -21,10 +21,10 @@ class FunctionalConnectivityBase(BaseMarker):
----------
agg_method : str, optional
The method to perform aggregation using. Check valid options in
:func:`junifer.stats.get_aggfunc_by_name` (default "mean").
:func:`.get_aggfunc_by_name` (default "mean").
agg_method_params : dict, optional
Parameters to pass to the aggregation function. Check valid options in
:func:`junifer.stats.get_aggfunc_by_name` (default None).
:func:`.get_aggfunc_by_name` (default None).
cor_method : str, optional
The method to perform correlation using. Check valid options in
:class:`nilearn.connectome.ConnectivityMeasure`

View file

@ -20,13 +20,13 @@ class FunctionalConnectivityParcels(FunctionalConnectivityBase):
----------
parcellation : str or list of str
The name(s) of the parcellation(s). Check valid options by calling
:func:`junifer.data.parcellations.list_parcellations`.
:func:`.list_parcellations`.
agg_method : str, optional
The method to perform aggregation using. Check valid options in
:func:`junifer.stats.get_aggfunc_by_name` (default "mean").
:func:`.get_aggfunc_by_name` (default "mean").
agg_method_params : dict, optional
Parameters to pass to the aggregation function. Check valid options in
:func:`junifer.stats.get_aggfunc_by_name` (default None).
:func:`.get_aggfunc_by_name` (default None).
cor_method : str, optional
The method to perform correlation using. Check valid options in
:class:`nilearn.connectome.ConnectivityMeasure`

View file

@ -21,7 +21,7 @@ class FunctionalConnectivitySpheres(FunctionalConnectivityBase):
----------
coords : str
The name of the coordinates list to use. See
:func:`junifer.data.coordinates.list_coordinates` for options.
:func:`.list_coordinates` for options.
radius : float, optional
The radius of the sphere in mm. If None, the signal will be extracted
from a single voxel. See :class:`nilearn.maskers.NiftiSpheresMasker`
@ -31,7 +31,7 @@ class FunctionalConnectivitySpheres(FunctionalConnectivityBase):
the spheres overlap (default is False).
agg_method : str, optional
The aggregation method to use.
See :func:`junifer.stats.get_aggfunc_by_name` for more information
See :func:`.get_aggfunc_by_name` for more information
(default None).
agg_method_params : dict, optional
The parameters to pass to the aggregation method (default None).

View file

@ -25,13 +25,13 @@ class ParcelAggregation(BaseMarker):
----------
parcellation : str or list of str
The name(s) of the parcellation(s). Check valid options by calling
:func:`junifer.data.parcellations.list_parcellations`.
:func:`.list_parcellations`.
method : str
The method to perform aggregation using. Check valid options in
:func:`junifer.stats.get_aggfunc_by_name`.
:func:`.get_aggfunc_by_name`.
method_params : dict, optional
Parameters to pass to the aggregation function. Check valid options in
:func:`junifer.stats.get_aggfunc_by_name`.
:func:`.get_aggfunc_by_name`.
time_method : str, optional
The method to use to aggregate the time series over the time points,
after applying :term:`method` (only applicable to BOLD data). If None,

View file

@ -22,7 +22,7 @@ class ReHoParcels(ReHoBase):
----------
parcellation : str
The name of the parcellation. Check valid options by calling
:func:`junifer.data.parcellations.list_parcellations`.
:func:`.list_parcellations`.
use_afni : bool, optional
Whether to use AFNI for computing. If None, will use AFNI only
if available (default None).
@ -70,10 +70,10 @@ class ReHoParcels(ReHoBase):
agg_method : str, optional
The method to perform aggregation using. Check valid options in
:func:`junifer.stats.get_aggfunc_by_name` (default "mean").
:func:`.get_aggfunc_by_name` (default "mean").
agg_method_params : dict, optional
Parameters to pass to the aggregation function. Check valid options in
:func:`junifer.stats.get_aggfunc_by_name` (default None).
:func:`.get_aggfunc_by_name` (default None).
masks : str, dict or list of dict or str, optional
The specification of the masks to apply to regions before extracting
signals. Check :ref:`Using Masks <using_masks>` for more details.

View file

@ -22,7 +22,7 @@ class ReHoSpheres(ReHoBase):
----------
coords : str
The name of the coordinates list to use. See
:func:`junifer.data.coordinates.list_coordinates` for options.
:func:`.list_coordinates` for options.
radius : float, optional
The radius of the sphere in millimeters. If None, the signal will be
extracted from a single voxel. See
@ -78,7 +78,7 @@ class ReHoSpheres(ReHoBase):
agg_method : str, optional
The aggregation method to use.
See :func:`junifer.stats.get_aggfunc_by_name` for more information
See :func:`.get_aggfunc_by_name` for more information
(default None).
agg_method_params : dict, optional
The parameters to pass to the aggregation method (default None).

View file

@ -22,7 +22,7 @@ class SphereAggregation(BaseMarker):
----------
coords : str
The name of the coordinates list to use. See
:func:`junifer.data.coordinates.list_coordinates` for options.
:func:`.list_coordinates` for options.
radius : float, optional
The radius of the sphere in millimeters. If None, the signal will be
extracted from a single voxel. See
@ -33,7 +33,7 @@ class SphereAggregation(BaseMarker):
the spheres overlap (default is False).
method : str, optional
The aggregation method to use.
See :func:`junifer.stats.get_aggfunc_by_name` for more information
See :func:`.get_aggfunc_by_name` for more information
(default "mean").
method_params : dict, optional
The parameters to pass to the aggregation method (default None).

View file

@ -20,10 +20,10 @@ class TemporalSNRBase(BaseMarker):
----------
agg_method : str, optional
The method to perform aggregation using. Check valid options in
:func:`junifer.stats.get_aggfunc_by_name` (default "mean").
:func:`.get_aggfunc_by_name` (default "mean").
agg_method_params : dict, optional
Parameters to pass to the aggregation function. Check valid options in
:func:`junifer.stats.get_aggfunc_by_name` (default None).
:func:`.get_aggfunc_by_name` (default None).
masks : str, dict or list of dict or str, optional
The specification of the masks to apply to regions before extracting
signals. Check :ref:`Using Masks <using_masks>` for more details.

View file

@ -18,13 +18,13 @@ class TemporalSNRParcels(TemporalSNRBase):
----------
parcellation : str or list of str
The name(s) of the parcellation(s). Check valid options by calling
:func:`junifer.data.parcellations.list_parcellations`.
:func:`.list_parcellations`.
agg_method : str, optional
The method to perform aggregation using. Check valid options in
:func:`junifer.stats.get_aggfunc_by_name` (default "mean").
:func:`.get_aggfunc_by_name` (default "mean").
agg_method_params : dict, optional
Parameters to pass to the aggregation function. Check valid options in
:func:`junifer.stats.get_aggfunc_by_name` (default None).
:func:`.get_aggfunc_by_name` (default None).
masks : str, dict or list of dict or str, optional
The specification of the masks to apply to regions before extracting
signals. Check :ref:`Using Masks <using_masks>` for more details.

View file

@ -19,7 +19,7 @@ class TemporalSNRSpheres(TemporalSNRBase):
----------
coords : str
The name of the coordinates list to use. See
:func:`junifer.data.coordinates.list_coordinates` for options.
:func:`.list_coordinates` for options.
radius : float, optional
The radius of the sphere in mm. If None, the signal will be extracted
from a single voxel. See :class:`nilearn.maskers.NiftiSpheresMasker`
@ -29,7 +29,7 @@ class TemporalSNRSpheres(TemporalSNRBase):
the spheres overlap (default is False).
agg_method : str, optional
The aggregation method to use.
See :func:`junifer.stats.get_aggfunc_by_name` for more information
See :func:`.get_aggfunc_by_name` for more information
(default None).
agg_method_params : dict, optional
The parameters to pass to the aggregation method (default None).

View file

@ -99,7 +99,7 @@ def test_base_marker_subclassing() -> None:
"element": "elem",
"datareader": "dr",
},
}
},
}
marker = MyBaseMarker(on=["BOLD"])
output = marker.fit_transform(input=input_) # process

View file

@ -141,10 +141,7 @@ def build(
object_ = klass(**init_params)
except Exception as e:
raise_error(
msg=(
f"Failed to create {step} ({name}). "
f"Error: {e}"
),
msg=(f"Failed to create {step} ({name}). " f"Error: {e}"),
klass=RuntimeError,
exception=e,
)

View file

@ -28,8 +28,8 @@ def get_aggfunc_by_name(
* ``mean`` -> :func:`numpy.mean`
* ``std`` -> :func:`numpy.std`
* ``trim_mean`` -> :func:`scipy.stats.trim_mean`
* ``count`` -> :func:`junifer.stats.count`
* ``select`` -> :func:`junifer.stats.select`
* ``count`` -> :func:`.count`
* ``select`` -> :func:`.select`
func_params : dict, optional
Parameters to pass to the function.

View file

@ -95,8 +95,8 @@ class BaseFeatureStorage(ABC):
-------
dict
List of features in the storage. The keys are the feature MD5 to
be used in :meth:`junifer.storage.BaseFeatureStorage.read_df`
and the values are the metadata of each feature.
be used in :meth:`.read_df` and the values are the metadata of each
feature.
"""
raise_error(

View file

@ -114,8 +114,8 @@ class HDF5FeatureStorage(BaseFeatureStorage):
values are found (default True).
chunk_size : int, optional
The chunk size to use when collecting data from element files in
:meth:`junifer.storage.HDF5FeatureStorage.collect`. If the file count
is smaller than the value, the minimum is used (default 100).
:meth:`.collect`. If the file count is smaller than the value, the
minimum is used (default 100).
See Also
--------
@ -262,8 +262,8 @@ class HDF5FeatureStorage(BaseFeatureStorage):
-------
dict
List of features in the storage. The keys are the feature MD5 to
be used in :meth:`junifer.storage.HDF5FeatureStorage.read_df`
and the values are the metadata of each feature.
be used in :meth:`.read_df` and the values are the metadata of each
feature.
"""
# Read metadata
@ -496,9 +496,7 @@ class HDF5FeatureStorage(BaseFeatureStorage):
) -> None:
"""Write processed data to HDF5 (should not be called directly).
This is used primarily in
:func:`junifer.storage.HDF5FeatureStorage.store_metadata` and
``_store_data``.
This is used primarily in :meth:`.store_metadata` and ``_store_data``.
Parameters
----------

View file

@ -213,8 +213,8 @@ class SQLiteFeatureStorage(PandasBaseFeatureStorage):
-------
dict
List of features in the storage. The keys are the feature MD5 to
be used in :meth:`junifer.storage.SQLiteFeatureStorage.read_df`
and the values are the metadata of each feature.
be used in :meth:`.read_df` and the values are the metadata of each
feature.
"""
# Retrieve meta table from storage