nipreps / mriqc

Automated Quality Control and visual reports for Quality Assessment of structural (T1w, T2w) and functional MRI of the brain
http://mriqc.readthedocs.io
Apache License 2.0
300 stars 132 forks source link

mriqc 23.0.1: not working with sessions #1095

Closed WilliamFCB closed 1 year ago

WilliamFCB commented 1 year ago

What happened?

just updated to 23.01 in the Ihope this solved the issue of mriqc not reading a valid bids directory:

singularity build mriqc_23.1.sif docker://nipreps/mriqc

It did not run on a bids directory with sessions, but ran successfully after creating a directory without sessions.

What command did you use?

module purge
module load singularity/3.11.1-ce 

if [ ! -e $log ] ; then
    echo $sub $ses 

    mv logs/slurm-${SLURM_JOBID}.txt $log

    time singularity run --cleanenv --contain \
    -B ${TOOLS_DIR} \
    -B ${BIDS_DIR_TMP}/:/data_in \
    -B ${SCRIPTS_DIR}/:${SCRIPTS_DIR} \
    -B ${DERIV_DIR}/:/data_out \
    -B ${WORK_DIR}/:/work \
    -B /tmp:/tmp \
    ${mriqc_sif} \
    /data_in \
    /data_out \
    participant \
    -w /work \
    --participant-label ${sub} \
    --session-id ${ses} \
    --mem_gb ${mem} \
    --float32 \
    --nprocs ${SLURM_CPUS_PER_TASK} \
    --ants-nthreads ${SLURM_CPUS_PER_TASK} \
    --no-sub \
    -vv
fi

After creating a bids directory without sessions, mriqc ran as expected: 

module purge
module load singularity/3.11.1-ce 

if [ ! -e $log ] ; then
    echo $sub $ses 

    mv logs/slurm-${SLURM_JOBID}.txt $log

    time singularity run --cleanenv --contain \
    -B ${TOOLS_DIR} \
    -B ${BIDS_DIR_TMP}/:/data_in \
    -B ${SCRIPTS_DIR}/:${SCRIPTS_DIR} \
    -B ${DERIV_DIR}/:/data_out \
    -B ${WORK_DIR}/:/work \
    -B /tmp:/tmp \
    ${mriqc_sif} \
    /data_in \
    /data_out \
    participant \
    -w /work \
    --participant-label ${sub} \
    --mem_gb ${mem} \
    --float32 \
    --nprocs ${SLURM_CPUS_PER_TASK} \
    --ants-nthreads ${SLURM_CPUS_PER_TASK} \
    --no-sub \
    -vv
fi

What version of fMRIPrep are you running?

only using mriqc on structural data

How are you running this software?

Singularity

Is your data BIDS valid?

Yes

Are you reusing any previously computed results?

No

Please copy and paste any relevant log output.

output when running on a bids directory with sessions:
/mnt/scratch/VIA_BIDS/mriqc/bids_data_DRCMR_mriqc_mprage /mnt/projects/VIA_BIDS/scripts/mriqc /mnt/scratch/VIA_BIDS/mriqc/DRCMR_work_mriqc_mprage 2 DRCMR
sub-via025 ses-01DRCMRprisma
usage: mriqc [-h] [--version] [-v] [--species {human,rat}]
             [--participant-label PARTICIPANT_LABEL [PARTICIPANT_LABEL ...]]
             [--session-id [SESSION_ID ...]] [--run-id [RUN_ID ...]]
             [--task-id [TASK_ID ...]] [-m [MODALITIES ...]] [--dsname DSNAME]
             [--bids-database-dir PATH] [--nprocs NPROCS]
             [--omp-nthreads OMP_NTHREADS] [--mem MEMORY_GB] [--testing] [-f]
             [--pdb] [-w WORK_DIR] [--verbose-reports] [--write-graph]
             [--dry-run] [--resource-monitor] [--use-plugin USE_PLUGIN]
             [--no-sub] [--email EMAIL] [--webapi-url WEBAPI_URL]
             [--webapi-port WEBAPI_PORT] [--upload-strict] [--notrack]
             [--ants-float] [--ants-settings ANTS_SETTINGS] [--ica]
             [--fft-spikes-detector] [--fd_thres FD_THRES] [--deoblique]
             [--despike] [--start-idx START_IDX] [--stop-idx STOP_IDX]
             bids_dir output_dir {participant,group} [{participant,group} ...]
mriqc: error: Querying BIDS dataset at </data_in> got an empty result.
Please, check out your currently set filters:

 *participant_label: ['via025']
 *session: ['ses-01DRCMRprisma']
 *run: None
 *task: None
 *bids_type: None

real    0m1.957s
user    0m0.530s
sys 0m0.520s

Additional information / screenshots

No response

oesteban commented 1 year ago

Does it work without setting --session-id?

WilliamFCB commented 1 year ago

Hi Oscar,

Many thanks for your response!

I did not try that. I just generated a temporary bids structure without a session subdir and successfully ran mriqc on that one. So in principle, I am good. However, I would think the sesion-id setting should work in case of longitudinal data and one wants to single out a specific session. I am a bit hung up with multiple datasets and analyses to try it out now...... Maybe, If I can find the time :-) Cheers

oesteban commented 1 year ago

if you can send me the output of a simple find on the folder structure, I can add that manifest to our currently tested ones and we will know for sure whether the problem is indexing or the session filter of the command line.

WilliamFCB commented 1 year ago

The directory structure that I tried the "-- session-id" flag on and did not work looks like:

dataset_description.json README sub-via0998 sub-via0998/ses-01CFINskyra sub-via0998/ses-01CFINskyra/anat sub-via0999 sub-via0999/ses-01CFINskyra sub-via0999/ses-01CFINskyra/anat

I moved the files to a structure, on which I successfully ran mriqc without the "--session-id" flag

dataset_description.json README sub-via0998 sub-via0998/anat sub-via0998anat/sub-via0998_ses-01CFINskyra_acq-mp2rage_rec-moco_run-01_T1w.json sub-via0998/anat/sub-via0998_ses-01CFINskyra_acq-mp2rage_rec-moco_run-01_T1w.nii.gz sub-via0999 sub-via0999/anat sub-via0999/anat/sub-via0999_ses-01CFINskyra_acq-mp2rage_rec-moco_run-01_T1w.json sub-via0999/anat/sub-via0999_ses-01CFINskyra_acq-mp2rage_rec-moco_run-01_T1w.nii.gz

Now I look at it .... it is maybe a bit strange that the latter ran successfully, as the ses-

oesteban commented 1 year ago

Yes, that is a bit surprising. I'm curious about the MP2RAGE performance - I guess it works from the moment we integrated synthstrip.

WilliamFCB commented 1 year ago

sounds like I have been lucky then :-)

WilliamFCB commented 1 year ago

Hi Oscar

Here is an example of synthsterip on a very bad quality mp2rage. Did a very nice job I would think

Screenshot 2023-03-30 at 17 38 43
oesteban commented 1 year ago

Yes, pretty good. However, that image looks more like a classic MPRAGE, rather than the MP2RAGE with the echoes combined.

WilliamFCB commented 1 year ago

It is the UNI image with the background noise being suppressed

WilliamFCB commented 1 year ago

Maybe it is in the docs, but does mriqc down sample to 2mm iso?

oesteban commented 1 year ago

No, it runs a quick and dirty affine registration with MNI152NLin2009cAsym. For that, it uses the 2mm version of the template (saving memory and time at the cost of accuracy)

WilliamFCB commented 1 year ago

synthstrip seems also to work nicely on non background denoised mp2rage data. I ran it with (purple mask) and without the --no-csf flag

image
oesteban commented 1 year ago

I believe this is finished. Please reopen if I'm wrong.