Skip to content

Instantly share code, notes, and snippets.

View oesteban's full-sized avatar
🦄

Oscar Esteban oesteban

🦄
View GitHub Profile
@oesteban
oesteban / createjson.py
Last active August 8, 2016 19:12
an API-created gist
#!/opt/conda/bin/python
"""
Convert files to json objects uploadable to GitHub gists using:
curl -v -H "Authorization: token <insert token here>" -X POST https://api.github.com/gists --data @<filename.json>
"""
import sys
import json
@oesteban
oesteban / nose3.log
Created August 8, 2016 19:00
an API-created gist
This file has been truncated, but you can view the full file.
nose.config: INFO: Ignoring files matching ['^\\.', '^_', '^setup\\.py$']
nose.plugins.cover: INFO: Coverage report will include only packages: ['nipype']
nose.selector: INFO: /root/src/nipype/nipype/interfaces/tests/use_resources is executable; skipped
/root/src/nipype/nipype/workflows/dmri/mrtrix/group_connectivity.py:15: UserWarning: cmp not installed
warnings.warn('cmp not installed')
Doctest: nipype.algorithms.mesh ... ok
Doctest: nipype.algorithms.metrics ... ok
Doctest: nipype.algorithms.metrics.ErrorMap ... ok
Doctest: nipype.algorithms.metrics.FuzzyOverlap ... ok
Doctest: nipype.algorithms.metrics.Overlap ... ok
@oesteban
oesteban / autossh init.d
Created July 26, 2016 17:10 — forked from atr000/autossh init.d
launches and maintains uniquely named autossh tunnels alive
#! /bin/sh
#
# Author: Andreas Olsson <[email protected]>
# Version: @(#)autossh_tunnel.foo 0.1 27-Aug-2008 [email protected]
#
# For each tunnel; make a uniquely named copy of this template.
## SETTINGS
#
@oesteban
oesteban / remove_output.py
Created June 6, 2016 18:51 — forked from damianavila/remove_output.py
Remove output from IPython notebook from the command line (dev version 1.0)
"""
Usage: python remove_output.py notebook.ipynb [ > without_output.ipynb ]
Modified from remove_output by Minrk
"""
import sys
import io
import os
from IPython.nbformat.current import read, write
#!/bin/bash
# A universal helper to enable NeuroDebian repository for a travis
# environment.
#
# Its purpose to remove all repetative actions from various .travis.yml spread
# across projects and gain control in the future to point to an alternative,
# more appropriate for travis deployments, mirror.
# for the protocol
@oesteban
oesteban / slice_contours.cpp
Last active August 29, 2015 14:10
A sliced 3D volume writer, with contours
// --------------------------------------------------------------------------------------
// File: slice_contours.cxx
// Date: Nov 18, 2014
// Author: [email protected] (Oscar Esteban)
// Version: 1.0 beta
// License: GPLv3 - 29 June 2007
// Short Summary:
// --------------------------------------------------------------------------------------
//
// Copyright (c) 2014, [email protected] (Oscar Esteban)
@oesteban
oesteban / myecc.sch
Created September 5, 2014 09:11
A FLIRT schedule for eddy correction
# 4mm scale
setscale 4
setoption smoothing 6
setoption paramsubset 1 0 0 0 0 0 0 1 1 1 1 1 1
clear U
clear UA
clear UB
clear US
clear UP
# try the identity transform as a starting point at this resolution
@oesteban
oesteban / myhmc.sch
Last active August 29, 2015 14:06
A FLIRT schedule file for head-motion correction
# 4mm scale
setscale 4
setoption smoothing 6
clear U
clear UA
clear UB
clear US
clear UP
# try the identity transform as a starting point at this resolution
clear UQ
#http://stackoverflow.com/questions/15880367/python-uniform-distribution-of-points-on-4-dimensional-sphere
dim = 3
norm = np.random.normal
normal_deviates = norm(size=(dim, N))
radius = np.sqrt((normal_deviates**2).sum(axis=0))
points = normal_deviates/radius
points = points.reshape(-1,3)
@oesteban
oesteban / SurfaceTransforms.py
Created September 10, 2013 19:40
Old code for transforming surfaces from freesurfer
# http://surfer.nmr.mgh.harvard.edu/fswiki/FreeSurferTrackVisTransforms
tkr1_tfm = fsbt.mri_info( op.join( tpms_dir, 'wm_volume_fraction.nii.gz' ), 'vox2ras-tkr' )
r2v_tfm = fsbt.mri_info( op.join( tpms_dir, 'wm_volume_fraction.nii.gz' ), 'ras2vox' )
tkr2_tfm = fsbt.mri_info( op.join( tpms_dir, 'wm_volume_fraction.nii.gz' ), 'ras2vox-tkr' )
v2r_tfm = fsbt.mri_info( op.join( tpms_dir, 'wm_volume_fraction.nii.gz' ), 'vox2ras' )
tfm = np.dot( tkr2_tfm, v2r_tfm )
M = tfm[0:3,0:3]
O = tfm[0:3,3]