systole.interact.Viewer#

class systole.interact.Viewer(bids_folder: str | PathLike | None = None, preprocessed_folder: str | PathLike | None = None, output_folder: str | PathLike = '', session: str | PathLike = 'ses-session1', modality: str | PathLike = 'beh', pattern: str | PathLike = 'task-', participant_id: str | None = None, signal_type: str | PathLike = 'PPG', figsize: Tuple[int, int] = (15, 7))[source]#

This class handles the interaction with BIDS structured folders. It calls the` Editor` class internally to generate the interactive plots.

Parameters:
bids_folder

Path to the input BIDS folder. If the BIDS folder is used as input, the Viewer tries to read the preprocessed physiological recordings generated by the command line for reports in BIDS/derivatives/systole/. .. note:

If this parameter is provided, `preprocessed_folder` will be ignored
(implicitely here, `preprocessed_folder=BIDS/derivatives/systole/`).
preprocessed_folder

Path to the folder where preprocessed physiological recording have been saved. This should be used if not working directly inside the BIDS folder and the preprocessed data have been save loaclly. .. note:

If this parameter is provided, `bids_folder` will be ignored.
output_folder

Path to the output folder. This is where the JSON files containing peaks correction, bad segments and signal validity logs will be saved. If an empty strimg is provided (default), the results will be saved in BIDS/derivative/systole/corrected/ when working in the BIDS folder, or in preprocessed_folder/corrected/ when working whith a local folder.

session

The BIDS sub-session where the pysio files are stored. Defaults to “ses-session1”.

modality

The BIDS sub-modality where the pysio files are stored (e.g. “func” or “beh”).

pattern

The string pattern that the pysio files should contain. This allows to refine the selection of possible physio files, in case the folders contains many _physio-gz.tsv.

participant_id

The participant ID as registered in the BIDS folder. If None (default), the first participant in the list of available recordings is selected.

signal_type

The type of signal that are being analyzed. Can be “PPG”, “ECG” or “RESP”. Defaults to “PPG”.

figsize

The size of the interactive Matplotlib figure for peaks edition. Defaults to (15, 7).

Raises:
ValueError

If both bids_folder and preprocessed_folder are provided.

See also

Editor
__init__(bids_folder: str | PathLike | None = None, preprocessed_folder: str | PathLike | None = None, output_folder: str | PathLike = '', session: str | PathLike = 'ses-session1', modality: str | PathLike = 'beh', pattern: str | PathLike = 'task-', participant_id: str | None = None, signal_type: str | PathLike = 'PPG', figsize: Tuple[int, int] = (15, 7)) None[source]#

Methods

__init__([bids_folder, preprocessed_folder, ...])

load_file()

Load the files containing the physiological recordings and the metadat JSON files for one participant.

load_signal()

Load the signal from the input folder (BIDS or local).

plot_signal(change)

update_list(change)

Updating the list of participants available in the folder when the text boxes are used.