.. DO NOT EDIT. .. THIS FILE WAS AUTOMATICALLY GENERATED BY SPHINX-GALLERY. .. TO MAKE CHANGES, EDIT THE SOURCE PYTHON FILE: .. "auto_examples/run_ets_rss_marker.py" .. LINE NUMBERS ARE GIVEN BELOW. .. only:: html .. note:: :class: sphx-glr-download-link-note :ref:`Go to the end ` to download the full example code. .. rst-class:: sphx-glr-example-title .. _sphx_glr_auto_examples_run_ets_rss_marker.py: Extracting root sum of squares from edge-wise timeseries. ========================================================= This example uses a ``RSSETSMarker`` to compute root sum of squares of the edge-wise timeseries using the Schaefer parcellation (100 rois and 200 rois, 17 Yeo networks) for a 4D nifti BOLD file. Authors: Leonard Sasse, Sami Hamdan, Nicolas Nieto, Synchon Mandal License: BSD 3 clause .. GENERATED FROM PYTHON SOURCE LINES 14-23 .. code-block:: Python import tempfile import junifer.testing.registry # noqa: F401 from junifer.api import collect, run from junifer.storage import HDF5FeatureStorage from junifer.utils import configure_logging .. GENERATED FROM PYTHON SOURCE LINES 24-25 Set the logging level to info to see extra information: .. GENERATED FROM PYTHON SOURCE LINES 25-27 .. code-block:: Python configure_logging(level="INFO") .. rst-class:: sphx-glr-script-out .. code-block:: none 2026-10-19 21:14:31 [info ] ===== Lib Versions ===== [junifer] pkg=utils 2026-10-19 21:14:31 [info ] click: 8.5.0 [junifer] pkg=utils 2026-10-19 21:14:31 [info ] numpy: 2.4.6 [junifer] pkg=utils 2026-10-19 21:14:31 [info ] scipy: 1.17.1 [junifer] pkg=utils 2026-10-19 21:14:31 [info ] datalad: 1.7.1 [junifer] pkg=utils 2026-10-19 21:14:31 [info ] pandas: 3.0.6 [junifer] pkg=utils 2026-10-19 21:14:31 [info ] nibabel: 5.4.2 [junifer] pkg=utils 2026-10-19 21:14:31 [info ] nilearn: 0.14.1 [junifer] pkg=utils 2026-10-19 21:14:31 [info ] sqlalchemy: 2.1.5 [junifer] pkg=utils 2026-10-19 21:14:31 [info ] ruamel.yaml: 0.19.1 [junifer] pkg=utils 2026-10-19 21:14:31 [info ] h5py: 3.16.0 [junifer] pkg=utils 2026-10-19 21:14:31 [info ] tqdm: 4.70.1 [junifer] pkg=utils 2026-10-19 21:14:31 [info ] templateflow: 25.1.2 [junifer] pkg=utils 2026-10-19 21:14:31 [info ] lapy: 1.7.0 [junifer] pkg=utils 2026-10-19 21:14:31 [info ] junifer_data: 1.6.1 [junifer] pkg=utils 2026-10-19 21:14:31 [info ] junifer: 0.0.8 [junifer] pkg=utils 2026-10-19 21:14:31 [info ] ======================== [junifer] pkg=utils .. GENERATED FROM PYTHON SOURCE LINES 28-29 Define the DataGrabber interface .. GENERATED FROM PYTHON SOURCE LINES 29-33 .. code-block:: Python datagrabber = { "kind": "ADHDTestingDataGrabber", } .. GENERATED FROM PYTHON SOURCE LINES 34-35 Define the markers interface .. GENERATED FROM PYTHON SOURCE LINES 35-48 .. code-block:: Python markers = [ { "name": "Schaefer100x17_RSSETS", "kind": "RSSETSMarker", "parcellation": "Schaefer100x17", }, { "name": "Schaefer200x17_RSSETS", "kind": "RSSETSMarker", "parcellation": "Schaefer200x17", }, ] .. GENERATED FROM PYTHON SOURCE LINES 49-51 Create a temporary directory for junifer feature extraction: At the end you can read the extracted data into a ``pandas.DataFrame``. .. GENERATED FROM PYTHON SOURCE LINES 51-75 .. code-block:: Python with tempfile.TemporaryDirectory() as tmpdir: # Define the storage interface storage = { "kind": "HDF5FeatureStorage", "uri": f"{tmpdir}/test.hdf5", } # Run the defined junifer feature extraction pipeline run( workdir=tmpdir, datagrabber=datagrabber, markers=markers, storage=storage, elements=["sub-01"], # we calculate for one subject only ) # Collect extracted features data collect(storage=storage) # Create storage object to read in extracted features db = HDF5FeatureStorage(uri=storage["uri"]) # List all the features print(db.list_features()) # Read extracted features df_rssets = db.read_df(feature_name="BOLD_Schaefer200x17_RSSETS_rss_ets") .. rst-class:: sphx-glr-script-out .. code-block:: none 2026-10-19 21:14:31 [info ] Parameters: {'types': ['BOLD'], 'datadir': '/tmp/tmp5u84on0q', 'resolution': 3.0, 'n_timepoints': 50} [junifer] component=ADHDTestingDataGrabber pkg=datagrabber step=datagrabber 2026-10-19 21:14:31 [info ] Parameters: {'on': ['BOLD'], 'name': 'Schaefer100x17_RSSETS', 'parcellation': ['Schaefer100x17'], 'agg_method': 'mean', 'agg_method_params': None, 'masks': None} [junifer] component=Schaefer100x17_RSSETS pkg=markers step=marker 2026-10-19 21:14:31 [info ] Parameters: {'on': ['BOLD'], 'name': 'Schaefer200x17_RSSETS', 'parcellation': ['Schaefer200x17'], 'agg_method': 'mean', 'agg_method_params': None, 'masks': None} [junifer] component=Schaefer200x17_RSSETS pkg=markers step=marker 2026-10-19 21:14:31 [info ] Parameters: {'uri': '/tmp/tmp1crjlx6t/test.hdf5', 'single_output': False, 'overwrite': 'update', 'compression': 7, 'force_float32': True, 'chunk_size': 100} [junifer] component=HDF5FeatureStorage pkg=storage step=storage 2026-10-19 21:14:31 [info ] Validating Marker Collection [junifer] pkg=pipeline 2026-10-19 21:14:31 [info ] DataGrabber output type: ['BOLD'] [junifer] pkg=pipeline 2026-10-19 21:14:31 [info ] Validating Data Reader: [junifer] pkg=pipeline 2026-10-19 21:14:31 [info ] Data Reader output type: ['BOLD'] [junifer] pkg=pipeline 2026-10-19 21:14:31 [info ] Validating Marker: Schaefer100x17_RSSETS [junifer] pkg=pipeline 2026-10-19 21:14:31 [info ] Marker output type: [] [junifer] pkg=pipeline 2026-10-19 21:14:31 [info ] Validating storage for Schaefer100x17_RSSETS [junifer] pkg=pipeline 2026-10-19 21:14:31 [info ] Validating Marker: Schaefer200x17_RSSETS [junifer] pkg=pipeline 2026-10-19 21:14:31 [info ] Marker output type: [] [junifer] pkg=pipeline 2026-10-19 21:14:31 [info ] Validating storage for Schaefer200x17_RSSETS [junifer] pkg=pipeline [fetch_adhd] Dataset directory found: /home/docker/nilearn_data/adhd 2026-10-19 21:14:31 [info ] Getting element ('sub-01',) [junifer] pkg=datagrabber step=datagrabber 2026-10-19 21:14:31 [info ] Fitting pipeline [junifer] pkg=pipeline 2026-10-19 21:14:31 [info ] Reading BOLD from /home/docker/nilearn_data/adhd/data/0010042/0010042_rest_tshift_RPI_voreg_mni_res-3mm_tp-50.nii [junifer] pkg=datareader step=datareader 2026-10-19 21:14:31 [info ] BOLD is of type NIFTI [junifer] pkg=datareader step=datareader 2026-10-19 21:14:31 [info ] Fitting marker Schaefer100x17_RSSETS [junifer] pkg=pipeline 2026-10-19 21:14:31 [info ] Computing DataType.BOLD [junifer] pkg=markers step=marker 2026-10-19 21:14:31 [info ] Parameters: {'on': ['BOLD'], 'name': 'ParcelAggregation', 'parcellation': ['Schaefer100x17'], 'method': 'mean', 'method_params': None, 'time_method': None, 'time_method_params': None, 'masks': None} [junifer] component=ParcelAggregation pkg=markers step=marker 2026-10-19 21:14:31 [info ] Parcellation parameters: [junifer] pkg=data 2026-10-19 21:14:31 [info ] resolution: 3.0 [junifer] pkg=data 2026-10-19 21:14:31 [info ] n_rois: 100 [junifer] pkg=data 2026-10-19 21:14:31 [info ] yeo_networks: 17 [junifer] pkg=data 2026-10-19 21:14:31 [info ] Loading parcellation: /home/docker/junifer_data/v8/parcellations/Schaefer2018/Yeo2011/Schaefer2018_100Parcels_17Networks_order_FSLMNI152_2mm.nii.gz [junifer] pkg=data 2026-10-19 21:14:32 [info ] Storing in [junifer] pkg=markers step=marker 2026-10-19 21:14:32 [info ] Writing HDF5 metadata for 7fc47362cf2be31570759647d701d4ca to: /tmp/tmp1crjlx6t/element_sub-01_test.hdf5 [junifer] pkg=storage step=storage 2026-10-19 21:14:32 [info ] Wrote HDF5 metadata for 7fc47362cf2be31570759647d701d4ca to: /tmp/tmp1crjlx6t/element_sub-01_test.hdf5 [junifer] pkg=storage step=storage 2026-10-19 21:14:32 [info ] Writing HDF5 data for 7fc47362cf2be31570759647d701d4ca to: /tmp/tmp1crjlx6t/element_sub-01_test.hdf5 [junifer] pkg=storage step=storage 2026-10-19 21:14:32 [info ] Wrote HDF5 data for 7fc47362cf2be31570759647d701d4ca to: /tmp/tmp1crjlx6t/element_sub-01_test.hdf5 [junifer] pkg=storage step=storage 2026-10-19 21:14:32 [info ] Fitting marker Schaefer200x17_RSSETS [junifer] pkg=pipeline 2026-10-19 21:14:32 [info ] Computing DataType.BOLD [junifer] pkg=markers step=marker 2026-10-19 21:14:32 [info ] Parameters: {'on': ['BOLD'], 'name': 'ParcelAggregation', 'parcellation': ['Schaefer200x17'], 'method': 'mean', 'method_params': None, 'time_method': None, 'time_method_params': None, 'masks': None} [junifer] component=ParcelAggregation pkg=markers step=marker 2026-10-19 21:14:32 [info ] Parcellation parameters: [junifer] pkg=data 2026-10-19 21:14:32 [info ] resolution: 3.0 [junifer] pkg=data 2026-10-19 21:14:32 [info ] n_rois: 200 [junifer] pkg=data 2026-10-19 21:14:32 [info ] yeo_networks: 17 [junifer] pkg=data 2026-10-19 21:14:32 [info ] Loading parcellation: /home/docker/junifer_data/v8/parcellations/Schaefer2018/Yeo2011/Schaefer2018_200Parcels_17Networks_order_FSLMNI152_2mm.nii.gz [junifer] pkg=data 2026-10-19 21:14:33 [info ] Storing in [junifer] pkg=markers step=marker 2026-10-19 21:14:33 [info ] Writing HDF5 metadata for bd734d5ef16f583bf3dc85f198aa6b45 to: /tmp/tmp1crjlx6t/element_sub-01_test.hdf5 [junifer] pkg=storage step=storage 2026-10-19 21:14:33 [info ] Wrote HDF5 metadata for bd734d5ef16f583bf3dc85f198aa6b45 to: /tmp/tmp1crjlx6t/element_sub-01_test.hdf5 [junifer] pkg=storage step=storage 2026-10-19 21:14:33 [info ] Writing HDF5 data for bd734d5ef16f583bf3dc85f198aa6b45 to: /tmp/tmp1crjlx6t/element_sub-01_test.hdf5 [junifer] pkg=storage step=storage 2026-10-19 21:14:33 [info ] Wrote HDF5 data for bd734d5ef16f583bf3dc85f198aa6b45 to: /tmp/tmp1crjlx6t/element_sub-01_test.hdf5 [junifer] pkg=storage step=storage 2026-10-19 21:14:33 [info ] Marker collection fitting done [junifer] pkg=pipeline 2026-10-19 21:14:33 [info ] Collecting data using HDF5FeatureStorage [junifer] pkg=api 2026-10-19 21:14:33 [info ] Parameters: {'uri': '/tmp/tmp1crjlx6t/test.hdf5', 'single_output': False, 'overwrite': 'update', 'compression': 7, 'force_float32': True, 'chunk_size': 100} [junifer] component=HDF5FeatureStorage pkg=storage step=storage 2026-10-19 21:14:33 [info ] Parameters: {'uri': '/tmp/tmp1crjlx6t/test.hdf5', 'single_output': True, 'overwrite': 'update', 'compression': 7, 'force_float32': True, 'chunk_size': 100} [junifer] component=HDF5FeatureStorage pkg=storage step=storage 2026-10-19 21:14:33 [info ] Collecting metadata from /tmp/tmp1crjlx6t/*_test.hdf5 [junifer] pkg=storage step=storage file-metadata: 0it [00:00, ?it/s]2026-10-19 21:14:33 [info ] Parameters: {'uri': '/tmp/tmp1crjlx6t/element_sub-01_test.hdf5', 'single_output': True, 'overwrite': 'update', 'compression': 7, 'force_float32': True, 'chunk_size': 100} [junifer] component=HDF5FeatureStorage pkg=storage step=storage file-metadata: 1it [00:00, 75.93it/s] 2026-10-19 21:14:33 [info ] Writing metadata to HDF5 file ... [junifer] pkg=storage step=storage 2026-10-19 21:14:33 [info ] Collecting data from /tmp/tmp1crjlx6t/*_test.hdf5 [junifer] pkg=storage step=storage 2026-10-19 21:14:33 [info ] Will collect 2 features. [junifer] pkg=storage step=storage 2026-10-19 21:14:33 [info ] Collecting 1 files for feature MD5: 7fc47362cf2be31570759647d701d4ca. [junifer] pkg=storage step=storage 2026-10-19 21:14:33 [info ] Collecting 1 files for feature MD5: bd734d5ef16f583bf3dc85f198aa6b45. [junifer] pkg=storage step=storage feature: 0%| | 0/2 [00:00
root_sum_of_squares_ets
subject timepoint
sub-01 0 56.673000
1 95.662399
2 149.116409
3 130.551895
4 127.797150


.. rst-class:: sphx-glr-timing **Total running time of the script:** (0 minutes 3.192 seconds) .. _sphx_glr_download_auto_examples_run_ets_rss_marker.py: .. only:: html .. container:: sphx-glr-footer sphx-glr-footer-example .. container:: sphx-glr-download sphx-glr-download-jupyter :download:`Download Jupyter notebook: run_ets_rss_marker.ipynb ` .. container:: sphx-glr-download sphx-glr-download-python :download:`Download Python source code: run_ets_rss_marker.py ` .. container:: sphx-glr-download sphx-glr-download-zip :download:`Download zipped: run_ets_rss_marker.zip ` .. only:: html .. rst-class:: sphx-glr-signature `Gallery generated by Sphinx-Gallery `_