9.1.4. Markers

Markers for feature extraction.

enum junifer.markers.ALFFImpl(value)

Accepted ALFF implementations.

  • junifer : junifer’s ALFF

  • afni : AFNI’s 3dRSFC

Member Type:

str

Valid values are as follows:

junifer = <ALFFImpl.junifer: 'junifer'>
afni = <ALFFImpl.afni: 'afni'>
pydantic model junifer.markers.ALFFMaps

Class for ALFF / fALFF on maps.

Parameters:
mapsstr

The name of the map(s) to use. See list_data() for options.

usingALFFImpl
highpasspositive float, optional

Highpass cutoff frequency (default 0.01).

lowpasspositive float, optional

Lowpass cutoff frequency (default 0.1).

trpositive float, optional

The repetition time of the BOLD data. If None, will extract the TR from NIfTI header (default None).

maskslist of dict or str, or None, optional

The specification of the masks to apply to regions before extracting signals. Check Using Masks for more details. If None, will not apply any mask (default None).

namestr or None, optional

The name of the marker. If None, will use the class name (default None).

Notes

The tr parameter is crucial for the correctness of fALFF/ALFF computation. If a dataset is correctly preprocessed, the tr should be extracted from the NIfTI without any issue. However, it has been reported that some preprocessed data might not have the correct tr in the NIfTI header.

ALFF/fALFF are computed using a bandpass butterworth filter. See scipy.signal.butter() and scipy.signal.filtfilt() for more details.

Create a new model by parsing and validating input data from keyword arguments.

Raises [ValidationError][pydantic_core.ValidationError] if the input data cannot be validated to form a valid model.

self is explicitly positional-only to allow self as a field name.

Show JSON schema
{
   "title": "ALFFMaps",
   "description": "Class for ALFF / fALFF on maps.\n\nParameters\n----------\nmaps : str\n    The name of the map(s) to use.\n    See :func:`.list_data` for options.\nusing : :enum:`.ALFFImpl`\nhighpass : positive float, optional\n    Highpass cutoff frequency (default 0.01).\nlowpass : positive float, optional\n    Lowpass cutoff frequency (default 0.1).\ntr : positive float, optional\n    The repetition time of the BOLD data.\n    If None, will extract the TR from NIfTI header (default None).\nmasks : list of dict or str, or None, optional\n    The specification of the masks to apply to regions before extracting\n    signals. Check :ref:`Using Masks <using_masks>` for more details.\n    If None, will not apply any mask (default None).\nname : str or None, optional\n    The name of the marker.\n    If None, will use the class name (default None).\n\nNotes\n-----\nThe ``tr`` parameter is crucial for the correctness of fALFF/ALFF\ncomputation. If a dataset is correctly preprocessed, the ``tr`` should be\nextracted from the NIfTI without any issue. However, it has been\nreported that some preprocessed data might not have the correct ``tr`` in\nthe NIfTI header.\n\nALFF/fALFF are computed using a bandpass butterworth filter. See\n:func:`scipy.signal.butter` and :func:`scipy.signal.filtfilt` for more\ndetails.",
   "type": "object",
   "properties": {
      "on": {
         "default": [
            "BOLD"
         ],
         "items": {
            "const": "BOLD",
            "type": "string"
         },
         "title": "On",
         "type": "array"
      },
      "name": {
         "anyOf": [
            {
               "type": "string"
            },
            {
               "type": "null"
            }
         ],
         "default": null,
         "title": "Name"
      },
      "using": {
         "$ref": "#/$defs/ALFFImpl"
      },
      "highpass": {
         "default": 0.01,
         "exclusiveMinimum": 0,
         "title": "Highpass",
         "type": "number"
      },
      "lowpass": {
         "default": 0.1,
         "exclusiveMinimum": 0,
         "title": "Lowpass",
         "type": "number"
      },
      "tr": {
         "anyOf": [
            {
               "exclusiveMinimum": 0,
               "type": "number"
            },
            {
               "type": "null"
            }
         ],
         "default": null,
         "title": "Tr"
      },
      "agg_method": {
         "default": "mean",
         "title": "Agg Method",
         "type": "string"
      },
      "agg_method_params": {
         "anyOf": [
            {
               "additionalProperties": true,
               "type": "object"
            },
            {
               "type": "null"
            }
         ],
         "default": null,
         "title": "Agg Method Params"
      },
      "masks": {
         "anyOf": [
            {
               "items": {
                  "anyOf": [
                     {
                        "additionalProperties": true,
                        "type": "object"
                     },
                     {
                        "type": "string"
                     }
                  ]
               },
               "type": "array"
            },
            {
               "type": "null"
            }
         ],
         "default": null,
         "title": "Masks"
      },
      "maps": {
         "title": "Maps",
         "type": "string"
      }
   },
   "$defs": {
      "ALFFImpl": {
         "description": "Accepted ALFF implementations.\n\n* ``junifer`` : ``junifer``'s ALFF\n* ``afni`` : AFNI's ``3dRSFC``",
         "enum": [
            "junifer",
            "afni"
         ],
         "title": "ALFFImpl",
         "type": "string"
      }
   },
   "required": [
      "using",
      "maps"
   ]
}

Config:
  • use_enum_values: bool = True

Fields:
  • maps (str)

  • on (list[Literal[junifer.datagrabber.base.DataType.BOLD]])

field maps: str [Required]
field on: list[Literal[DataType.BOLD]] = [<DataType.BOLD: 'BOLD'>]
compute(input, extra_input=None)

Compute.

Parameters:
inputdict

The BOLD data as dictionary.

extra_inputdict, optional

The other fields in the pipeline data object (default None).

Returns:
dict

The computed result as dictionary. This will be either returned to the user or stored in the storage by calling the store method with this as a parameter. The dictionary has the following keys:

  • alff : dictionary with the following keys:

    • data : ROI values as numpy.ndarray

    • col_names : ROI labels as list of str

  • falff : dictionary with the following keys:

    • data : ROI values as numpy.ndarray

    • col_names : ROI labels as list of str

pydantic model junifer.markers.ALFFParcels

Class for ALFF / fALFF on parcels.

Parameters:
parcellationlist of str

The name(s) of the parcellation(s) to use. See list_data() for options.

usingALFFImpl
agg_methodstr, optional

The aggregation function to use. See get_aggfunc_by_name() for options (default “mean”).

agg_method_paramsdict or None, optional

The parameters to pass to the aggregation function. See get_aggfunc_by_name() for valid options (default None).

highpasspositive float, optional

Highpass cutoff frequency (default 0.01).

lowpasspositive float, optional

Lowpass cutoff frequency (default 0.1).

trpositive float, optional

The repetition time of the BOLD data. If None, will extract the TR from NIfTI header (default None).

maskslist of dict or str, or None, optional

The specification of the masks to apply to regions before extracting signals. Check Using Masks for more details. If None, will not apply any mask (default None).

namestr or None, optional

The name of the marker. If None, will use the class name (default None).

Notes

The tr parameter is crucial for the correctness of fALFF/ALFF computation. If a dataset is correctly preprocessed, the tr should be extracted from the NIfTI without any issue. However, it has been reported that some preprocessed data might not have the correct tr in the NIfTI header.

ALFF/fALFF are computed using a bandpass butterworth filter. See scipy.signal.butter() and scipy.signal.filtfilt() for more details.

Create a new model by parsing and validating input data from keyword arguments.

Raises [ValidationError][pydantic_core.ValidationError] if the input data cannot be validated to form a valid model.

self is explicitly positional-only to allow self as a field name.

Show JSON schema
{
   "title": "ALFFParcels",
   "description": "Class for ALFF / fALFF on parcels.\n\nParameters\n----------\nparcellation : list of str\n    The name(s) of the parcellation(s) to use.\n    See :func:`.list_data` for options.\nusing : :enum:`.ALFFImpl`\nagg_method : str, optional\n    The aggregation function to use.\n    See :func:`.get_aggfunc_by_name` for options (default \"mean\").\nagg_method_params : dict or None, optional\n    The parameters to pass to the aggregation function.\n    See :func:`.get_aggfunc_by_name` for valid options (default None).\nhighpass : positive float, optional\n    Highpass cutoff frequency (default 0.01).\nlowpass : positive float, optional\n    Lowpass cutoff frequency (default 0.1).\ntr : positive float, optional\n    The repetition time of the BOLD data.\n    If None, will extract the TR from NIfTI header (default None).\nmasks : list of dict or str, or None, optional\n    The specification of the masks to apply to regions before extracting\n    signals. Check :ref:`Using Masks <using_masks>` for more details.\n    If None, will not apply any mask (default None).\nname : str or None, optional\n    The name of the marker.\n    If None, will use the class name (default None).\n\nNotes\n-----\nThe ``tr`` parameter is crucial for the correctness of fALFF/ALFF\ncomputation. If a dataset is correctly preprocessed, the ``tr`` should be\nextracted from the NIfTI without any issue. However, it has been\nreported that some preprocessed data might not have the correct ``tr`` in\nthe NIfTI header.\n\nALFF/fALFF are computed using a bandpass butterworth filter. See\n:func:`scipy.signal.butter` and :func:`scipy.signal.filtfilt` for more\ndetails.",
   "type": "object",
   "properties": {
      "on": {
         "default": [
            "BOLD"
         ],
         "items": {
            "const": "BOLD",
            "type": "string"
         },
         "title": "On",
         "type": "array"
      },
      "name": {
         "anyOf": [
            {
               "type": "string"
            },
            {
               "type": "null"
            }
         ],
         "default": null,
         "title": "Name"
      },
      "using": {
         "$ref": "#/$defs/ALFFImpl"
      },
      "highpass": {
         "default": 0.01,
         "exclusiveMinimum": 0,
         "title": "Highpass",
         "type": "number"
      },
      "lowpass": {
         "default": 0.1,
         "exclusiveMinimum": 0,
         "title": "Lowpass",
         "type": "number"
      },
      "tr": {
         "anyOf": [
            {
               "exclusiveMinimum": 0,
               "type": "number"
            },
            {
               "type": "null"
            }
         ],
         "default": null,
         "title": "Tr"
      },
      "agg_method": {
         "default": "mean",
         "title": "Agg Method",
         "type": "string"
      },
      "agg_method_params": {
         "anyOf": [
            {
               "additionalProperties": true,
               "type": "object"
            },
            {
               "type": "null"
            }
         ],
         "default": null,
         "title": "Agg Method Params"
      },
      "masks": {
         "anyOf": [
            {
               "items": {
                  "anyOf": [
                     {
                        "additionalProperties": true,
                        "type": "object"
                     },
                     {
                        "type": "string"
                     }
                  ]
               },
               "type": "array"
            },
            {
               "type": "null"
            }
         ],
         "default": null,
         "title": "Masks"
      },
      "parcellation": {
         "items": {
            "type": "string"
         },
         "title": "Parcellation",
         "type": "array"
      }
   },
   "$defs": {
      "ALFFImpl": {
         "description": "Accepted ALFF implementations.\n\n* ``junifer`` : ``junifer``'s ALFF\n* ``afni`` : AFNI's ``3dRSFC``",
         "enum": [
            "junifer",
            "afni"
         ],
         "title": "ALFFImpl",
         "type": "string"
      }
   },
   "required": [
      "using",
      "parcellation"
   ]
}

Config:
  • use_enum_values: bool = True

Fields:
  • on (list[Literal[junifer.datagrabber.base.DataType.BOLD]])

  • parcellation (list[str])

field on: list[Literal[DataType.BOLD]] = [<DataType.BOLD: 'BOLD'>]
field parcellation: list[str] [Required]
compute(input, extra_input=None)

Compute.

Parameters:
inputdict

The BOLD data as dictionary.

extra_inputdict, optional

The other fields in the pipeline data object (default None).

Returns:
dict

The computed result as dictionary. This will be either returned to the user or stored in the storage by calling the store method with this as a parameter. The dictionary has the following keys:

  • alff : dictionary with the following keys:

    • data : ROI values as numpy.ndarray

    • col_names : ROI labels as list of str

  • falff : dictionary with the following keys:

    • data : ROI values as numpy.ndarray

    • col_names : ROI labels as list of str

pydantic model junifer.markers.ALFFSpheres

Class for computing ALFF / fALFF on spheres.

Parameters:
coordsstr

The name of the coordinates list to use. See list_data() for options.

usingALFFImpl
radiuszero or positive float or None, optional

The radius of the sphere in millimetres. If None, the signal will be extracted from a single voxel. See JuniferNiftiSpheresMasker for more information (default None).

allow_overlapbool, optional

Whether to allow overlapping spheres. If False, an error is raised if the spheres overlap (default False).

agg_methodstr, optional

The aggregation function to use. See get_aggfunc_by_name() for options (default “mean”).

agg_method_paramsdict or None, optional

The parameters to pass to the aggregation function. See get_aggfunc_by_name() for valid options (default None).

highpasspositive float, optional

Highpass cutoff frequency (default 0.01).

lowpasspositive float, optional

Lowpass cutoff frequency (default 0.1).

trpositive float, optional

The repetition time of the BOLD data. If None, will extract the TR from NIfTI header (default None).

maskslist of dict or str, or None, optional

The specification of the masks to apply to regions before extracting signals. Check Using Masks for more details. If None, will not apply any mask (default None).

namestr or None, optional

The name of the marker. If None, will use the class name (default None).

Notes

The tr parameter is crucial for the correctness of fALFF/ALFF computation. If a dataset is correctly preprocessed, the tr should be extracted from the NIfTI without any issue. However, it has been reported that some preprocessed data might not have the correct tr in the NIFTI header.

ALFF/fALFF are computed using a bandpass butterworth filter. See scipy.signal.butter() and scipy.signal.filtfilt() for more details.

Create a new model by parsing and validating input data from keyword arguments.

Raises [ValidationError][pydantic_core.ValidationError] if the input data cannot be validated to form a valid model.

self is explicitly positional-only to allow self as a field name.

Show JSON schema
{
   "title": "ALFFSpheres",
   "description": "Class for computing ALFF / fALFF on spheres.\n\nParameters\n----------\ncoords : str\n    The name of the coordinates list to use.\n    See :func:`.list_data` for options.\nusing : :enum:`.ALFFImpl`\nradius : ``zero`` or positive float or None, optional\n    The radius of the sphere in millimetres.\n    If None, the signal will be extracted from a single voxel.\n    See :class:`.JuniferNiftiSpheresMasker` for more information\n    (default None).\nallow_overlap : bool, optional\n    Whether to allow overlapping spheres.\n    If False, an error is raised if the spheres overlap (default False).\nagg_method : str, optional\n    The aggregation function to use.\n    See :func:`.get_aggfunc_by_name` for options (default \"mean\").\nagg_method_params : dict or None, optional\n    The parameters to pass to the aggregation function.\n    See :func:`.get_aggfunc_by_name` for valid options (default None).\nhighpass : positive float, optional\n    Highpass cutoff frequency (default 0.01).\nlowpass : positive float, optional\n    Lowpass cutoff frequency (default 0.1).\ntr : positive float, optional\n    The repetition time of the BOLD data.\n    If None, will extract the TR from NIfTI header (default None).\nmasks : list of dict or str, or None, optional\n    The specification of the masks to apply to regions before extracting\n    signals. Check :ref:`Using Masks <using_masks>` for more details.\n    If None, will not apply any mask (default None).\nname : str or None, optional\n    The name of the marker.\n    If None, will use the class name (default None).\n\nNotes\n-----\nThe ``tr`` parameter is crucial for the correctness of fALFF/ALFF\ncomputation. If a dataset is correctly preprocessed, the ``tr`` should be\nextracted from the NIfTI without any issue. However, it has been\nreported that some preprocessed data might not have the correct ``tr`` in\nthe NIFTI header.\n\nALFF/fALFF are computed using a bandpass butterworth filter. See\n:func:`scipy.signal.butter` and :func:`scipy.signal.filtfilt` for more\ndetails.",
   "type": "object",
   "properties": {
      "on": {
         "default": [
            "BOLD"
         ],
         "items": {
            "const": "BOLD",
            "type": "string"
         },
         "title": "On",
         "type": "array"
      },
      "name": {
         "anyOf": [
            {
               "type": "string"
            },
            {
               "type": "null"
            }
         ],
         "default": null,
         "title": "Name"
      },
      "using": {
         "$ref": "#/$defs/ALFFImpl"
      },
      "highpass": {
         "default": 0.01,
         "exclusiveMinimum": 0,
         "title": "Highpass",
         "type": "number"
      },
      "lowpass": {
         "default": 0.1,
         "exclusiveMinimum": 0,
         "title": "Lowpass",
         "type": "number"
      },
      "tr": {
         "anyOf": [
            {
               "exclusiveMinimum": 0,
               "type": "number"
            },
            {
               "type": "null"
            }
         ],
         "default": null,
         "title": "Tr"
      },
      "agg_method": {
         "default": "mean",
         "title": "Agg Method",
         "type": "string"
      },
      "agg_method_params": {
         "anyOf": [
            {
               "additionalProperties": true,
               "type": "object"
            },
            {
               "type": "null"
            }
         ],
         "default": null,
         "title": "Agg Method Params"
      },
      "masks": {
         "anyOf": [
            {
               "items": {
                  "anyOf": [
                     {
                        "additionalProperties": true,
                        "type": "object"
                     },
                     {
                        "type": "string"
                     }
                  ]
               },
               "type": "array"
            },
            {
               "type": "null"
            }
         ],
         "default": null,
         "title": "Masks"
      },
      "coords": {
         "title": "Coords",
         "type": "string"
      },
      "radius": {
         "anyOf": [
            {
               "const": 0,
               "type": "integer"
            },
            {
               "exclusiveMinimum": 0,
               "type": "number"
            },
            {
               "type": "null"
            }
         ],
         "default": null,
         "title": "Radius"
      },
      "allow_overlap": {
         "default": false,
         "title": "Allow Overlap",
         "type": "boolean"
      }
   },
   "$defs": {
      "ALFFImpl": {
         "description": "Accepted ALFF implementations.\n\n* ``junifer`` : ``junifer``'s ALFF\n* ``afni`` : AFNI's ``3dRSFC``",
         "enum": [
            "junifer",
            "afni"
         ],
         "title": "ALFFImpl",
         "type": "string"
      }
   },
   "required": [
      "using",
      "coords"
   ]
}

Config:
  • use_enum_values: bool = True

Fields:
  • allow_overlap (bool)

  • coords (str)

  • on (list[Literal[junifer.datagrabber.base.DataType.BOLD]])

  • radius (Literal[0] | float | None)

field allow_overlap: bool = False
field coords: str [Required]
field on: list[Literal[DataType.BOLD]] = [<DataType.BOLD: 'BOLD'>]
field radius: Literal[0] | Annotated[float, Gt(gt=0)] | None = None
compute(input, extra_input=None)

Compute.

Parameters:
inputdict

The BOLD data as dictionary.

extra_inputdict, optional

The other fields in the pipeline data object (default None).

Returns:
dict

The computed result as dictionary. This will be either returned to the user or stored in the storage by calling the store method with this as a parameter. The dictionary has the following keys:

  • alff : dictionary with the following keys:

    • data : ROI values as numpy.ndarray

    • col_names : ROI labels as list of str

  • falff : dictionary with the following keys:

    • data : ROI values as numpy.ndarray

    • col_names : ROI labels as list of str

pydantic model junifer.markers.BaseMarker

Abstract base class for marker.

For every marker, one needs to provide a concrete implementation of this abstract class.

Parameters:
onlist of DataType or None, optional

The data type(s) to apply the marker on. If None, will work on all available data types. Check DataType for valid values (default None).

namestr or None, optional

The name of the marker. If None, will use the class name (default None).

Attributes:
valid_inputs

Valid data types to operate on.

Raises:
AttributeError

If the marker does not have _MARKER_INOUT_MAPPINGS attribute.

ValueError

If required input data type(s) is(are) not found.

Create a new model by parsing and validating input data from keyword arguments.

Raises [ValidationError][pydantic_core.ValidationError] if the input data cannot be validated to form a valid model.

self is explicitly positional-only to allow self as a field name.

Show JSON schema
{
   "title": "BaseMarker",
   "description": "Abstract base class for marker.\n\nFor every marker, one needs to provide a concrete\nimplementation of this abstract class.\n\nParameters\n----------\non : list of :enum:`.DataType` or None, optional\n    The data type(s) to apply the marker on.\n    If None, will work on all available data types.\n    Check :enum:`.DataType` for valid values (default None).\nname : str or None, optional\n    The name of the marker.\n    If None, will use the class name (default None).\n\nAttributes\n----------\nvalid_inputs\n\nRaises\n------\nAttributeError\n    If the marker does not have ``_MARKER_INOUT_MAPPINGS`` attribute.\nValueError\n    If required input data type(s) is(are) not found.",
   "type": "object",
   "properties": {
      "on": {
         "anyOf": [
            {
               "items": {
                  "$ref": "#/$defs/DataType"
               },
               "type": "array"
            },
            {
               "type": "null"
            }
         ],
         "default": null,
         "title": "On"
      },
      "name": {
         "anyOf": [
            {
               "type": "string"
            },
            {
               "type": "null"
            }
         ],
         "default": null,
         "title": "Name"
      }
   },
   "$defs": {
      "DataType": {
         "description": "Accepted data type.",
         "enum": [
            "T1w",
            "T2w",
            "BOLD",
            "Warp",
            "VBM_GM",
            "VBM_WM",
            "VBM_CSF",
            "fALFF",
            "GCOR",
            "LCOR",
            "DWI",
            "FreeSurfer"
         ],
         "title": "DataType",
         "type": "string"
      }
   }
}

Config:
  • use_enum_values: bool = True

Fields:
  • name (str | None)

  • on (list[junifer.datagrabber.base.DataType] | None)

field name: str | None = None
field on: list[DataType] | None = None
abstract compute(input, extra_input=None)

Compute.

Parameters:
inputdict

A single input from the pipeline data object in which to compute the marker.

extra_inputdict, optional

The other fields in the pipeline data object. Useful for accessing other data kind that needs to be used in the computation. For example, the functional connectivity markers can make use of the confounds if available (default None).

Returns:
dict

The computed result as dictionary. This will be either returned to the user or stored in the storage by calling the store method with this as a parameter.

model_post_init(context)

Override this method to perform additional initialization after __init__ and model_construct. This is useful if you want to do some validation that requires the entire model to be initialized.

storage_type(input_type, output_feature)

Get StorageType for a feature.

Parameters:
input_typeDataType

The data type input to the marker.

output_featurestr

The feature output of the marker.

Returns:
StorageType

The storage type output of the marker.

store(data_type, feature, output, storage)

Store.

Parameters:
data_typeDataType

The data type to store.

featurestr

The feature to store.

outputdict

The computed result as a dictionary to store.

storagestorage-like

The storage class, for example, SQLiteFeatureStorage.

validate_input(input)

Validate input.

Parameters:
inputlist of str

The input to the pipeline step. The list must contain the available Junifer Data dictionary keys.

Returns:
list of str

The actual elements of the input that will be processed by this pipeline step.

Raises:
ValueError

If the input does not have the required data.

validate_marker_params()

Run extra logical validation for marker.

Subclasses can override to provide validation.

property valid_inputs: list[DataType]

Valid data types to operate on.

Returns:
list of DataType

The list of data types that can be used as input for this marker.

pydantic model junifer.markers.BrainPrint

Class for BrainPrint.

Parameters:
numpositive int, optional

Number of eigenvalues to compute (default 50).

skip_cortexbool, optional

Whether to skip cortical surface or not (default False).

keep_eigenvectorsbool, optional

Whether to also return eigenvectors or not (default False).

normstr, optional

Eigenvalues normalization method (default “none”).

reweightbool, optional

Whether to reweight eigenvalues or not (default False).

asymmetrybool, optional

Whether to calculate asymmetry between lateral structures (default False).

asymmetry_distance{“euc”}, optional

Distance measurement to use if asymmetry=True:

  • "euc" : Euclidean

(default “euc”).

use_cholmodbool, optional

If True, attempts to use the Cholesky decomposition for improved execution speed. Requires the scikit-sparse library. If it cannot be found, an error will be thrown. If False, will use slower LU decomposition (default False).

namestr or None, optional

The name of the marker. If None, will use the class name (default None).

Create a new model by parsing and validating input data from keyword arguments.

Raises [ValidationError][pydantic_core.ValidationError] if the input data cannot be validated to form a valid model.

self is explicitly positional-only to allow self as a field name.

Show JSON schema
{
   "title": "BrainPrint",
   "description": "Class for BrainPrint.\n\nParameters\n----------\nnum : positive int, optional\n    Number of eigenvalues to compute (default 50).\nskip_cortex : bool, optional\n    Whether to skip cortical surface or not (default False).\nkeep_eigenvectors : bool, optional\n    Whether to also return eigenvectors or not (default False).\nnorm : str, optional\n    Eigenvalues normalization method (default \"none\").\nreweight : bool, optional\n    Whether to reweight eigenvalues or not (default False).\nasymmetry : bool, optional\n    Whether to calculate asymmetry between lateral structures\n    (default False).\nasymmetry_distance : {\"euc\"}, optional\n    Distance measurement to use if ``asymmetry=True``:\n\n    * ``\"euc\"`` : Euclidean\n\n    (default \"euc\").\nuse_cholmod : bool, optional\n    If True, attempts to use the Cholesky decomposition for improved\n    execution speed. Requires the ``scikit-sparse`` library. If it cannot\n    be found, an error will be thrown. If False, will use slower LU\n    decomposition (default False).\nname : str or None, optional\n    The name of the marker.\n    If None, will use the class name (default None).",
   "type": "object",
   "properties": {
      "on": {
         "anyOf": [
            {
               "items": {
                  "$ref": "#/$defs/DataType"
               },
               "type": "array"
            },
            {
               "type": "null"
            }
         ],
         "default": null,
         "title": "On"
      },
      "name": {
         "anyOf": [
            {
               "type": "string"
            },
            {
               "type": "null"
            }
         ],
         "default": null,
         "title": "Name"
      },
      "num": {
         "default": 50,
         "exclusiveMinimum": 0,
         "title": "Num",
         "type": "integer"
      },
      "skip_cortex": {
         "default": false,
         "title": "Skip Cortex",
         "type": "boolean"
      },
      "keep_eigenvectors": {
         "default": false,
         "title": "Keep Eigenvectors",
         "type": "boolean"
      },
      "norm": {
         "default": "none",
         "title": "Norm",
         "type": "string"
      },
      "reweight": {
         "default": false,
         "title": "Reweight",
         "type": "boolean"
      },
      "asymmetry": {
         "default": false,
         "title": "Asymmetry",
         "type": "boolean"
      },
      "asymmetry_distance": {
         "default": "euc",
         "title": "Asymmetry Distance",
         "type": "string"
      },
      "use_cholmod": {
         "default": false,
         "title": "Use Cholmod",
         "type": "boolean"
      }
   },
   "$defs": {
      "DataType": {
         "description": "Accepted data type.",
         "enum": [
            "T1w",
            "T2w",
            "BOLD",
            "Warp",
            "VBM_GM",
            "VBM_WM",
            "VBM_CSF",
            "fALFF",
            "GCOR",
            "LCOR",
            "DWI",
            "FreeSurfer"
         ],
         "title": "DataType",
         "type": "string"
      }
   }
}

Config:
  • use_enum_values: bool = True

Fields:
  • asymmetry (bool)

  • asymmetry_distance (str)

  • keep_eigenvectors (bool)

  • norm (str)

  • num (Annotated[int, annotated_types.Gt(gt=0)])

  • reweight (bool)

  • skip_cortex (bool)

  • use_cholmod (bool)

field asymmetry: bool = False
field asymmetry_distance: str = 'euc'
field keep_eigenvectors: bool = False
field norm: str = 'none'
field num: Annotated[int, Gt(gt=0)] = 50
Constraints:
  • gt = 0

field reweight: bool = False
field skip_cortex: bool = False
field use_cholmod: bool = False
compute(input, extra_input=None)

Compute.

Parameters:
inputdict

The FreeSurfer data as dictionary.

extra_inputdict, optional

The other fields in the pipeline data object (default None).

Returns:
dict

The computed result as dictionary. This will be either returned to the user or stored in the storage by calling the store method with this as a parameter. The dictionary has the following keys:

  • eigenvalues : dictionary with the following keys:

    • data : eigenvalues as np.ndarray

    • col_names : surface labels as list of str

    • row_names : eigenvalue count labels as list of str

    • row_header_col_name : “eigenvalue”

  • areas : dictionary with the following keys:

    • data : areas as np.ndarray

    • col_names : surface labels as list of str

  • volumes : dictionary with the following keys:

    • data : volumes as np.ndarray

    • col_names : surface labels as list of str

  • distancesdictionary with the following keys

    if asymmetry = True:

    • data : distances as np.ndarray

    • col_names : surface labels as list of str

References

[1]

Wachinger, C., Golland, P., Kremen, W. et al. (2015) BrainPrint: A discriminative characterization of brain morphology. NeuroImage, Volume 109, Pages 232-248. https://doi.org/10.1016/j.neuroimage.2015.01.032.

[2]

Reuter, M., Wolter, F.E., Peinecke, N. (2006) Laplace-Beltrami spectra as ‘Shape-DNA’ of surfaces and solids. Computer-Aided Design, Volume 38, Issue 4, Pages 342-366. https://doi.org/10.1016/j.cad.2005.10.011.

model_post_init(context)

Override this method to perform additional initialization after __init__ and model_construct. This is useful if you want to do some validation that requires the entire model to be initialized.

pydantic model junifer.markers.CrossParcellationFC

Class for calculating parcel-wise correlations with 2 parcellations.

Parameters:
parcellation_onestr

The name of the first parcellation.

parcellation_twostr

The name of the second parcellation.

agg_methodstr, optional

The aggregation function to use. See get_aggfunc_by_name() for options (default “mean”).

agg_method_paramsdict, optional

The parameters to pass to the aggregation function. See get_aggfunc_by_name() for options (default None).

corr_methodstr, optional

Any method that can be passed to pandas.DataFrame.corr() (default “pearson”).

maskslist of dict or str, optional

The specification of the masks to apply to regions before extracting signals. Check Using Masks for more details. If None, will not apply any mask (default None).

namestr or None, optional

The name of the marker. If None, will use the class name (default None).

Create a new model by parsing and validating input data from keyword arguments.

Raises [ValidationError][pydantic_core.ValidationError] if the input data cannot be validated to form a valid model.

self is explicitly positional-only to allow self as a field name.

Show JSON schema
{
   "title": "CrossParcellationFC",
   "description": "Class for calculating parcel-wise correlations with 2 parcellations.\n\nParameters\n----------\nparcellation_one : str\n    The name of the first parcellation.\nparcellation_two : str\n    The name of the second parcellation.\nagg_method : str, optional\n    The aggregation function to use.\n    See :func:`.get_aggfunc_by_name` for options\n    (default \"mean\").\nagg_method_params : dict, optional\n    The parameters to pass to the aggregation function.\n    See :func:`.get_aggfunc_by_name` for options\n    (default None).\ncorr_method : str, optional\n    Any method that can be passed to\n    :meth:`pandas.DataFrame.corr` (default \"pearson\").\nmasks : list of dict or str, optional\n    The specification of the masks to apply to regions before extracting\n    signals. Check :ref:`Using Masks <using_masks>` for more details.\n    If None, will not apply any mask (default None).\nname : str or None, optional\n    The name of the marker.\n    If None, will use the class name (default None).",
   "type": "object",
   "properties": {
      "on": {
         "default": [
            "BOLD"
         ],
         "items": {
            "const": "BOLD",
            "type": "string"
         },
         "title": "On",
         "type": "array"
      },
      "name": {
         "anyOf": [
            {
               "type": "string"
            },
            {
               "type": "null"
            }
         ],
         "default": null,
         "title": "Name"
      },
      "parcellation_one": {
         "title": "Parcellation One",
         "type": "string"
      },
      "parcellation_two": {
         "title": "Parcellation Two",
         "type": "string"
      },
      "agg_method": {
         "default": "mean",
         "title": "Agg Method",
         "type": "string"
      },
      "agg_method_params": {
         "anyOf": [
            {
               "additionalProperties": true,
               "type": "object"
            },
            {
               "type": "null"
            }
         ],
         "default": null,
         "title": "Agg Method Params"
      },
      "corr_method": {
         "default": "pearson",
         "title": "Corr Method",
         "type": "string"
      },
      "masks": {
         "anyOf": [
            {
               "items": {
                  "anyOf": [
                     {
                        "additionalProperties": true,
                        "type": "object"
                     },
                     {
                        "type": "string"
                     }
                  ]
               },
               "type": "array"
            },
            {
               "type": "null"
            }
         ],
         "default": null,
         "title": "Masks"
      }
   },
   "required": [
      "parcellation_one",
      "parcellation_two"
   ]
}

Config:
  • use_enum_values: bool = True

Fields:
  • agg_method (str)

  • agg_method_params (dict | None)

  • corr_method (str)

  • masks (list[dict | str] | None)

  • on (list[Literal[junifer.datagrabber.base.DataType.BOLD]])

  • parcellation_one (str)

  • parcellation_two (str)

field agg_method: str = 'mean'
field agg_method_params: dict | None = None
field corr_method: str = 'pearson'
field masks: list[dict | str] | None = None
field on: list[Literal[DataType.BOLD]] = [<DataType.BOLD: 'BOLD'>]
field parcellation_one: str [Required]
field parcellation_two: str [Required]
compute(input, extra_input=None)

Compute.

Take a timeseries, parcellate them with two different parcellation schemes, and get parcel-wise correlations between the two different parcellated time series. Shape of output matrix corresponds to number of ROIs in (parcellation_two, parcellation_one).

Parameters:
inputdict

The BOLD data as a dictionary.

extra_inputdict, optional

The other fields in the pipeline data object (default None).

Returns:
dict

The computed result as dictionary. This will be either returned to the user or stored in the storage by calling the store method with this as a parameter. The dictionary has the following keys:

  • functional_connectivity : dictionary with the following keys:

    • datacorrelation between the two parcellations as

      numpy.ndarray

    • col_namesROI labels for first parcellation as list of

      str

    • row_namesROI labels for second parcellation as list of

      str

validate_marker_params()

Run extra logical validation for marker.

pydantic model junifer.markers.EdgeCentricFCMaps

Class for edge-centric FC using maps.

Parameters:
mapsstr

The name of the map(s) to use. See list_data() for options.

conn_methodstr, optional

The connectivity measure to use. See JuniferConnectivityMeasure for options (default “correlation”).

conn_method_paramsdict or None, optional

The parameters to pass to JuniferConnectivityMeasure. If None, {"empirical": True} will be used, which would mean sklearn.covariance.EmpiricalCovariance is used to compute covariance. If usage of sklearn.covariance.LedoitWolf is desired, {"empirical": False} should be passed (default None).

maskslist of dict or str, optional

The specification of the masks to apply to regions before extracting signals. Check Using Masks for more details. If None, will not apply any mask (default None).

namestr or None, optional

The name of the marker. If None, will use the class name (default None).

References

[1]

Jo et al. (2021) Subject identification using edge-centric functional connectivity. https://doi.org/10.1016/j.neuroimage.2021.118204

Create a new model by parsing and validating input data from keyword arguments.

Raises [ValidationError][pydantic_core.ValidationError] if the input data cannot be validated to form a valid model.

self is explicitly positional-only to allow self as a field name.

Show JSON schema
{
   "title": "EdgeCentricFCMaps",
   "description": "Class for edge-centric FC using maps.\n\nParameters\n----------\nmaps : str\n    The name of the map(s) to use.\n    See :func:`.list_data` for options.\nconn_method : str, optional\n    The connectivity measure to use.\n    See :class:`.JuniferConnectivityMeasure` for options\n    (default \"correlation\").\nconn_method_params : dict or None, optional\n    The parameters to pass to :class:`.JuniferConnectivityMeasure`.\n    If None, ``{\"empirical\": True}`` will be used, which would mean\n    :class:`sklearn.covariance.EmpiricalCovariance` is used to compute\n    covariance. If usage of :class:`sklearn.covariance.LedoitWolf` is\n    desired, ``{\"empirical\": False}`` should be passed\n    (default None).\nmasks : list of dict or str, optional\n    The specification of the masks to apply to regions before extracting\n    signals. Check :ref:`Using Masks <using_masks>` for more details.\n    If None, will not apply any mask (default None).\nname : str or None, optional\n    The name of the marker.\n    If None, will use the class name (default None).\n\nReferences\n----------\n.. [1] Jo et al. (2021)\n       Subject identification using edge-centric functional connectivity.\n       https://doi.org/10.1016/j.neuroimage.2021.118204",
   "type": "object",
   "properties": {
      "on": {
         "default": [
            "BOLD"
         ],
         "items": {
            "const": "BOLD",
            "type": "string"
         },
         "title": "On",
         "type": "array"
      },
      "name": {
         "anyOf": [
            {
               "type": "string"
            },
            {
               "type": "null"
            }
         ],
         "default": null,
         "title": "Name"
      },
      "agg_method": {
         "default": "mean",
         "title": "Agg Method",
         "type": "string"
      },
      "agg_method_params": {
         "anyOf": [
            {
               "additionalProperties": true,
               "type": "object"
            },
            {
               "type": "null"
            }
         ],
         "default": null,
         "title": "Agg Method Params"
      },
      "conn_method": {
         "default": "correlation",
         "title": "Conn Method",
         "type": "string"
      },
      "conn_method_params": {
         "anyOf": [
            {
               "additionalProperties": true,
               "type": "object"
            },
            {
               "type": "null"
            }
         ],
         "default": null,
         "title": "Conn Method Params"
      },
      "masks": {
         "anyOf": [
            {
               "items": {
                  "anyOf": [
                     {
                        "additionalProperties": true,
                        "type": "object"
                     },
                     {
                        "type": "string"
                     }
                  ]
               },
               "type": "array"
            },
            {
               "type": "null"
            }
         ],
         "default": null,
         "title": "Masks"
      },
      "maps": {
         "title": "Maps",
         "type": "string"
      }
   },
   "required": [
      "maps"
   ]
}

Config:
  • use_enum_values: bool = True

Fields:
  • maps (str)

  • on (list[Literal[junifer.datagrabber.base.DataType.BOLD]])

field maps: str [Required]
field on: list[Literal[DataType.BOLD]] = [<DataType.BOLD: 'BOLD'>]
aggregate(input, extra_input=None)

Perform maps aggregation and ETS computation.

Parameters:
inputdict

A single input from the pipeline data object in which to compute the marker.

extra_inputdict, optional

The other fields in the pipeline data object. Useful for accessing other data kind that needs to be used in the computation. For example, the functional connectivity markers can make use of the confounds if available (default None).

Returns:
dict

The computed result as dictionary. This will be either returned to the user or stored in the storage by calling the store method with this as a parameter. The dictionary has the following keys:

  • aggregation : dictionary with the following keys:

    • data : ROI values as numpy.ndarray

    • col_names : ROI labels as list of str

pydantic model junifer.markers.EdgeCentricFCParcels

Class for edge-centric FC using parcellations.

Parameters:
parcellationlist of str

The name(s) of the parcellation(s) to use. See list_data() for options.

agg_methodstr, optional

The aggregation function to use. See get_aggfunc_by_name() for options (default “mean”).

agg_method_paramsdict or None, optional

The parameters to pass to the aggregation function. See get_aggfunc_by_name() for options (default None).

conn_methodstr, optional

The connectivity measure to use. See JuniferConnectivityMeasure for options (default “correlation”).

conn_method_paramsdict or None, optional

The parameters to pass to JuniferConnectivityMeasure. If None, {"empirical": True} will be used, which would mean sklearn.covariance.EmpiricalCovariance is used to compute covariance. If usage of sklearn.covariance.LedoitWolf is desired, {"empirical": False} should be passed (default None).

maskslist of dict or str, or None, optional

The specification of the masks to apply to regions before extracting signals. Check Using Masks for more details. If None, will not apply any mask (default None).

namestr or None, optional

The name of the marker. If None, will use the class name (default None).

References

[1]

Jo et al. (2021) Subject identification using edge-centric functional connectivity. https://doi.org/10.1016/j.neuroimage.2021.118204

Create a new model by parsing and validating input data from keyword arguments.

Raises [ValidationError][pydantic_core.ValidationError] if the input data cannot be validated to form a valid model.

self is explicitly positional-only to allow self as a field name.

Show JSON schema
{
   "title": "EdgeCentricFCParcels",
   "description": "Class for edge-centric FC using parcellations.\n\nParameters\n----------\nparcellation : list of str\n    The name(s) of the parcellation(s) to use.\n    See :func:`.list_data` for options.\nagg_method : str, optional\n    The aggregation function to use.\n    See :func:`.get_aggfunc_by_name` for options\n    (default \"mean\").\nagg_method_params : dict or None, optional\n    The parameters to pass to the aggregation function.\n    See :func:`.get_aggfunc_by_name` for options (default None).\nconn_method : str, optional\n    The connectivity measure to use.\n    See :class:`.JuniferConnectivityMeasure` for options\n    (default \"correlation\").\nconn_method_params : dict or None, optional\n    The parameters to pass to :class:`.JuniferConnectivityMeasure`.\n    If None, ``{\"empirical\": True}`` will be used, which would mean\n    :class:`sklearn.covariance.EmpiricalCovariance` is used to compute\n    covariance. If usage of :class:`sklearn.covariance.LedoitWolf` is\n    desired, ``{\"empirical\": False}`` should be passed\n    (default None).\nmasks : list of dict or str, or None, optional\n    The specification of the masks to apply to regions before extracting\n    signals. Check :ref:`Using Masks <using_masks>` for more details.\n    If None, will not apply any mask (default None).\nname : str or None, optional\n    The name of the marker.\n    If None, will use the class name (default None).\n\nReferences\n----------\n.. [1] Jo et al. (2021)\n       Subject identification using edge-centric functional connectivity.\n       https://doi.org/10.1016/j.neuroimage.2021.118204",
   "type": "object",
   "properties": {
      "on": {
         "default": [
            "BOLD"
         ],
         "items": {
            "const": "BOLD",
            "type": "string"
         },
         "title": "On",
         "type": "array"
      },
      "name": {
         "anyOf": [
            {
               "type": "string"
            },
            {
               "type": "null"
            }
         ],
         "default": null,
         "title": "Name"
      },
      "agg_method": {
         "default": "mean",
         "title": "Agg Method",
         "type": "string"
      },
      "agg_method_params": {
         "anyOf": [
            {
               "additionalProperties": true,
               "type": "object"
            },
            {
               "type": "null"
            }
         ],
         "default": null,
         "title": "Agg Method Params"
      },
      "conn_method": {
         "default": "correlation",
         "title": "Conn Method",
         "type": "string"
      },
      "conn_method_params": {
         "anyOf": [
            {
               "additionalProperties": true,
               "type": "object"
            },
            {
               "type": "null"
            }
         ],
         "default": null,
         "title": "Conn Method Params"
      },
      "masks": {
         "anyOf": [
            {
               "items": {
                  "anyOf": [
                     {
                        "additionalProperties": true,
                        "type": "object"
                     },
                     {
                        "type": "string"
                     }
                  ]
               },
               "type": "array"
            },
            {
               "type": "null"
            }
         ],
         "default": null,
         "title": "Masks"
      },
      "parcellation": {
         "items": {
            "type": "string"
         },
         "title": "Parcellation",
         "type": "array"
      }
   },
   "required": [
      "parcellation"
   ]
}

Config:
  • use_enum_values: bool = True

Fields:
  • on (list[Literal[junifer.datagrabber.base.DataType.BOLD]])

  • parcellation (list[str])

field on: list[Literal[DataType.BOLD]] = [<DataType.BOLD: 'BOLD'>]
field parcellation: list[str] [Required]
aggregate(input, extra_input=None)

Perform parcel aggregation and ETS computation.

Parameters:
inputdict

A single input from the pipeline data object in which to compute the marker.

extra_inputdict, optional

The other fields in the pipeline data object. Useful for accessing other data kind that needs to be used in the computation. For example, the functional connectivity markers can make use of the confounds if available (default None).

Returns:
dict

The computed result as dictionary. This will be either returned to the user or stored in the storage by calling the store method with this as a parameter. The dictionary has the following keys:

  • aggregation : dictionary with the following keys:

    • data : ROI values as numpy.ndarray

    • col_names : ROI labels as list of str

pydantic model junifer.markers.EdgeCentricFCSpheres

Class for edge-centric FC using coordinates (spheres).

Parameters:
coordsstr

The name of the coordinates list to use. See list_data() for options.

radiuszero or positive float or None, optional

The radius of the sphere in millimetres. If None, the signal will be extracted from a single voxel. See JuniferNiftiSpheresMasker for more information (default None).

allow_overlapbool, optional

Whether to allow overlapping spheres. If False, an error is raised if the spheres overlap (default False).

agg_methodstr, optional

The aggregation function to use. See get_aggfunc_by_name() for options (default “mean”).

agg_method_paramsdict, optional

The parameters to pass to the aggregation function. See get_aggfunc_by_name() for options (default None).

conn_methodstr, optional

The connectivity measure to use. See JuniferConnectivityMeasure for options (default “correlation”).

conn_method_paramsdict or None, optional

The parameters to pass to JuniferConnectivityMeasure. If None, {"empirical": True} will be used, which would mean sklearn.covariance.EmpiricalCovariance is used to compute covariance. If usage of sklearn.covariance.LedoitWolf is desired, {"empirical": False} should be passed (default None).

maskslist of dict or str, or None, optional

The specification of the masks to apply to regions before extracting signals. Check Using Masks for more details. If None, will not apply any mask (default None).

namestr or None, optional

The name of the marker. If None, will use the class name (default None).

References

[1]

Jo et al. (2021) Subject identification using edge-centric functional connectivity. https://doi.org/10.1016/j.neuroimage.2021.118204

Create a new model by parsing and validating input data from keyword arguments.

Raises [ValidationError][pydantic_core.ValidationError] if the input data cannot be validated to form a valid model.

self is explicitly positional-only to allow self as a field name.

Show JSON schema
{
   "title": "EdgeCentricFCSpheres",
   "description": "Class for edge-centric FC using coordinates (spheres).\n\nParameters\n----------\ncoords : str\n    The name of the coordinates list to use.\n    See :func:`.list_data` for options.\nradius : ``zero`` or positive float or None, optional\n    The radius of the sphere in millimetres.\n    If None, the signal will be extracted from a single voxel.\n    See :class:`.JuniferNiftiSpheresMasker` for more information\n    (default None).\nallow_overlap : bool, optional\n    Whether to allow overlapping spheres.\n    If False, an error is raised if the spheres overlap (default False).\nagg_method : str, optional\n    The aggregation function to use.\n    See :func:`.get_aggfunc_by_name` for options\n    (default \"mean\").\nagg_method_params : dict, optional\n    The parameters to pass to the aggregation function.\n    See :func:`.get_aggfunc_by_name` for options (default None).\nconn_method : str, optional\n    The connectivity measure to use.\n    See :class:`.JuniferConnectivityMeasure` for options\n    (default \"correlation\").\nconn_method_params : dict or None, optional\n    The parameters to pass to :class:`.JuniferConnectivityMeasure`.\n    If None, ``{\"empirical\": True}`` will be used, which would mean\n    :class:`sklearn.covariance.EmpiricalCovariance` is used to compute\n    covariance. If usage of :class:`sklearn.covariance.LedoitWolf` is\n    desired, ``{\"empirical\": False}`` should be passed\n    (default None).\nmasks : list of dict or str, or None, optional\n    The specification of the masks to apply to regions before extracting\n    signals. Check :ref:`Using Masks <using_masks>` for more details.\n    If None, will not apply any mask (default None).\nname : str or None, optional\n    The name of the marker.\n    If None, will use the class name (default None).\n\nReferences\n----------\n.. [1] Jo et al. (2021)\n       Subject identification using edge-centric functional connectivity.\n       https://doi.org/10.1016/j.neuroimage.2021.118204",
   "type": "object",
   "properties": {
      "on": {
         "default": [
            "BOLD"
         ],
         "items": {
            "const": "BOLD",
            "type": "string"
         },
         "title": "On",
         "type": "array"
      },
      "name": {
         "anyOf": [
            {
               "type": "string"
            },
            {
               "type": "null"
            }
         ],
         "default": null,
         "title": "Name"
      },
      "agg_method": {
         "default": "mean",
         "title": "Agg Method",
         "type": "string"
      },
      "agg_method_params": {
         "anyOf": [
            {
               "additionalProperties": true,
               "type": "object"
            },
            {
               "type": "null"
            }
         ],
         "default": null,
         "title": "Agg Method Params"
      },
      "conn_method": {
         "default": "correlation",
         "title": "Conn Method",
         "type": "string"
      },
      "conn_method_params": {
         "anyOf": [
            {
               "additionalProperties": true,
               "type": "object"
            },
            {
               "type": "null"
            }
         ],
         "default": null,
         "title": "Conn Method Params"
      },
      "masks": {
         "anyOf": [
            {
               "items": {
                  "anyOf": [
                     {
                        "additionalProperties": true,
                        "type": "object"
                     },
                     {
                        "type": "string"
                     }
                  ]
               },
               "type": "array"
            },
            {
               "type": "null"
            }
         ],
         "default": null,
         "title": "Masks"
      },
      "coords": {
         "title": "Coords",
         "type": "string"
      },
      "radius": {
         "anyOf": [
            {
               "const": 0,
               "type": "integer"
            },
            {
               "exclusiveMinimum": 0,
               "type": "number"
            },
            {
               "type": "null"
            }
         ],
         "default": null,
         "title": "Radius"
      },
      "allow_overlap": {
         "default": false,
         "title": "Allow Overlap",
         "type": "boolean"
      }
   },
   "required": [
      "coords"
   ]
}

Config:
  • use_enum_values: bool = True

Fields:
  • allow_overlap (bool)

  • coords (str)

  • on (list[Literal[junifer.datagrabber.base.DataType.BOLD]])

  • radius (Literal[0] | Annotated[float, annotated_types.Gt(gt=0)] | None)

field allow_overlap: bool = False
field coords: str [Required]
field on: list[Literal[DataType.BOLD]] = [<DataType.BOLD: 'BOLD'>]
field radius: Literal[0] | Annotated[float, Gt(gt=0)] | None = None
aggregate(input, extra_input=None)

Perform sphere aggregation and ETS computation.

Parameters:
inputdict

A single input from the pipeline data object in which to compute the marker.

extra_inputdict, optional

The other fields in the pipeline data object. Useful for accessing other data kind that needs to be used in the computation. For example, the functional connectivity markers can make use of the confounds if available (default None).

Returns:
dict

The computed result as dictionary. This will be either returned to the user or stored in the storage by calling the store method with this as a parameter. The dictionary has the following keys:

  • aggregation : dictionary with the following keys:

    • data : ROI values as numpy.ndarray

    • col_names : ROI labels as list of str

pydantic model junifer.markers.FunctionalConnectivityMaps

Class for functional connectivity using maps.

Parameters:
mapsstr

The name of the map(s) to use. See list_data() for options.

conn_methodstr, optional

The connectivity measure to use. See JuniferConnectivityMeasure for options (default “correlation”).

conn_method_paramsdict or None, optional

The parameters to pass to JuniferConnectivityMeasure. If None, {"empirical": True} will be used, which would mean sklearn.covariance.EmpiricalCovariance is used to compute covariance. If usage of sklearn.covariance.LedoitWolf is desired, {"empirical": False} should be passed (default None).

maskslist of dict or str, or None, optional

The specification of the masks to apply to regions before extracting signals. Check Using Masks for more details. If None, will not apply any mask (default None).

namestr or None, optional

The name of the marker. If None, will use the class name (default None).

Create a new model by parsing and validating input data from keyword arguments.

Raises [ValidationError][pydantic_core.ValidationError] if the input data cannot be validated to form a valid model.

self is explicitly positional-only to allow self as a field name.

Show JSON schema
{
   "title": "FunctionalConnectivityMaps",
   "description": "Class for functional connectivity using maps.\n\nParameters\n----------\nmaps : str\n    The name of the map(s) to use.\n    See :func:`.list_data` for options.\nconn_method : str, optional\n    The connectivity measure to use.\n    See :class:`.JuniferConnectivityMeasure` for options\n    (default \"correlation\").\nconn_method_params : dict or None, optional\n    The parameters to pass to :class:`.JuniferConnectivityMeasure`.\n    If None, ``{\"empirical\": True}`` will be used, which would mean\n    :class:`sklearn.covariance.EmpiricalCovariance` is used to compute\n    covariance. If usage of :class:`sklearn.covariance.LedoitWolf` is\n    desired, ``{\"empirical\": False}`` should be passed\n    (default None).\nmasks : list of dict or str, or None, optional\n    The specification of the masks to apply to regions before extracting\n    signals. Check :ref:`Using Masks <using_masks>` for more details.\n    If None, will not apply any mask (default None).\nname : str or None, optional\n    The name of the marker.\n    If None, will use the class name (default None).",
   "type": "object",
   "properties": {
      "on": {
         "default": [
            "BOLD"
         ],
         "items": {
            "const": "BOLD",
            "type": "string"
         },
         "title": "On",
         "type": "array"
      },
      "name": {
         "anyOf": [
            {
               "type": "string"
            },
            {
               "type": "null"
            }
         ],
         "default": null,
         "title": "Name"
      },
      "agg_method": {
         "default": "mean",
         "title": "Agg Method",
         "type": "string"
      },
      "agg_method_params": {
         "anyOf": [
            {
               "additionalProperties": true,
               "type": "object"
            },
            {
               "type": "null"
            }
         ],
         "default": null,
         "title": "Agg Method Params"
      },
      "conn_method": {
         "default": "correlation",
         "title": "Conn Method",
         "type": "string"
      },
      "conn_method_params": {
         "anyOf": [
            {
               "additionalProperties": true,
               "type": "object"
            },
            {
               "type": "null"
            }
         ],
         "default": null,
         "title": "Conn Method Params"
      },
      "masks": {
         "anyOf": [
            {
               "items": {
                  "anyOf": [
                     {
                        "additionalProperties": true,
                        "type": "object"
                     },
                     {
                        "type": "string"
                     }
                  ]
               },
               "type": "array"
            },
            {
               "type": "null"
            }
         ],
         "default": null,
         "title": "Masks"
      },
      "maps": {
         "title": "Maps",
         "type": "string"
      }
   },
   "required": [
      "maps"
   ]
}

Config:
  • use_enum_values: bool = True

Fields:
  • maps (str)

  • on (list[Literal[junifer.datagrabber.base.DataType.BOLD]])

field maps: str [Required]
field on: list[Literal[DataType.BOLD]] = [<DataType.BOLD: 'BOLD'>]
aggregate(input, extra_input=None)

Perform maps aggregation.

Parameters:
inputdict

A single input from the pipeline data object in which to compute the marker.

extra_inputdict, optional

The other fields in the pipeline data object. Useful for accessing other data kind that needs to be used in the computation. For example, the functional connectivity markers can make use of the confounds if available (default None).

Returns:
dict

The computed result as dictionary. This will be either returned to the user or stored in the storage by calling the store method with this as a parameter. The dictionary has the following keys:

  • aggregation : dictionary with the following keys:

    • data : ROI values as numpy.ndarray

    • col_names : ROI labels as list of str

pydantic model junifer.markers.FunctionalConnectivityParcels

Class for functional connectivity using parcellations.

Parameters:
parcellationlist of str

The name(s) of the parcellation(s) to use. See list_data() for options.

agg_methodstr, optional

The aggregation function to use. See get_aggfunc_by_name() for options (default “mean”).

agg_method_paramsdict or None, optional

The parameters to pass to the aggregation function. See get_aggfunc_by_name() for options (default None).

conn_methodstr, optional

The connectivity measure to use. See JuniferConnectivityMeasure for options (default “correlation”).

conn_method_paramsdict or None, optional

The parameters to pass to JuniferConnectivityMeasure. If None, {"empirical": True} will be used, which would mean sklearn.covariance.EmpiricalCovariance is used to compute covariance. If usage of sklearn.covariance.LedoitWolf is desired, {"empirical": False} should be passed (default None).

maskslist of dict or str, or None, optional

The specification of the masks to apply to regions before extracting signals. Check Using Masks for more details. If None, will not apply any mask (default None).

namestr or None, optional

The name of the marker. If None, will use the class name (default None).

Create a new model by parsing and validating input data from keyword arguments.

Raises [ValidationError][pydantic_core.ValidationError] if the input data cannot be validated to form a valid model.

self is explicitly positional-only to allow self as a field name.

Show JSON schema
{
   "title": "FunctionalConnectivityParcels",
   "description": "Class for functional connectivity using parcellations.\n\nParameters\n----------\nparcellation : list of str\n    The name(s) of the parcellation(s) to use.\n    See :func:`.list_data` for options.\nagg_method : str, optional\n    The aggregation function to use.\n    See :func:`.get_aggfunc_by_name` for options\n    (default \"mean\").\nagg_method_params : dict or None, optional\n    The parameters to pass to the aggregation function.\n    See :func:`.get_aggfunc_by_name` for options (default None).\nconn_method : str, optional\n    The connectivity measure to use.\n    See :class:`.JuniferConnectivityMeasure` for options\n    (default \"correlation\").\nconn_method_params : dict or None, optional\n    The parameters to pass to :class:`.JuniferConnectivityMeasure`.\n    If None, ``{\"empirical\": True}`` will be used, which would mean\n    :class:`sklearn.covariance.EmpiricalCovariance` is used to compute\n    covariance. If usage of :class:`sklearn.covariance.LedoitWolf` is\n    desired, ``{\"empirical\": False}`` should be passed\n    (default None).\nmasks : list of dict or str, or None, optional\n    The specification of the masks to apply to regions before extracting\n    signals. Check :ref:`Using Masks <using_masks>` for more details.\n    If None, will not apply any mask (default None).\nname : str or None, optional\n    The name of the marker.\n    If None, will use the class name (default None).",
   "type": "object",
   "properties": {
      "on": {
         "default": [
            "BOLD"
         ],
         "items": {
            "const": "BOLD",
            "type": "string"
         },
         "title": "On",
         "type": "array"
      },
      "name": {
         "anyOf": [
            {
               "type": "string"
            },
            {
               "type": "null"
            }
         ],
         "default": null,
         "title": "Name"
      },
      "agg_method": {
         "default": "mean",
         "title": "Agg Method",
         "type": "string"
      },
      "agg_method_params": {
         "anyOf": [
            {
               "additionalProperties": true,
               "type": "object"
            },
            {
               "type": "null"
            }
         ],
         "default": null,
         "title": "Agg Method Params"
      },
      "conn_method": {
         "default": "correlation",
         "title": "Conn Method",
         "type": "string"
      },
      "conn_method_params": {
         "anyOf": [
            {
               "additionalProperties": true,
               "type": "object"
            },
            {
               "type": "null"
            }
         ],
         "default": null,
         "title": "Conn Method Params"
      },
      "masks": {
         "anyOf": [
            {
               "items": {
                  "anyOf": [
                     {
                        "additionalProperties": true,
                        "type": "object"
                     },
                     {
                        "type": "string"
                     }
                  ]
               },
               "type": "array"
            },
            {
               "type": "null"
            }
         ],
         "default": null,
         "title": "Masks"
      },
      "parcellation": {
         "items": {
            "type": "string"
         },
         "title": "Parcellation",
         "type": "array"
      }
   },
   "required": [
      "parcellation"
   ]
}

Config:
  • use_enum_values: bool = True

Fields:
  • on (list[Literal[junifer.datagrabber.base.DataType.BOLD]])

  • parcellation (list[str])

field on: list[Literal[DataType.BOLD]] = [<DataType.BOLD: 'BOLD'>]
field parcellation: list[str] [Required]
aggregate(input, extra_input=None)

Perform parcel aggregation.

Parameters:
inputdict

A single input from the pipeline data object in which to compute the marker.

extra_inputdict, optional

The other fields in the pipeline data object. Useful for accessing other data kind that needs to be used in the computation. For example, the functional connectivity markers can make use of the confounds if available (default None).

Returns:
dict

The computed result as dictionary. This will be either returned to the user or stored in the storage by calling the store method with this as a parameter. The dictionary has the following keys:

  • aggregation : dictionary with the following keys:

    • data : ROI values as numpy.ndarray

    • col_names : ROI labels as list of str

pydantic model junifer.markers.FunctionalConnectivitySpheres

Class for functional connectivity using coordinates (spheres).

Parameters:
coordsstr

The name of the coordinates list to use. See list_data() for options.

radiuszero or positive float or None, optional

The radius of the sphere in millimetres. If None, the signal will be extracted from a single voxel. See JuniferNiftiSpheresMasker for more information (default None).

allow_overlapbool, optional

Whether to allow overlapping spheres. If False, an error is raised if the spheres overlap (default False).

agg_methodstr, optional

The aggregation function to use. See get_aggfunc_by_name() for options (default “mean”).

agg_method_paramsdict or None, optional

The parameters to pass to the aggregation function. See get_aggfunc_by_name() for options (default None).

conn_methodstr, optional

The connectivity measure to use. See JuniferConnectivityMeasure for options (default “correlation”).

conn_method_paramsdict or None, optional

The parameters to pass to JuniferConnectivityMeasure. If None, {"empirical": True} will be used, which would mean sklearn.covariance.EmpiricalCovariance is used to compute covariance. If usage of sklearn.covariance.LedoitWolf is desired, {"empirical": False} should be passed (default None).

maskslist of dict or str, or None, optional

The specification of the masks to apply to regions before extracting signals. Check Using Masks for more details. If None, will not apply any mask (default None).

namestr or None, optional

The name of the marker. If None, will use the class name (default None).

Create a new model by parsing and validating input data from keyword arguments.

Raises [ValidationError][pydantic_core.ValidationError] if the input data cannot be validated to form a valid model.

self is explicitly positional-only to allow self as a field name.

Show JSON schema
{
   "title": "FunctionalConnectivitySpheres",
   "description": "Class for functional connectivity using coordinates (spheres).\n\nParameters\n----------\ncoords : str\n    The name of the coordinates list to use.\n    See :func:`.list_data` for options.\nradius : ``zero`` or positive float or None, optional\n    The radius of the sphere in millimetres.\n    If None, the signal will be extracted from a single voxel.\n    See :class:`.JuniferNiftiSpheresMasker` for more information\n    (default None).\nallow_overlap : bool, optional\n    Whether to allow overlapping spheres.\n    If False, an error is raised if the spheres overlap (default False).\nagg_method : str, optional\n    The aggregation function to use.\n    See :func:`.get_aggfunc_by_name` for options\n    (default \"mean\").\nagg_method_params : dict or None, optional\n    The parameters to pass to the aggregation function.\n    See :func:`.get_aggfunc_by_name` for options (default None).\nconn_method : str, optional\n    The connectivity measure to use.\n    See :class:`.JuniferConnectivityMeasure` for options\n    (default \"correlation\").\nconn_method_params : dict or None, optional\n    The parameters to pass to :class:`.JuniferConnectivityMeasure`.\n    If None, ``{\"empirical\": True}`` will be used, which would mean\n    :class:`sklearn.covariance.EmpiricalCovariance` is used to compute\n    covariance. If usage of :class:`sklearn.covariance.LedoitWolf` is\n    desired, ``{\"empirical\": False}`` should be passed\n    (default None).\nmasks : list of dict or str, or None, optional\n    The specification of the masks to apply to regions before extracting\n    signals. Check :ref:`Using Masks <using_masks>` for more details.\n    If None, will not apply any mask (default None).\nname : str or None, optional\n    The name of the marker.\n    If None, will use the class name (default None).",
   "type": "object",
   "properties": {
      "on": {
         "default": [
            "BOLD"
         ],
         "items": {
            "const": "BOLD",
            "type": "string"
         },
         "title": "On",
         "type": "array"
      },
      "name": {
         "anyOf": [
            {
               "type": "string"
            },
            {
               "type": "null"
            }
         ],
         "default": null,
         "title": "Name"
      },
      "agg_method": {
         "default": "mean",
         "title": "Agg Method",
         "type": "string"
      },
      "agg_method_params": {
         "anyOf": [
            {
               "additionalProperties": true,
               "type": "object"
            },
            {
               "type": "null"
            }
         ],
         "default": null,
         "title": "Agg Method Params"
      },
      "conn_method": {
         "default": "correlation",
         "title": "Conn Method",
         "type": "string"
      },
      "conn_method_params": {
         "anyOf": [
            {
               "additionalProperties": true,
               "type": "object"
            },
            {
               "type": "null"
            }
         ],
         "default": null,
         "title": "Conn Method Params"
      },
      "masks": {
         "anyOf": [
            {
               "items": {
                  "anyOf": [
                     {
                        "additionalProperties": true,
                        "type": "object"
                     },
                     {
                        "type": "string"
                     }
                  ]
               },
               "type": "array"
            },
            {
               "type": "null"
            }
         ],
         "default": null,
         "title": "Masks"
      },
      "coords": {
         "title": "Coords",
         "type": "string"
      },
      "radius": {
         "anyOf": [
            {
               "const": 0,
               "type": "integer"
            },
            {
               "exclusiveMinimum": 0,
               "type": "number"
            },
            {
               "type": "null"
            }
         ],
         "default": null,
         "title": "Radius"
      },
      "allow_overlap": {
         "default": false,
         "title": "Allow Overlap",
         "type": "boolean"
      }
   },
   "required": [
      "coords"
   ]
}

Config:
  • use_enum_values: bool = True

Fields:
  • allow_overlap (bool)

  • coords (str)

  • on (list[Literal[junifer.datagrabber.base.DataType.BOLD]])

  • radius (Literal[0] | Annotated[float, annotated_types.Gt(gt=0)] | None)

field allow_overlap: bool = False
field coords: str [Required]
field on: list[Literal[DataType.BOLD]] = [<DataType.BOLD: 'BOLD'>]
field radius: Literal[0] | Annotated[float, Gt(gt=0)] | None = None
aggregate(input, extra_input=None)

Perform sphere aggregation.

Parameters:
inputdict

A single input from the pipeline data object in which to compute the marker.

extra_inputdict, optional

The other fields in the pipeline data object. Useful for accessing other data kind that needs to be used in the computation. For example, the functional connectivity markers can make use of the confounds if available (default None).

Returns:
dict

The computed result as dictionary. This will be either returned to the user or stored in the storage by calling the store method with this as a parameter. The dictionary has the following keys:

  • aggregation : dictionary with the following keys:

    • data : ROI values as numpy.ndarray

    • col_names : ROI labels as list of str

pydantic model junifer.markers.MapsAggregation

Class for maps aggregation.

Parameters:
mapsstr

The name of the map(s) to use. See list_data() for options.

time_methodstr or None, optional

The aggregation function to use for time series after applying method (only applicable to BOLD data). If None, it will not operate on the time dimension (default None).

time_method_paramsdict or None, optional

The parameters to pass to the time aggregation method (default None).

onlist of {DataType.T1w, DataType.T2w, DataType.BOLD, DataType.VBM_GM, DataType.VBM_WM, DataType.VBM_CSF, DataType.FALFF, DataType.GCOR, DataType.LCOR} or None, optional

The data type(s) to apply the marker on. If None, will work on all available data. Check DataType for valid values (default None).

maskslist of dict or str, or None, optional

The specification of the masks to apply to regions before extracting signals. Check Using Masks for more details. If None, will not apply any mask (default None).

namestr or None, optional

The name of the marker. If None, will use the class name (default None).

Raises:
ValueError

If time_method is specified for non-BOLD data or if time_method_params is not None when time_method is None.

Create a new model by parsing and validating input data from keyword arguments.

Raises [ValidationError][pydantic_core.ValidationError] if the input data cannot be validated to form a valid model.

self is explicitly positional-only to allow self as a field name.

Show JSON schema
{
   "title": "MapsAggregation",
   "description": "Class for maps aggregation.\n\nParameters\n----------\nmaps : str\n    The name of the map(s) to use.\n    See :func:`.list_data` for options.\ntime_method : str or None, optional\n    The aggregation function to use for time series after applying\n    :term:`method` (only applicable to BOLD data). If None,\n    it will not operate on the time dimension (default None).\ntime_method_params : dict or None, optional\n    The parameters to pass to the time aggregation method (default None).\non : list of {``DataType.T1w``, ``DataType.T2w``, ``DataType.BOLD``,          ``DataType.VBM_GM``, ``DataType.VBM_WM``, ``DataType.VBM_CSF``,          ``DataType.FALFF``, ``DataType.GCOR``, ``DataType.LCOR``} or None,          optional\n    The data type(s) to apply the marker on.\n    If None, will work on all available data.\n    Check :enum:`.DataType` for valid values (default None).\nmasks : list of dict or str, or None, optional\n    The specification of the masks to apply to regions before extracting\n    signals. Check :ref:`Using Masks <using_masks>` for more details.\n    If None, will not apply any mask (default None).\nname : str or None, optional\n    The name of the marker.\n    If None, will use the class name (default None).\n\nRaises\n------\nValueError\n    If ``time_method`` is specified for non-BOLD data or if\n    ``time_method_params`` is not None when ``time_method`` is None.",
   "type": "object",
   "properties": {
      "on": {
         "anyOf": [
            {
               "items": {
                  "enum": [
                     "T1w",
                     "T2w",
                     "BOLD",
                     "VBM_GM",
                     "VBM_WM",
                     "VBM_CSF",
                     "fALFF",
                     "GCOR",
                     "LCOR"
                  ],
                  "type": "string"
               },
               "type": "array"
            },
            {
               "type": "null"
            }
         ],
         "default": null,
         "title": "On"
      },
      "name": {
         "anyOf": [
            {
               "type": "string"
            },
            {
               "type": "null"
            }
         ],
         "default": null,
         "title": "Name"
      },
      "maps": {
         "title": "Maps",
         "type": "string"
      },
      "time_method": {
         "anyOf": [
            {
               "type": "string"
            },
            {
               "type": "null"
            }
         ],
         "default": null,
         "title": "Time Method"
      },
      "time_method_params": {
         "anyOf": [
            {
               "additionalProperties": true,
               "type": "object"
            },
            {
               "type": "null"
            }
         ],
         "default": null,
         "title": "Time Method Params"
      },
      "masks": {
         "anyOf": [
            {
               "items": {
                  "anyOf": [
                     {
                        "additionalProperties": true,
                        "type": "object"
                     },
                     {
                        "type": "string"
                     }
                  ]
               },
               "type": "array"
            },
            {
               "type": "null"
            }
         ],
         "default": null,
         "title": "Masks"
      }
   },
   "required": [
      "maps"
   ]
}

Config:
  • use_enum_values: bool = True

Fields:
  • maps (str)

  • masks (list[dict | str] | None)

  • on (list[Literal[junifer.datagrabber.base.DataType.T1w, junifer.datagrabber.base.DataType.T2w, junifer.datagrabber.base.DataType.BOLD, junifer.datagrabber.base.DataType.VBM_GM, junifer.datagrabber.base.DataType.VBM_WM, junifer.datagrabber.base.DataType.VBM_CSF, junifer.datagrabber.base.DataType.FALFF, junifer.datagrabber.base.DataType.GCOR, junifer.datagrabber.base.DataType.LCOR]] | None)

  • time_method (str | None)

  • time_method_params (dict[str, Any] | None)

field maps: str [Required]
field masks: list[dict | str] | None = None
field on: list[Literal[DataType.T1w, DataType.T2w, DataType.BOLD, DataType.VBM_GM, DataType.VBM_WM, DataType.VBM_CSF, DataType.FALFF, DataType.GCOR, DataType.LCOR]] | None = None
field time_method: str | None = None
field time_method_params: dict[str, Any] | None = None
compute(input, extra_input=None)

Compute.

Parameters:
inputdict

A single input from the pipeline data object in which to compute the marker.

extra_inputdict, optional

The other fields in the pipeline data object. Useful for accessing other data kind that needs to be used in the computation. For example, the functional connectivity markers can make use of the confounds if available (default None).

Returns:
dict

The computed result as dictionary. This will be either returned to the user or stored in the storage by calling the store method with this as a parameter. The dictionary has the following keys:

  • aggregation : dictionary with the following keys:

    • data : ROI values as numpy.ndarray

    • col_names : ROI labels as list of str

Warns:
RuntimeWarning

If time aggregation is required but only time point is available.

validate_marker_params()

Run extra logical validation for marker.

pydantic model junifer.markers.ParcelAggregation

Class for parcel aggregation.

Parameters:
parcellationlist of str

The name(s) of the parcellation(s) to use. See list_data() for options.

methodstr, optional

The aggregation function to use. See get_aggfunc_by_name() for options (default “mean”).

method_paramsdict or None, optional

The parameters to pass to the aggregation function. See get_aggfunc_by_name() for options (default None).

time_methodstr or None, optional

The aggregation function to use for time series after applying method (only applicable to BOLD data). If None, it will not operate on the time dimension (default None).

time_method_paramsdict or None, optional

The parameters to pass to the time aggregation function (default None).

onlist of {DataType.T1w, DataType.T2w, DataType.BOLD, DataType.VBM_GM, DataType.VBM_WM, DataType.VBM_CSF, DataType.FALFF, DataType.GCOR, DataType.LCOR} or None, optional

The data type(s) to apply the marker on. If None, will work on all available data. Check DataType for valid values (default None).

maskslist of dict or str, or None, optional

The specification of the masks to apply to regions before extracting signals. Check Using Masks for more details. If None, will not apply any mask (default None).

namestr or None, optional

The name of the marker. If None, will use the class name (default None).

Raises:
ValueError

If time_method is specified for non-BOLD data or if time_method_params is not None when time_method is None.

Create a new model by parsing and validating input data from keyword arguments.

Raises [ValidationError][pydantic_core.ValidationError] if the input data cannot be validated to form a valid model.

self is explicitly positional-only to allow self as a field name.

Show JSON schema
{
   "title": "ParcelAggregation",
   "description": "Class for parcel aggregation.\n\nParameters\n----------\nparcellation : list of str\n    The name(s) of the parcellation(s) to use.\n    See :func:`.list_data` for options.\nmethod : str, optional\n    The aggregation function to use.\n    See :func:`.get_aggfunc_by_name` for options\n    (default \"mean\").\nmethod_params : dict or None, optional\n    The parameters to pass to the aggregation function.\n    See :func:`.get_aggfunc_by_name` for options (default None).\ntime_method : str or None, optional\n    The aggregation function to use for time series after applying\n    :term:`method` (only applicable to BOLD data). If None,\n    it will not operate on the time dimension (default None).\ntime_method_params : dict or None, optional\n    The parameters to pass to the time aggregation function (default None).\non : list of {``DataType.T1w``, ``DataType.T2w``, ``DataType.BOLD``,          ``DataType.VBM_GM``, ``DataType.VBM_WM``, ``DataType.VBM_CSF``,          ``DataType.FALFF``, ``DataType.GCOR``, ``DataType.LCOR``} or None,          optional\n    The data type(s) to apply the marker on.\n    If None, will work on all available data.\n    Check :enum:`.DataType` for valid values (default None).\nmasks : list of dict or str, or None, optional\n    The specification of the masks to apply to regions before extracting\n    signals. Check :ref:`Using Masks <using_masks>` for more details.\n    If None, will not apply any mask (default None).\nname : str or None, optional\n    The name of the marker.\n    If None, will use the class name (default None).\n\nRaises\n------\nValueError\n    If ``time_method`` is specified for non-BOLD data or if\n    ``time_method_params`` is not None when ``time_method`` is None.",
   "type": "object",
   "properties": {
      "on": {
         "anyOf": [
            {
               "items": {
                  "enum": [
                     "T1w",
                     "T2w",
                     "BOLD",
                     "VBM_GM",
                     "VBM_WM",
                     "VBM_CSF",
                     "fALFF",
                     "GCOR",
                     "LCOR"
                  ],
                  "type": "string"
               },
               "type": "array"
            },
            {
               "type": "null"
            }
         ],
         "default": null,
         "title": "On"
      },
      "name": {
         "anyOf": [
            {
               "type": "string"
            },
            {
               "type": "null"
            }
         ],
         "default": null,
         "title": "Name"
      },
      "parcellation": {
         "items": {
            "type": "string"
         },
         "title": "Parcellation",
         "type": "array"
      },
      "method": {
         "default": "mean",
         "title": "Method",
         "type": "string"
      },
      "method_params": {
         "anyOf": [
            {
               "additionalProperties": true,
               "type": "object"
            },
            {
               "type": "null"
            }
         ],
         "default": null,
         "title": "Method Params"
      },
      "time_method": {
         "anyOf": [
            {
               "type": "string"
            },
            {
               "type": "null"
            }
         ],
         "default": null,
         "title": "Time Method"
      },
      "time_method_params": {
         "anyOf": [
            {
               "additionalProperties": true,
               "type": "object"
            },
            {
               "type": "null"
            }
         ],
         "default": null,
         "title": "Time Method Params"
      },
      "masks": {
         "anyOf": [
            {
               "items": {
                  "anyOf": [
                     {
                        "additionalProperties": true,
                        "type": "object"
                     },
                     {
                        "type": "string"
                     }
                  ]
               },
               "type": "array"
            },
            {
               "type": "null"
            }
         ],
         "default": null,
         "title": "Masks"
      }
   },
   "required": [
      "parcellation"
   ]
}

Config:
  • use_enum_values: bool = True

Fields:
  • masks (list[dict | str] | None)

  • method (str)

  • method_params (dict[str, Any] | None)

  • on (list[Literal[junifer.datagrabber.base.DataType.T1w, junifer.datagrabber.base.DataType.T2w, junifer.datagrabber.base.DataType.BOLD, junifer.datagrabber.base.DataType.VBM_GM, junifer.datagrabber.base.DataType.VBM_WM, junifer.datagrabber.base.DataType.VBM_CSF, junifer.datagrabber.base.DataType.FALFF, junifer.datagrabber.base.DataType.GCOR, junifer.datagrabber.base.DataType.LCOR]] | None)

  • parcellation (list[str])

  • time_method (str | None)

  • time_method_params (dict[str, Any] | None)

field masks: list[dict | str] | None = None
field method: str = 'mean'
field method_params: dict[str, Any] | None = None
field on: list[Literal[DataType.T1w, DataType.T2w, DataType.BOLD, DataType.VBM_GM, DataType.VBM_WM, DataType.VBM_CSF, DataType.FALFF, DataType.GCOR, DataType.LCOR]] | None = None
field parcellation: list[str] [Required]
field time_method: str | None = None
field time_method_params: dict[str, Any] | None = None
compute(input, extra_input=None)

Compute.

Parameters:
inputdict

A single input from the pipeline data object in which to compute the marker.

extra_inputdict, optional

The other fields in the pipeline data object. Useful for accessing other data kind that needs to be used in the computation. For example, the functional connectivity markers can make use of the confounds if available (default None).

Returns:
dict

The computed result as dictionary. This will be either returned to the user or stored in the storage by calling the store method with this as a parameter. The dictionary has the following keys:

  • aggregation : dictionary with the following keys:

    • data : ROI values as numpy.ndarray

    • col_names : ROI labels as list of str

Warns:
RuntimeWarning

If time aggregation is required but only time point is available.

validate_marker_params()

Run extra logical validation for marker.

pydantic model junifer.markers.RSSETSMarker

Class for root sum of squares of edgewise timeseries.

Parameters:
parcellationlist of str

The name(s) of the parcellation(s) to use. See list_data() for options.

agg_methodstr, optional

The aggregation function to use. See get_aggfunc_by_name() for options (default “mean”).

agg_method_paramsdict or None, optional

The parameters to pass to the aggregation function. See get_aggfunc_by_name() for options (default None).

maskslist of dict or str, or None, optional

The specification of the masks to apply to regions before extracting signals. Check Using Masks for more details. If None, will not apply any mask (default None).

namestr or None, optional

The name of the marker. If None, will use the class name (default None).

Create a new model by parsing and validating input data from keyword arguments.

Raises [ValidationError][pydantic_core.ValidationError] if the input data cannot be validated to form a valid model.

self is explicitly positional-only to allow self as a field name.

Show JSON schema
{
   "title": "RSSETSMarker",
   "description": "Class for root sum of squares of edgewise timeseries.\n\nParameters\n----------\nparcellation : list of str\n    The name(s) of the parcellation(s) to use.\n    See :func:`.list_data` for options.\nagg_method : str, optional\n    The aggregation function to use.\n    See :func:`.get_aggfunc_by_name` for options\n    (default \"mean\").\nagg_method_params : dict or None, optional\n    The parameters to pass to the aggregation function.\n    See :func:`.get_aggfunc_by_name` for options (default None).\nmasks : list of dict or str, or None, optional\n    The specification of the masks to apply to regions before extracting\n    signals. Check :ref:`Using Masks <using_masks>` for more details.\n    If None, will not apply any mask (default None).\nname : str or None, optional\n    The name of the marker.\n    If None, will use the class name (default None).",
   "type": "object",
   "properties": {
      "on": {
         "default": [
            "BOLD"
         ],
         "items": {
            "const": "BOLD",
            "type": "string"
         },
         "title": "On",
         "type": "array"
      },
      "name": {
         "anyOf": [
            {
               "type": "string"
            },
            {
               "type": "null"
            }
         ],
         "default": null,
         "title": "Name"
      },
      "parcellation": {
         "items": {
            "type": "string"
         },
         "title": "Parcellation",
         "type": "array"
      },
      "agg_method": {
         "default": "mean",
         "title": "Agg Method",
         "type": "string"
      },
      "agg_method_params": {
         "anyOf": [
            {
               "additionalProperties": true,
               "type": "object"
            },
            {
               "type": "null"
            }
         ],
         "default": null,
         "title": "Agg Method Params"
      },
      "masks": {
         "anyOf": [
            {
               "items": {
                  "anyOf": [
                     {
                        "additionalProperties": true,
                        "type": "object"
                     },
                     {
                        "type": "string"
                     }
                  ]
               },
               "type": "array"
            },
            {
               "type": "null"
            }
         ],
         "default": null,
         "title": "Masks"
      }
   },
   "required": [
      "parcellation"
   ]
}

Config:
  • use_enum_values: bool = True

Fields:
  • agg_method (str)

  • agg_method_params (dict | None)

  • masks (list[dict | str] | None)

  • on (list[Literal[junifer.datagrabber.base.DataType.BOLD]])

  • parcellation (list[str])

field agg_method: str = 'mean'
field agg_method_params: dict | None = None
field masks: list[dict | str] | None = None
field on: list[Literal[DataType.BOLD]] = [<DataType.BOLD: 'BOLD'>]
field parcellation: list[str] [Required]
compute(input, extra_input=None)

Compute.

Take a timeseries of brain areas, and calculate timeseries for each edge according to the method outlined in [1]. For more information, check https://github.com/brain-networks/edge-ts/blob/master/main.m

Parameters:
inputdict

The BOLD data as dictionary.

extra_inputdict, optional

The other fields in the pipeline data object (default None).

Returns:
dict

The computed result as dictionary. This will be either returned to the user or stored in the storage by calling the store method with this as a parameter. The dictionary has the following keys:

  • data : the actual computed values as a numpy.ndarray

  • col_names : the column labels for the computed values as list

References

[1]

Zamani Esfahlani et al. (2020) High-amplitude cofluctuations in cortical activity drive functional connectivity doi: 10.1073/pnas.2005531117

enum junifer.markers.ReHoImpl(value)

Accepted ReHo implementations.

  • junifer : junifer’s ReHo

  • afni : AFNI’s 3dReHo

Member Type:

str

Valid values are as follows:

junifer = <ReHoImpl.junifer: 'junifer'>
afni = <ReHoImpl.afni: 'afni'>
pydantic model junifer.markers.ReHoMaps

Class for regional homogeneity on maps.

Parameters:
mapsstr

The name of the map(s) to use. See list_data() for options.

usingReHoImpl
reho_paramsdict or None, optional

Extra parameters for computing ReHo map as a dictionary (default None). If using=ReHoImpl.afni, then the valid keys are:

  • nneigh{7, 19, 27}, optional (default 27)

    Number of voxels in the neighbourhood, inclusive. Can be:

    • 7 : for facewise neighbours only

    • 19 : for face- and edge-wise neighbours

    • 27 : for face-, edge-, and node-wise neighbors

  • neigh_radpositive float, optional

    The radius of a desired neighbourhood (default None).

  • neigh_xpositive float, optional

    The semi-radius for x-axis of ellipsoidal volumes (default None).

  • neigh_ypositive float, optional

    The semi-radius for y-axis of ellipsoidal volumes (default None).

  • neigh_zpositive float, optional

    The semi-radius for z-axis of ellipsoidal volumes (default None).

  • box_radpositive int, optional

    The number of voxels outward in a given cardinal direction for a cubic box centered on a given voxel (default None).

  • box_xpositive int, optional

    The number of voxels for +/- x-axis of cuboidal volumes (default None).

  • box_ypositive int, optional

    The number of voxels for +/- y-axis of cuboidal volumes (default None).

  • box_zpositive int, optional

    The number of voxels for +/- z-axis of cuboidal volumes (default None).

else if using=ReHoImpl.junifer, then the valid keys are:

  • nneigh{7, 19, 27, 125}, optional (default 27)

    Number of voxels in the neighbourhood, inclusive. Can be:

    • 7 : for facewise neighbours only

    • 19 : for face- and edge-wise neighbours

    • 27 : for face-, edge-, and node-wise neighbors

    • 125 : for 5x5 cuboidal volume

maskslist of dict or str, or None, optional

The specification of the masks to apply to regions before extracting signals. Check Using Masks for more details. If None, will not apply any mask (default None).

namestr or None, optional

The name of the marker. If None, it will use the class name (default None).

Create a new model by parsing and validating input data from keyword arguments.

Raises [ValidationError][pydantic_core.ValidationError] if the input data cannot be validated to form a valid model.

self is explicitly positional-only to allow self as a field name.

Show JSON schema
{
   "title": "ReHoMaps",
   "description": "Class for regional homogeneity on maps.\n\nParameters\n----------\nmaps : str\n    The name of the map(s) to use.\n    See :func:`.list_data` for options.\nusing : :enum:`.ReHoImpl`\nreho_params : dict or None, optional\n    Extra parameters for computing ReHo map as a dictionary (default None).\n    If ``using=ReHoImpl.afni``, then the valid keys are:\n\n    * ``nneigh`` : {7, 19, 27}, optional (default 27)\n        Number of voxels in the neighbourhood, inclusive. Can be:\n\n        - 7 : for facewise neighbours only\n        - 19 : for face- and edge-wise neighbours\n        - 27 : for face-, edge-, and node-wise neighbors\n\n    * ``neigh_rad`` : positive float, optional\n        The radius of a desired neighbourhood (default None).\n    * ``neigh_x`` : positive float, optional\n        The semi-radius for x-axis of ellipsoidal volumes (default None).\n    * ``neigh_y`` : positive float, optional\n        The semi-radius for y-axis of ellipsoidal volumes (default None).\n    * ``neigh_z`` : positive float, optional\n        The semi-radius for z-axis of ellipsoidal volumes (default None).\n    * ``box_rad`` : positive int, optional\n        The number of voxels outward in a given cardinal direction for a\n        cubic box centered on a given voxel (default None).\n    * ``box_x`` : positive int, optional\n        The number of voxels for +/- x-axis of cuboidal volumes\n        (default None).\n    * ``box_y`` : positive int, optional\n        The number of voxels for +/- y-axis of cuboidal volumes\n        (default None).\n    * ``box_z`` : positive int, optional\n        The number of voxels for +/- z-axis of cuboidal volumes\n        (default None).\n\n    else if ``using=ReHoImpl.junifer``, then the valid keys are:\n\n    * ``nneigh`` : {7, 19, 27, 125}, optional (default 27)\n        Number of voxels in the neighbourhood, inclusive. Can be:\n\n        * 7 : for facewise neighbours only\n        * 19 : for face- and edge-wise neighbours\n        * 27 : for face-, edge-, and node-wise neighbors\n        * 125 : for 5x5 cuboidal volume\n\nmasks : list of dict or str, or None, optional\n    The specification of the masks to apply to regions before extracting\n    signals. Check :ref:`Using Masks <using_masks>` for more details.\n    If None, will not apply any mask (default None).\nname : str or None, optional\n    The name of the marker.\n    If None, it will use the class name (default None).",
   "type": "object",
   "properties": {
      "on": {
         "default": [
            "BOLD"
         ],
         "items": {
            "const": "BOLD",
            "type": "string"
         },
         "title": "On",
         "type": "array"
      },
      "name": {
         "anyOf": [
            {
               "type": "string"
            },
            {
               "type": "null"
            }
         ],
         "default": null,
         "title": "Name"
      },
      "using": {
         "$ref": "#/$defs/ReHoImpl"
      },
      "reho_params": {
         "anyOf": [
            {
               "additionalProperties": true,
               "type": "object"
            },
            {
               "type": "null"
            }
         ],
         "default": null,
         "title": "Reho Params"
      },
      "agg_method": {
         "default": "mean",
         "title": "Agg Method",
         "type": "string"
      },
      "agg_method_params": {
         "anyOf": [
            {
               "additionalProperties": true,
               "type": "object"
            },
            {
               "type": "null"
            }
         ],
         "default": null,
         "title": "Agg Method Params"
      },
      "masks": {
         "anyOf": [
            {
               "items": {
                  "anyOf": [
                     {
                        "additionalProperties": true,
                        "type": "object"
                     },
                     {
                        "type": "string"
                     }
                  ]
               },
               "type": "array"
            },
            {
               "type": "null"
            }
         ],
         "default": null,
         "title": "Masks"
      },
      "maps": {
         "title": "Maps",
         "type": "string"
      }
   },
   "$defs": {
      "ReHoImpl": {
         "description": "Accepted ReHo implementations.\n\n* ``junifer`` : ``junifer``'s ReHo\n* ``afni`` : AFNI's ``3dReHo``",
         "enum": [
            "junifer",
            "afni"
         ],
         "title": "ReHoImpl",
         "type": "string"
      }
   },
   "required": [
      "using",
      "maps"
   ]
}

Config:
  • use_enum_values: bool = True

Fields:
  • maps (str)

  • on (list[Literal[junifer.datagrabber.base.DataType.BOLD]])

field maps: str [Required]
field on: list[Literal[DataType.BOLD]] = [<DataType.BOLD: 'BOLD'>]
compute(input, extra_input=None)

Compute.

Parameters:
inputdict

The BOLD data as dictionary.

extra_inputdict, optional

The other fields in the pipeline data object (default None).

Returns:
dict

The computed result as dictionary. This will be either returned to the user or stored in the storage by calling the store method with this as a parameter. The dictionary has the following keys:

  • reho : dictionary with the following keys:

    • data : ROI values as numpy.ndarray

    • col_names : ROI labels as list of str

pydantic model junifer.markers.ReHoParcels

Class for regional homogeneity on parcels.

Parameters:
parcellationlist of str

The name(s) of the parcellation(s) to use. See list_data() for options.

usingReHoImpl
reho_paramsdict or None, optional

Extra parameters for computing ReHo map as a dictionary (default None). If using=ReHoImpl.afni, then the valid keys are:

  • nneigh{7, 19, 27}, optional (default 27)

    Number of voxels in the neighbourhood, inclusive. Can be:

    • 7 : for facewise neighbours only

    • 19 : for face- and edge-wise neighbours

    • 27 : for face-, edge-, and node-wise neighbors

  • neigh_radpositive float, optional

    The radius of a desired neighbourhood (default None).

  • neigh_xpositive float, optional

    The semi-radius for x-axis of ellipsoidal volumes (default None).

  • neigh_ypositive float, optional

    The semi-radius for y-axis of ellipsoidal volumes (default None).

  • neigh_zpositive float, optional

    The semi-radius for z-axis of ellipsoidal volumes (default None).

  • box_radpositive int, optional

    The number of voxels outward in a given cardinal direction for a cubic box centered on a given voxel (default None).

  • box_xpositive int, optional

    The number of voxels for +/- x-axis of cuboidal volumes (default None).

  • box_ypositive int, optional

    The number of voxels for +/- y-axis of cuboidal volumes (default None).

  • box_zpositive int, optional

    The number of voxels for +/- z-axis of cuboidal volumes (default None).

else if using=ReHoImpl.junifer, then the valid keys are:

  • nneigh{7, 19, 27, 125}, optional (default 27)

    Number of voxels in the neighbourhood, inclusive. Can be:

    • 7 : for facewise neighbours only

    • 19 : for face- and edge-wise neighbours

    • 27 : for face-, edge-, and node-wise neighbors

    • 125 : for 5x5 cuboidal volume

agg_methodstr, optional

The aggregation function to use. See get_aggfunc_by_name() for options (default “mean”).

agg_method_paramsdict or None, optional

The parameters to pass to the aggregation function. See get_aggfunc_by_name() for options (default None).

maskslist of dict or str, or None, optional

The specification of the masks to apply to regions before extracting signals. Check Using Masks for more details. If None, will not apply any mask (default None).

namestr or None, optional

The name of the marker. If None, it will use the class name (default None).

Create a new model by parsing and validating input data from keyword arguments.

Raises [ValidationError][pydantic_core.ValidationError] if the input data cannot be validated to form a valid model.

self is explicitly positional-only to allow self as a field name.

Show JSON schema
{
   "title": "ReHoParcels",
   "description": "Class for regional homogeneity on parcels.\n\nParameters\n----------\nparcellation : list of str\n    The name(s) of the parcellation(s) to use.\n    See :func:`.list_data` for options.\nusing : :enum:`.ReHoImpl`\nreho_params : dict or None, optional\n    Extra parameters for computing ReHo map as a dictionary (default None).\n    If ``using=ReHoImpl.afni``, then the valid keys are:\n\n    * ``nneigh`` : {7, 19, 27}, optional (default 27)\n        Number of voxels in the neighbourhood, inclusive. Can be:\n\n        - 7 : for facewise neighbours only\n        - 19 : for face- and edge-wise neighbours\n        - 27 : for face-, edge-, and node-wise neighbors\n\n    * ``neigh_rad`` : positive float, optional\n        The radius of a desired neighbourhood (default None).\n    * ``neigh_x`` : positive float, optional\n        The semi-radius for x-axis of ellipsoidal volumes (default None).\n    * ``neigh_y`` : positive float, optional\n        The semi-radius for y-axis of ellipsoidal volumes (default None).\n    * ``neigh_z`` : positive float, optional\n        The semi-radius for z-axis of ellipsoidal volumes (default None).\n    * ``box_rad`` : positive int, optional\n        The number of voxels outward in a given cardinal direction for a\n        cubic box centered on a given voxel (default None).\n    * ``box_x`` : positive int, optional\n        The number of voxels for +/- x-axis of cuboidal volumes\n        (default None).\n    * ``box_y`` : positive int, optional\n        The number of voxels for +/- y-axis of cuboidal volumes\n        (default None).\n    * ``box_z`` : positive int, optional\n        The number of voxels for +/- z-axis of cuboidal volumes\n        (default None).\n\n    else if ``using=ReHoImpl.junifer``, then the valid keys are:\n\n    * ``nneigh`` : {7, 19, 27, 125}, optional (default 27)\n        Number of voxels in the neighbourhood, inclusive. Can be:\n\n        * 7 : for facewise neighbours only\n        * 19 : for face- and edge-wise neighbours\n        * 27 : for face-, edge-, and node-wise neighbors\n        * 125 : for 5x5 cuboidal volume\n\nagg_method : str, optional\n    The aggregation function to use.\n    See :func:`.get_aggfunc_by_name` for options\n    (default \"mean\").\nagg_method_params : dict or None, optional\n    The parameters to pass to the aggregation function.\n    See :func:`.get_aggfunc_by_name` for options (default None).\nmasks : list of dict or str, or None, optional\n    The specification of the masks to apply to regions before extracting\n    signals. Check :ref:`Using Masks <using_masks>` for more details.\n    If None, will not apply any mask (default None).\nname : str or None, optional\n    The name of the marker.\n    If None, it will use the class name (default None).",
   "type": "object",
   "properties": {
      "on": {
         "default": [
            "BOLD"
         ],
         "items": {
            "const": "BOLD",
            "type": "string"
         },
         "title": "On",
         "type": "array"
      },
      "name": {
         "anyOf": [
            {
               "type": "string"
            },
            {
               "type": "null"
            }
         ],
         "default": null,
         "title": "Name"
      },
      "using": {
         "$ref": "#/$defs/ReHoImpl"
      },
      "reho_params": {
         "anyOf": [
            {
               "additionalProperties": true,
               "type": "object"
            },
            {
               "type": "null"
            }
         ],
         "default": null,
         "title": "Reho Params"
      },
      "agg_method": {
         "default": "mean",
         "title": "Agg Method",
         "type": "string"
      },
      "agg_method_params": {
         "anyOf": [
            {
               "additionalProperties": true,
               "type": "object"
            },
            {
               "type": "null"
            }
         ],
         "default": null,
         "title": "Agg Method Params"
      },
      "masks": {
         "anyOf": [
            {
               "items": {
                  "anyOf": [
                     {
                        "additionalProperties": true,
                        "type": "object"
                     },
                     {
                        "type": "string"
                     }
                  ]
               },
               "type": "array"
            },
            {
               "type": "null"
            }
         ],
         "default": null,
         "title": "Masks"
      },
      "parcellation": {
         "items": {
            "type": "string"
         },
         "title": "Parcellation",
         "type": "array"
      }
   },
   "$defs": {
      "ReHoImpl": {
         "description": "Accepted ReHo implementations.\n\n* ``junifer`` : ``junifer``'s ReHo\n* ``afni`` : AFNI's ``3dReHo``",
         "enum": [
            "junifer",
            "afni"
         ],
         "title": "ReHoImpl",
         "type": "string"
      }
   },
   "required": [
      "using",
      "parcellation"
   ]
}

Config:
  • use_enum_values: bool = True

Fields:
  • on (list[Literal[junifer.datagrabber.base.DataType.BOLD]])

  • parcellation (list[str])

field on: list[Literal[DataType.BOLD]] = [<DataType.BOLD: 'BOLD'>]
field parcellation: list[str] [Required]
compute(input, extra_input=None)

Compute.

Parameters:
inputdict

The BOLD data as dictionary.

extra_inputdict, optional

The other fields in the pipeline data object (default None).

Returns:
dict

The computed result as dictionary. This will be either returned to the user or stored in the storage by calling the store method with this as a parameter. The dictionary has the following keys:

  • reho : dictionary with the following keys:

    • data : ROI values as numpy.ndarray

    • col_names : ROI labels as list of str

pydantic model junifer.markers.ReHoSpheres

Class for regional homogeneity on spheres.

Parameters:
coordsstr

The name of the coordinates list to use. See list_data() for options.

usingReHoImpl
radiuszero or positive float or None, optional

The radius of the sphere in millimetres. If None, the signal will be extracted from a single voxel. See JuniferNiftiSpheresMasker for more information (default None).

allow_overlapbool, optional

Whether to allow overlapping spheres. If False, an error is raised if the spheres overlap (default False).

reho_paramsdict or None, optional

Extra parameters for computing ReHo map as a dictionary (default None). If using=ReHoImpl.afni, then the valid keys are:

  • nneigh{7, 19, 27}, optional (default 27)

    Number of voxels in the neighbourhood, inclusive. Can be:

    • 7 : for facewise neighbours only

    • 19 : for face- and edge-wise neighbours

    • 27 : for face-, edge-, and node-wise neighbors

  • neigh_radpositive float, optional

    The radius of a desired neighbourhood (default None).

  • neigh_xpositive float, optional

    The semi-radius for x-axis of ellipsoidal volumes (default None).

  • neigh_ypositive float, optional

    The semi-radius for y-axis of ellipsoidal volumes (default None).

  • neigh_zpositive float, optional

    The semi-radius for z-axis of ellipsoidal volumes (default None).

  • box_radpositive int, optional

    The number of voxels outward in a given cardinal direction for a cubic box centered on a given voxel (default None).

  • box_xpositive int, optional

    The number of voxels for +/- x-axis of cuboidal volumes (default None).

  • box_ypositive int, optional

    The number of voxels for +/- y-axis of cuboidal volumes (default None).

  • box_zpositive int, optional

    The number of voxels for +/- z-axis of cuboidal volumes (default None).

else if using=ReHoImpl.junifer, then the valid keys are:

  • nneigh{7, 19, 27, 125}, optional (default 27)

    Number of voxels in the neighbourhood, inclusive. Can be:

    • 7 : for facewise neighbours only

    • 19 : for face- and edge-wise neighbours

    • 27 : for face-, edge-, and node-wise neighbors

    • 125 : for 5x5 cuboidal volume

agg_methodstr, optional

The aggregation function to use. See get_aggfunc_by_name() for options (default “mean”).

agg_method_paramsdict or None, optional

The parameters to pass to the aggregation function. See get_aggfunc_by_name() for options (default None).

maskslist of dict or str, or None, optional

The specification of the masks to apply to regions before extracting signals. Check Using Masks for more details. If None, will not apply any mask (default None).

namestr or None, optional

The name of the marker. If None, it will use the class name (default None).

Create a new model by parsing and validating input data from keyword arguments.

Raises [ValidationError][pydantic_core.ValidationError] if the input data cannot be validated to form a valid model.

self is explicitly positional-only to allow self as a field name.

Show JSON schema
{
   "title": "ReHoSpheres",
   "description": "Class for regional homogeneity on spheres.\n\nParameters\n----------\ncoords : str\n    The name of the coordinates list to use.\n    See :func:`.list_data` for options.\nusing : :enum:`.ReHoImpl`\nradius : ``zero`` or positive float or None, optional\n    The radius of the sphere in millimetres.\n    If None, the signal will be extracted from a single voxel.\n    See :class:`.JuniferNiftiSpheresMasker` for more information\n    (default None).\nallow_overlap : bool, optional\n    Whether to allow overlapping spheres.\n    If False, an error is raised if the spheres overlap (default False).\nreho_params : dict or None, optional\n    Extra parameters for computing ReHo map as a dictionary (default None).\n    If ``using=ReHoImpl.afni``, then the valid keys are:\n\n    * ``nneigh`` : {7, 19, 27}, optional (default 27)\n        Number of voxels in the neighbourhood, inclusive. Can be:\n\n        - 7 : for facewise neighbours only\n        - 19 : for face- and edge-wise neighbours\n        - 27 : for face-, edge-, and node-wise neighbors\n\n    * ``neigh_rad`` : positive float, optional\n        The radius of a desired neighbourhood (default None).\n    * ``neigh_x`` : positive float, optional\n        The semi-radius for x-axis of ellipsoidal volumes (default None).\n    * ``neigh_y`` : positive float, optional\n        The semi-radius for y-axis of ellipsoidal volumes (default None).\n    * ``neigh_z`` : positive float, optional\n        The semi-radius for z-axis of ellipsoidal volumes (default None).\n    * ``box_rad`` : positive int, optional\n        The number of voxels outward in a given cardinal direction for a\n        cubic box centered on a given voxel (default None).\n    * ``box_x`` : positive int, optional\n        The number of voxels for +/- x-axis of cuboidal volumes\n        (default None).\n    * ``box_y`` : positive int, optional\n        The number of voxels for +/- y-axis of cuboidal volumes\n        (default None).\n    * ``box_z`` : positive int, optional\n        The number of voxels for +/- z-axis of cuboidal volumes\n        (default None).\n\n    else if ``using=ReHoImpl.junifer``, then the valid keys are:\n\n    * ``nneigh`` : {7, 19, 27, 125}, optional (default 27)\n        Number of voxels in the neighbourhood, inclusive. Can be:\n\n        * 7 : for facewise neighbours only\n        * 19 : for face- and edge-wise neighbours\n        * 27 : for face-, edge-, and node-wise neighbors\n        * 125 : for 5x5 cuboidal volume\n\nagg_method : str, optional\n    The aggregation function to use.\n    See :func:`.get_aggfunc_by_name` for options\n    (default \"mean\").\nagg_method_params : dict or None, optional\n    The parameters to pass to the aggregation function.\n    See :func:`.get_aggfunc_by_name` for options (default None).\nmasks : list of dict or str, or None, optional\n    The specification of the masks to apply to regions before extracting\n    signals. Check :ref:`Using Masks <using_masks>` for more details.\n    If None, will not apply any mask (default None).\nname : str or None, optional\n    The name of the marker.\n    If None, it will use the class name (default None).",
   "type": "object",
   "properties": {
      "on": {
         "default": [
            "BOLD"
         ],
         "items": {
            "const": "BOLD",
            "type": "string"
         },
         "title": "On",
         "type": "array"
      },
      "name": {
         "anyOf": [
            {
               "type": "string"
            },
            {
               "type": "null"
            }
         ],
         "default": null,
         "title": "Name"
      },
      "using": {
         "$ref": "#/$defs/ReHoImpl"
      },
      "reho_params": {
         "anyOf": [
            {
               "additionalProperties": true,
               "type": "object"
            },
            {
               "type": "null"
            }
         ],
         "default": null,
         "title": "Reho Params"
      },
      "agg_method": {
         "default": "mean",
         "title": "Agg Method",
         "type": "string"
      },
      "agg_method_params": {
         "anyOf": [
            {
               "additionalProperties": true,
               "type": "object"
            },
            {
               "type": "null"
            }
         ],
         "default": null,
         "title": "Agg Method Params"
      },
      "masks": {
         "anyOf": [
            {
               "items": {
                  "anyOf": [
                     {
                        "additionalProperties": true,
                        "type": "object"
                     },
                     {
                        "type": "string"
                     }
                  ]
               },
               "type": "array"
            },
            {
               "type": "null"
            }
         ],
         "default": null,
         "title": "Masks"
      },
      "coords": {
         "title": "Coords",
         "type": "string"
      },
      "radius": {
         "anyOf": [
            {
               "const": 0,
               "type": "integer"
            },
            {
               "exclusiveMinimum": 0,
               "type": "number"
            },
            {
               "type": "null"
            }
         ],
         "default": null,
         "title": "Radius"
      },
      "allow_overlap": {
         "default": false,
         "title": "Allow Overlap",
         "type": "boolean"
      }
   },
   "$defs": {
      "ReHoImpl": {
         "description": "Accepted ReHo implementations.\n\n* ``junifer`` : ``junifer``'s ReHo\n* ``afni`` : AFNI's ``3dReHo``",
         "enum": [
            "junifer",
            "afni"
         ],
         "title": "ReHoImpl",
         "type": "string"
      }
   },
   "required": [
      "using",
      "coords"
   ]
}

Config:
  • use_enum_values: bool = True

Fields:
  • allow_overlap (bool)

  • coords (str)

  • on (list[Literal[junifer.datagrabber.base.DataType.BOLD]])

  • radius (Literal[0] | Annotated[float, annotated_types.Gt(gt=0)] | None)

field allow_overlap: bool = False
field coords: str [Required]
field on: list[Literal[DataType.BOLD]] = [<DataType.BOLD: 'BOLD'>]
field radius: Literal[0] | Annotated[float, Gt(gt=0)] | None = None
compute(input, extra_input=None)

Compute.

Parameters:
inputdict

The BOLD data as dictionary.

extra_inputdict, optional

The other fields in the pipeline data object (default None).

Returns:
dict

The computed result as dictionary. This will be either returned to the user or stored in the storage by calling the store method with this as a parameter. The dictionary has the following keys:

  • reho : dictionary with the following keys:

    • data : ROI values as numpy.ndarray

    • col_names : ROI labels as list of str

pydantic model junifer.markers.SphereAggregation

Class for sphere aggregation.

Parameters:
coordsstr

The name of the coordinates list to use. See list_data() for options.

radiuszero or positive float or None, optional

The radius of the sphere in millimeters. If None, the signal will be extracted from a single voxel. See JuniferNiftiSpheresMasker for more information (default None).

allow_overlapbool, optional

Whether to allow overlapping spheres. If False, an error is raised if the spheres overlap (default False).

methodstr, optional

The aggregation function to use. See get_aggfunc_by_name() for options (default “mean”).

method_paramsdict or None, optional

The parameters to pass to the aggregation function. See get_aggfunc_by_name() for options (default None).

time_methodstr or None, optional

The aggregation function to use for time series after applying method (only applicable to BOLD data). If None, it will not operate on the time dimension (default None).

time_method_paramsdict or None, optional

The parameters to pass to the time aggregation function (default None).

onlist of {DataType.T1w, DataType.T2w, DataType.BOLD, DataType.VBM_GM, DataType.VBM_WM, DataType.VBM_CSF, DataType.FALFF, DataType.GCOR, DataType.LCOR} or None,

optional The data type(s) to apply the marker on. If None, will work on all available data. Check DataType for valid values (default None).

maskslist of dict or str, or None, optional

The specification of the masks to apply to regions before extracting signals. Check Using Masks for more details. If None, will not apply any mask (default None).

namestr or None, optional

The name of the marker. If None, will use the class name (default None).

Raises:
ValueError

If time_method is specified for non-BOLD data or if time_method_params is not None when time_method is None.

Create a new model by parsing and validating input data from keyword arguments.

Raises [ValidationError][pydantic_core.ValidationError] if the input data cannot be validated to form a valid model.

self is explicitly positional-only to allow self as a field name.

Show JSON schema
{
   "title": "SphereAggregation",
   "description": "Class for sphere aggregation.\n\nParameters\n----------\ncoords : str\n    The name of the coordinates list to use.\n    See :func:`.list_data` for options.\nradius : ``zero`` or positive float or None, optional\n    The radius of the sphere in millimeters.\n    If None, the signal will be extracted from a single voxel.\n    See :class:`.JuniferNiftiSpheresMasker` for more information\n    (default None).\nallow_overlap : bool, optional\n    Whether to allow overlapping spheres.\n    If False, an error is raised if the spheres overlap (default False).\nmethod : str, optional\n    The aggregation function to use.\n    See :func:`.get_aggfunc_by_name` for options\n    (default \"mean\").\nmethod_params : dict or None, optional\n    The parameters to pass to the aggregation function.\n    See :func:`.get_aggfunc_by_name` for options (default None).\ntime_method : str or None, optional\n    The aggregation function to use for time series after applying\n    :term:`method` (only applicable to BOLD data). If None,\n    it will not operate on the time dimension (default None).\ntime_method_params : dict or None, optional\n    The parameters to pass to the time aggregation function (default None).\non : list of {``DataType.T1w``, ``DataType.T2w``, ``DataType.BOLD``,         ``DataType.VBM_GM``, ``DataType.VBM_WM``, ``DataType.VBM_CSF``,         ``DataType.FALFF``, ``DataType.GCOR``, ``DataType.LCOR``} or None,\n    optional\n    The data type(s) to apply the marker on.\n    If None, will work on all available data.\n    Check :enum:`.DataType` for valid values (default None).\nmasks : list of dict or str, or None, optional\n    The specification of the masks to apply to regions before extracting\n    signals. Check :ref:`Using Masks <using_masks>` for more details.\n    If None, will not apply any mask (default None).\nname : str or None, optional\n    The name of the marker.\n    If None, will use the class name (default None).\n\nRaises\n------\nValueError\n    If ``time_method`` is specified for non-BOLD data or if\n    ``time_method_params`` is not None when ``time_method`` is None.",
   "type": "object",
   "properties": {
      "on": {
         "anyOf": [
            {
               "items": {
                  "enum": [
                     "T1w",
                     "T2w",
                     "BOLD",
                     "VBM_GM",
                     "VBM_WM",
                     "VBM_CSF",
                     "fALFF",
                     "GCOR",
                     "LCOR"
                  ],
                  "type": "string"
               },
               "type": "array"
            },
            {
               "type": "null"
            }
         ],
         "default": null,
         "title": "On"
      },
      "name": {
         "anyOf": [
            {
               "type": "string"
            },
            {
               "type": "null"
            }
         ],
         "default": null,
         "title": "Name"
      },
      "coords": {
         "title": "Coords",
         "type": "string"
      },
      "radius": {
         "anyOf": [
            {
               "const": 0,
               "type": "integer"
            },
            {
               "exclusiveMinimum": 0,
               "type": "number"
            },
            {
               "type": "null"
            }
         ],
         "default": null,
         "title": "Radius"
      },
      "allow_overlap": {
         "default": false,
         "title": "Allow Overlap",
         "type": "boolean"
      },
      "method": {
         "default": "mean",
         "title": "Method",
         "type": "string"
      },
      "method_params": {
         "anyOf": [
            {
               "additionalProperties": true,
               "type": "object"
            },
            {
               "type": "null"
            }
         ],
         "default": null,
         "title": "Method Params"
      },
      "time_method": {
         "anyOf": [
            {
               "type": "string"
            },
            {
               "type": "null"
            }
         ],
         "default": null,
         "title": "Time Method"
      },
      "time_method_params": {
         "anyOf": [
            {
               "additionalProperties": true,
               "type": "object"
            },
            {
               "type": "null"
            }
         ],
         "default": null,
         "title": "Time Method Params"
      },
      "masks": {
         "anyOf": [
            {
               "items": {
                  "anyOf": [
                     {
                        "additionalProperties": true,
                        "type": "object"
                     },
                     {
                        "type": "string"
                     }
                  ]
               },
               "type": "array"
            },
            {
               "type": "null"
            }
         ],
         "default": null,
         "title": "Masks"
      }
   },
   "required": [
      "coords"
   ]
}

Config:
  • use_enum_values: bool = True

Fields:
  • allow_overlap (bool)

  • coords (str)

  • masks (list[dict | str] | None)

  • method (str)

  • method_params (dict[str, Any] | None)

  • on (list[Literal[junifer.datagrabber.base.DataType.T1w, junifer.datagrabber.base.DataType.T2w, junifer.datagrabber.base.DataType.BOLD, junifer.datagrabber.base.DataType.VBM_GM, junifer.datagrabber.base.DataType.VBM_WM, junifer.datagrabber.base.DataType.VBM_CSF, junifer.datagrabber.base.DataType.FALFF, junifer.datagrabber.base.DataType.GCOR, junifer.datagrabber.base.DataType.LCOR]] | None)

  • radius (Literal[0] | Annotated[float, annotated_types.Gt(gt=0)] | None)

  • time_method (str | None)

  • time_method_params (dict[str, Any] | None)

field allow_overlap: bool = False
field coords: str [Required]
field masks: list[dict | str] | None = None
field method: str = 'mean'
field method_params: dict[str, Any] | None = None
field on: list[Literal[DataType.T1w, DataType.T2w, DataType.BOLD, DataType.VBM_GM, DataType.VBM_WM, DataType.VBM_CSF, DataType.FALFF, DataType.GCOR, DataType.LCOR]] | None = None
field radius: Literal[0] | Annotated[float, Gt(gt=0)] | None = None
field time_method: str | None = None
field time_method_params: dict[str, Any] | None = None
compute(input, extra_input=None)

Compute.

Parameters:
inputdict

A single input from the pipeline data object in which to compute the marker.

extra_inputdict, optional

The other fields in the pipeline data object. Useful for accessing other data kind that needs to be used in the computation. For example, the functional connectivity markers can make use of the confounds if available (default None).

Returns:
dict

The computed result as dictionary. This will be either returned to the user or stored in the storage by calling the store method with this as a parameter. The dictionary has the following keys:

  • aggregation : dictionary with the following keys:

    • data : ROI values as numpy.ndarray

    • col_names : ROI labels as list of str

Warns:
RuntimeWarning

If time aggregation is required but only time point is available.

validate_marker_params()

Run extra logical validation for marker.

pydantic model junifer.markers.TemporalSNRMaps

Class for temporal signal-to-noise ratio using maps.

Parameters:
mapsstr

The name of the map(s) to use. See list_data() for options.

maskslist of dict or str, optional

The specification of the masks to apply to regions before extracting signals. Check Using Masks for more details. If None, will not apply any mask (default None).

namestr or None, optional

The name of the marker. If None, will use the class name (default None).

Create a new model by parsing and validating input data from keyword arguments.

Raises [ValidationError][pydantic_core.ValidationError] if the input data cannot be validated to form a valid model.

self is explicitly positional-only to allow self as a field name.

Show JSON schema
{
   "title": "TemporalSNRMaps",
   "description": "Class for temporal signal-to-noise ratio using maps.\n\nParameters\n----------\nmaps : str\n    The name of the map(s) to use.\n    See :func:`.list_data` for options.\nmasks : list of dict or str, optional\n    The specification of the masks to apply to regions before extracting\n    signals. Check :ref:`Using Masks <using_masks>` for more details.\n    If None, will not apply any mask (default None).\nname : str or None, optional\n    The name of the marker.\n    If None, will use the class name (default None).",
   "type": "object",
   "properties": {
      "on": {
         "default": [
            "BOLD"
         ],
         "items": {
            "const": "BOLD",
            "type": "string"
         },
         "title": "On",
         "type": "array"
      },
      "name": {
         "anyOf": [
            {
               "type": "string"
            },
            {
               "type": "null"
            }
         ],
         "default": null,
         "title": "Name"
      },
      "agg_method": {
         "default": "mean",
         "title": "Agg Method",
         "type": "string"
      },
      "agg_method_params": {
         "anyOf": [
            {
               "additionalProperties": true,
               "type": "object"
            },
            {
               "type": "null"
            }
         ],
         "default": null,
         "title": "Agg Method Params"
      },
      "masks": {
         "anyOf": [
            {
               "items": {
                  "anyOf": [
                     {
                        "additionalProperties": true,
                        "type": "object"
                     },
                     {
                        "type": "string"
                     }
                  ]
               },
               "type": "array"
            },
            {
               "type": "null"
            }
         ],
         "default": null,
         "title": "Masks"
      },
      "maps": {
         "title": "Maps",
         "type": "string"
      }
   },
   "required": [
      "maps"
   ]
}

Config:
  • use_enum_values: bool = True

Fields:
  • maps (str)

  • on (list[Literal[junifer.datagrabber.base.DataType.BOLD]])

field maps: str [Required]
field on: list[Literal[DataType.BOLD]] = [<DataType.BOLD: 'BOLD'>]
aggregate(input, extra_input=None)

Perform maps aggregation.

Parameters:
inputdict

A single input from the pipeline data object in which the data is the voxelwise temporal SNR map.

extra_inputdict, optional

The other fields in the pipeline data object. Useful for accessing other data kind that needs to be used in the computation. For example, the functional connectivity markers can make use of the confounds if available (default None).

Returns:
dict

The computed result as dictionary. This will be either returned to the user or stored in the storage by calling the store method with this as a parameter. The dictionary has the following keys:

  • aggregation : dictionary with the following keys:

    • data : ROI-wise tSNR values as numpy.ndarray

    • col_names : ROI labels as list of str

pydantic model junifer.markers.TemporalSNRParcels

Class for temporal signal-to-noise ratio using parcellations.

Parameters:
parcellationlist of str

The name(s) of the parcellation(s) to use. See list_data() for options.

agg_methodstr, optional

The aggregation function to use. See get_aggfunc_by_name() for options (default “mean”).

agg_method_paramsdict or None, optional

The parameters to pass to the aggregation function. See get_aggfunc_by_name() for options (default None).

maskslist of dict or str, or None, optional

The specification of the masks to apply to regions before extracting signals. Check Using Masks for more details. If None, will not apply any mask (default None).

namestr or None, optional

The name of the marker. If None, will use the class name (default None).

Create a new model by parsing and validating input data from keyword arguments.

Raises [ValidationError][pydantic_core.ValidationError] if the input data cannot be validated to form a valid model.

self is explicitly positional-only to allow self as a field name.

Show JSON schema
{
   "title": "TemporalSNRParcels",
   "description": "Class for temporal signal-to-noise ratio using parcellations.\n\nParameters\n----------\nparcellation : list of str\n    The name(s) of the parcellation(s) to use.\n    See :func:`.list_data` for options.\nagg_method : str, optional\n    The aggregation function to use.\n    See :func:`.get_aggfunc_by_name` for options\n    (default \"mean\").\nagg_method_params : dict or None, optional\n    The parameters to pass to the aggregation function.\n    See :func:`.get_aggfunc_by_name` for options (default None).\nmasks : list of dict or str, or None, optional\n    The specification of the masks to apply to regions before extracting\n    signals. Check :ref:`Using Masks <using_masks>` for more details.\n    If None, will not apply any mask (default None).\nname : str or None, optional\n    The name of the marker.\n    If None, will use the class name (default None).",
   "type": "object",
   "properties": {
      "on": {
         "default": [
            "BOLD"
         ],
         "items": {
            "const": "BOLD",
            "type": "string"
         },
         "title": "On",
         "type": "array"
      },
      "name": {
         "anyOf": [
            {
               "type": "string"
            },
            {
               "type": "null"
            }
         ],
         "default": null,
         "title": "Name"
      },
      "agg_method": {
         "default": "mean",
         "title": "Agg Method",
         "type": "string"
      },
      "agg_method_params": {
         "anyOf": [
            {
               "additionalProperties": true,
               "type": "object"
            },
            {
               "type": "null"
            }
         ],
         "default": null,
         "title": "Agg Method Params"
      },
      "masks": {
         "anyOf": [
            {
               "items": {
                  "anyOf": [
                     {
                        "additionalProperties": true,
                        "type": "object"
                     },
                     {
                        "type": "string"
                     }
                  ]
               },
               "type": "array"
            },
            {
               "type": "null"
            }
         ],
         "default": null,
         "title": "Masks"
      },
      "parcellation": {
         "items": {
            "type": "string"
         },
         "title": "Parcellation",
         "type": "array"
      }
   },
   "required": [
      "parcellation"
   ]
}

Config:
  • use_enum_values: bool = True

Fields:
  • on (list[Literal[junifer.datagrabber.base.DataType.BOLD]])

  • parcellation (list[str])

field on: list[Literal[DataType.BOLD]] = [<DataType.BOLD: 'BOLD'>]
field parcellation: list[str] [Required]
aggregate(input, extra_input=None)

Perform parcel aggregation.

Parameters:
inputdict

A single input from the pipeline data object in which the data is the voxelwise temporal SNR map.

extra_inputdict, optional

The other fields in the pipeline data object. Useful for accessing other data kind that needs to be used in the computation. For example, the functional connectivity markers can make use of the confounds if available (default None).

Returns:
dict

The computed result as dictionary. This will be either returned to the user or stored in the storage by calling the store method with this as a parameter. The dictionary has the following keys:

  • aggregation : dictionary with the following keys:

    • data : ROI-wise tSNR values as numpy.ndarray

    • col_names : ROI labels as list of str

pydantic model junifer.markers.TemporalSNRSpheres

Class for temporal signal-to-noise ratio using coordinates (spheres).

Parameters:
coordsstr

The name of the coordinates list to use. See list_data() for options.

radiuszero or positive float or None, optional

The radius of the sphere in millimeters. If None, the signal will be extracted from a single voxel. See JuniferNiftiSpheresMasker for more information (default None).

allow_overlapbool, optional

Whether to allow overlapping spheres. If False, an error is raised if the spheres overlap (default is False).

agg_methodstr, optional

The aggregation function to use. See get_aggfunc_by_name() for options (default “mean”).

agg_method_paramsdict or None, optional

The parameters to pass to the aggregation function. See get_aggfunc_by_name() for options (default None).

maskslist of dict or str, or None, optional

The specification of the masks to apply to regions before extracting signals. Check Using Masks for more details. If None, will not apply any mask (default None).

namestr or None, optional

The name of the marker. If None, will use the class name (default None).

Create a new model by parsing and validating input data from keyword arguments.

Raises [ValidationError][pydantic_core.ValidationError] if the input data cannot be validated to form a valid model.

self is explicitly positional-only to allow self as a field name.

Show JSON schema
{
   "title": "TemporalSNRSpheres",
   "description": "Class for temporal signal-to-noise ratio using coordinates (spheres).\n\nParameters\n----------\ncoords : str\n    The name of the coordinates list to use.\n    See :func:`.list_data` for options.\nradius : ``zero`` or positive float or None, optional\n    The radius of the sphere in millimeters.\n    If None, the signal will be extracted from a single voxel.\n    See :class:`.JuniferNiftiSpheresMasker` for more information\n    (default None).\nallow_overlap : bool, optional\n    Whether to allow overlapping spheres.\n    If False, an error is raised if the spheres overlap (default is False).\nagg_method : str, optional\n    The aggregation function to use.\n    See :func:`.get_aggfunc_by_name` for options\n    (default \"mean\").\nagg_method_params : dict or None, optional\n    The parameters to pass to the aggregation function.\n    See :func:`.get_aggfunc_by_name` for options (default None).\nmasks : list of dict or str, or None, optional\n    The specification of the masks to apply to regions before extracting\n    signals. Check :ref:`Using Masks <using_masks>` for more details.\n    If None, will not apply any mask (default None).\nname : str or None, optional\n    The name of the marker.\n    If None, will use the class name (default None).",
   "type": "object",
   "properties": {
      "on": {
         "default": [
            "BOLD"
         ],
         "items": {
            "const": "BOLD",
            "type": "string"
         },
         "title": "On",
         "type": "array"
      },
      "name": {
         "anyOf": [
            {
               "type": "string"
            },
            {
               "type": "null"
            }
         ],
         "default": null,
         "title": "Name"
      },
      "agg_method": {
         "default": "mean",
         "title": "Agg Method",
         "type": "string"
      },
      "agg_method_params": {
         "anyOf": [
            {
               "additionalProperties": true,
               "type": "object"
            },
            {
               "type": "null"
            }
         ],
         "default": null,
         "title": "Agg Method Params"
      },
      "masks": {
         "anyOf": [
            {
               "items": {
                  "anyOf": [
                     {
                        "additionalProperties": true,
                        "type": "object"
                     },
                     {
                        "type": "string"
                     }
                  ]
               },
               "type": "array"
            },
            {
               "type": "null"
            }
         ],
         "default": null,
         "title": "Masks"
      },
      "coords": {
         "title": "Coords",
         "type": "string"
      },
      "radius": {
         "anyOf": [
            {
               "const": 0,
               "type": "integer"
            },
            {
               "exclusiveMinimum": 0,
               "type": "number"
            },
            {
               "type": "null"
            }
         ],
         "default": null,
         "title": "Radius"
      },
      "allow_overlap": {
         "default": false,
         "title": "Allow Overlap",
         "type": "boolean"
      }
   },
   "required": [
      "coords"
   ]
}

Config:
  • use_enum_values: bool = True

Fields:
  • allow_overlap (bool)

  • coords (str)

  • on (list[Literal[junifer.datagrabber.base.DataType.BOLD]])

  • radius (Literal[0] | Annotated[float, annotated_types.Gt(gt=0)] | None)

field allow_overlap: bool = False
field coords: str [Required]
field on: list[Literal[DataType.BOLD]] = [<DataType.BOLD: 'BOLD'>]
field radius: Literal[0] | Annotated[float, Gt(gt=0)] | None = None
aggregate(input, extra_input=None)

Perform sphere aggregation.

Parameters:
inputdict

A single input from the pipeline data object in which the data is the voxelwise temporal SNR map.

extra_inputdict, optional

The other fields in the pipeline data object. Useful for accessing other data kind that needs to be used in the computation. For example, the functional connectivity markers can make use of the confounds if available (default None).

Returns:
dict

The computed result as dictionary. This will be either returned to the user or stored in the storage by calling the store method with this as a parameter. The dictionary has the following keys:

  • aggregation : dictionary with the following keys:

    • data : ROI-wise tSNR values as numpy.ndarray

    • col_names : ROI labels as list of str

Complexity

Provide imports for complexity sub-package.

pydantic model junifer.markers.complexity.HurstExponent

Class for Hurst exponent of a time series.

Parameters:
parcellationlist of str

The name(s) of the parcellation(s) to use. See list_data() for options.

agg_methodstr, optional

The aggregation function to use. See get_aggfunc_by_name() for options (default “mean”).

agg_method_paramsdict or None, optional

The parameters to pass to the aggregation function. See get_aggfunc_by_name() for options (default None).

maskslist of dict or str, or None, optional

The specification of the masks to apply to regions before extracting signals. Check Using Masks for more details. If None, will not apply any mask (default None).

paramsdict or None, optional

The parameters to pass to the Hurst exponent calculation function. See junifer.markers.utils._hurst_exponent for more information. If None, value is set to {"method": "dfa"} (default None).

namestr or None, optional

The name of the marker. If None, will use the class name (default None).

Warning

This class is not automatically imported by junifer and requires you to import it explicitly. You can do it programmatically by from junifer.markers.complexity import HurstExponent or in the YAML by with: junifer.markers.complexity.

Create a new model by parsing and validating input data from keyword arguments.

Raises [ValidationError][pydantic_core.ValidationError] if the input data cannot be validated to form a valid model.

self is explicitly positional-only to allow self as a field name.

Show JSON schema
{
   "title": "HurstExponent",
   "description": "Class for Hurst exponent of a time series.\n\nParameters\n----------\nparcellation : list of str\n    The name(s) of the parcellation(s) to use.\n    See :func:`.list_data` for options.\nagg_method : str, optional\n    The aggregation function to use.\n    See :func:`.get_aggfunc_by_name` for options\n    (default \"mean\").\nagg_method_params : dict or None, optional\n    The parameters to pass to the aggregation function.\n    See :func:`.get_aggfunc_by_name` for options (default None).\nmasks : list of dict or str, or None, optional\n    The specification of the masks to apply to regions before extracting\n    signals. Check :ref:`Using Masks <using_masks>` for more details.\n    If None, will not apply any mask (default None).\nparams : dict or None, optional\n    The parameters to pass to the Hurst exponent calculation function.\n    See ``junifer.markers.utils._hurst_exponent`` for more information.\n    If None, value is set to ``{\"method\": \"dfa\"}`` (default None).\nname : str or None, optional\n    The name of the marker.\n    If None, will use the class name (default None).\n\nWarnings\n--------\nThis class is not automatically imported by junifer and requires you to\nimport it explicitly. You can do it programmatically by\n``from junifer.markers.complexity import HurstExponent`` or in the YAML by\n``with: junifer.markers.complexity``.",
   "type": "object",
   "properties": {
      "on": {
         "default": [
            "BOLD"
         ],
         "items": {
            "const": "BOLD",
            "type": "string"
         },
         "title": "On",
         "type": "array"
      },
      "name": {
         "anyOf": [
            {
               "type": "string"
            },
            {
               "type": "null"
            }
         ],
         "default": null,
         "title": "Name"
      },
      "parcellation": {
         "items": {
            "type": "string"
         },
         "title": "Parcellation",
         "type": "array"
      },
      "agg_method": {
         "default": "mean",
         "title": "Agg Method",
         "type": "string"
      },
      "agg_method_params": {
         "anyOf": [
            {
               "additionalProperties": true,
               "type": "object"
            },
            {
               "type": "null"
            }
         ],
         "default": null,
         "title": "Agg Method Params"
      },
      "masks": {
         "anyOf": [
            {
               "items": {
                  "anyOf": [
                     {
                        "additionalProperties": true,
                        "type": "object"
                     },
                     {
                        "type": "string"
                     }
                  ]
               },
               "type": "array"
            },
            {
               "type": "null"
            }
         ],
         "default": null,
         "title": "Masks"
      },
      "params": {
         "anyOf": [
            {
               "additionalProperties": true,
               "type": "object"
            },
            {
               "type": "null"
            }
         ],
         "default": null,
         "title": "Params"
      }
   },
   "required": [
      "parcellation"
   ]
}

Config:
  • use_enum_values: bool = True

Fields:
  • on (list[Literal[junifer.datagrabber.base.DataType.BOLD]])

  • params (dict | None)

field on: list[Literal[DataType.BOLD]] = [<DataType.BOLD: 'BOLD'>]
field params: dict | None = None
compute_complexity(extracted_bold_values)

Compute complexity measure.

Take a timeseries of brain areas, and calculate Hurst exponent using the detrended fluctuation analysis method assuming the data is monofractal [1].

Parameters:
extracted_bold_valuesnumpy.ndarray

The BOLD values extracted via parcel aggregation.

Returns:
numpy.ndarray

The values after computing complexity measure.

See also

neurokit2.fractal_dfa

References

[1]

Peng, C.; Havlin, S.; Stanley, H.E.; Goldberger, A.L. Quantification of scaling exponents and crossover phenomena in nonstationary heartbeat time series. Chaos Interdiscip. J. Nonlinear Sci., 5, 82-87, 1995.

validate_marker_params()

Run extra logical validation for marker.

pydantic model junifer.markers.complexity.MultiscaleEntropyAUC

Class for AUC of multiscale entropy of a time series.

Parameters:
parcellationlist of str

The name(s) of the parcellation(s) to use. See list_data() for options.

agg_methodstr, optional

The aggregation function to use. See get_aggfunc_by_name() for options (default “mean”).

agg_method_paramsdict or None, optional

The parameters to pass to the aggregation function. See get_aggfunc_by_name() for options (default None).

maskslist of dict or str, or None, optional

The specification of the masks to apply to regions before extracting signals. Check Using Masks for more details. If None, will not apply any mask (default None).

paramsdict or None, optional

The parameters to pass to the AUC of multiscale entropy calculation function. See junifer.markers.utils._multiscale_entropy_auc for more information. If None, value is set to {"m": 2, "tol": 0.5, "scale": 10} (default None).

namestr or None, optional

The name of the marker. If None, will use the class name (default None).

Warning

This class is not automatically imported by junifer and requires you to import it explicitly. You can do it programmatically by from junifer.markers.complexity import MultiscaleEntropyAUC or in the YAML by with: junifer.markers.complexity.

Create a new model by parsing and validating input data from keyword arguments.

Raises [ValidationError][pydantic_core.ValidationError] if the input data cannot be validated to form a valid model.

self is explicitly positional-only to allow self as a field name.

Show JSON schema
{
   "title": "MultiscaleEntropyAUC",
   "description": "Class for AUC of multiscale entropy of a time series.\n\nParameters\n----------\nparcellation : list of str\n    The name(s) of the parcellation(s) to use.\n    See :func:`.list_data` for options.\nagg_method : str, optional\n    The aggregation function to use.\n    See :func:`.get_aggfunc_by_name` for options\n    (default \"mean\").\nagg_method_params : dict or None, optional\n    The parameters to pass to the aggregation function.\n    See :func:`.get_aggfunc_by_name` for options (default None).\nmasks : list of dict or str, or None, optional\n    The specification of the masks to apply to regions before extracting\n    signals. Check :ref:`Using Masks <using_masks>` for more details.\n    If None, will not apply any mask (default None).\nparams : dict or None, optional\n    The parameters to pass to the AUC of multiscale entropy calculation\n    function. See\n    ``junifer.markers.utils._multiscale_entropy_auc`` for more information.\n    If None, value is set to ``{\"m\": 2, \"tol\": 0.5, \"scale\": 10}``\n    (default None).\nname : str or None, optional\n    The name of the marker.\n    If None, will use the class name (default None).\n\nWarnings\n--------\nThis class is not automatically imported by junifer and requires you to\nimport it explicitly. You can do it programmatically by\n``from junifer.markers.complexity import MultiscaleEntropyAUC`` or in the\nYAML by ``with: junifer.markers.complexity``.",
   "type": "object",
   "properties": {
      "on": {
         "default": [
            "BOLD"
         ],
         "items": {
            "const": "BOLD",
            "type": "string"
         },
         "title": "On",
         "type": "array"
      },
      "name": {
         "anyOf": [
            {
               "type": "string"
            },
            {
               "type": "null"
            }
         ],
         "default": null,
         "title": "Name"
      },
      "parcellation": {
         "items": {
            "type": "string"
         },
         "title": "Parcellation",
         "type": "array"
      },
      "agg_method": {
         "default": "mean",
         "title": "Agg Method",
         "type": "string"
      },
      "agg_method_params": {
         "anyOf": [
            {
               "additionalProperties": true,
               "type": "object"
            },
            {
               "type": "null"
            }
         ],
         "default": null,
         "title": "Agg Method Params"
      },
      "masks": {
         "anyOf": [
            {
               "items": {
                  "anyOf": [
                     {
                        "additionalProperties": true,
                        "type": "object"
                     },
                     {
                        "type": "string"
                     }
                  ]
               },
               "type": "array"
            },
            {
               "type": "null"
            }
         ],
         "default": null,
         "title": "Masks"
      },
      "params": {
         "anyOf": [
            {
               "additionalProperties": true,
               "type": "object"
            },
            {
               "type": "null"
            }
         ],
         "default": null,
         "title": "Params"
      }
   },
   "required": [
      "parcellation"
   ]
}

Config:
  • use_enum_values: bool = True

Fields:
  • on (list[Literal[junifer.datagrabber.base.DataType.BOLD]])

  • params (dict | None)

field on: list[Literal[DataType.BOLD]] = [<DataType.BOLD: 'BOLD'>]
field params: dict | None = None
compute_complexity(extracted_bold_values)

Compute complexity measure.

Take a timeseries of brain areas, calculate multiscale entropy for each region and calculate the AUC of the entropy curves leading to a region-wise map of the brain [1].

Parameters:
extracted_bold_valuesnumpy.ndarray

The BOLD values extracted via parcel aggregation.

Returns:
numpy.ndarray

The values after computing complexity measure.

See also

neurokit2.entropy_multiscale

References

[1]

Costa, M., Goldberger, A. L., & Peng, C. K. Multiscale entropy analysis of complex physiologic time series. Physical review letters, 89(6), 068102, 2002.

validate_marker_params()

Run extra logical validation for marker.

pydantic model junifer.markers.complexity.PermEntropy

Class for permutation entropy of a time series.

Parameters:
parcellationlist of str

The name(s) of the parcellation(s) to use. See list_data() for options.

agg_methodstr, optional

The aggregation function to use. See get_aggfunc_by_name() for options (default “mean”).

agg_method_paramsdict or None, optional

The parameters to pass to the aggregation function. See get_aggfunc_by_name() for options (default None).

maskslist of dict or str, or None, optional

The specification of the masks to apply to regions before extracting signals. Check Using Masks for more details. If None, will not apply any mask (default None).

paramsdict or None, optional

The parameters to pass to the permutation entropy calculation function. See junifer.markers.utils._perm_entropy for more information. If None, value is set to {"m": 2, "delay": 1} (default None).

namestr or None, optional

The name of the marker. If None, will use the class name (default None).

Warning

This class is not automatically imported by junifer and requires you to import it explicitly. You can do it programmatically by from junifer.markers.complexity import PermEntropy or in the YAML by with: junifer.markers.complexity.

Create a new model by parsing and validating input data from keyword arguments.

Raises [ValidationError][pydantic_core.ValidationError] if the input data cannot be validated to form a valid model.

self is explicitly positional-only to allow self as a field name.

Show JSON schema
{
   "title": "PermEntropy",
   "description": "Class for permutation entropy of a time series.\n\nParameters\n----------\nparcellation : list of str\n    The name(s) of the parcellation(s) to use.\n    See :func:`.list_data` for options.\nagg_method : str, optional\n    The aggregation function to use.\n    See :func:`.get_aggfunc_by_name` for options\n    (default \"mean\").\nagg_method_params : dict or None, optional\n    The parameters to pass to the aggregation function.\n    See :func:`.get_aggfunc_by_name` for options (default None).\nmasks : list of dict or str, or None, optional\n    The specification of the masks to apply to regions before extracting\n    signals. Check :ref:`Using Masks <using_masks>` for more details.\n    If None, will not apply any mask (default None).\nparams : dict or None, optional\n    The parameters to pass to the permutation entropy calculation function.\n    See ``junifer.markers.utils._perm_entropy`` for more information.\n    If None, value is set to ``{\"m\": 2, \"delay\": 1}`` (default None).\nname : str or None, optional\n    The name of the marker.\n    If None, will use the class name (default None).\n\nWarnings\n--------\nThis class is not automatically imported by junifer and requires you to\nimport it explicitly. You can do it programmatically by\n``from junifer.markers.complexity import PermEntropy`` or in the YAML by\n``with: junifer.markers.complexity``.",
   "type": "object",
   "properties": {
      "on": {
         "default": [
            "BOLD"
         ],
         "items": {
            "const": "BOLD",
            "type": "string"
         },
         "title": "On",
         "type": "array"
      },
      "name": {
         "anyOf": [
            {
               "type": "string"
            },
            {
               "type": "null"
            }
         ],
         "default": null,
         "title": "Name"
      },
      "parcellation": {
         "items": {
            "type": "string"
         },
         "title": "Parcellation",
         "type": "array"
      },
      "agg_method": {
         "default": "mean",
         "title": "Agg Method",
         "type": "string"
      },
      "agg_method_params": {
         "anyOf": [
            {
               "additionalProperties": true,
               "type": "object"
            },
            {
               "type": "null"
            }
         ],
         "default": null,
         "title": "Agg Method Params"
      },
      "masks": {
         "anyOf": [
            {
               "items": {
                  "anyOf": [
                     {
                        "additionalProperties": true,
                        "type": "object"
                     },
                     {
                        "type": "string"
                     }
                  ]
               },
               "type": "array"
            },
            {
               "type": "null"
            }
         ],
         "default": null,
         "title": "Masks"
      },
      "params": {
         "anyOf": [
            {
               "additionalProperties": true,
               "type": "object"
            },
            {
               "type": "null"
            }
         ],
         "default": null,
         "title": "Params"
      }
   },
   "required": [
      "parcellation"
   ]
}

Config:
  • use_enum_values: bool = True

Fields:
  • on (list[Literal[junifer.datagrabber.base.DataType.BOLD]])

  • params (dict | None)

field on: list[Literal[DataType.BOLD]] = [<DataType.BOLD: 'BOLD'>]
field params: dict | None = None
compute_complexity(extracted_bold_values)

Compute complexity measure.

Take a timeseries of brain areas, and calculate permutation entropy according to the method outlined in [1].

Parameters:
extracted_bold_valuesnumpy.ndarray

The BOLD values extracted via parcel aggregation.

Returns:
numpy.ndarray

The values after computing complexity measure.

See also

neurokit2.entropy_permutation

References

[1]

Bandt, C., & Pompe, B. (2002) Permutation entropy: a natural complexity measure for time series. Physical review letters, 88(17), 174102.

validate_marker_params()

Run extra logical validation for marker.

pydantic model junifer.markers.complexity.RangeEntropy

Class for range entropy of a time series.

Parameters:
parcellationlist of str

The name(s) of the parcellation(s) to use. See list_data() for options.

agg_methodstr, optional

The aggregation function to use. See get_aggfunc_by_name() for options (default “mean”).

agg_method_paramsdict or None, optional

The parameters to pass to the aggregation function. See get_aggfunc_by_name() for options (default None).

maskslist of dict or str, or None, optional

The specification of the masks to apply to regions before extracting signals. Check Using Masks for more details. If None, will not apply any mask (default None).

paramsdict or None, optional

The parameters to pass to the range entropy calculation function. See junifer.markers.utils._range_entropy for more information. If None, value is set to {"m": 2, "tol": 0.5, "delay": 1} (default None).

namestr or None, optional

The name of the marker. If None, will use the class name (default None).

Warning

This class is not automatically imported by junifer and requires you to import it explicitly. You can do it programmatically by from junifer.markers.complexity import RangeEntropy or in the YAML by with: junifer.markers.complexity.

Create a new model by parsing and validating input data from keyword arguments.

Raises [ValidationError][pydantic_core.ValidationError] if the input data cannot be validated to form a valid model.

self is explicitly positional-only to allow self as a field name.

Show JSON schema
{
   "title": "RangeEntropy",
   "description": "Class for range entropy of a time series.\n\nParameters\n----------\nparcellation : list of str\n    The name(s) of the parcellation(s) to use.\n    See :func:`.list_data` for options.\nagg_method : str, optional\n    The aggregation function to use.\n    See :func:`.get_aggfunc_by_name` for options\n    (default \"mean\").\nagg_method_params : dict or None, optional\n    The parameters to pass to the aggregation function.\n    See :func:`.get_aggfunc_by_name` for options (default None).\nmasks : list of dict or str, or None, optional\n    The specification of the masks to apply to regions before extracting\n    signals. Check :ref:`Using Masks <using_masks>` for more details.\n    If None, will not apply any mask (default None).\nparams : dict or None, optional\n    The parameters to pass to the range entropy calculation function.\n    See ``junifer.markers.utils._range_entropy`` for more information.\n    If None, value is set to ``{\"m\": 2, \"tol\": 0.5, \"delay\": 1}``\n    (default None).\nname : str or None, optional\n    The name of the marker.\n    If None, will use the class name (default None).\n\nWarnings\n--------\nThis class is not automatically imported by junifer and requires you to\nimport it explicitly. You can do it programmatically by\n``from junifer.markers.complexity import RangeEntropy`` or in the YAML by\n``with: junifer.markers.complexity``.",
   "type": "object",
   "properties": {
      "on": {
         "default": [
            "BOLD"
         ],
         "items": {
            "const": "BOLD",
            "type": "string"
         },
         "title": "On",
         "type": "array"
      },
      "name": {
         "anyOf": [
            {
               "type": "string"
            },
            {
               "type": "null"
            }
         ],
         "default": null,
         "title": "Name"
      },
      "parcellation": {
         "items": {
            "type": "string"
         },
         "title": "Parcellation",
         "type": "array"
      },
      "agg_method": {
         "default": "mean",
         "title": "Agg Method",
         "type": "string"
      },
      "agg_method_params": {
         "anyOf": [
            {
               "additionalProperties": true,
               "type": "object"
            },
            {
               "type": "null"
            }
         ],
         "default": null,
         "title": "Agg Method Params"
      },
      "masks": {
         "anyOf": [
            {
               "items": {
                  "anyOf": [
                     {
                        "additionalProperties": true,
                        "type": "object"
                     },
                     {
                        "type": "string"
                     }
                  ]
               },
               "type": "array"
            },
            {
               "type": "null"
            }
         ],
         "default": null,
         "title": "Masks"
      },
      "params": {
         "anyOf": [
            {
               "additionalProperties": true,
               "type": "object"
            },
            {
               "type": "null"
            }
         ],
         "default": null,
         "title": "Params"
      }
   },
   "required": [
      "parcellation"
   ]
}

Config:
  • use_enum_values: bool = True

Fields:
  • on (list[Literal[junifer.datagrabber.base.DataType.BOLD]])

  • params (dict | None)

field on: list[Literal[DataType.BOLD]] = [<DataType.BOLD: 'BOLD'>]
field params: dict | None = None
compute_complexity(extracted_bold_values)

Compute complexity measure.

Take a timeseries of brain areas, and calculate range entropy according to the method outlined in [1].

Parameters:
extracted_bold_valuesnumpy.ndarray

The BOLD values extracted via parcel aggregation.

Returns:
numpy.ndarray

The values after computing complexity measure.

See also

neurokit2.entropy_range

References

[1]

A. Omidvarnia et al. (2018) Range Entropy: A Bridge between Signal Complexity and Self-Similarity. Entropy, vol. 20, no. 12, p. 962, 2018.

validate_marker_params()

Run extra logical validation for marker.

pydantic model junifer.markers.complexity.RangeEntropyAUC

Class for AUC of range entropy values of a time series over r = 0 to 1.

Parameters:
parcellationlist of str

The name(s) of the parcellation(s) to use. See list_data() for options.

agg_methodstr, optional

The aggregation function to use. See get_aggfunc_by_name() for options (default “mean”).

agg_method_paramsdict or None, optional

The parameters to pass to the aggregation function. See get_aggfunc_by_name() for options (default None).

maskslist of dict or str, or None, optional

The specification of the masks to apply to regions before extracting signals. Check Using Masks for more details. If None, will not apply any mask (default None).

paramsdict or None, optional

The parameters to pass to the range entropy calculation function. See junifer.markers.utils._range_entropy for more information. If None, value is set to {"m": 2, "delay": 1, "n_r": 10} (default None).

namestr or None, optional

The name of the marker. If None, will use the class name (default None).

Warning

This class is not automatically imported by junifer and requires you to import it explicitly. You can do it programmatically by from junifer.markers.complexity import RangeEntropyAUC or in the YAML by with: junifer.markers.complexity.

Create a new model by parsing and validating input data from keyword arguments.

Raises [ValidationError][pydantic_core.ValidationError] if the input data cannot be validated to form a valid model.

self is explicitly positional-only to allow self as a field name.

Show JSON schema
{
   "title": "RangeEntropyAUC",
   "description": "Class for AUC of range entropy values of a time series over r = 0 to 1.\n\nParameters\n----------\nparcellation : list of str\n    The name(s) of the parcellation(s) to use.\n    See :func:`.list_data` for options.\nagg_method : str, optional\n    The aggregation function to use.\n    See :func:`.get_aggfunc_by_name` for options\n    (default \"mean\").\nagg_method_params : dict or None, optional\n    The parameters to pass to the aggregation function.\n    See :func:`.get_aggfunc_by_name` for options (default None).\nmasks : list of dict or str, or None, optional\n    The specification of the masks to apply to regions before extracting\n    signals. Check :ref:`Using Masks <using_masks>` for more details.\n    If None, will not apply any mask (default None).\nparams : dict or None, optional\n    The parameters to pass to the range entropy calculation function.\n    See ``junifer.markers.utils._range_entropy`` for more information.\n    If None, value is set to ``{\"m\": 2, \"delay\": 1, \"n_r\": 10}``\n    (default None).\nname : str or None, optional\n    The name of the marker.\n    If None, will use the class name (default None).\n\nWarnings\n--------\nThis class is not automatically imported by junifer and requires you to\nimport it explicitly. You can do it programmatically by\n``from junifer.markers.complexity import RangeEntropyAUC`` or in the YAML\nby ``with: junifer.markers.complexity``.",
   "type": "object",
   "properties": {
      "on": {
         "default": [
            "BOLD"
         ],
         "items": {
            "const": "BOLD",
            "type": "string"
         },
         "title": "On",
         "type": "array"
      },
      "name": {
         "anyOf": [
            {
               "type": "string"
            },
            {
               "type": "null"
            }
         ],
         "default": null,
         "title": "Name"
      },
      "parcellation": {
         "items": {
            "type": "string"
         },
         "title": "Parcellation",
         "type": "array"
      },
      "agg_method": {
         "default": "mean",
         "title": "Agg Method",
         "type": "string"
      },
      "agg_method_params": {
         "anyOf": [
            {
               "additionalProperties": true,
               "type": "object"
            },
            {
               "type": "null"
            }
         ],
         "default": null,
         "title": "Agg Method Params"
      },
      "masks": {
         "anyOf": [
            {
               "items": {
                  "anyOf": [
                     {
                        "additionalProperties": true,
                        "type": "object"
                     },
                     {
                        "type": "string"
                     }
                  ]
               },
               "type": "array"
            },
            {
               "type": "null"
            }
         ],
         "default": null,
         "title": "Masks"
      },
      "params": {
         "anyOf": [
            {
               "additionalProperties": true,
               "type": "object"
            },
            {
               "type": "null"
            }
         ],
         "default": null,
         "title": "Params"
      }
   },
   "required": [
      "parcellation"
   ]
}

Config:
  • use_enum_values: bool = True

Fields:
  • on (list[Literal[junifer.datagrabber.base.DataType.BOLD]])

  • params (dict | None)

field on: list[Literal[DataType.BOLD]] = [<DataType.BOLD: 'BOLD'>]
field params: dict | None = None
compute_complexity(extracted_bold_values)

Compute complexity measure.

Take a timeseries of brain areas, calculate range entropy according to the method outlined in [1] across the range of tolerance value r from 0 to 1, and compute its area under the curve.

Parameters:
extracted_bold_valuesnumpy.ndarray

The BOLD values extracted via parcel aggregation.

Returns:
numpy.ndarray

The values after computing complexity measure.

See also

neurokit2.entropy_range

References

[1]

A. Omidvarnia et al. (2018) Range Entropy: A Bridge between Signal Complexity and Self-Similarity. Entropy, vol. 20, no. 12, p. 962, 2018.

validate_marker_params()

Run extra logical validation for marker.

pydantic model junifer.markers.complexity.SampleEntropy

Class for sample entropy of a time series.

Parameters:
parcellationlist of str

The name(s) of the parcellation(s) to use. See list_data() for options.

agg_methodstr, optional

The aggregation function to use. See get_aggfunc_by_name() for options (default “mean”).

agg_method_paramsdict or None, optional

The parameters to pass to the aggregation function. See get_aggfunc_by_name() for options (default None).

maskslist of dict or str, or None, optional

The specification of the masks to apply to regions before extracting signals. Check Using Masks for more details. If None, will not apply any mask (default None).

paramsdict or None, optional

The parameters to pass to the sample entropy calculation function. See junifer.markers.utils._sample_entropy for more information. If None, value is set to {"m": 2, "delay": 1, "tol": 0.5} (default None).

namestr or None, optional

The name of the marker. If None, will use the class name (default None).

Warning

This class is not automatically imported by junifer and requires you to import it explicitly. You can do it programmatically by from junifer.markers.complexity import SampleEntropy or in the YAML by with: junifer.markers.complexity.

Create a new model by parsing and validating input data from keyword arguments.

Raises [ValidationError][pydantic_core.ValidationError] if the input data cannot be validated to form a valid model.

self is explicitly positional-only to allow self as a field name.

Show JSON schema
{
   "title": "SampleEntropy",
   "description": "Class for sample entropy of a time series.\n\nParameters\n----------\nparcellation : list of str\n    The name(s) of the parcellation(s) to use.\n    See :func:`.list_data` for options.\nagg_method : str, optional\n    The aggregation function to use.\n    See :func:`.get_aggfunc_by_name` for options\n    (default \"mean\").\nagg_method_params : dict or None, optional\n    The parameters to pass to the aggregation function.\n    See :func:`.get_aggfunc_by_name` for options (default None).\nmasks : list of dict or str, or None, optional\n    The specification of the masks to apply to regions before extracting\n    signals. Check :ref:`Using Masks <using_masks>` for more details.\n    If None, will not apply any mask (default None).\nparams : dict or None, optional\n    The parameters to pass to the sample entropy calculation function.\n    See ``junifer.markers.utils._sample_entropy`` for more information.\n    If None, value is set to ``{\"m\": 2, \"delay\": 1, \"tol\": 0.5}``\n    (default None).\nname : str or None, optional\n    The name of the marker.\n    If None, will use the class name (default None).\n\nWarnings\n--------\nThis class is not automatically imported by junifer and requires you to\nimport it explicitly. You can do it programmatically by\n``from junifer.markers.complexity import SampleEntropy`` or in the YAML by\n``with: junifer.markers.complexity``.",
   "type": "object",
   "properties": {
      "on": {
         "default": [
            "BOLD"
         ],
         "items": {
            "const": "BOLD",
            "type": "string"
         },
         "title": "On",
         "type": "array"
      },
      "name": {
         "anyOf": [
            {
               "type": "string"
            },
            {
               "type": "null"
            }
         ],
         "default": null,
         "title": "Name"
      },
      "parcellation": {
         "items": {
            "type": "string"
         },
         "title": "Parcellation",
         "type": "array"
      },
      "agg_method": {
         "default": "mean",
         "title": "Agg Method",
         "type": "string"
      },
      "agg_method_params": {
         "anyOf": [
            {
               "additionalProperties": true,
               "type": "object"
            },
            {
               "type": "null"
            }
         ],
         "default": null,
         "title": "Agg Method Params"
      },
      "masks": {
         "anyOf": [
            {
               "items": {
                  "anyOf": [
                     {
                        "additionalProperties": true,
                        "type": "object"
                     },
                     {
                        "type": "string"
                     }
                  ]
               },
               "type": "array"
            },
            {
               "type": "null"
            }
         ],
         "default": null,
         "title": "Masks"
      },
      "params": {
         "anyOf": [
            {
               "additionalProperties": true,
               "type": "object"
            },
            {
               "type": "null"
            }
         ],
         "default": null,
         "title": "Params"
      }
   },
   "required": [
      "parcellation"
   ]
}

Config:
  • use_enum_values: bool = True

Fields:
  • on (list[Literal[junifer.datagrabber.base.DataType.BOLD]])

  • params (dict | None)

field on: list[Literal[DataType.BOLD]] = [<DataType.BOLD: 'BOLD'>]
field params: dict | None = None
compute_complexity(extracted_bold_values)

Compute complexity measure.

Take a timeseries of brain areas, and calculate sample entropy [1].

Parameters:
extracted_bold_valuesnumpy.ndarray

The BOLD values extracted via parcel aggregation.

Returns:
numpy.ndarray

The values after computing complexity measure.

See also

neurokit2.entropy_sample

References

[1]

Richman, J., Moorman, J. Physiological time-series analysis using approximate entropy and sample entropy. Am. J. Physiol. Heart Circ. Physiol., 278 (6) (2000), pp. H2039-2049

validate_marker_params()

Run extra logical validation for marker.

pydantic model junifer.markers.complexity.WeightedPermEntropy

Class for weighted permutation entropy of a time series.

Parameters:
parcellationlist of str

The name(s) of the parcellation(s) to use. See list_data() for options.

agg_methodstr, optional

The aggregation function to use. See get_aggfunc_by_name() for options (default “mean”).

agg_method_paramsdict or None, optional

The parameters to pass to the aggregation function. See get_aggfunc_by_name() for options (default None).

maskslist of dict or str, or None, optional

The specification of the masks to apply to regions before extracting signals. Check Using Masks for more details. If None, will not apply any mask (default None).

paramsdict or None, optional

The parameters to pass to the weighted permutation entropy calculation function. See junifer.markers.utils._weighted_perm_entropy for more information. If None, value is set to {"m": 2, "delay": 1} (default None).

namestr or None, optional

The name of the marker. If None, will use the class name (default None).

Warning

This class is not automatically imported by junifer and requires you to import it explicitly. You can do it programmatically by from junifer.markers.complexity import WeightedPermEntropy or in the YAML by with: junifer.markers.complexity.

Create a new model by parsing and validating input data from keyword arguments.

Raises [ValidationError][pydantic_core.ValidationError] if the input data cannot be validated to form a valid model.

self is explicitly positional-only to allow self as a field name.

Show JSON schema
{
   "title": "WeightedPermEntropy",
   "description": "Class for weighted permutation entropy of a time series.\n\nParameters\n----------\nparcellation : list of str\n    The name(s) of the parcellation(s) to use.\n    See :func:`.list_data` for options.\nagg_method : str, optional\n    The aggregation function to use.\n    See :func:`.get_aggfunc_by_name` for options\n    (default \"mean\").\nagg_method_params : dict or None, optional\n    The parameters to pass to the aggregation function.\n    See :func:`.get_aggfunc_by_name` for options (default None).\nmasks : list of dict or str, or None, optional\n    The specification of the masks to apply to regions before extracting\n    signals. Check :ref:`Using Masks <using_masks>` for more details.\n    If None, will not apply any mask (default None).\nparams : dict or None, optional\n    The parameters to pass to the weighted permutation entropy calculation\n    function. See ``junifer.markers.utils._weighted_perm_entropy`` for more\n    information. If None, value is set to ``{\"m\": 2, \"delay\": 1}``\n    (default None).\nname : str or None, optional\n    The name of the marker.\n    If None, will use the class name (default None).\n\nWarnings\n--------\nThis class is not automatically imported by junifer and requires you to\nimport it explicitly. You can do it programmatically by\n``from junifer.markers.complexity import WeightedPermEntropy`` or in the\nYAML by ``with: junifer.markers.complexity``.",
   "type": "object",
   "properties": {
      "on": {
         "default": [
            "BOLD"
         ],
         "items": {
            "const": "BOLD",
            "type": "string"
         },
         "title": "On",
         "type": "array"
      },
      "name": {
         "anyOf": [
            {
               "type": "string"
            },
            {
               "type": "null"
            }
         ],
         "default": null,
         "title": "Name"
      },
      "parcellation": {
         "items": {
            "type": "string"
         },
         "title": "Parcellation",
         "type": "array"
      },
      "agg_method": {
         "default": "mean",
         "title": "Agg Method",
         "type": "string"
      },
      "agg_method_params": {
         "anyOf": [
            {
               "additionalProperties": true,
               "type": "object"
            },
            {
               "type": "null"
            }
         ],
         "default": null,
         "title": "Agg Method Params"
      },
      "masks": {
         "anyOf": [
            {
               "items": {
                  "anyOf": [
                     {
                        "additionalProperties": true,
                        "type": "object"
                     },
                     {
                        "type": "string"
                     }
                  ]
               },
               "type": "array"
            },
            {
               "type": "null"
            }
         ],
         "default": null,
         "title": "Masks"
      },
      "params": {
         "anyOf": [
            {
               "additionalProperties": true,
               "type": "object"
            },
            {
               "type": "null"
            }
         ],
         "default": null,
         "title": "Params"
      }
   },
   "required": [
      "parcellation"
   ]
}

Config:
  • use_enum_values: bool = True

Fields:
  • on (list[Literal[junifer.datagrabber.base.DataType.BOLD]])

  • params (dict | None)

field on: list[Literal[DataType.BOLD]] = [<DataType.BOLD: 'BOLD'>]
field params: dict | None = None
compute_complexity(extracted_bold_values)

Compute complexity measure.

Take a timeseries of brain areas, and calculate weighted permutation entropy according to the method outlined in [1].

Parameters:
extracted_bold_valuesnumpy.ndarray

The BOLD values extracted via parcel aggregation.

Returns:
numpy.ndarray

The values after computing complexity measure.

See also

neurokit2.entropy_permutation

References

[1]

Fadlallah, B., Chen, B., Keil, A., & Principe, J. (2013) Weighted-permutation entropy: A complexity measure for time series incorporating amplitude information. Physical Review E, 87(2), 022911.

validate_marker_params()

Run extra logical validation for marker.