from EPD install:
As the last step, you should edit your .bashrc or prepend the EPD install path: /software/python/EPD/7.0/bin Thank you for installing EPD!
$ export PATH=/software/python/EPD/7.0/bin:$PATH
import os | |
import numpy as np | |
from nipype.interfaces.spm import * | |
import nipype.interfaces.matlab as mlab # how to run matlab | |
mlab.MatlabCommand.set_default_matlab_cmd("matlab -nodesktop -nosplash") | |
mlab.MatlabCommand.set_default_paths('/software/spm8') |
#! /usr/bin/env python | |
import argparse | |
from nipype.utils.filemanip import loadcrash | |
def display_crash_files(crashfile, rerun): | |
"display crash file content and rerun if required" | |
crash_data = loadcrash(crashfile) | |
node = crash_data['node'] |
import os | |
from nipype.interfaces.base import (CommandLine, CommandLineInputSpec, | |
TraitedSpec, File, | |
InputMultiPath, traits) | |
from nipype.utils.misc import isdefined | |
from nipype.utils.filemanip import fname_presuffix | |
class ITKNaryMaximumImageFilterInputSpec(CommandLineInputSpec): | |
tcl_script = File(exists=True, argstr = '-b %s', position = 1, |
l2BGflow = pe.Workflow(name='l2BGflow') | |
# setup a between group 2-sample t-test node | |
twosamplettestdes = pe.Node(interface=spm.TwoSampleTTestDesign(), name="twosampttestdes") | |
twosamplettestdes.inputs.explicit_mask_file = os.path.abspath('/software/spm8/apriori/brainmask.nii') | |
l2BGestimate = pe.Node(interface=spm.EstimateModel(), name="twosampleestimate") | |
l2BGestimate.inputs.estimation_method = {'Classical' : 1} | |
l2BGconestimate = pe.Node(interface = spm.EstimateContrast(), name="twosampleconestimate") | |
con_1 = ('Controls','T', ['Group_{1}'],[1]) | |
con_2 = ('Patients','T', ['Group_{2}'],[1]) | |
con_3 = ('Controls>Patients','T',['Group_{1}','Group_{2}'],[1,-1]) |
""" | |
Preprocess the Haxby data with SPM+FSL: normalize to MNI | |
""" | |
import os | |
import urllib | |
import tarfile | |
import gzip | |
import glob | |
import shutil |
from EPD install:
As the last step, you should edit your .bashrc or prepend the EPD install path: /software/python/EPD/7.0/bin Thank you for installing EPD!
$ export PATH=/software/python/EPD/7.0/bin:$PATH
Please note that this gist applies to EPD version 7.0 and 7.1. EPD 7.1 includes ETS | |
but not completely on OSX x64. Furthermore a patch has been submitted for inclusion | |
in virtualenv that should resolve the virtualenv issue. | |
The notes below were compiled for 7.0 and will need to be replaced with corresponding | |
7.1 paths. | |
https://github.com/satra/virtualenv/tree/fix/EPDpatch |
"""Example script that executes via SGE qsub | |
""" | |
import nipype.pipeline.engine as pe | |
import nipype.interfaces.matlab as mlab | |
import nipype.interfaces.spm as spm | |
import os | |
mlab.MatlabCommand.set_default_matlab_cmd("matlab -nodesktop -nosplash") | |
mlab.MatlabCommand.set_default_paths('/software/spm8') |
In [19]: class A(HasTraits): | |
foo = Int | |
def __init__(self, **kwargs): | |
super(A, self).__init__(**kwargs) | |
self.on_trait_change(self.raiseerror, 'foo') | |
def raiseerror(self, obj, name, old, new): | |
raise Exception('testing exception') | |
....: | |
....: |
class Stream(object): | |
"""Function to capture stdout and stderr streams with timestamps | |
http://stackoverflow.com/questions/4984549/merge-and-sync-stdout-and-stderr/5188359#5188359 | |
""" | |
def __init__(self, name, impl): | |
self._name = name | |
self._impl = impl | |
self._buf = '' |