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
# -*- 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. |
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 mayavi import mlab | |
from tvtk.api import tvtk | |
import numpy as np | |
surfname = os.path.join( model_path, 'fixed.csf.vtk' ) | |
reader =tvtk.PolyDataReader( file_name=surfname ) | |
mesh = reader.get_output() | |
reader.update() |
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
# 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] |
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
#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) |
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
# 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 |
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
# 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 |
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
// -------------------------------------------------------------------------------------- | |
// 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) |
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
#!/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 |
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
""" | |
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 |
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
#! /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 | |
# |
OlderNewer