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
echo "usage: png2pdfslides.sh FOLDER_WITH_PNG CROP_WIDTH by CROP_HEIGHT CROP_OFFSETX CROP_OFFSETX" | |
echo "output: merged.pdf in FOLDER_WITH_PNG" | |
echo " " | |
# This script converts PNG screenshots into a compiled PDF using file name ordering (presumably corresponding to timestamp if consecutive screenshots) | |
# 1) Goes into folder $MAINF | |
# 2) Crops an $WIDTH by $HEIGHT region for each PNG starting with a $OFFSETX pixels offset from the left and a OFFSETY pixels offset from the top | |
# 3) Converts each croped PNG to JPEG2000 for lossless PDF embedding | |
# 4) Converts each JPEG2000 to PDF | |
# 5) Merges all the PDFs together into one merged.pdf |
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
# Crossing tissues sensitivity estimation | |
import numpy as np | |
# D1, D2, D3, the tissues diffusivities | |
# assumes D1 >= D2=D3 | |
# comment and uncomment as needed | |
# um^2 / ms | |
MD = 0.14 |
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/env python | |
# -*- coding: utf-8 -*- | |
import numpy as np | |
import nibabel as nib | |
import argparse | |
DESCRIPTION = """ | |
Compute mean b-value from voxelwise btable (output of compute_spatial_btable.py). |
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/env python | |
# -*- coding: utf-8 -*- | |
# first draft of script to compute voxelwise bvec and bval after GNL | |
# work on the output of calc_grad_perc_dev | |
# calc_grad_perc_dev works on the fullwarp output of gradunwrap.py | |
import numpy as np | |
import nibabel as nib | |
import argparse |
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 BeautifulSoup as bs | |
import requests | |
import pylab as pl | |
def countPubmed(searchterm, minyear, maxyear): | |
quer = '%20'.join(searchterm.split(' ')) | |
N_res = [] | |
y = [] | |
for year in range(minyear, maxyear+1): |
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/env python | |
import numpy as np | |
import nibabel as nib | |
import sys | |
def main(input, output, dx, dy, dz): | |
img = nib.load(input) | |
data = img.get_data() | |
downsampling_factor = np.array([int(dx), int(dy), int(dz)]) | |
print('Input image is size {} {} {}'.format(data.shape[0], data.shape[1], data.shape[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
from scipy.io import loadmat | |
import numpy as np | |
import sys | |
if __name__ == "__main__": | |
print('input_ants_rigid_transform input_bvecs output_bvec') | |
# Loading Ants transform | |
trans = loadmat(sys.argv[1]) | |
matrice = trans['AffineTransform_double_3_3'][:9].reshape((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
import argparse | |
import numpy as np | |
import nibabel as nib | |
import sklearn.cluster as clu | |
DESCRIPTION = """ |
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 argparse | |
import numpy as np | |
import nibabel as nib | |
from scipy.spatial.distance import pdist, squareform | |
DESCRIPTION = """ |
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 sys | |
import numpy as np | |
import nibabel as nib | |
import tractconverter as tc | |
from dipy.tracking.streamlinespeed import length, set_number_of_points | |
from dipy.tracking.vox2track import track_counts |
NewerOlder