Пример #1
0
    deriv_path = deriv_dir / sub_string
    fig_path = deriv_path / 'figures'
    print(f'Generating report for task-{task} data from {sub_string}')

    # Initialize the report
    # Make the report object
    report = Report(subject=sub_string,
                    title=f'{sub_string}: task-{task} report',
                    image_format='png', verbose=True, projs=False,
                    subjects_dir=None)

    # Behavioral Section
    # Plot behavioral data
    behav_fig_file = fig_path / f'{sub_string}_task-{task}_beh_performance.png'
    report.add_images_to_section(behav_fig_file,
                                 captions='Behavior: Performance Summary',
                                 section='Behavior')

    # EEG Section
    # Load the Raw data
    raw_fif_file = deriv_path / \
        f'{sub_string}_task-{task}_ref-FCz_desc-resamp_raw.fif.gz'
    raw = mne.io.read_raw_fif(raw_fif_file, preload=True)

    # Load the Epochs
    epoch_fif_file = deriv_path / \
        f'{sub_string}_task-{task}_ref-mastoids_desc-cleaned_epo.fif.gz'
    epochs = mne.read_epochs(epoch_fif_file, preload=True)

    # Load Epochs json
    json_file = deriv_path / \