Skip to content

Instantly share code, notes, and snippets.

View JasperVanDenBosch's full-sized avatar

Jasper J.F. van den Bosch JasperVanDenBosch

View GitHub Profile
@JasperVanDenBosch
JasperVanDenBosch / captions.py
Created November 30, 2023 16:08
Add caption to image
"""Add a text label to an image
Uses Pillow, install with `pip install pillow`
"""
from os.path import expanduser, join, basename
from glob import glob
from PIL import Image, ImageDraw, ImageFont
## full path to your image directory, ~ = your home directory
img_dir = expanduser('~/stimuli/nsd/special100')
@JasperVanDenBosch
JasperVanDenBosch / discover_openneuro_fmriprep.py
Created June 20, 2022 18:53
Find openneuro datasets that have fmriprep results
"""Find openneuro datasets that have an fmriprep derivative
This is a fairly brute-force method. Takes about one hour, and 8GB of HD space.
requirements:
datalad
pandas
requests
"""
@JasperVanDenBosch
JasperVanDenBosch / ssp log
Created December 8, 2014 20:44
SSP log after mnefun PR with specific EOG channel
Applying baseline correction ... (mode: mean)
Applying baseline correction ... (mode: mean)
5 bad epochs dropped
Loading and filtering 1 files.
Opening raw data file /diskArray/data/clj/zc/sss_fif/zc_clj_01_raw_sss.fif...
Current compensation grade : 0
Range : 26000 ... 941999 = 26.000 ... 941.999 secs
Ready.
Reading 0 ... 915999 = 0.000 ... 915.999 secs...
@JasperVanDenBosch
JasperVanDenBosch / gist:10302181
Created April 9, 2014 18:47
output_of_python-v.txt
# installing zipimport hook
import zipimport # builtin
# installed zipimport hook
# /usr/lib/python2.7/site.pyc matches /usr/lib/python2.7/site.py
import site # precompiled from /usr/lib/python2.7/site.pyc
# /usr/lib/python2.7/os.pyc matches /usr/lib/python2.7/os.py
import os # precompiled from /usr/lib/python2.7/os.pyc
import errno # builtin
import posix # builtin
# /usr/lib/python2.7/posixpath.pyc matches /usr/lib/python2.7/posixpath.py
@JasperVanDenBosch
JasperVanDenBosch / pip-freeze.txt
Created April 9, 2014 18:38
attachments for matplotlib issue #2963 Segmentation Fault on adding BBoxImage to matshow
Brlapi==0.5.6
GnuPGInterface==0.3.2
Mako==0.5.0
MarkupSafe==0.15
PAM==0.4.2
PIL==1.1.7
Twisted-Core==11.1.0
Twisted-Names==11.1.0
Twisted-Web==11.1.0
adium-theme-ubuntu==0.3.2
@JasperVanDenBosch
JasperVanDenBosch / version.py
Created May 1, 2012 13:02 — forked from dcreager/version.py
Extract a setuptools version from the git repository: adapted for PEP 386
# -*- coding: utf-8 -*-
# Author: Douglas Creager <[email protected]>
# This file is placed into the public domain.
# Calculates the current version number. If possible, this is the
# output of “git describe”, modified to conform to the versioning
# scheme that setuptools uses. If “git describe” returns an error
# (most likely because we're in an unpacked copy of a release tarball,
# rather than in a git working copy), then we fall back on reading the
# contents of the RELEASE-VERSION file.
# fabric extension to enable handling expected prompts
#
# Read more at http://ilogue.com/jasper/blog/fexpect--dealing-with-prompts-in-fabric-with-pexpect/
#
# This file Copyright (c) Jasper van den Bosch, ilogue, [email protected]
# Pexpect Copyright (c) 2012 Noah Spurrier ,see: http://www.noah.org/wiki/pexpect#License
from fabric.state import env
import fabric.api