Skip to content

Instantly share code, notes, and snippets.

View dtxe's full-sized avatar

Simeon Wong dtxe

View GitHub Profile
%% 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
#!/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
@dtxe
dtxe / linkDs.sh
Created May 30, 2017 17:23
Symlink CTF *.ds, with renaming
#!/bin/bash
#
# Simeon Wong
if [ -d $1 ]
then
# make destination directory
mkdir $2
SRCBASE=$(basename $1 .ds)