Note
Click here to download the full example code or to run this example in your browser via Binder
Running NiBetaSeries¶
This example runs through a basic call of NiBetaSeries using
the commandline entry point nibs
.
While this example is using python, typically nibs
will be
called directly on the commandline.
Import all the necessary packages¶
import tempfile # make a temporary directory for files
import os # interact with the filesystem
import urllib.request # grad data from internet
import tarfile # extract files from tar
from subprocess import Popen, PIPE, STDOUT # enable calling commandline
import matplotlib.pyplot as plt # manipulate figures
import seaborn as sns # display results
import pandas as pd # manipulate tabular data
import nibabel as nib # load the beta maps in python
from nilearn import plotting # plot nifti images
Download relevant data from ds000164 (and Atlas Files)¶
The subject data came from openneuro [notebook-1]. The atlas data came from a recently published parcellation in a publically accessible github repository.
# atlas github repo for reference:
"""https://github.com/ThomasYeoLab/CBIG/raw/master/stable_projects/\
brain_parcellation/Schaefer2018_LocalGlobal/Parcellations/MNI/"""
data_dir = tempfile.mkdtemp()
print('Our working directory: {}'.format(data_dir))
# download the tar data
url = "https://www.dropbox.com/s/fvtyld08srwl3x9/ds000164-test_v2.tar.gz?dl=1"
tar_file = os.path.join(data_dir, "ds000164.tar.gz")
u = urllib.request.urlopen(url)
data = u.read()
u.close()
# write tar data to file
with open(tar_file, "wb") as f:
f.write(data)
# extract the data
tar = tarfile.open(tar_file, mode='r|gz')
tar.extractall(path=data_dir)
os.remove(tar_file)
Out:
Our working directory: /tmp/tmpqq5l7e3o
Display the minimal dataset necessary to run nibs¶
# https://stackoverflow.com/questions/9727673/list-directory-tree-structure-in-python
def list_files(startpath):
for root, dirs, files in os.walk(startpath):
level = root.replace(startpath, '').count(os.sep)
indent = ' ' * 4 * (level)
print('{}{}/'.format(indent, os.path.basename(root)))
subindent = ' ' * 4 * (level + 1)
for f in files:
print('{}{}'.format(subindent, f))
list_files(data_dir)
Out:
tmpqq5l7e3o/
ds000164/
dataset_description.json
CHANGES
README
task-stroop_events.json
T1w.json
task-stroop_bold.json
sub-001/
anat/
sub-001_T1w.nii.gz
func/
sub-001_task-stroop_events.tsv
sub-001_task-stroop_bold.nii.gz
derivatives/
data/
Schaefer2018_100Parcels_7Networks_order.txt
Schaefer2018_100Parcels_7Networks_order_FSLMNI152_2mm.nii.gz
fmriprep/
dataset_description.json
sub-001/
func/
sub-001_task-stroop_desc-confounds_regressors.tsv
sub-001_task-stroop_space-MNI152NLin2009cAsym_desc-brain_mask.nii.gz
sub-001_task-stroop_space-MNI152NLin2009cAsym_desc-preproc_bold.nii.gz
Manipulate events file so it satifies assumptions¶
1. the correct column has 1’s and 0’s corresponding to correct and incorrect, respectively. 2. the condition column is renamed to trial_type nibs currently depends on the “correct” column being binary and the “trial_type” column to contain the trial types of interest.
read the file¶
events_file = os.path.join(data_dir,
"ds000164",
"sub-001",
"func",
"sub-001_task-stroop_events.tsv")
events_df = pd.read_csv(events_file, sep='\t', na_values="n/a")
print(events_df.head())
Out:
onset duration correct condition response_time
0 0.342 1 Y neutral 1.186
1 3.345 1 Y congruent 0.667
2 12.346 1 Y congruent 0.614
3 15.349 1 Y neutral 0.696
4 18.350 1 Y neutral 0.752
replace condition with trial_type¶
events_df.rename({"condition": "trial_type"}, axis='columns', inplace=True)
print(events_df.head())
Out:
onset duration correct trial_type response_time
0 0.342 1 Y neutral 1.186
1 3.345 1 Y congruent 0.667
2 12.346 1 Y congruent 0.614
3 15.349 1 Y neutral 0.696
4 18.350 1 Y neutral 0.752
save the file¶
events_df.to_csv(events_file, sep="\t", na_rep="n/a", index=False)
Manipulate the region order file¶
There are several adjustments to the atlas file that need to be completed before we can pass it into nibs. Importantly, the relevant column names MUST be named “index” and “regions”. “index” refers to which integer within the file corresponds to which region in the atlas nifti file. “regions” refers the name of each region in the atlas nifti file.
read the atlas file¶
atlas_txt = os.path.join(data_dir,
"ds000164",
"derivatives",
"data",
"Schaefer2018_100Parcels_7Networks_order.txt")
atlas_df = pd.read_csv(atlas_txt, sep="\t", header=None)
print(atlas_df.head())
Out:
0 1 2 3 4 5
0 1 7Networks_LH_Vis_1 120 18 131 0
1 2 7Networks_LH_Vis_2 120 18 132 0
2 3 7Networks_LH_Vis_3 120 18 133 0
3 4 7Networks_LH_Vis_4 120 18 135 0
4 5 7Networks_LH_Vis_5 120 18 136 0
drop color coding columns¶
atlas_df.drop([2, 3, 4, 5], axis='columns', inplace=True)
print(atlas_df.head())
Out:
0 1
0 1 7Networks_LH_Vis_1
1 2 7Networks_LH_Vis_2
2 3 7Networks_LH_Vis_3
3 4 7Networks_LH_Vis_4
4 5 7Networks_LH_Vis_5
rename columns with the approved headings: “index” and “regions”¶
atlas_df.rename({0: 'index', 1: 'regions'}, axis='columns', inplace=True)
print(atlas_df.head())
Out:
index regions
0 1 7Networks_LH_Vis_1
1 2 7Networks_LH_Vis_2
2 3 7Networks_LH_Vis_3
3 4 7Networks_LH_Vis_4
4 5 7Networks_LH_Vis_5
remove prefix “7Networks”¶
atlas_df.replace(regex={'7Networks_(.*)': '\\1'}, inplace=True)
print(atlas_df.head())
Out:
index regions
0 1 LH_Vis_1
1 2 LH_Vis_2
2 3 LH_Vis_3
3 4 LH_Vis_4
4 5 LH_Vis_5
write out the file as .tsv¶
atlas_tsv = atlas_txt.replace(".txt", ".tsv")
atlas_df.to_csv(atlas_tsv, sep="\t", index=False)
Run nibs¶
This demonstration mimics how you would use nibs on the command line If you only wanted the beta maps and not the correlation matrices, do not include the atlas (-a) and lookup table options (-l)
out_dir = os.path.join(data_dir, "ds000164", "derivatives")
work_dir = os.path.join(out_dir, "work")
atlas_mni_file = os.path.join(data_dir,
"ds000164",
"derivatives",
"data",
"Schaefer2018_100Parcels_7Networks_order_FSLMNI152_2mm.nii.gz")
cmd = """\
nibs -c WhiteMatter CSF \
--participant-label 001 \
--estimator lsa \
--hrf-model glover \
-w {work_dir} \
-a {atlas_mni_file} \
-l {atlas_tsv} \
{bids_dir} \
fmriprep \
{out_dir} \
participant
""".format(atlas_mni_file=atlas_mni_file,
atlas_tsv=atlas_tsv,
bids_dir=os.path.join(data_dir, "ds000164"),
out_dir=out_dir,
work_dir=work_dir)
# Since we cannot run bash commands inside this tutorial
# we are printing the actual bash command so you can see it
# in the output
print("The Example Command:\n", cmd)
# call nibs
p = Popen(cmd, shell=True, stdout=PIPE, stderr=STDOUT)
while True:
line = p.stdout.readline()
if not line:
break
print(line)
Out:
The Example Command:
nibs -c WhiteMatter CSF --participant-label 001 --estimator lsa --hrf-model glover -w /tmp/tmpqq5l7e3o/ds000164/derivatives/work -a /tmp/tmpqq5l7e3o/ds000164/derivatives/data/Schaefer2018_100Parcels_7Networks_order_FSLMNI152_2mm.nii.gz -l /tmp/tmpqq5l7e3o/ds000164/derivatives/data/Schaefer2018_100Parcels_7Networks_order.tsv /tmp/tmpqq5l7e3o/ds000164 fmriprep /tmp/tmpqq5l7e3o/ds000164/derivatives participant
b'210220-05:01:19,599 nipype.workflow INFO:\n'
b"\t Workflow nibetaseries_participant_wf settings: ['check', 'execution', 'logging', 'monitoring']\n"
b'210220-05:01:19,611 nipype.workflow INFO:\n'
b'\t Running in parallel.\n'
b'210220-05:01:19,613 nipype.workflow INFO:\n'
b'\t [MultiProc] Running 0 tasks, and 1 jobs ready. Free memory (GB): 3.25/3.25, Free processors: 2/2.\n'
b'/home/docs/checkouts/readthedocs.org/user_builds/nibetaseries/envs/latest/lib/python3.7/site-packages/bids/layout/validation.py:46: UserWarning: The ability to pass arguments to BIDSLayout that control indexing is likely to be removed in future; possibly as early as PyBIDS 0.14. This includes the `config_filename`, `ignore`, `force_index`, and `index_metadata` arguments. The recommended usage pattern is to initialize a new BIDSLayoutIndexer with these arguments, and pass it to the BIDSLayout via the `indexer` argument.\n'
b' warnings.warn("The ability to pass arguments to BIDSLayout that control "\n'
b"/home/docs/checkouts/readthedocs.org/user_builds/nibetaseries/envs/latest/lib/python3.7/site-packages/bids/layout/models.py:152: FutureWarning: The 'extension' entity currently excludes the leading dot ('.'). As of version 0.14.0, it will include the leading dot. To suppress this warning and include the leading dot, use `bids.config.set_option('extension_initial_dot', True)`.\n"
b' FutureWarning)\n'
b"/home/docs/checkouts/readthedocs.org/user_builds/nibetaseries/envs/latest/lib/python3.7/site-packages/bids/layout/models.py:225: UserWarning: Accessing entities as attributes is deprecated as of 0.7. Please use the .entities dictionary instead (i.e., .entities['task'] instead of .task.\n"
b' % (attr, attr))\n'
b"/home/docs/checkouts/readthedocs.org/user_builds/nibetaseries/envs/latest/lib/python3.7/site-packages/bids/layout/models.py:225: UserWarning: Accessing entities as attributes is deprecated as of 0.7. Please use the .entities dictionary instead (i.e., .entities['space'] instead of .space.\n"
b' % (attr, attr))\n'
b'210220-05:01:19,670 nipype.workflow INFO:\n'
b'\t [Node] Setting-up "nibetaseries_participant_wf.single_subject001_wf.betaseries_wf.betaseries_node" in "/tmp/tmpqq5l7e3o/ds000164/derivatives/work/NiBetaSeries_work/nibetaseries_participant_wf/single_subject001_wf/betaseries_wf/16f898a9084a9dc798b18592614eedb53f7bf385/betaseries_node".\n'
b'210220-05:01:19,675 nipype.workflow INFO:\n'
b'\t [Node] Running "betaseries_node" ("nibetaseries.interfaces.nistats.LSABetaSeries")\n'
b'210220-05:01:21,615 nipype.workflow INFO:\n'
b'\t [MultiProc] Running 1 tasks, and 0 jobs ready. Free memory (GB): 3.05/3.25, Free processors: 1/2.\n'
b' Currently running:\n'
b' * nibetaseries_participant_wf.single_subject001_wf.betaseries_wf.betaseries_node\n'
b'210220-05:01:24,273 nipype.workflow INFO:\n'
b'\t [Node] Finished "nibetaseries_participant_wf.single_subject001_wf.betaseries_wf.betaseries_node".\n'
b'210220-05:01:25,617 nipype.workflow INFO:\n'
b'\t [Job 0] Completed (nibetaseries_participant_wf.single_subject001_wf.betaseries_wf.betaseries_node).\n'
b'210220-05:01:25,618 nipype.workflow INFO:\n'
b'\t [MultiProc] Running 0 tasks, and 2 jobs ready. Free memory (GB): 3.25/3.25, Free processors: 2/2.\n'
b'210220-05:01:27,619 nipype.workflow INFO:\n'
b'\t [MultiProc] Running 0 tasks, and 6 jobs ready. Free memory (GB): 3.25/3.25, Free processors: 2/2.\n'
b'210220-05:01:27,668 nipype.workflow INFO:\n'
b'\t [Node] Setting-up "_ds_betaseries_file0" in "/tmp/tmpqq5l7e3o/ds000164/derivatives/work/NiBetaSeries_work/nibetaseries_participant_wf/single_subject001_wf/16f898a9084a9dc798b18592614eedb53f7bf385/ds_betaseries_file/mapflow/_ds_betaseries_file0".\n'
b'210220-05:01:27,670 nipype.workflow INFO:\n'
b'\t [Node] Running "_ds_betaseries_file0" ("nibetaseries.interfaces.bids.DerivativesDataSink")\n'
b'210220-05:01:27,673 nipype.workflow INFO:\n'
b'\t [Node] Setting-up "_ds_betaseries_file1" in "/tmp/tmpqq5l7e3o/ds000164/derivatives/work/NiBetaSeries_work/nibetaseries_participant_wf/single_subject001_wf/16f898a9084a9dc798b18592614eedb53f7bf385/ds_betaseries_file/mapflow/_ds_betaseries_file1".\n'
b'210220-05:01:27,675 nipype.workflow INFO:\n'
b'\t [Node] Running "_ds_betaseries_file1" ("nibetaseries.interfaces.bids.DerivativesDataSink")\n'
b'210220-05:01:27,685 nipype.workflow INFO:\n'
b'\t [Node] Finished "_ds_betaseries_file0".\n'
b'210220-05:01:27,686 nipype.workflow INFO:\n'
b'\t [Node] Finished "_ds_betaseries_file1".\n'
b'210220-05:01:29,621 nipype.workflow INFO:\n'
b'\t [Job 7] Completed (_ds_betaseries_file0).\n'
b'210220-05:01:29,621 nipype.workflow INFO:\n'
b'\t [Job 8] Completed (_ds_betaseries_file1).\n'
b'210220-05:01:29,622 nipype.workflow INFO:\n'
b'\t [MultiProc] Running 0 tasks, and 4 jobs ready. Free memory (GB): 3.25/3.25, Free processors: 2/2.\n'
b'210220-05:01:29,670 nipype.workflow INFO:\n'
b'\t [Node] Setting-up "_ds_betaseries_file2" in "/tmp/tmpqq5l7e3o/ds000164/derivatives/work/NiBetaSeries_work/nibetaseries_participant_wf/single_subject001_wf/16f898a9084a9dc798b18592614eedb53f7bf385/ds_betaseries_file/mapflow/_ds_betaseries_file2".\n'
b'210220-05:01:29,671 nipype.workflow INFO:\n'
b'\t [Node] Setting-up "_censor_volumes0" in "/tmp/tmpqq5l7e3o/ds000164/derivatives/work/NiBetaSeries_work/nibetaseries_participant_wf/single_subject001_wf/16f898a9084a9dc798b18592614eedb53f7bf385/censor_volumes/mapflow/_censor_volumes0".\n'
b'210220-05:01:29,673 nipype.workflow INFO:\n'
b'\t [Node] Running "_ds_betaseries_file2" ("nibetaseries.interfaces.bids.DerivativesDataSink")\n'
b'210220-05:01:29,673 nipype.workflow INFO:\n'
b'\t [Node] Running "_censor_volumes0" ("nibetaseries.interfaces.nilearn.CensorVolumes")\n'
b'210220-05:01:29,683 nipype.workflow INFO:\n'
b'\t [Node] Finished "_ds_betaseries_file2".\n'
b'210220-05:01:29,720 nipype.workflow INFO:\n'
b'\t [Node] Finished "_censor_volumes0".\n'
b'210220-05:01:31,623 nipype.workflow INFO:\n'
b'\t [Job 9] Completed (_ds_betaseries_file2).\n'
b'210220-05:01:31,623 nipype.workflow INFO:\n'
b'\t [Job 10] Completed (_censor_volumes0).\n'
b'210220-05:01:31,624 nipype.workflow INFO:\n'
b'\t [MultiProc] Running 0 tasks, and 3 jobs ready. Free memory (GB): 3.25/3.25, Free processors: 2/2.\n'
b'210220-05:01:31,677 nipype.workflow INFO:\n'
b'\t [Node] Setting-up "nibetaseries_participant_wf.single_subject001_wf.ds_betaseries_file" in "/tmp/tmpqq5l7e3o/ds000164/derivatives/work/NiBetaSeries_work/nibetaseries_participant_wf/single_subject001_wf/16f898a9084a9dc798b18592614eedb53f7bf385/ds_betaseries_file".\n'
b'210220-05:01:31,678 nipype.workflow INFO:\n'
b'\t [Node] Setting-up "_censor_volumes1" in "/tmp/tmpqq5l7e3o/ds000164/derivatives/work/NiBetaSeries_work/nibetaseries_participant_wf/single_subject001_wf/16f898a9084a9dc798b18592614eedb53f7bf385/censor_volumes/mapflow/_censor_volumes1".\n'
b'210220-05:01:31,680 nipype.workflow INFO:\n'
b'\t [Node] Running "_censor_volumes1" ("nibetaseries.interfaces.nilearn.CensorVolumes")\n'
b'210220-05:01:31,681 nipype.workflow INFO:\n'
b'\t [Node] Setting-up "_ds_betaseries_file0" in "/tmp/tmpqq5l7e3o/ds000164/derivatives/work/NiBetaSeries_work/nibetaseries_participant_wf/single_subject001_wf/16f898a9084a9dc798b18592614eedb53f7bf385/ds_betaseries_file/mapflow/_ds_betaseries_file0".\n'
b'210220-05:01:31,684 nipype.workflow INFO:\n'
b'\t [Node] Running "_ds_betaseries_file0" ("nibetaseries.interfaces.bids.DerivativesDataSink")\n'
b'210220-05:01:31,694 nipype.workflow INFO:\n'
b'\t [Node] Finished "_ds_betaseries_file0".\n'
b'210220-05:01:31,696 nipype.workflow INFO:\n'
b'\t [Node] Setting-up "_ds_betaseries_file1" in "/tmp/tmpqq5l7e3o/ds000164/derivatives/work/NiBetaSeries_work/nibetaseries_participant_wf/single_subject001_wf/16f898a9084a9dc798b18592614eedb53f7bf385/ds_betaseries_file/mapflow/_ds_betaseries_file1".\n'
b'210220-05:01:31,698 nipype.workflow INFO:\n'
b'\t [Node] Running "_ds_betaseries_file1" ("nibetaseries.interfaces.bids.DerivativesDataSink")\n'
b'210220-05:01:31,708 nipype.workflow INFO:\n'
b'\t [Node] Finished "_ds_betaseries_file1".\n'
b'210220-05:01:31,709 nipype.workflow INFO:\n'
b'\t [Node] Setting-up "_ds_betaseries_file2" in "/tmp/tmpqq5l7e3o/ds000164/derivatives/work/NiBetaSeries_work/nibetaseries_participant_wf/single_subject001_wf/16f898a9084a9dc798b18592614eedb53f7bf385/ds_betaseries_file/mapflow/_ds_betaseries_file2".\n'
b'210220-05:01:31,712 nipype.workflow INFO:\n'
b'\t [Node] Running "_ds_betaseries_file2" ("nibetaseries.interfaces.bids.DerivativesDataSink")\n'
b'210220-05:01:31,721 nipype.workflow INFO:\n'
b'\t [Node] Finished "_ds_betaseries_file2".\n'
b'210220-05:01:31,723 nipype.workflow INFO:\n'
b'\t [Node] Finished "nibetaseries_participant_wf.single_subject001_wf.ds_betaseries_file".\n'
b'210220-05:01:31,736 nipype.workflow INFO:\n'
b'\t [Node] Finished "_censor_volumes1".\n'
b'210220-05:01:33,625 nipype.workflow INFO:\n'
b'\t [Job 1] Completed (nibetaseries_participant_wf.single_subject001_wf.ds_betaseries_file).\n'
b'210220-05:01:33,626 nipype.workflow INFO:\n'
b'\t [Job 11] Completed (_censor_volumes1).\n'
b'210220-05:01:33,626 nipype.workflow INFO:\n'
b'\t [MultiProc] Running 0 tasks, and 1 jobs ready. Free memory (GB): 3.25/3.25, Free processors: 2/2.\n'
b'210220-05:01:33,674 nipype.workflow INFO:\n'
b'\t [Node] Setting-up "_censor_volumes2" in "/tmp/tmpqq5l7e3o/ds000164/derivatives/work/NiBetaSeries_work/nibetaseries_participant_wf/single_subject001_wf/16f898a9084a9dc798b18592614eedb53f7bf385/censor_volumes/mapflow/_censor_volumes2".\n'
b'210220-05:01:33,676 nipype.workflow INFO:\n'
b'\t [Node] Running "_censor_volumes2" ("nibetaseries.interfaces.nilearn.CensorVolumes")\n'
b'210220-05:01:33,718 nipype.workflow INFO:\n'
b'\t [Node] Finished "_censor_volumes2".\n'
b'210220-05:01:35,627 nipype.workflow INFO:\n'
b'\t [Job 12] Completed (_censor_volumes2).\n'
b'210220-05:01:35,628 nipype.workflow INFO:\n'
b'\t [MultiProc] Running 0 tasks, and 1 jobs ready. Free memory (GB): 3.25/3.25, Free processors: 2/2.\n'
b'210220-05:01:35,676 nipype.workflow INFO:\n'
b'\t [Node] Setting-up "nibetaseries_participant_wf.single_subject001_wf.censor_volumes" in "/tmp/tmpqq5l7e3o/ds000164/derivatives/work/NiBetaSeries_work/nibetaseries_participant_wf/single_subject001_wf/16f898a9084a9dc798b18592614eedb53f7bf385/censor_volumes".\n'
b'210220-05:01:35,679 nipype.workflow INFO:\n'
b'\t [Node] Setting-up "_censor_volumes0" in "/tmp/tmpqq5l7e3o/ds000164/derivatives/work/NiBetaSeries_work/nibetaseries_participant_wf/single_subject001_wf/16f898a9084a9dc798b18592614eedb53f7bf385/censor_volumes/mapflow/_censor_volumes0".\n'
b'210220-05:01:35,680 nipype.workflow INFO:\n'
b'\t [Node] Cached "_censor_volumes0" - collecting precomputed outputs\n'
b'210220-05:01:35,680 nipype.workflow INFO:\n'
b'\t [Node] "_censor_volumes0" found cached.\n'
b'210220-05:01:35,681 nipype.workflow INFO:\n'
b'\t [Node] Setting-up "_censor_volumes1" in "/tmp/tmpqq5l7e3o/ds000164/derivatives/work/NiBetaSeries_work/nibetaseries_participant_wf/single_subject001_wf/16f898a9084a9dc798b18592614eedb53f7bf385/censor_volumes/mapflow/_censor_volumes1".\n'
b'210220-05:01:35,682 nipype.workflow INFO:\n'
b'\t [Node] Cached "_censor_volumes1" - collecting precomputed outputs\n'
b'210220-05:01:35,682 nipype.workflow INFO:\n'
b'\t [Node] "_censor_volumes1" found cached.\n'
b'210220-05:01:35,682 nipype.workflow INFO:\n'
b'\t [Node] Setting-up "_censor_volumes2" in "/tmp/tmpqq5l7e3o/ds000164/derivatives/work/NiBetaSeries_work/nibetaseries_participant_wf/single_subject001_wf/16f898a9084a9dc798b18592614eedb53f7bf385/censor_volumes/mapflow/_censor_volumes2".\n'
b'210220-05:01:35,683 nipype.workflow INFO:\n'
b'\t [Node] Cached "_censor_volumes2" - collecting precomputed outputs\n'
b'210220-05:01:35,683 nipype.workflow INFO:\n'
b'\t [Node] "_censor_volumes2" found cached.\n'
b'210220-05:01:35,684 nipype.workflow INFO:\n'
b'\t [Node] Finished "nibetaseries_participant_wf.single_subject001_wf.censor_volumes".\n'
b'210220-05:01:37,629 nipype.workflow INFO:\n'
b'\t [Job 2] Completed (nibetaseries_participant_wf.single_subject001_wf.censor_volumes).\n'
b'210220-05:01:37,630 nipype.workflow INFO:\n'
b'\t [MultiProc] Running 0 tasks, and 1 jobs ready. Free memory (GB): 3.25/3.25, Free processors: 2/2.\n'
b'210220-05:01:37,679 nipype.workflow INFO:\n'
b'\t [Node] Setting-up "nibetaseries_participant_wf.single_subject001_wf.check_beta_series_list" in "/tmp/tmpqq5l7e3o/ds000164/derivatives/work/NiBetaSeries_work/nibetaseries_participant_wf/single_subject001_wf/16f898a9084a9dc798b18592614eedb53f7bf385/check_beta_series_list".\n'
b'210220-05:01:37,682 nipype.workflow INFO:\n'
b'\t [Node] Running "check_beta_series_list" ("nipype.interfaces.utility.wrappers.Function")\n'
b'210220-05:01:37,687 nipype.workflow INFO:\n'
b'\t [Node] Finished "nibetaseries_participant_wf.single_subject001_wf.check_beta_series_list".\n'
b'210220-05:01:39,631 nipype.workflow INFO:\n'
b'\t [Job 3] Completed (nibetaseries_participant_wf.single_subject001_wf.check_beta_series_list).\n'
b'210220-05:01:39,632 nipype.workflow INFO:\n'
b'\t [MultiProc] Running 0 tasks, and 1 jobs ready. Free memory (GB): 3.25/3.25, Free processors: 2/2.\n'
b'210220-05:01:41,633 nipype.workflow INFO:\n'
b'\t [MultiProc] Running 0 tasks, and 3 jobs ready. Free memory (GB): 3.25/3.25, Free processors: 2/2.\n'
b'210220-05:01:41,685 nipype.workflow INFO:\n'
b'\t [Node] Setting-up "_atlas_corr_node0" in "/tmp/tmpqq5l7e3o/ds000164/derivatives/work/NiBetaSeries_work/nibetaseries_participant_wf/single_subject001_wf/correlation_wf/16f898a9084a9dc798b18592614eedb53f7bf385/atlas_corr_node/mapflow/_atlas_corr_node0".\n'
b'210220-05:01:41,687 nipype.workflow INFO:\n'
b'\t [Node] Setting-up "_atlas_corr_node1" in "/tmp/tmpqq5l7e3o/ds000164/derivatives/work/NiBetaSeries_work/nibetaseries_participant_wf/single_subject001_wf/correlation_wf/16f898a9084a9dc798b18592614eedb53f7bf385/atlas_corr_node/mapflow/_atlas_corr_node1".\n'
b'210220-05:01:41,687 nipype.workflow INFO:\n'
b'\t [Node] Running "_atlas_corr_node0" ("nibetaseries.interfaces.nilearn.AtlasConnectivity")\n'
b'210220-05:01:41,690 nipype.workflow INFO:\n'
b'\t [Node] Running "_atlas_corr_node1" ("nibetaseries.interfaces.nilearn.AtlasConnectivity")\n'
b'210220-05:01:43,636 nipype.workflow INFO:\n'
b'\t [MultiProc] Running 2 tasks, and 1 jobs ready. Free memory (GB): 2.85/3.25, Free processors: 0/2.\n'
b' Currently running:\n'
b' * _atlas_corr_node1\n'
b' * _atlas_corr_node0\n'
b'[NiftiLabelsMasker.fit_transform] loading data from /tmp/tmpqq5l7e3o/ds000164/derivatives/data/Schaefer2018_100Parcels_7Networks_order_FSLMNI152_2mm.nii.gz\n'
b'Resampling labels\n'
b'[NiftiLabelsMasker.transform_single_imgs] Loading data from /tmp/tmpqq5l7e3o/ds000164/derivatives/work/NiBetaSeries_work/nibetaseries_participant_wf/single_subject001_wf/betaseries_wf/16f898a9084a9dc798b18592614eedb53f7bf385/betaseries_node/desc-neutral_betase\n'
b'[NiftiLabelsMasker.transform_single_imgs] Extracting region signals\n'
b'[NiftiLabelsMasker.transform_single_imgs] Cleaning extracted signals\n'
b'210220-05:01:49,514 nipype.workflow INFO:\n'
b'\t [Node] Finished "_atlas_corr_node0".\n'
b'210220-05:01:49,641 nipype.workflow INFO:\n'
b'\t [Job 13] Completed (_atlas_corr_node0).\n'
b'210220-05:01:49,642 nipype.workflow INFO:\n'
b'\t [MultiProc] Running 1 tasks, and 1 jobs ready. Free memory (GB): 3.05/3.25, Free processors: 1/2.\n'
b' Currently running:\n'
b' * _atlas_corr_node1\n'
b'210220-05:01:49,708 nipype.workflow INFO:\n'
b'\t [Node] Setting-up "_atlas_corr_node2" in "/tmp/tmpqq5l7e3o/ds000164/derivatives/work/NiBetaSeries_work/nibetaseries_participant_wf/single_subject001_wf/correlation_wf/16f898a9084a9dc798b18592614eedb53f7bf385/atlas_corr_node/mapflow/_atlas_corr_node2".\n'
b'210220-05:01:49,711 nipype.workflow INFO:\n'
b'\t [Node] Running "_atlas_corr_node2" ("nibetaseries.interfaces.nilearn.AtlasConnectivity")\n'
b'[NiftiLabelsMasker.fit_transform] loading data from /tmp/tmpqq5l7e3o/ds000164/derivatives/data/Schaefer2018_100Parcels_7Networks_order_FSLMNI152_2mm.nii.gz\n'
b'Resampling labels\n'
b'[NiftiLabelsMasker.transform_single_imgs] Loading data from /tmp/tmpqq5l7e3o/ds000164/derivatives/work/NiBetaSeries_work/nibetaseries_participant_wf/single_subject001_wf/betaseries_wf/16f898a9084a9dc798b18592614eedb53f7bf385/betaseries_node/desc-congruent_beta\n'
b'[NiftiLabelsMasker.transform_single_imgs] Extracting region signals\n'
b'[NiftiLabelsMasker.transform_single_imgs] Cleaning extracted signals\n'
b'210220-05:01:50,434 nipype.workflow INFO:\n'
b'\t [Node] Finished "_atlas_corr_node1".\n'
b'210220-05:01:51,643 nipype.workflow INFO:\n'
b'\t [Job 14] Completed (_atlas_corr_node1).\n'
b'210220-05:01:51,645 nipype.workflow INFO:\n'
b'\t [MultiProc] Running 1 tasks, and 0 jobs ready. Free memory (GB): 3.05/3.25, Free processors: 1/2.\n'
b' Currently running:\n'
b' * _atlas_corr_node2\n'
b'[NiftiLabelsMasker.fit_transform] loading data from /tmp/tmpqq5l7e3o/ds000164/derivatives/data/Schaefer2018_100Parcels_7Networks_order_FSLMNI152_2mm.nii.gz\n'
b'Resampling labels\n'
b'[NiftiLabelsMasker.transform_single_imgs] Loading data from /tmp/tmpqq5l7e3o/ds000164/derivatives/work/NiBetaSeries_work/nibetaseries_participant_wf/single_subject001_wf/betaseries_wf/16f898a9084a9dc798b18592614eedb53f7bf385/betaseries_node/desc-incongruent_be\n'
b'[NiftiLabelsMasker.transform_single_imgs] Extracting region signals\n'
b'[NiftiLabelsMasker.transform_single_imgs] Cleaning extracted signals\n'
b'210220-05:01:54,533 nipype.workflow INFO:\n'
b'\t [Node] Finished "_atlas_corr_node2".\n'
b'210220-05:01:55,646 nipype.workflow INFO:\n'
b'\t [Job 15] Completed (_atlas_corr_node2).\n'
b'210220-05:01:55,647 nipype.workflow INFO:\n'
b'\t [MultiProc] Running 0 tasks, and 1 jobs ready. Free memory (GB): 3.25/3.25, Free processors: 2/2.\n'
b'210220-05:01:55,696 nipype.workflow INFO:\n'
b'\t [Node] Setting-up "nibetaseries_participant_wf.single_subject001_wf.correlation_wf.atlas_corr_node" in "/tmp/tmpqq5l7e3o/ds000164/derivatives/work/NiBetaSeries_work/nibetaseries_participant_wf/single_subject001_wf/correlation_wf/16f898a9084a9dc798b18592614eedb53f7bf385/atlas_corr_node".\n'
b'210220-05:01:55,699 nipype.workflow INFO:\n'
b'\t [Node] Setting-up "_atlas_corr_node0" in "/tmp/tmpqq5l7e3o/ds000164/derivatives/work/NiBetaSeries_work/nibetaseries_participant_wf/single_subject001_wf/correlation_wf/16f898a9084a9dc798b18592614eedb53f7bf385/atlas_corr_node/mapflow/_atlas_corr_node0".\n'
b'210220-05:01:55,700 nipype.workflow INFO:\n'
b'\t [Node] Cached "_atlas_corr_node0" - collecting precomputed outputs\n'
b'210220-05:01:55,700 nipype.workflow INFO:\n'
b'\t [Node] "_atlas_corr_node0" found cached.\n'
b'210220-05:01:55,701 nipype.workflow INFO:\n'
b'\t [Node] Setting-up "_atlas_corr_node1" in "/tmp/tmpqq5l7e3o/ds000164/derivatives/work/NiBetaSeries_work/nibetaseries_participant_wf/single_subject001_wf/correlation_wf/16f898a9084a9dc798b18592614eedb53f7bf385/atlas_corr_node/mapflow/_atlas_corr_node1".\n'
b'210220-05:01:55,702 nipype.workflow INFO:\n'
b'\t [Node] Cached "_atlas_corr_node1" - collecting precomputed outputs\n'
b'210220-05:01:55,702 nipype.workflow INFO:\n'
b'\t [Node] "_atlas_corr_node1" found cached.\n'
b'210220-05:01:55,702 nipype.workflow INFO:\n'
b'\t [Node] Setting-up "_atlas_corr_node2" in "/tmp/tmpqq5l7e3o/ds000164/derivatives/work/NiBetaSeries_work/nibetaseries_participant_wf/single_subject001_wf/correlation_wf/16f898a9084a9dc798b18592614eedb53f7bf385/atlas_corr_node/mapflow/_atlas_corr_node2".\n'
b'210220-05:01:55,703 nipype.workflow INFO:\n'
b'\t [Node] Cached "_atlas_corr_node2" - collecting precomputed outputs\n'
b'210220-05:01:55,703 nipype.workflow INFO:\n'
b'\t [Node] "_atlas_corr_node2" found cached.\n'
b'210220-05:01:55,705 nipype.workflow INFO:\n'
b'\t [Node] Finished "nibetaseries_participant_wf.single_subject001_wf.correlation_wf.atlas_corr_node".\n'
b'210220-05:01:57,648 nipype.workflow INFO:\n'
b'\t [Job 4] Completed (nibetaseries_participant_wf.single_subject001_wf.correlation_wf.atlas_corr_node).\n'
b'210220-05:01:57,650 nipype.workflow INFO:\n'
b'\t [MultiProc] Running 0 tasks, and 2 jobs ready. Free memory (GB): 3.25/3.25, Free processors: 2/2.\n'
b'210220-05:01:59,651 nipype.workflow INFO:\n'
b'\t [MultiProc] Running 0 tasks, and 6 jobs ready. Free memory (GB): 3.25/3.25, Free processors: 2/2.\n'
b'210220-05:01:59,698 nipype.workflow INFO:\n'
b'\t [Node] Setting-up "_ds_correlation_fig0" in "/tmp/tmpqq5l7e3o/ds000164/derivatives/work/NiBetaSeries_work/nibetaseries_participant_wf/single_subject001_wf/16f898a9084a9dc798b18592614eedb53f7bf385/ds_correlation_fig/mapflow/_ds_correlation_fig0".\n'
b'210220-05:01:59,700 nipype.workflow INFO:\n'
b'\t [Node] Setting-up "_ds_correlation_fig1" in "/tmp/tmpqq5l7e3o/ds000164/derivatives/work/NiBetaSeries_work/nibetaseries_participant_wf/single_subject001_wf/16f898a9084a9dc798b18592614eedb53f7bf385/ds_correlation_fig/mapflow/_ds_correlation_fig1".\n'
b'210220-05:01:59,700 nipype.workflow INFO:\n'
b'\t [Node] Running "_ds_correlation_fig0" ("nibetaseries.interfaces.bids.DerivativesDataSink")\n'
b'210220-05:01:59,702 nipype.workflow INFO:\n'
b'\t [Node] Running "_ds_correlation_fig1" ("nibetaseries.interfaces.bids.DerivativesDataSink")\n'
b'210220-05:01:59,711 nipype.workflow INFO:\n'
b'\t [Node] Finished "_ds_correlation_fig0".\n'
b'210220-05:01:59,713 nipype.workflow INFO:\n'
b'\t [Node] Finished "_ds_correlation_fig1".\n'
b'210220-05:02:01,652 nipype.workflow INFO:\n'
b'\t [Job 16] Completed (_ds_correlation_fig0).\n'
b'210220-05:02:01,653 nipype.workflow INFO:\n'
b'\t [Job 17] Completed (_ds_correlation_fig1).\n'
b'210220-05:02:01,654 nipype.workflow INFO:\n'
b'\t [MultiProc] Running 0 tasks, and 4 jobs ready. Free memory (GB): 3.25/3.25, Free processors: 2/2.\n'
b'210220-05:02:01,706 nipype.workflow INFO:\n'
b'\t [Node] Setting-up "_ds_correlation_fig2" in "/tmp/tmpqq5l7e3o/ds000164/derivatives/work/NiBetaSeries_work/nibetaseries_participant_wf/single_subject001_wf/16f898a9084a9dc798b18592614eedb53f7bf385/ds_correlation_fig/mapflow/_ds_correlation_fig2".\n'
b'210220-05:02:01,707 nipype.workflow INFO:\n'
b'\t [Node] Setting-up "_ds_correlation_matrix0" in "/tmp/tmpqq5l7e3o/ds000164/derivatives/work/NiBetaSeries_work/nibetaseries_participant_wf/single_subject001_wf/16f898a9084a9dc798b18592614eedb53f7bf385/ds_correlation_matrix/mapflow/_ds_correlation_matrix0".\n'
b'210220-05:02:01,709 nipype.workflow INFO:\n'
b'\t [Node] Running "_ds_correlation_fig2" ("nibetaseries.interfaces.bids.DerivativesDataSink")\n'
b'210220-05:02:01,709 nipype.workflow INFO:\n'
b'\t [Node] Running "_ds_correlation_matrix0" ("nibetaseries.interfaces.bids.DerivativesDataSink")\n'
b'210220-05:02:01,719 nipype.workflow INFO:\n'
b'\t [Node] Finished "_ds_correlation_matrix0".\n'
b'210220-05:02:01,720 nipype.workflow INFO:\n'
b'\t [Node] Finished "_ds_correlation_fig2".\n'
b'210220-05:02:03,654 nipype.workflow INFO:\n'
b'\t [Job 18] Completed (_ds_correlation_fig2).\n'
b'210220-05:02:03,655 nipype.workflow INFO:\n'
b'\t [Job 19] Completed (_ds_correlation_matrix0).\n'
b'210220-05:02:03,656 nipype.workflow INFO:\n'
b'\t [MultiProc] Running 0 tasks, and 3 jobs ready. Free memory (GB): 3.25/3.25, Free processors: 2/2.\n'
b'210220-05:02:03,708 nipype.workflow INFO:\n'
b'\t [Node] Setting-up "nibetaseries_participant_wf.single_subject001_wf.ds_correlation_fig" in "/tmp/tmpqq5l7e3o/ds000164/derivatives/work/NiBetaSeries_work/nibetaseries_participant_wf/single_subject001_wf/16f898a9084a9dc798b18592614eedb53f7bf385/ds_correlation_fig".\n'
b'210220-05:02:03,709 nipype.workflow INFO:\n'
b'\t [Node] Setting-up "_ds_correlation_matrix1" in "/tmp/tmpqq5l7e3o/ds000164/derivatives/work/NiBetaSeries_work/nibetaseries_participant_wf/single_subject001_wf/16f898a9084a9dc798b18592614eedb53f7bf385/ds_correlation_matrix/mapflow/_ds_correlation_matrix1".\n'
b'210220-05:02:03,712 nipype.workflow INFO:\n'
b'\t [Node] Running "_ds_correlation_matrix1" ("nibetaseries.interfaces.bids.DerivativesDataSink")\n'
b'210220-05:02:03,712 nipype.workflow INFO:\n'
b'\t [Node] Setting-up "_ds_correlation_fig0" in "/tmp/tmpqq5l7e3o/ds000164/derivatives/work/NiBetaSeries_work/nibetaseries_participant_wf/single_subject001_wf/16f898a9084a9dc798b18592614eedb53f7bf385/ds_correlation_fig/mapflow/_ds_correlation_fig0".\n'
b'210220-05:02:03,715 nipype.workflow INFO:\n'
b'\t [Node] Running "_ds_correlation_fig0" ("nibetaseries.interfaces.bids.DerivativesDataSink")\n'
b'210220-05:02:03,722 nipype.workflow INFO:\n'
b'\t [Node] Finished "_ds_correlation_matrix1".\n'
b'210220-05:02:03,724 nipype.workflow INFO:\n'
b'\t [Node] Finished "_ds_correlation_fig0".\n'
b'210220-05:02:03,725 nipype.workflow INFO:\n'
b'\t [Node] Setting-up "_ds_correlation_fig1" in "/tmp/tmpqq5l7e3o/ds000164/derivatives/work/NiBetaSeries_work/nibetaseries_participant_wf/single_subject001_wf/16f898a9084a9dc798b18592614eedb53f7bf385/ds_correlation_fig/mapflow/_ds_correlation_fig1".\n'
b'210220-05:02:03,727 nipype.workflow INFO:\n'
b'\t [Node] Running "_ds_correlation_fig1" ("nibetaseries.interfaces.bids.DerivativesDataSink")\n'
b'210220-05:02:03,734 nipype.workflow INFO:\n'
b'\t [Node] Finished "_ds_correlation_fig1".\n'
b'210220-05:02:03,734 nipype.workflow INFO:\n'
b'\t [Node] Setting-up "_ds_correlation_fig2" in "/tmp/tmpqq5l7e3o/ds000164/derivatives/work/NiBetaSeries_work/nibetaseries_participant_wf/single_subject001_wf/16f898a9084a9dc798b18592614eedb53f7bf385/ds_correlation_fig/mapflow/_ds_correlation_fig2".\n'
b'210220-05:02:03,736 nipype.workflow INFO:\n'
b'\t [Node] Running "_ds_correlation_fig2" ("nibetaseries.interfaces.bids.DerivativesDataSink")\n'
b'210220-05:02:03,742 nipype.workflow INFO:\n'
b'\t [Node] Finished "_ds_correlation_fig2".\n'
b'210220-05:02:03,744 nipype.workflow INFO:\n'
b'\t [Node] Finished "nibetaseries_participant_wf.single_subject001_wf.ds_correlation_fig".\n'
b'210220-05:02:05,656 nipype.workflow INFO:\n'
b'\t [Job 5] Completed (nibetaseries_participant_wf.single_subject001_wf.ds_correlation_fig).\n'
b'210220-05:02:05,657 nipype.workflow INFO:\n'
b'\t [Job 20] Completed (_ds_correlation_matrix1).\n'
b'210220-05:02:05,658 nipype.workflow INFO:\n'
b'\t [MultiProc] Running 0 tasks, and 1 jobs ready. Free memory (GB): 3.25/3.25, Free processors: 2/2.\n'
b'210220-05:02:05,706 nipype.workflow INFO:\n'
b'\t [Node] Setting-up "_ds_correlation_matrix2" in "/tmp/tmpqq5l7e3o/ds000164/derivatives/work/NiBetaSeries_work/nibetaseries_participant_wf/single_subject001_wf/16f898a9084a9dc798b18592614eedb53f7bf385/ds_correlation_matrix/mapflow/_ds_correlation_matrix2".\n'
b'210220-05:02:05,708 nipype.workflow INFO:\n'
b'\t [Node] Running "_ds_correlation_matrix2" ("nibetaseries.interfaces.bids.DerivativesDataSink")\n'
b'210220-05:02:05,714 nipype.workflow INFO:\n'
b'\t [Node] Finished "_ds_correlation_matrix2".\n'
b'210220-05:02:07,658 nipype.workflow INFO:\n'
b'\t [Job 21] Completed (_ds_correlation_matrix2).\n'
b'210220-05:02:07,659 nipype.workflow INFO:\n'
b'\t [MultiProc] Running 0 tasks, and 1 jobs ready. Free memory (GB): 3.25/3.25, Free processors: 2/2.\n'
b'210220-05:02:07,709 nipype.workflow INFO:\n'
b'\t [Node] Setting-up "nibetaseries_participant_wf.single_subject001_wf.ds_correlation_matrix" in "/tmp/tmpqq5l7e3o/ds000164/derivatives/work/NiBetaSeries_work/nibetaseries_participant_wf/single_subject001_wf/16f898a9084a9dc798b18592614eedb53f7bf385/ds_correlation_matrix".\n'
b'210220-05:02:07,712 nipype.workflow INFO:\n'
b'\t [Node] Setting-up "_ds_correlation_matrix0" in "/tmp/tmpqq5l7e3o/ds000164/derivatives/work/NiBetaSeries_work/nibetaseries_participant_wf/single_subject001_wf/16f898a9084a9dc798b18592614eedb53f7bf385/ds_correlation_matrix/mapflow/_ds_correlation_matrix0".\n'
b'210220-05:02:07,713 nipype.workflow INFO:\n'
b'\t [Node] Running "_ds_correlation_matrix0" ("nibetaseries.interfaces.bids.DerivativesDataSink")\n'
b'210220-05:02:07,719 nipype.workflow INFO:\n'
b'\t [Node] Finished "_ds_correlation_matrix0".\n'
b'210220-05:02:07,720 nipype.workflow INFO:\n'
b'\t [Node] Setting-up "_ds_correlation_matrix1" in "/tmp/tmpqq5l7e3o/ds000164/derivatives/work/NiBetaSeries_work/nibetaseries_participant_wf/single_subject001_wf/16f898a9084a9dc798b18592614eedb53f7bf385/ds_correlation_matrix/mapflow/_ds_correlation_matrix1".\n'
b'210220-05:02:07,721 nipype.workflow INFO:\n'
b'\t [Node] Running "_ds_correlation_matrix1" ("nibetaseries.interfaces.bids.DerivativesDataSink")\n'
b'210220-05:02:07,727 nipype.workflow INFO:\n'
b'\t [Node] Finished "_ds_correlation_matrix1".\n'
b'210220-05:02:07,728 nipype.workflow INFO:\n'
b'\t [Node] Setting-up "_ds_correlation_matrix2" in "/tmp/tmpqq5l7e3o/ds000164/derivatives/work/NiBetaSeries_work/nibetaseries_participant_wf/single_subject001_wf/16f898a9084a9dc798b18592614eedb53f7bf385/ds_correlation_matrix/mapflow/_ds_correlation_matrix2".\n'
b'210220-05:02:07,729 nipype.workflow INFO:\n'
b'\t [Node] Running "_ds_correlation_matrix2" ("nibetaseries.interfaces.bids.DerivativesDataSink")\n'
b'210220-05:02:07,735 nipype.workflow INFO:\n'
b'\t [Node] Finished "_ds_correlation_matrix2".\n'
b'210220-05:02:07,736 nipype.workflow INFO:\n'
b'\t [Node] Finished "nibetaseries_participant_wf.single_subject001_wf.ds_correlation_matrix".\n'
b'210220-05:02:09,661 nipype.workflow INFO:\n'
b'\t [Job 6] Completed (nibetaseries_participant_wf.single_subject001_wf.ds_correlation_matrix).\n'
b'210220-05:02:09,662 nipype.workflow INFO:\n'
b'\t [MultiProc] Running 0 tasks, and 0 jobs ready. Free memory (GB): 3.25/3.25, Free processors: 2/2.\n'
b'/home/docs/checkouts/readthedocs.org/user_builds/nibetaseries/envs/latest/lib/python3.7/site-packages/sklearn/externals/joblib/__init__.py:15: FutureWarning: sklearn.externals.joblib is deprecated in 0.21 and will be removed in 0.23. Please import this functionality directly from joblib, which can be installed with: pip install joblib. If this warning is raised when loading pickled models, you may need to re-serialize those models with scikit-learn 0.21+.\n'
b' warnings.warn(msg, category=FutureWarning)\n'
b'Computing run 1 out of 1 runs (go take a coffee, a big one)\n'
b'\n'
b'Computation of 1 runs done in 2 seconds\n'
b'\n'
b"/home/docs/checkouts/readthedocs.org/user_builds/nibetaseries/envs/latest/lib/python3.7/site-packages/nistats/regression.py:339: FutureWarning: 'resid' from RegressionResults has been deprecated and will be removed. Please use 'residuals' instead.\n"
b' FutureWarning,\n'
b"/home/docs/checkouts/readthedocs.org/user_builds/nibetaseries/envs/latest/lib/python3.7/site-packages/bids/layout/models.py:152: FutureWarning: The 'extension' entity currently excludes the leading dot ('.'). As of version 0.14.0, it will include the leading dot. To suppress this warning and include the leading dot, use `bids.config.set_option('extension_initial_dot', True)`.\n"
b' FutureWarning)\n'
b"/home/docs/checkouts/readthedocs.org/user_builds/nibetaseries/envs/latest/lib/python3.7/site-packages/bids/layout/models.py:152: FutureWarning: The 'extension' entity currently excludes the leading dot ('.'). As of version 0.14.0, it will include the leading dot. To suppress this warning and include the leading dot, use `bids.config.set_option('extension_initial_dot', True)`.\n"
b' FutureWarning)\n'
b"/home/docs/checkouts/readthedocs.org/user_builds/nibetaseries/envs/latest/lib/python3.7/site-packages/bids/layout/models.py:152: FutureWarning: The 'extension' entity currently excludes the leading dot ('.'). As of version 0.14.0, it will include the leading dot. To suppress this warning and include the leading dot, use `bids.config.set_option('extension_initial_dot', True)`.\n"
b' FutureWarning)\n'
b"/home/docs/checkouts/readthedocs.org/user_builds/nibetaseries/envs/latest/lib/python3.7/site-packages/bids/layout/models.py:152: FutureWarning: The 'extension' entity currently excludes the leading dot ('.'). As of version 0.14.0, it will include the leading dot. To suppress this warning and include the leading dot, use `bids.config.set_option('extension_initial_dot', True)`.\n"
b' FutureWarning)\n'
b'pandoc: Error running filter pandoc-citeproc:\n'
b"Could not find executable 'pandoc-citeproc'.\n"
b'Could not generate CITATION.html file:\n'
b'pandoc -s --bibliography /home/docs/checkouts/readthedocs.org/user_builds/nibetaseries/envs/latest/lib/python3.7/site-packages/nibetaseries/data/references.bib --filter pandoc-citeproc --metadata pagetitle="NiBetaSeries citation boilerplate" /tmp/tmpqq5l7e3o/ds000164/derivatives/nibetaseries/logs/CITATION.md -o /tmp/tmpqq5l7e3o/ds000164/derivatives/nibetaseries/logs/CITATION.html\n'
Observe generated outputs¶
list_files(data_dir)
Out:
tmpqq5l7e3o/
ds000164/
dataset_description.json
CHANGES
README
task-stroop_events.json
T1w.json
task-stroop_bold.json
sub-001/
anat/
sub-001_T1w.nii.gz
func/
sub-001_task-stroop_events.tsv
sub-001_task-stroop_bold.nii.gz
derivatives/
data/
Schaefer2018_100Parcels_7Networks_order.txt
Schaefer2018_100Parcels_7Networks_order_FSLMNI152_2mm.nii.gz
Schaefer2018_100Parcels_7Networks_order.tsv
fmriprep/
dataset_description.json
sub-001/
func/
sub-001_task-stroop_desc-confounds_regressors.tsv
sub-001_task-stroop_space-MNI152NLin2009cAsym_desc-brain_mask.nii.gz
sub-001_task-stroop_space-MNI152NLin2009cAsym_desc-preproc_bold.nii.gz
nibetaseries/
logs/
CITATION.tex
CITATION.md
CITATION.bib
sub-001/
func/
sub-001_task-stroop_space-MNI152NLin2009cAsym_desc-congruent_correlation.svg
sub-001_task-stroop_space-MNI152NLin2009cAsym_desc-neutral_betaseries.nii.gz
sub-001_task-stroop_space-MNI152NLin2009cAsym_desc-congruent_correlation.tsv
sub-001_task-stroop_space-MNI152NLin2009cAsym_desc-neutral_correlation.tsv
sub-001_task-stroop_space-MNI152NLin2009cAsym_desc-incongruent_correlation.svg
sub-001_task-stroop_space-MNI152NLin2009cAsym_desc-incongruent_correlation.tsv
sub-001_task-stroop_space-MNI152NLin2009cAsym_desc-neutral_correlation.svg
sub-001_task-stroop_space-MNI152NLin2009cAsym_desc-congruent_betaseries.nii.gz
sub-001_task-stroop_space-MNI152NLin2009cAsym_desc-incongruent_betaseries.nii.gz
work/
dbcache/
layout_index.sqlite
fMRIPrep/
layout_index.sqlite
NiBetaSeries_work/
nibetaseries_participant_wf/
graph1.json
d3.js
graph.json
index.html
single_subject001_wf/
correlation_wf/
16f898a9084a9dc798b18592614eedb53f7bf385/
atlas_corr_node/
_inputs.pklz
_0x65e6ce73d724e8e9f7aac8bc82135c00.json
_node.pklz
result_atlas_corr_node.pklz
mapflow/
_atlas_corr_node0/
_0xbda46c2411a35c89b02bac6058af5f2f.json
desc-neutral_correlation.tsv
result__atlas_corr_node0.pklz
_inputs.pklz
desc-neutral_correlation.svg
_node.pklz
_report/
report.rst
_atlas_corr_node2/
_0x10b6f8a4011af0a4f2bdd46dd1a9bd36.json
_inputs.pklz
result__atlas_corr_node2.pklz
desc-incongruent_correlation.svg
desc-incongruent_correlation.tsv
_node.pklz
_report/
report.rst
_atlas_corr_node1/
_0xf99f351778713893eaa8606db8b09912.json
desc-congruent_correlation.svg
result__atlas_corr_node1.pklz
_inputs.pklz
desc-congruent_correlation.tsv
_node.pklz
_report/
report.rst
_report/
report.rst
betaseries_wf/
16f898a9084a9dc798b18592614eedb53f7bf385/
betaseries_node/
desc-congruent_betaseries_censored.nii.gz
desc-neutral_betaseries.nii.gz
_0xc563f80fe899553234a898f46007b4e9.json
desc-incongruent_betaseries.nii.gz
desc-residuals_bold.nii.gz
desc-congruent_betaseries.nii.gz
_inputs.pklz
desc-neutral_betaseries_censored.nii.gz
result_betaseries_node.pklz
_node.pklz
desc-incongruent_betaseries_censored.nii.gz
_report/
report.rst
16f898a9084a9dc798b18592614eedb53f7bf385/
ds_betaseries_file/
result_ds_betaseries_file.pklz
_inputs.pklz
_0x2273329634c26d4e28e52d9d94eb32d3.json
_node.pklz
mapflow/
_ds_betaseries_file1/
_inputs.pklz
_0x6fc2c1cad61083be43280fccc2ad9de3.json
result__ds_betaseries_file1.pklz
_node.pklz
_report/
report.rst
_ds_betaseries_file0/
_0xb97a6e40690b610d9afa0eac43873e48.json
result__ds_betaseries_file0.pklz
_inputs.pklz
_node.pklz
_report/
report.rst
_ds_betaseries_file2/
result__ds_betaseries_file2.pklz
_inputs.pklz
_0x1fa26e86c210cf980e46b4f390ae72a5.json
_node.pklz
_report/
report.rst
_report/
report.rst
ds_correlation_fig/
result_ds_correlation_fig.pklz
_inputs.pklz
_0x286014e2393997821b4e196451b56f45.json
_node.pklz
mapflow/
_ds_correlation_fig0/
result__ds_correlation_fig0.pklz
_inputs.pklz
_0x392c391bc6a4fed3c6b0611ec383d830.json
_node.pklz
_report/
report.rst
_ds_correlation_fig1/
result__ds_correlation_fig1.pklz
_inputs.pklz
_0x76b0088ba1a26045d513a393e89bc302.json
_node.pklz
_report/
report.rst
_ds_correlation_fig2/
result__ds_correlation_fig2.pklz
_0x527f8884e4f6246a61097cb24aa98515.json
_inputs.pklz
_node.pklz
_report/
report.rst
_report/
report.rst
check_beta_series_list/
result_check_beta_series_list.pklz
_inputs.pklz
_0x02091a58fd4ea9a305438bb285853157.json
_node.pklz
_report/
report.rst
ds_correlation_matrix/
result_ds_correlation_matrix.pklz
_inputs.pklz
_0xd882f2bd6fdd0b32f5213e902c8e1995.json
_node.pklz
mapflow/
_ds_correlation_matrix2/
result__ds_correlation_matrix2.pklz
_inputs.pklz
_0x9d545f6a20ff8434707e376e8cd273ec.json
_node.pklz
_report/
report.rst
_ds_correlation_matrix1/
_0x1afcf28c68b441f3fb9e768dfb2ac376.json
_inputs.pklz
result__ds_correlation_matrix1.pklz
_node.pklz
_report/
report.rst
_ds_correlation_matrix0/
_inputs.pklz
result__ds_correlation_matrix0.pklz
_0x0f195710d93f5360af3bd291c3f529e2.json
_node.pklz
_report/
report.rst
_report/
report.rst
censor_volumes/
result_censor_volumes.pklz
_0x695b75becef51b40cba8010982ca5bfc.json
_inputs.pklz
_node.pklz
mapflow/
_censor_volumes0/
_0x3b388a157077678487ce6f4c44148d9f.json
result__censor_volumes0.pklz
_inputs.pklz
_node.pklz
_report/
report.rst
_censor_volumes1/
result__censor_volumes1.pklz
_inputs.pklz
_0xb3db7912ccdabe82c78280e22fdd9459.json
_node.pklz
_report/
report.rst
_censor_volumes2/
_0x38723e828ba98468060773dd4fddf59d.json
_inputs.pklz
result__censor_volumes2.pklz
_node.pklz
_report/
report.rst
_report/
report.rst
Collect correlation results¶
output_path = os.path.join(out_dir, "nibetaseries", "sub-001", "func")
trial_types = ['congruent', 'incongruent', 'neutral']
filename_template = ('sub-001_task-stroop_space-MNI152NLin2009cAsym_'
'desc-{trial_type}_{suffix}.{ext}')
pd_dict = {}
for trial_type in trial_types:
fname = filename_template.format(trial_type=trial_type, suffix='correlation', ext='tsv')
file_path = os.path.join(output_path, fname)
pd_dict[trial_type] = pd.read_csv(file_path, sep='\t', na_values="n/a", index_col=0)
# display example matrix
print(pd_dict[trial_type].head())
Out:
LH_Vis_1 LH_Vis_2 ... RH_Default_PCC_1 RH_Default_PCC_2
LH_Vis_1 NaN 0.218330 ... -0.230491 0.029901
LH_Vis_2 0.218330 NaN ... -0.272462 0.051350
LH_Vis_3 -0.194092 0.447437 ... 0.088024 0.083169
LH_Vis_4 0.122895 0.525723 ... -0.185403 0.188181
LH_Vis_5 0.283664 0.533833 ... -0.393412 -0.288453
[5 rows x 100 columns]
Graph the correlation results¶
fig, axes = plt.subplots(nrows=3, ncols=1, sharex=True, sharey=True, figsize=(10, 30),
gridspec_kw={'wspace': 0.025, 'hspace': 0.075})
cbar_ax = fig.add_axes([.91, .3, .03, .4])
r = 0
for trial_type, df in pd_dict.items():
g = sns.heatmap(df, ax=axes[r], vmin=-.5, vmax=1., square=True,
cbar=True, cbar_ax=cbar_ax)
axes[r].set_title(trial_type)
# iterate over rows
r += 1
plt.tight_layout()
Out:
/home/docs/checkouts/readthedocs.org/user_builds/nibetaseries/checkouts/latest/examples/plot_run_nibetaseries.py:246: UserWarning: This figure includes Axes that are not compatible with tight_layout, so results might be incorrect.
plt.tight_layout()
Collect beta map results¶
nii_dict = {}
for trial_type in trial_types:
fname = filename_template.format(trial_type=trial_type, suffix='betaseries', ext='nii.gz')
file_path = os.path.join(output_path, fname)
nii_dict[trial_type] = nib.load(file_path)
# view incongruent beta_maps
nib.viewers.OrthoSlicer3D(nii_dict['incongruent'].get_fdata(),
title="Incongruent Betas").set_position(10, 13, 10)
Graph beta map standard deviation¶
We can find where the betas have the highest standard deviation for each trial type. Unsuprisingly, the largest deviations are near the edge of the brain mask and the subcortical regions.
# standard deviations for each trial type
std_dict = {tt: nib.Nifti1Image(img.get_fdata().std(axis=-1), img.affine, img.header)
for tt, img in nii_dict.items()}
fig, axes = plt.subplots(nrows=3, ncols=1, figsize=(10, 20))
for idx, (trial_type, nii) in enumerate(std_dict.items()):
plotting.plot_stat_map(nii, title=trial_type, cut_coords=(0, 0, 0),
threshold=5, vmax=20, axes=axes[idx])
References¶
- notebook-1
Timothy D Verstynen. The organization and dynamics of corticostriatal pathways link the medial orbitofrontal cortex to future behavioral responses. Journal of Neurophysiology, 112(10):2457–2469, 2014. URL: https://doi.org/10.1152/jn.00221.2014, doi:10.1152/jn.00221.2014.
Total running time of the script: ( 1 minutes 4.901 seconds)