Skip to content

Instantly share code, notes, and snippets.

View ted-strauss-K1's full-sized avatar

Ted Strauss ted-strauss-K1

View GitHub Profile
@ted-strauss-K1
ted-strauss-K1 / move.sh
Created February 12, 2020 15:15
sort dicom slices into folders
#!/bin/bash
set -eu
find pTIF0002_20200129_161954623/ -type f | while read f; do
p=$(dcmdump "$f" | awk '/ProtocolName/{print $3;}' | sed -e 's,\],,g' -e 's,\[,,g')
n=$(dcmdump "$f" | awk '/SeriesNumber/{print $3;}' | sed -e 's,\],,g' -e 's,\[,,g')
d="$n-$p"
# rails generate bulkrax:install
/usr/lib/ruby/vendor_ruby/rubygems/defaults/operating_system.rb:10: warning: constant Gem::ConfigMap is deprecated
/usr/lib/ruby/vendor_ruby/rubygems/defaults/operating_system.rb:10: warning: constant Gem::ConfigMap is deprecated
/usr/lib/ruby/vendor_ruby/rubygems/defaults/operating_system.rb:29: warning: constant Gem::ConfigMap is deprecated
/usr/lib/ruby/vendor_ruby/rubygems/defaults/operating_system.rb:30: warning: constant Gem::ConfigMap is deprecated
/usr/lib/ruby/vendor_ruby/rubygems/defaults/operating_system.rb:10: warning: constant Gem::ConfigMap is deprecated
NOTE: Gem::Specification#rubyforge_project= is deprecated with no replacement. It will be removed on or after 2019-12-01.
Gem::Specification#rubyforge_project= called from /var/lib/gems/2.4.0/specifications/i18n-0.9.5.gemspec:17.
NOTE: Gem::Specification#rubyforge_project= is deprecated with no replacement. It will be removed on or after 2019-12-01.
Gem::Specification#rubyforge_project= called from /usr/share/rub
{"anon-subject":{"approved":false,"value":"003"},"bids-acquisition":{"approved":false,"value":null},"bids-contrast-enhancement":{"approved":false,"value":null},"bids-direction":{"approved":false,"value":null},"bids-echo":{"approved":false,"value":null},"bids-reconstruction-algorithm":{"approved":false,"value":null},"bids-session":{"approved":false,"value":null},"bids-task":{"approved":false,"value":null},"comment":{"approved":false,"value":""},"dataset-id":"bd8037c4-895b-11e9-81af-00163eacdccb","dataset-refcommit":"7668d85eb1e025389c604a42c9f361568859ce47","location":"dicoms","procedures":[{"on-anonymize":{"approved":false,"value":false},"procedure-call":{"approved":false,"value":null},"procedure-name":{"approved":false,"value":"hirni-dicom-converter"}}],"subject":{"approved":false,"value":"190524134213DST1312211075243167017"},"type":"dicomseries:all"}
{"anon-subject":{"approved":false,"value":"003"},"bids-acquisition":{"approved":false,"value":null},"bids-contrast-enhancement":{"approved":false,"value":null}
datalad rev-create hirni-bids
cd hirni-bids
datalad run-procedure setup_hirni_dataset
## import dicom recently tarred off the dicom server
datalad hirni-import-dcm -d . ../PD00020_05122018.tar.gz acq001
## confirm the subdataset has been created
datalad subdatasets
cd acq001/dicom
# check whether extractor is active on dataset
git config -f .datalad/config -l
{"anon-subject":{"approved":false,"value":"001"},"bids-acquisition":{"approved":false,"value":null},"bids-contrast-enhancement":{"approved":false,"value":null},"bids-direction":{"approved":false,"value":null},"bids-echo":{"approved":false,"value":null},"bids-reconstruction-algorithm":{"approved":false,"value":null},"bids-session":{"approved":false,"value":null},"bids-task":{"approved":false,"value":null},"comment":{"approved":false,"value":""},"dataset-id":"cfa497ae-6b71-11e9-81af-00163eacdccb","dataset-refcommit":"e7d800699ad73a00067c5be9d9b229e59aa95516","location":"dicoms","procedures":[{"on-anonymize":{"approved":false,"value":false},"procedure-call":{"approved":false,"value":null},"procedure-name":{"approved":false,"value":"hirni-dicom-converter"}}],"subject":{"approved":false,"value":"181205141932STD1312211075243167017"},"type":"dicomseries:all"}
{"title": "ABCDEFGHV1002E","name": "abcdefghv1002e","notes": "testing test","tag_string": "","license_id": "","owner_org": "neurospeed-lab","url": "","version": "1","author": "Ted Strauss","author_email": "ted.strauss@mcgill.ca","maintainer": "Ted Strauss","maintainer_email": "ted.strauss@mcgill.ca","InstitutionName":"McConnell Brain Imaging Centre, McGill University","InstitutionAddress":"3801 University St.,Montreal,QC,Canada","Manufacturer":"CTF","ManufacturersModelName":"CTF-275: OMEGA 2000","SoftwareVersions":"Acq 5.4.2-linux-20070507","TaskName":"rest","SamplingFrequency":2400,"PowerLineFrequency":60,"MEGChannelCount":270,"MEGREFChannelCount":26,"EEGChannelCount":0,"EOGChannelCount":2,"ECGChannelCount":1,"EMGChannelCount":0,"MiscChannelCount":0,"TriggerChannelCount":0,"DewarPosition":"Upright","SoftwareFilters":{"SpatialCompensation":{"GradientOrder":"3rd"}},"RecordingDuration":600,"RecordingType":"continuous","EpochLength":0,"ContinuousHeadLocalization":false,"DigitizedLandmarks":false,"DigitizedHeadPo
@ted-strauss-K1
ted-strauss-K1 / bids_meg.json
Created February 8, 2018 15:53
CKAN schema describing BIDS MEG format
{
"scheming_version": 1,
"dataset_type": "bids_meg",
"about": "A dataset in the Open MEG Archive",
"about_url": "https://www.mcgill.ca/bic/resources/omega",
"dataset_fields":
[
{
"field_name": "title",
"label": "Title",
@ted-strauss-K1
ted-strauss-K1 / x-y-z-01.csv
Created April 28, 2017 17:04
Sample x,y,z data file for use in data viz demo.
x y z
0.689484 -0.014459 0.428751
0.476483 0.162624 0.449488
0.58677 0.102149 0.769481
1.068768 0.678668 1.023915
1.43806 0.683633 0.752397
1.483567 0.140479 1.389489
1.163844 0.125522 1.098527
1.491083 0.31764 0.760376
1.970356 0.389628 0.631279
<img src="https://dl.dropboxusercontent.com/u/12539240/MCIN/logo.png" width="280px"/>
#Manual of Operations
[TOC]
##Introduction
The objective of this manual is to provide detailed information about the protocols used in recruitment, screening, and testing of subjects and their families for CCNA.
1) install drupal & apache
wget http://ftp.drupal.org/files/projects/drupal-7.12.tar.gz
tar zxvf drupal-7.12.tar.gz
sudo apt-get install apache2 php5-pgsql php5-gd libapache2-mod-php5 php-apc
sudo mkdir /var/www/drupal
sudo mv drupal-7.12/* drupal-7.12/.htaccess /var/www/drupal
sudo cp /var/www/drupal/sites/default/default.settings.php /var/www/drupal/sites/default/settings.php
sudo chown www-data:www-data /var/www/drupal/sites/default/settings.php
sudo mkdir /var/www/drupal/sites/default/files