.. 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 SQLiteFeatureStorage 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 /__w/junifer/junifer/junifer/utils/logging.py:155: UserWarning: The '__version__' attribute is deprecated and will be removed in MarkupSafe 3.1. Use feature detection, or `importlib.metadata.version("markupsafe")`, instead. vstring = str(getattr(module, "__version__", None)) 2025-09-24 13:48:39,077 - JUNIFER - INFO - ===== Lib Versions ===== 2025-09-24 13:48:39,078 - JUNIFER - INFO - click: 8.1.8 2025-09-24 13:48:39,078 - JUNIFER - INFO - numpy: 1.26.4 2025-09-24 13:48:39,078 - JUNIFER - INFO - scipy: 1.15.0 2025-09-24 13:48:39,078 - JUNIFER - INFO - datalad: 1.1.6 2025-09-24 13:48:39,078 - JUNIFER - INFO - pandas: 2.1.4 2025-09-24 13:48:39,078 - JUNIFER - INFO - nibabel: 5.3.2 2025-09-24 13:48:39,078 - JUNIFER - INFO - nilearn: 0.10.4 2025-09-24 13:48:39,078 - JUNIFER - INFO - sqlalchemy: 2.0.43 2025-09-24 13:48:39,078 - JUNIFER - INFO - ruamel.yaml: 0.18.15 2025-09-24 13:48:39,078 - JUNIFER - INFO - tqdm: 4.66.6 2025-09-24 13:48:39,078 - JUNIFER - INFO - templateflow: 24.2.2 2025-09-24 13:48:39,078 - JUNIFER - INFO - junifer_data: None 2025-09-24 13:48:39,078 - JUNIFER - INFO - junifer: 0.0.7.dev217 2025-09-24 13:48:39,078 - JUNIFER - INFO - ======================== .. GENERATED FROM PYTHON SOURCE LINES 28-29 Define the DataGrabber interface .. GENERATED FROM PYTHON SOURCE LINES 29-33 .. code-block:: Python datagrabber = { "kind": "SPMAuditoryTestingDataGrabber", } .. 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": "SQLiteFeatureStorage", "uri": f"{tmpdir}/test.sqlite", } # Run the defined junifer feature extraction pipeline run( workdir=tmpdir, datagrabber=datagrabber, markers=markers, storage=storage, elements=["sub001"], # we calculate for one subject only ) # Collect extracted features data collect(storage=storage) # Create storage object to read in extracted features db = SQLiteFeatureStorage(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 2025-09-24 13:48:39,080 - JUNIFER - INFO - Registering RSSETSMarker in marker 2025-09-24 13:48:39,080 - JUNIFER - INFO - Validating Marker Collection 2025-09-24 13:48:39,080 - JUNIFER - INFO - DataGrabber output type: ['BOLD', 'T1w'] 2025-09-24 13:48:39,080 - JUNIFER - INFO - Validating Data Reader: 2025-09-24 13:48:39,081 - JUNIFER - INFO - Data Reader output type: ['BOLD', 'T1w'] 2025-09-24 13:48:39,081 - JUNIFER - INFO - Validating Marker: Schaefer100x17_RSSETS 2025-09-24 13:48:39,081 - JUNIFER - INFO - Marker output type: ['timeseries'] 2025-09-24 13:48:39,081 - JUNIFER - INFO - Validating storage for Schaefer100x17_RSSETS 2025-09-24 13:48:39,081 - JUNIFER - INFO - Validating Marker: Schaefer200x17_RSSETS 2025-09-24 13:48:39,081 - JUNIFER - INFO - Marker output type: ['timeseries'] 2025-09-24 13:48:39,081 - JUNIFER - INFO - Validating storage for Schaefer200x17_RSSETS 2025-09-24 13:48:39,081 - JUNIFER - INFO - Getting element sub001 2025-09-24 13:48:41,194 - JUNIFER - INFO - Fitting pipeline 2025-09-24 13:48:41,194 - JUNIFER - INFO - Reading BOLD from /tmp/tmpp060a83a/sub001_bold.nii.gz 2025-09-24 13:48:41,194 - JUNIFER - INFO - BOLD is of type NIFTI 2025-09-24 13:48:41,195 - JUNIFER - INFO - Reading T1w from /tmp/tmpp060a83a/sub001_T1w.nii.gz 2025-09-24 13:48:41,195 - JUNIFER - INFO - T1w is of type NIFTI 2025-09-24 13:48:41,196 - JUNIFER - INFO - Fitting marker Schaefer100x17_RSSETS 2025-09-24 13:48:41,196 - JUNIFER - INFO - Computing BOLD 2025-09-24 13:48:41,196 - JUNIFER - INFO - Parcellation will be warped from MNI152NLin6Asym to MNI152Lin using highest resolution 2025-09-24 13:48:41,196 - JUNIFER - INFO - Parcellation parameters: 2025-09-24 13:48:41,196 - JUNIFER - INFO - resolution: None 2025-09-24 13:48:41,197 - JUNIFER - INFO - n_rois: 100 2025-09-24 13:48:41,197 - JUNIFER - INFO - yeo_networks: 17 2025-09-24 13:48:41,197 - JUNIFER - INFO - Resolution set to None, using highest resolution. 2025-09-24 13:48:41,273 - JUNIFER - INFO - Loading parcellation: /github/home/junifer_data/v4/parcellations/Schaefer2018/Yeo2011/Schaefer2018_100Parcels_17Networks_order_FSLMNI152_1mm.nii.gz 2025-09-24 13:48:43,663 - JUNIFER - INFO - Downloading template MNI152Lin (T1w in resolution 1) 2025-09-24 13:48:44,173 - JUNIFER - INFO - antsApplyTransforms command to be executed: antsApplyTransforms -d 3 -e 3 -n 'GenericLabel[NearestNeighbor]' -i /tmp/junifer/tmp2m3jhq9x/ants_parcellation_warper_Schaefer100x17_from_MNI152NLin6Asym_to_MNI152Lin_2e3509ce-994d-11f0-83de-7258d444b196w4curikk/prewarp_parcellation.nii.gz -r /tmp/junifer/tmp2m3jhq9x/ants_parcellation_warper_Schaefer100x17_from_MNI152NLin6Asym_to_MNI152Lin_2e3509ce-994d-11f0-83de-7258d444b196w4curikk/MNI152Lin_T1w.nii.gz -t /github/home/junifer_data/v4/.git/annex/objects/JQ/Pp/SHA256E-s145422752--5091350b36f951d455dabd429ebe86c493c75a0217dca311ae355f1d62e080b0.h5/SHA256E-s145422752--5091350b36f951d455dabd429ebe86c493c75a0217dca311ae355f1d62e080b0.h5 -o /tmp/junifer/tmp2m3jhq9x/ants_parcellation_warper_Schaefer100x17_from_MNI152NLin6Asym_to_MNI152Lin_2e3509ce-994d-11f0-83de-7258d444b196w4curikk/parcellation_warped.nii.gz 2025-09-24 13:48:50,492 - JUNIFER - INFO - antsApplyTransforms command succeeded with the following output: 2025-09-24 13:48:53,753 - JUNIFER - INFO - Storing in 2025-09-24 13:48:53,771 - JUNIFER - INFO - Fitting marker Schaefer200x17_RSSETS 2025-09-24 13:48:53,772 - JUNIFER - INFO - Computing BOLD 2025-09-24 13:48:53,772 - JUNIFER - INFO - Parcellation will be warped from MNI152NLin6Asym to MNI152Lin using highest resolution 2025-09-24 13:48:53,772 - JUNIFER - INFO - Parcellation parameters: 2025-09-24 13:48:53,772 - JUNIFER - INFO - resolution: None 2025-09-24 13:48:53,772 - JUNIFER - INFO - n_rois: 200 2025-09-24 13:48:53,772 - JUNIFER - INFO - yeo_networks: 17 2025-09-24 13:48:53,772 - JUNIFER - INFO - Resolution set to None, using highest resolution. 2025-09-24 13:48:53,848 - JUNIFER - INFO - Loading parcellation: /github/home/junifer_data/v4/parcellations/Schaefer2018/Yeo2011/Schaefer2018_200Parcels_17Networks_order_FSLMNI152_1mm.nii.gz 2025-09-24 13:48:56,218 - JUNIFER - INFO - Downloading template MNI152Lin (T1w in resolution 1) 2025-09-24 13:48:56,728 - JUNIFER - INFO - antsApplyTransforms command to be executed: antsApplyTransforms -d 3 -e 3 -n 'GenericLabel[NearestNeighbor]' -i /tmp/junifer/tmp2m3jhq9x/ants_parcellation_warper_Schaefer200x17_from_MNI152NLin6Asym_to_MNI152Lin_35b3c2b2-994d-11f0-83de-7258d444b196ywz8_ivm/prewarp_parcellation.nii.gz -r /tmp/junifer/tmp2m3jhq9x/ants_parcellation_warper_Schaefer200x17_from_MNI152NLin6Asym_to_MNI152Lin_35b3c2b2-994d-11f0-83de-7258d444b196ywz8_ivm/MNI152Lin_T1w.nii.gz -t /github/home/junifer_data/v4/.git/annex/objects/JQ/Pp/SHA256E-s145422752--5091350b36f951d455dabd429ebe86c493c75a0217dca311ae355f1d62e080b0.h5/SHA256E-s145422752--5091350b36f951d455dabd429ebe86c493c75a0217dca311ae355f1d62e080b0.h5 -o /tmp/junifer/tmp2m3jhq9x/ants_parcellation_warper_Schaefer200x17_from_MNI152NLin6Asym_to_MNI152Lin_35b3c2b2-994d-11f0-83de-7258d444b196ywz8_ivm/parcellation_warped.nii.gz 2025-09-24 13:49:08,232 - JUNIFER - INFO - antsApplyTransforms command succeeded with the following output: 2025-09-24 13:49:10,991 - JUNIFER - INFO - Storing in 2025-09-24 13:49:11,012 - JUNIFER - INFO - Marker collection fitting done 2025-09-24 13:49:11,023 - JUNIFER - INFO - Collecting data using SQLiteFeatureStorage 2025-09-24 13:49:11,023 - JUNIFER - INFO - Collecting data from /tmp/tmp_8v_u9v5/*test.sqlite file: 0it [00:00, ?it/s] feature: 0%| | 0/2 [00:00
root_sum_of_squares_ets
subject timepoint
sub001 0 2502.888057
1 168.174038
2 102.849715
3 132.639660
4 109.615993


.. rst-class:: sphx-glr-timing **Total running time of the script:** (0 minutes 32.009 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 `_