This file contains hidden or 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
bundle | |
prefix foaf <http://xmlns.com/foaf/0.1/> | |
prefix nipype <http://nipy.org/nipype/terms/0.6> | |
prefix dcterms <http://purl.org/dc/terms/> | |
activity(nipype:d21d596e2e0b11e2a1c714109fcf6ae7, 2012-11-14T03:31:39.567795, 2012-11-14T03:31:47.918502, [nipype:command="bet struct.nii /software/temp/nipype-tutorial/temp/provenance/struct_brain.nii.gz", prov:label="BET", prov:type='nipype:BET', nipype:working_directory="/software/temp/nipype-tutorial/temp/provenance", nipype:command_path="/usr/local/fsl/bin/bet", nipype:return_code=0, nipype:platform="Darwin-12.2.0-x86_64-i386-64bit", nipype:dependencies="/usr/local/fsl/bin/bet: is not an object file", nipype:duration="0.0" %% xsd:float, foaf:host="warpspeed.local"]) | |
collection(nipype:d21e243a2e0b11e2914a14109fcf6ae7, [prov:type='nipype:environment']) | |
used(nipype:d21d596e2e0b11e2a1c714109fcf6ae7, nipype:d21e243a2e0b11e2914a14109fcf6ae7, -) | |
entity(nipype:d21e2aeb2e0b11e2884f14109fcf6ae7, [prov:type='nipype:environment', nipype:ANTSPATH="/software/ANTSb |
This file contains hidden or 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
name of display: :0.0 | |
display: :0 screen: 0 | |
direct rendering: Yes | |
server glx vendor string: Chromium | |
server glx version string: 1.3 Chromium | |
server glx extensions: | |
GLX_ARB_multisample, GLX_EXT_texture_from_pixmap, GLX_SGIX_fbconfig, | |
GLX_ARB_get_proc_address | |
client glx vendor string: Chromium | |
client glx version string: 1.3 Chromium |
This file contains hidden or 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 isMoco(dcmfile): | |
"""Determine if a dicom file is a mocoseries | |
""" | |
import subprocess | |
cmd = ['mri_probedicom', '--i', dcmfile, '--t', '8', '103e'] | |
proc = subprocess.Popen(cmd, | |
stdout=subprocess.PIPE, | |
stderr=subprocess.PIPE) | |
stdout, stderr = proc.communicate() | |
return stdout.strip().startswith('MoCoSeries') |
This file contains hidden or 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 nipype.interfaces.fsl import BET | |
res = BET(in_file='struct.nii').run() | |
import nipype.external.prov as prov | |
import nipype.external.provgraph as pg | |
g = prov.json.load(open('provenance.json'), cls=prov.ProvBundle.JSONDecoder) | |
dot = pg.prov_to_dot(g) | |
dot.set_dpi(120) | |
dot.write_png('test.png') |
This file contains hidden or 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 nipype import logging, config | |
config.set('logging', 'workflow_level', 'DEBUG') | |
logging.update_logging(config) | |
from nipype.pipeline.engine import Node, Workflow | |
from nipype.interfaces.utility import Function | |
def createtwofiles(): |
This file contains hidden or 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
#DOES NOT WORK: GIFTI READ/WRITE is broken | |
import nibabel as nb | |
import nibabel.gifti as gifti | |
# load combined file | |
# created with: mris_convert --combinesurfs lh.pial rh.pial ./pial.gii | |
surf = gifti.read('pial.gii') | |
#load orig affine transform | |
ao = nb.load('orig.nii').get_affine() |
This file contains hidden or 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 enthought.mayavi import mlab | |
import streamlines | |
import numpy as np | |
from nibabel import load | |
from colorsys import rgb_to_hsv | |
# filename = "DeterministicTractography/QBALLRecon/hardiO10.trk" | |
trkfilename = "/software/data/STUT/DTI_TV/PWS04/dtk_35/dti_35.trk" #%hardiO10.trk_cross_streamline_id_20.trk" | |
bfilename = "/software/data/STUT/DTI_TV/PWS04/dt_recon/lowb.nii" |
This file contains hidden or 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
>> disp('Eig');tic;data=rand(500,500);eig(data);toc; | |
disp('Svd');tic;data=rand(1000,1000);[u,s,v]=svd(data);s=svd(data);toc; | |
disp('Inv');tic;data=rand(1000,1000);result=inv(data);toc; | |
disp('Det');tic;data=rand(1000,1000);result=det(data);toc; | |
disp('Dot');tic;a=rand(1000,1000);b=inv(a);result=a*b-eye(1000);toc; | |
disp('Done'); | |
Eig | |
Elapsed time is 0.840714 seconds. | |
Svd | |
Elapsed time is 1.931674 seconds. |
This file contains hidden or 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 nipype.utils.logger import logging, logger, fmlogger, iflogger | |
logger.setLevel(logging.getLevelName('CRITICAL')) | |
fmlogger.setLevel(logging.getLevelName('CRITICAL')) | |
iflogger.setLevel(logging.getLevelName('CRITICAL')) |
This file contains hidden or 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
In [1]: | |
cd /software/temp/nipype-tutorial/temp/ | |
/software/temp/nipype-tutorial/temp | |
In [2]: | |
ls INBET | |
s1struct.nii s3struct.nii | |
In [3]: |