Skip to content

Instantly share code, notes, and snippets.

@rwblair
rwblair / gist:6e0871b454ad0e73a1e4b11ee3e59208
Last active April 20, 2023 19:24
deno_bids_examples_errors
issue key filename schema path
┌───────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────┐
│ eeg_rest_fmri │
└───────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────┘
DWI_MISSING_BVEC sub-36_acq-NODDI10DIR_dwi.nii.gz schema.rules.checks.dwi.DWIMissingBvec
DWI_MISSING_BVAL sub-36_acq-NODDI10DIR_dwi.nii.gz schema.rules.checks.dwi.DWIMissingBval
@rwblair
rwblair / gist:77f68a2d1dec63567b5e92400fc3fd80
Created April 15, 2022 18:47
oneliner used to generate common derivatives datatypes run from inside datatypes dir.
grep -oP "^\w*:" *.yaml | sed -r 's/^(.*).yaml:(.*):/\1_\2_common:\n \$ref: schema.rules.datatypes.\1.\2\n entities:\n \$ref: schema.rules.datatypes.\1.\2.entities\n space: OPTIONAL\n desc: OPTIONAL\n/' > common_derivatives.yaml
---
root:
filename:
entities:
- any
extensions:
- '/'
children:
_use:
- ./top_level_files.yaml
@rwblair
rwblair / example_ds002837_versions.txt
Last active May 13, 2021 17:33
$ aws s3api --no-sign-request list-object-versions --bucket=openneuro.org --prefix ds002837/derivatives/sub-9/func/sub-9_task-500daysofsummer_bold_preprocessedICA.nii.gz
{
"Versions": [
{
"ETag": "\"0d6a47221c91f039c105b28fbde7da27-2\"",
"Size": 1854105076,
"StorageClass": "STANDARD",
"Key": "ds002837/derivatives/sub-9/func/sub-9_task-500daysofsummer_bold_preprocessedICA.nii.gz",
"VersionId": "NlyjwYWAx9z36mkHMPHII6A6J3TqGIp2",
"IsLatest": true,
"LastModified": "2021-04-20T23:34:42.000Z"
@rwblair
rwblair / age_by_ds.txt
Created April 28, 2020 17:04
for file in $(find . -maxdepth 2 -name participants.tsv -exec grep -lP "\tage" {} \;); do echo $file && csvcut -t -c age $file | sort | uniq; done > age_by_ds.txt
./ds001544/participants.tsv
0
age
./ds000001/participants.tsv
19
20
21
22
24
26
@rwblair
rwblair / sex_by_ds.txt
Created April 28, 2020 16:17
for file in $(find . -maxdepth 2 -name participants.tsv -exec grep -lP "\tsex" {} \;); do echo $file && csvcut -t -c sex $file | sort | uniq; done > sex_by_ds.txt
./ds001544/participants.tsv
m
sex
./ds000001/participants.tsv
F
M
"M,"
sex
./ds000244/participants.tsv
F
@rwblair
rwblair / gist:3ecc156aad2840758e656a14844e6984
Last active March 31, 2020 15:28
Nested objects for pet schema.
{
"type": "object",
"properties": {
"info": {
"type": "object"
"properties": {
"Modality": {"type": "string"}
},
"plasma": {
"type": "object"
{
"name": "ds000001 AFNI model",
"input": {"task": "balloonanalogrisktask"},
"blocks": [
{
"level": "subject",
"transformations": [
{
"name": "polynomial_expansion",
"order": 2
~/projects/s3-test $ aws s3api list-object-versions --bucket 907245365968-test | grep VersionId
"VersionId": "7gJ1tHgIOA7DHI4zMCF2WGIKwWheVson",
"VersionId": "396V1OKMHM0QBnRBSoL8Rh5EdhVoYg63",
~/projects/s3-test $ curl https://s3.amazonaws.com/907245365968-test/a.txt?versionId=7gJ1tHgIOA7DHI4zMCF2WGIKwWheVson
<?xml version="1.0" encoding="UTF-8"?>
<Error><Code>AccessDenied</Code><Message>Access Denied</Message><RequestId>A5D078F3B89ED356</RequestId><HostId>wG6NFU3MLIq6XwNM53fmvCjyZZY+LeSWz1zj3fQrKFAT9uNgATnFWEtOzaoteZwn4HuX+8bV0uY=</HostId></Error>
~/projects/s3-test $ aws s3api put-object-acl --bucket 907245365968-test --key a.txt --acl public-read --version-id 7gJ1tHgIOA7DHI4zMCF2WGIKwWheVson
{
"blocks" : [
{
"transformations" : [
{
"input" : [
"CSF"
],
"name" : "scale",
"rescale" : true,