Closed csleo95 closed 9 months ago
Hi! QSIPrep is expecting regular freesurfer naming, not BIDS.
Many thanks for the reply!
I have tried to set up the freesurfer directory using regular freesurfer naming in two ways, but neither worked. From my understanding (and please correct me if I am wrong), qsiprep needs the recon-all output from the T1W template estimated across sessions for each subject. So, I have first tried to set up the fresurfer directory with this output using only the name of the subject (as below), but it only worked when subjects had a single session.
├── freesurfer
│ └── sub-0001
│ ├── label
│ ├── mri
│ ├── scripts
│ ├── stats
│ ├── surf
│ ├── tmp
│ ├── touch
│ └── trash
Alternatively (in case my understanding is wrong), I have tried to set up the freesurfer directory with the recon-all ouput of the T1w of each session using the name of the subject + session (as below - suggested in https://surfer.nmr.mgh.harvard.edu/fswiki/BIDS), but it also did not work.
├── freesurfer
│ ├── sub-0001_ses-post2
│ │ ├── label
│ │ ├── mri
│ │ ├── scripts
│ │ ├── stats
│ │ ├── surf
│ │ ├── tmp
│ │ ├── touch
│ │ └── trash
│ └── sub-0001_ses-pre
│ ├── label
│ ├── mri
│ ├── scripts
│ ├── stats
│ ├── surf
│ ├── tmp
│ ├── touch
│ └── trash
How should the freesurfer directory be structured?
Many thanks again!
I got the same error for a dataset in which each subject had two sessions with dwi images in both sessions . I ran through singularity on a HPC with GPU capabilities: FMRIPREP v22.0.2 and QSIPREP v0.16.0RC3 successively on this data set with the following commands:
fMRIPrep command:
/opt/conda/bin/fmriprep --fs-license-file /work/freesurfer/license.txt /work/WordLearning \ /work/WordLearning/derivatives/fmriprep participant --participant-label pilot1 \
-w /work/temp_data_WordLearning --mem-mb 50000 --omp-nthreads 10 --nthreads 12 \
--fd-spike-threshold 0.5 --dvars-spike-threshold 2.0 --bold2t1w-dof 9 --cifti-output 91k \
--output-spaces MNI152NLin2009cAsym MNI152NLin6Asym T1w --ignore slicetiming \
sbref --fs-subjects-dir /work/WordLearning/derivatives/fmriprep/sourcedata/freesurfer \
--debug compcor --bids-filter-file /work/WordLearning/code/fmriprep/bids-filter.json
qsiprep command:
/usr/local/miniconda/bin/qsiprep /work/WordLearning /work/WordLearning/derivatives \
participant --participant_label pilot1 -w /work/temp_data_WordLearning \
--output-resolution 1.2 --fs-license-file /work/freesurfer/license.txt \
--eddy-config /work/WordLearning/code/qsiprep/eddy_params.json --b0-threshold 50 \
--unringing-method mrdegibbs --denoise-method dwidenoise \
--output-space T1w template --template MNI152NLin2009cAsym \--distortion-group-merge average
qsirecon command:
singularity run -B /scratch/jsein/BIDS:/work,$HOME/.templateflow:/home/qsiprep/.cache/templateflow \
--nv /scratch/jsein/my_images/qsiprep-0.16.0RC3.sif /work/$study \
/work/$study/derivatives participant --participant_label $sub \
-w /work/temp_data_${study} --fs-license-file /work/freesurfer/license.txt \
--recon-only --recon-spec mrtrix_multishell_msmt_ACT-hsvs --recon-input /work/$study/derivatives/qsiprep \
--freesurfer-input /work/$study/derivatives/fmriprep/sourcedata/freesurfer
freesurfer tree:
freesurfer
├── fsaverage
│ ├── label
│ ├── mri
│ ├── mri.2mm
│ ├── scripts
│ ├── surf
│ └── xhemi
└── sub-pilot1
├── label
├── mri
├── scripts
├── stats
├── surf
├── tmp
├── touch
└── trash
crash file for ses-02
when running qsirecon
on a subject having dwi images on both ses-01
and ses-02
:
crash-20221028-135754-jsein-get_atlases-ed4033b2-a680-4250-af04-00da1f9675a1.txt
In my case qsirecon works for ses-01
but keeps failing for ses-02
, stating:
Exception: No MNI to T1w transform found in anatomical directory
My question is: in which anatomical directory is qsirecon looking for when it deals with ses-02
, since he finds this file for ses-01
@csleo95 : did you try with the --longitudinal
flag?
@julfou81, I used the --longitudinal
flag when running the preprocessing workflow, but not when running the reconstruction workflow. Did you try it for the latter? Did it work?
@julfou81, I used the
--longitudinal
flag when running the preprocessing workflow, but not when running the reconstruction workflow. Did you try it for the latter? Did it work?
No, I am testing it now on the preprocessing workflow, but seeing your response and looking at the documentation, I doubt I would get different results than yours... The --longitudinal
options seems to only be used to create a longitudinal template with mri_robust_template
function. It is a similar behavior than FMRIPREP and does not force freesurfer to be run in "longitudinal mode".
@julfou81, I used the
--longitudinal
flag when running the preprocessing workflow, but not when running the reconstruction workflow. Did you try it for the latter? Did it work?No, I am testing it now on the preprocessing workflow, but seeing your response and looking at the documentation, I doubt I would get different results than yours... The
--longitudinal
options seems to only be used to create a longitudinal template withmri_robust_template
function. It is a similar behavior than FMRIPREP and does not force freesurfer to be run in "longitudinal mode".
Yes.. Please let me know if you get a different result. I have been also trying other combinations of flags and directory structures to run the reconstruction workflow. If I get something different, I will let you know!
Also having an issue running qsirecon on longitudinal data - everything words for ses-001, but the common anatomical files for ses-001 (the transformations and whatnot) are not recognized for ses-002, causing the whole thing to crash..
This sounds like a problem. Are all you running the hsvs workflow? And you have multi session data?
Our group hasn't run into a problem with this yet, but that's probably due to how we structure the running of longitudinal data. We usually have scans separated by a year or more, so mri_robust_template doesn't work. Instead we treat each session as its own subject. You can do this by making a different subject ID in BIDS for each session or you can process the multi-session data once per session using a bids filter file (this is what we do) eg:
filterfile=${PWD}/${sesid}_filter.json
echo "{" > ${filterfile}
echo "'fmap': {'datatype': 'fmap'}," >> ${filterfile}
echo "'dwi': {'datatype': 'dwi', 'session': '$sesid', 'suffix': 'dwi'}," >> ${filterfile}
echo "'sbref': {'datatype': 'func', 'session': '$sesid', 'suffix': 'sbref'}," >> ${filterfile}
echo "'flair': {'datatype': 'anat', 'session': '$sesid', 'suffix': 'FLAIR'}," >> ${filterfile}
echo "'t2w': {'datatype': 'anat', 'session': '$sesid', 'suffix': 'T2w'}," >> ${filterfile}
echo "'t1w': {'datatype': 'anat', 'session': '$sesid', 'suffix': 'T1w'}," >> ${filterfile}
echo "'roi': {'datatype': 'anat', 'session': '$sesid', 'suffix': 'roi'}" >> ${filterfile}
echo "}" >> ${filterfile}
# remove ses and get valid json
sed -i "s/'/\"/g" ${filterfile}
sed -i "s/ses-//g" ${filterfile}
Hi all!
I have been trying to run the mrtrix_singleshell_ss3t_ACT-hsvs reconstruction workflow on longitudinal dwi and T1w data that have gone through qsiprep proprocessing and freesurfer`s recon-all, respectively. I have tried to set up the freesurfer derivatives folder in multiple ways (including following these recommendations: https://surfer.nmr.mgh.harvard.edu/fswiki/BIDS). However, all of them resulted in the crash attached. The only way this reconstruction workflow worked was when I used only one session per subject (i.e., it only worked for cross-sectional data).
Many thanks in advance for the help!!
Best regards, Leo
Code:
Crash file: crash-20221002-161658-root-get_atlases-2836cb10-8ff7-4f37-a0ff-f90218b13522.txt