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 | |
# | |
# Simeon Wong | |
if [ -d $1 ] | |
then | |
# make destination directory | |
mkdir $2 | |
SRCBASE=$(basename $1 .ds) |
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 | |
# Usage dicom_to_nifti_anonymize [source dir] [dest dir] [participant ID] | |
if [[ $# -lt 2 ]]; then | |
DEST=$1 | |
else | |
# make the directory if it doesn't exist | |
if [ ! -d $2 ]; then | |
mkdir $2 | |
fi |
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
%% transforms | |
% transform into fsl coordinates (CT) | |
fslpos = elec.elecpos; | |
fslpos(:,4) = 1; | |
fslpos = (img_ct.transform \ fslpos')'; | |
if img_ct.hdr.x_r == 1 | |
fslpos(:,1) = img_ct.dim(1) - fslpos(:,1); | |
end |
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 python3 | |
# -*- coding: utf-8 -*- | |
""" | |
Created on Thu Dec 5 11:40:07 2019 | |
@author: simeonwong | |
""" | |
import pyedflib | |
import os.path |
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 | |
PLANID=12345678 | |
JWTTOKEN={{TOKEN}} | |
for DAY in {1..365} | |
do | |
curl 'https://plans.youversionapi.com/4.0/together/$PLANID/activities?day=$DAY&page=1&order=desc&talk_it_over=0' \ | |
-H 'authority: plans.youversionapi.com' \ | |
-H 'x-youversion-app-version: 4' \ |
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 | |
from collections import deque | |
import datetime | |
iters = 2000 | |
values = np.random.rand(10000) | |
def nproll(): |
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 -x | |
# fixQpdf.sh [zip file] [output folder] | |
BASEDIR=$HOME | |
TEMPDIR=$(uuidgen) | |
mkdir $BASEDIR/$TEMPDIR | |
mkdir $BASEDIR/$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
def list_mutator(inner_list): | |
inner_list.append(4) | |
def list_setter(inner_list): | |
inner_list = inner_list + [4] | |
def list_returner(inner_list): | |
inner_list = inner_list + [4] | |
return inner_list |
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 | |
cat - << EOF > /etc/apt/sources.d/bionic.list | |
deb http://ca.archive.ubuntu.com/ubuntu/ bionic main | |
deb http://ca.archive.ubuntu.com/ubuntu/ bionic universe | |
EOF | |
apt update | |
apt install -y g++-6 | |
apt install -y libgfortran3 |
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
''' quick and dirty script to glob a directory of dicom files and extract the header information into a csv file ''' | |
import pydicom | |
import glob | |
import pandas as pd | |
from tqdm import tqdm | |
import numpy as np | |
########################### | |
# Parameters |
OlderNewer