Remi-Gau / bids-app_rsHRF

Resting state HRF estimation from BOLD-fMRI signal
http://bids-apps.neuroimaging.io/rsHRF/
MIT License
1 stars 0 forks source link

Single file output name #4

Open Remi-Gau opened 3 years ago

Remi-Gau commented 3 years ago

Single file output name

Documented in this issue: https://github.com/Remi-Gau/bids-app_rsHRF/issues/4

After running the following:

subject=blnd01

input_dir=/home/remi/gin/olfaction_blind/derivatives/fmriprep/sub-$subject/func

input_file=`ls $input_dir/sub-blnd01_task-rest*2009*preproc_bold*nii.gz`
mask=`ls $input_dir/sub-blnd01_task-rest*2009*mask*nii.gz`

echo $input_file
echo $mask

output_dir=/home/remi/gin/olfaction_blind/derivatives/rshrf

rsHRF --input_file $input_file \
    --atlas $mask \
    --estimation canon2dd \
    --output_dir $output_dir

I get these files

sub-blnd01_task-rest_run-01_space-MNI152NLin2009cAsym_desc-preproc_bold_deconv.nii.gz
sub-blnd01_task-rest_run-01_space-MNI152NLin2009cAsym_desc-preproc_bold_event_number.nii.nii.gz
sub-blnd01_task-rest_run-01_space-MNI152NLin2009cAsym_desc-preproc_bold_FWHM.nii.gz
sub-blnd01_task-rest_run-01_space-MNI152NLin2009cAsym_desc-preproc_bold_Height.nii.gz
sub-blnd01_task-rest_run-01_space-MNI152NLin2009cAsym_desc-preproc_bold_hrf.mat
sub-blnd01_task-rest_run-01_space-MNI152NLin2009cAsym_desc-preproc_bold_plot_1.png
sub-blnd01_task-rest_run-01_space-MNI152NLin2009cAsym_desc-preproc_bold_plot_2.png
sub-blnd01_task-rest_run-01_space-MNI152NLin2009cAsym_desc-preproc_bold_Time2peak.nii.gz

Wrong extension

The extension of this file seems wrong

sub-blnd01_task-rest_run-01_space-MNI152NLin2009cAsym_desc-preproc_bold_event_number.nii.nii.gz

Non BIDS name

Although not required, when the input is from a BIDS dataset, it would be preferable if the output also conformed to the generic BIDS filename format (see below) when inputs file ARE BIDS valid filenames: the reason for this is that it simplify the creation of pipelines when filenames follow a given pattern.

# generic BIDS filename format
sub-<label>([_entity-<label>])*_suffix.ext

Maybe something like this could do.

sub-blnd01_task-rest_run-01_space-MNI152NLin2009cAsym_desc-preproc_deconv.nii.gz
sub-blnd01_task-rest_run-01_space-MNI152NLin2009cAsym_desc-preproc_eventnumber.nii.gz
sub-blnd01_task-rest_run-01_space-MNI152NLin2009cAsym_desc-preproc_FWHM.nii.gz
sub-blnd01_task-rest_run-01_space-MNI152NLin2009cAsym_desc-preproc_height.nii.gz
sub-blnd01_task-rest_run-01_space-MNI152NLin2009cAsym_desc-preproc_hrf.mat
sub-blnd01_task-rest_run-01_space-MNI152NLin2009cAsym_desc-preproc_label-1_plot.png
sub-blnd01_task-rest_run-01_space-MNI152NLin2009cAsym_desc-preproc_label-2_plot.png
sub-blnd01_task-rest_run-01_space-MNI152NLin2009cAsym_desc-preproc_T2P.nii.gz
NigelCol commented 3 years ago

Response to issues documented in #4.

The issues and suggestion have been implemented in the following commit https://github.com/BIDS-Apps/rsHRF/commit/8f351b06173fcb110124be7d8cda5a4ea880e146.

Wrong extension

The BIDS invalid filename of *event_number.nii.nii.gz has been adjust to eventnumber.nii.gz.

Non BIDS name

The output for a BIDS dataset has now been changed conform to a generic BIDS filename format as suggested.

The outputs for the BIDS dataset example given would now be :

 sub-blnd01_task-rest_run-01_space-MNI152NLin2009cAsym_desc-preproc_deconv.nii.gz
 sub-blnd01_task-rest_run-01_space-MNI152NLin2009cAsym_desc-preproc_eventnumber.nii.gz
 sub-blnd01_task-rest_run-01_space-MNI152NLin2009cAsym_desc-preproc_FWHM.nii.gz
 sub-blnd01_task-rest_run-01_space-MNI152NLin2009cAsym_desc-preproc_height.nii.gz
 sub-blnd01_task-rest_run-01_space-MNI152NLin2009cAsym_desc-preproc_hrf.mat
 sub-blnd01_task-rest_run-01_space-MNI152NLin2009cAsym_desc-preproc_hrf_plot.png
 sub-blnd01_task-rest_run-01_space-MNI152NLin2009cAsym_desc-preproc_deconvolution_plot.png
 sub-blnd01_task-rest_run-01_space-MNI152NLin2009cAsym_desc-preproc_T2P.nii.gz