Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
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
def save_diffusion_vec(dcm_files, out_bvecs, out_bvals): | |
bvals = [] | |
bvecs = [] | |
for dcm_file in dcm_files: | |
dcm_dat = dicom.read_file(dcm_file) | |
csa = nibabel.nicom.csareader.get_csa_header(dcm_dat) | |
bval = nibabel.nicom.csareader.get_b_value(csa) | |
bvec = nibabel.nicom.csareader.get_g_vector(csa) | |
bvals.append(bval) | |
bvecs.append(bvec) |
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
orange:nipype_test filo$ ./test.py | |
orange:nipype_test filo$ ls -al /tmp/was_run | |
-rw-r--r-- 1 filo wheel 0 Nov 19 12:21 /tmp/was_run | |
orange:nipype_test filo$ rm -rf /tmp/was_run | |
orange:nipype_test filo$ python simple_interface.py | |
gzip test.txt | |
orange:nipype_test filo$ ls -al /tmp/was_run | |
ls: /tmp/was_run: No such file or directory |
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
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
import numpy as np | |
import dicom, nibabel.nicom.csareader | |
def save_diffusion_vec(dcm_files, out_bvecs, out_bvals): | |
bvals = [] | |
bvecs = [] | |
for dcm_file in dcm_files: | |
dcm_dat = dicom.read_file(dcm_file) | |
csa = nibabel.nicom.csareader.get_csa_header(dcm_dat) | |
bval = nibabel.nicom.csareader.get_b_value(csa) |
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
source_folder = "/Volumes/Samsung_T1/bids_examples/symlinked" | |
target_folder = "/Volumes/Samsung_T1/bids_examples/empty" | |
import shutil, os | |
from glob import glob | |
try: | |
shutil.rmtree(target_folder) | |
except: | |
pass |
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
#pip install git+https://github.com/NeuroVault/pyneurovault | |
from pyneurovault import api | |
import numpy as np | |
all_collections = api.get_collections() | |
collections_with_dois = all_collections[np.logical_not(all_collections.DOI.isnull())] | |
images = api.get_images(collection_pks=list(collections_with_dois.collection_id)) | |
# Remove images that are thresholded |
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
#!/usr/bin/python | |
import os, shutil, errno | |
import nipype | |
from nipype.interfaces import fsl, ants, c3 | |
from nipype.caching import Memory | |
from nipype.interfaces.utility import IdentityInterface, Merge | |
#set up variables | |
datadir = "/scratch/users/macshine/data/nki/0102157" |
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
axis = 2 | |
new_shape = list(x.shape) | |
del new_shape[axis] | |
a1, a2 = np.indices(new_shape) | |
inds = [a1, a2] | |
inds.insert(axis, x.argmax(axis=axis)) | |
x[inds[0], inds[1], inds[2]] |
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
{% extends "base.html" %} | |
{% load crispy_forms_tags %} | |
{% load coffeescript %} | |
{% block head %} | |
<script src="{% static "scripts/clone-form.js"%}" type="text/javascript"></script> | |
:javascript | |
request_method = '{{request.method}}' | |
{% inlinecoffeescript %} | |
active_form = 0 |