Open Remi-Gau opened 3 years ago
Response to issues documented in #2
Expected input is actually not a BIDS dataset
The code was adjusted so that it expects preprocessed bold input data conform to the BIDS specifications (https://github.com/BIDS-Apps/rsHRF/commit/a31fae6dbf40b6730e85582b9888a5275c10b123)
bold
and not preproc
. --brainmask
argument expects brainmask files with the suffix mask
instead of brainmask
Generation of dataset_description.json file
The rsHRF with --bids_dir
now generates a dataset_description.json file as suggested (https://github.com/BIDS-Apps/rsHRF/commit/16cfeb789cdd037c5a5177b9929df6fda9239f86).
In addition there are now several checks implemented for the dataset_description.json
file (https://github.com/BIDS-Apps/rsHRF/commit/735b5fcaa13c357d6b9429360b379aad4a3a6f3e):
dataset_description.json
file in the bids_directoryDatasetType
is defined in dataset_description.json
fileDatasetType
is of the derivative
typeFilter BIDS-data for input into rsHRF toolbox
Based on the suggestion to allow users the freedom of giving any task
label for BIDS input, we added an additional argument to the toolbox named --bids_filter_file
(https://github.com/BIDS-Apps/rsHRF/commit/5f2863176e2f725ada9155680c2288e423df66ee).
This gives users more flexibility to filter the BIDS-data inputted in the rsHRF BIDS-app.
This arguments expects a filepath
to a .JSON
file that describes a custom BIDS filter for selecting input with PyBIDS, with the syntax {<query>: {<entity>: <filter>, ...}, .... }
Queries can be defined for bold
and/or mask
in the .JSON
file which allows the user to filter the BIDS-data to its individual needs.
For example :
{
'bold': {
'datatype': 'func',
'task' : 'restingstate',
'desc': 'preproc',
'surffix': 'bold',
'extension': 'nii.gz'
},
'mask': {
'datatype': 'func',
'task': 'restingstate',
'desc': 'brain',
'suffix': 'mask',
'extension': 'nii.gz'
}
}
These queries will filter the bold
and mask
data according to the defined entities
.
The mask
query will only have an effect when the --brainmask
argument is defined.
rsHRF-BIDS app uses the following queries, by default :
'bold' : {'datatype':' func', 'suffix': 'bold', 'extension': 'nii.gz', 'desc': 'preproc', 'task': 'rest'}
'mask' : {'datatype': 'func', 'suffix': 'mask', 'extension': 'nii.gz', 'desc': 'brain', 'task': 'rest'}
Only modification of these queries will have any effect. You may filter on any entity defined in the PyBIDS config file and derivatives file
This means that the BIDS-App by default checks for bold
or mask
data that has the following entities :
bold : sub-<label>/func/sub<label>-task_rest-desc_preproc_bold.nii.gz
mask : sub-<label>/func/sub<label>-task_rest-desc_brain_mask.nii.gz
Changing of these default entities and/or filtering by non-default entities (e.g. 'space'), can be done by defining the queries of bold
and/ or mask
defined in a .JSON
file using the -bids_filter_file
.
Expected is actually not a BIDS dataset
Documented in this issue: https://github.com/Remi-Gau/bids-app_rsHRF/issues/2
The following does not work does work because the package expects files ending with a
preproc.nii
and not*preproc_bold.nii
This gives the following error
I suspect the error is due to the fact that the BIDS app actually expect data that does in fact NOT conform to the BIDS specifications.
BIDS files have the general format:
sub-<label>_entity1-<label>_entity2-<label>[...]_suffix.ext
The general form for BIDS derivatives data is described here: https://bids-specification.readthedocs.io/en/stable/05-derivatives/02-common-data-types.html#preprocessed-or-cleaned-data
Which means that preprocessed bold data should have the suffix
bold
and not thepreproc
one that rsHRF expects. Something like this:Another issue is that
rsHRF
expects the task label to berest
. This is indeed the "suggested" label by the BIDs specification and makes for a good default but resting state dataset can technically have any task label.Those should be fixed to make the app work on most valid derivatives BIDS datasets. I suspect it would also be preferable to have the following as defaults:
docker run
command.Bot issues could be tested on the ds002790 dataset from open neuro that should be accessible from openeuro with datalad.
Additonally when processing a BIDS data set, it would be preferable to generate a
dataset_description.json
that helps track the provenance of the of the input.See here for more details: https://bids-specification.readthedocs.io/en/stable/03-modality-agnostic-files.html#derived-dataset-and-pipeline-description
Finally, one little extra: it could be nice when dealing with BIDS dataset to make sure that the input data is a derivatives dataset (this information should be included in the
DatasetType
of thedataset_description.json
of a dataset): the reason for this is to prevent users from running rsHRF on data that has not been minimally preprocessed (i.e realigned).