This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import glob, hashlib, csv | |
# replace with file location | |
path = r'/mnt/chromeos/MyFiles/Downloads/CSVs/' | |
files = glob.glob(path + r"/*.csv") | |
output = r"\output.csv" | |
# this is where we'll store the values | |
hits = [] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
""" | |
Gist made by Kshitij Chawla (Github name: kchawla-pi) for the Nilearn library in Feb/March 2019. | |
GPLv3 | |
""" | |
def replace_parameters(replacement_params, | |
end_version='future', | |
lib_name='Nilearn', | |
): | |
""" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import os | |
from tempfile import NamedTemporaryFile | |
import pandas as pd | |
from nose.tools import assert_true | |
from nistats import datasets | |
def test_make_events_file_localizer_first_level(): |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
def _download_spm_auditory_data(data_dir, subject_dir, subject_id): | |
print("Data absent, downloading...") | |
url = ("http://www.fil.ion.ucl.ac.uk/spm/download/data/MoAEpilot/" | |
"MoAEpilot.zip") | |
archive_path = os.path.join(subject_dir, os.path.basename(url)) | |
_fetch_file(url, subject_dir) | |
try: | |
_uncompress_file(archive_path) | |
except: |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
def fetch_spm_auditory(data_dir=None, data_name='spm_auditory', | |
subject_id="sub001", verbose=1): | |
"""Function to fetch SPM auditory single-subject data. | |
Parameters | |
---------- | |
data_dir: string | |
Path of the data directory. Used to force data storage in a specified | |
location. If the data is already present there, then will simply | |
glob it. | |
Returns |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import nilearn | |
import os | |
import pandas | |
from nistats.second_level_model import SecondLevelModel | |
# 4D images paths | |
img1 = nilearn.image.load_img(os.path.expanduser('~/nilearn_data/adhd/data/0010128/0010128_rest_tshift_RPI_voreg_mni.nii.gz')) | |
img2 = nilearn.image.load_img(os.path.expanduser('~/nilearn_data/adhd/data/2497695/2497695_rest_tshift_RPI_voreg_mni.nii.gz')) | |
# Single 4D image |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
""" | |
From | |
nilearn/examples/02_decoding/plot_haxby_searchlight.py | |
Erring code section is after Line # 75. | |
""" | |
""" | |
Searchlight analysis of face vs house recognition | |
================================================== | |
Searchlight analysis requires fitting a classifier a large amount of |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# -*- encoding: utf-8 -*- | |
# !/usr/bin/env python3 | |
""" | |
Accepts the path to a text file and extracts the words from it, without repetition, | |
and writs them to a text file 'unique_words_list.txt' in the samedirectory/folder. | |
""" | |
from pathlib import Path | |
def extract_words(filepath): |
NewerOlder