nipreps / fmriprep

fMRIPrep is a robust and easy-to-use pipeline for preprocessing of diverse fMRI data. The transparent workflow dispenses of manual intervention, thereby ensuring the reproducibility of the results.
https://fmriprep.org
Apache License 2.0
630 stars 292 forks source link

t1w_merge error in single subject multi session #2967

Closed Beaconian closed 10 months ago

Beaconian commented 1 year ago

What happened?

An error occurs during preprocessing of a single subject, which results in no structural images.

Each session has t1, flair and bold images. I tried deleting t1w images from session 2, but the problem persists.

I would greatly appreciate any help

What command did you use?

fmriprep-docker C:\Users\monog\Main\fMRI_Fondecyt\4_BIDS C:\Users\monog\Main\fMRI_Fondecyt\5_Preproc --participant-label 02 --fs-license-file C:\Users\monog\Main\fMRI_Fondecyt\FS_license.txt --mem 15500 

RUNNING: docker run --rm -e DOCKER_VERSION_8395080871=20.10.23 -it -v C:\Users\monog\Main\fMRI_Fondecyt\FS_license.txt:/opt/freesurfer/license.txt:ro -v C:\Users\monog\Main\fMRI_Fondecyt\4_BIDS:/data:ro -v C:\Users\monog\Main\fMRI_Fondecyt\5_Preproc:/out nipreps/fmriprep:22.1.1 /data /out participant --participant-label 02 --mem 15500
Node Name: fmriprep_22_1_wf.single_subject_02_wf.anat_preproc_wf.anat_template_wf.t1w_merge
File: /out/sub-02/log/20230314-170315_bb10e59c-e635-43b0-a432-69610ac858f4/crash-20230314-185844-root-t1w_merge-e4353ab0-f2ae-4165-b5c0-5c204bfbf2df.txt

What version of fMRIPrep are you running?

22.1.1

How are you running fMRIPrep?

Docker

Is your data BIDS valid?

Yes

Are you reusing any previously computed results?

No

Please copy and paste any relevant log output.

HTML Error Output

Node Name: fmriprep_22_1_wf.single_subject_02_wf.anat_preproc_wf.anat_template_wf.t1w_merge
File: /out/sub-02/log/20230314-170315_bb10e59c-e635-43b0-a432-69610ac858f4/crash-20230314-185844-root-t1w_merge-e4353ab0-f2ae-4165-b5c0-5c204bfbf2df.txt
Working Directory: /tmp/work/fmriprep_22_1_wf/single_subject_02_wf/anat_preproc_wf/anat_template_wf/t1w_merge
Inputs:
args:
auto_detect_sensitivity: True
average_metric:
environ: {'SUBJECTS_DIR': '/opt/freesurfer/subjects', 'OMP_NUM_THREADS': '1'}
fixed_timepoint: True
in_files:
in_intensity_scales:
initial_timepoint: 1
initial_transforms:
intensity_scaling: True
no_iteration: True
num_threads: 1
out_file: mri_robust_template_out.mgz
outlier_sensitivity:
scaled_intensity_outputs:
subjects_dir: /opt/freesurfer/subjects
subsample_threshold: 200
transform_outputs: True
Traceback (most recent call last):
  File "/opt/conda/lib/python3.9/site-packages/nipype/pipeline/plugins/multiproc.py", line 67, in run_node
    result["result"] = node.run(updatehash=updatehash)
  File "/opt/conda/lib/python3.9/site-packages/nipype/pipeline/engine/nodes.py", line 527, in run
    result = self._run_interface(execute=True)
  File "/opt/conda/lib/python3.9/site-packages/nipype/pipeline/engine/nodes.py", line 645, in _run_interface
    return self._run_command(execute)
  File "/opt/conda/lib/python3.9/site-packages/nipype/pipeline/engine/nodes.py", line 771, in _run_command
    raise NodeExecutionError(msg)
nipype.pipeline.engine.nodes.NodeExecutionError: Exception raised while executing Node t1w_merge.

Cmdline:
    mri_robust_template --satit --fixtp --mov /tmp/work/fmriprep_22_1_wf/single_subject_02_wf/anat_preproc_wf/anat_template_wf/n4_correct/mapflow/_n4_correct0/sub-02_ses-01_acq-AXIAL_T1w_ras_corrected.nii /tmp/work/fmriprep_22_1_wf/single_subject_02_wf/anat_preproc_wf/anat_template_wf/n4_correct/mapflow/_n4_correct1/sub-02_ses-01_acq-COR_T1w_ras_corrected.nii /tmp/work/fmriprep_22_1_wf/single_subject_02_wf/anat_preproc_wf/anat_template_wf/n4_correct/mapflow/_n4_correct2/sub-02_ses-01_acq-SAG_T1w_ras_corrected.nii --inittp 1 --iscale --noit --template sub-02_ses-01_acq-AXIAL_T1w_ras_template.nii --subsample 200 --lta /tmp/work/fmriprep_22_1_wf/single_subject_02_wf/anat_preproc_wf/anat_template_wf/t1w_merge/tp1.lta /tmp/work/fmriprep_22_1_wf/single_subject_02_wf/anat_preproc_wf/anat_template_wf/t1w_merge/tp2.lta /tmp/work/fmriprep_22_1_wf/single_subject_02_wf/anat_preproc_wf/anat_template_wf/t1w_merge/tp3.lta
Stdout:
    7.2.0

    --satit: Will estimate SAT iteratively!
    --fixtp: Will map everything to init TP!
    --mov: Using /tmp/work/fmriprep_22_1_wf/single_subject_02_wf/anat_preproc_wf/anat_template_wf/n4_correct/mapflow/_n4_correct0/sub-02_ses-01_acq-AXIAL_T1w_ras_corrected.nii as movable/source volume.
    --mov: Using /tmp/work/fmriprep_22_1_wf/single_subject_02_wf/anat_preproc_wf/anat_template_wf/n4_correct/mapflow/_n4_correct1/sub-02_ses-01_acq-COR_T1w_ras_corrected.nii as movable/source volume.
    --mov: Using /tmp/work/fmriprep_22_1_wf/single_subject_02_wf/anat_preproc_wf/anat_template_wf/n4_correct/mapflow/_n4_correct2/sub-02_ses-01_acq-SAG_T1w_ras_corrected.nii as movable/source volume.
        Total: 3 input volumes
    --inittp: Using TP 1 as target for initialization
    --iscale: Enabling intensity scaling!
    --noit: Will output only first template (no iterations)!
    --template: Using sub-02_ses-01_acq-AXIAL_T1w_ras_template.nii as template output volume.
    --subsample: Will subsample if size is larger than 200 on all axes!
    --lta: Will output LTA transforms
    Setting iscale ...
    reading source '/tmp/work/fmriprep_22_1_wf/single_subject_02_wf/anat_preproc_wf/anat_template_wf/n4_correct/mapflow/_n4_correct0/sub-02_ses-01_acq-AXIAL_T1w_ras_corrected.nii'...
    converting source '/tmp/work/fmriprep_22_1_wf/single_subject_02_wf/anat_preproc_wf/anat_template_wf/n4_correct/mapflow/_n4_correct0/sub-02_ses-01_acq-AXIAL_T1w_ras_corrected.nii' to bspline ...
    MRItoBSpline degree 3
    reading source '/tmp/work/fmriprep_22_1_wf/single_subject_02_wf/anat_preproc_wf/anat_template_wf/n4_correct/mapflow/_n4_correct1/sub-02_ses-01_acq-COR_T1w_ras_corrected.nii'...
    converting source '/tmp/work/fmriprep_22_1_wf/single_subject_02_wf/anat_preproc_wf/anat_template_wf/n4_correct/mapflow/_n4_correct1/sub-02_ses-01_acq-COR_T1w_ras_corrected.nii' to bspline ...
    MRItoBSpline degree 3
    reading source '/tmp/work/fmriprep_22_1_wf/single_subject_02_wf/anat_preproc_wf/anat_template_wf/n4_correct/mapflow/_n4_correct2/sub-02_ses-01_acq-SAG_T1w_ras_corrected.nii'...
    converting source '/tmp/work/fmriprep_22_1_wf/single_subject_02_wf/anat_preproc_wf/anat_template_wf/n4_correct/mapflow/_n4_correct2/sub-02_ses-01_acq-SAG_T1w_ras_corrected.nii' to bspline ...
    MRItoBSpline degree 3

    MultiRegistration::initializing Xforms (init 1 , maxres 0 , iterate 5 , epsit 0.01 ) : 

    [init] ========================= TP 2 to TP 1 ==============================
             Register TP 2 ( /tmp/work/fmriprep_22_1_wf/single_subject_02_wf/anat_preproc_wf/anat_template_wf/n4_correct/mapflow/_n4_correct1/sub-02_ses-01_acq-COR_T1w_ras_corrected.nii )
              to      TP 1 ( /tmp/work/fmriprep_22_1_wf/single_subject_02_wf/anat_preproc_wf/anat_template_wf/n4_correct/mapflow/_n4_correct0/sub-02_ses-01_acq-AXIAL_T1w_ras_corrected.nii )

    [init] ========================= TP 3 to TP 1 ==============================
             Register TP 3 ( /tmp/work/fmriprep_22_1_wf/single_subject_02_wf/anat_preproc_wf/anat_template_wf/n4_correct/mapflow/_n4_correct2/sub-02_ses-01_acq-SAG_T1w_ras_corrected.nii )
              to      TP 1 ( /tmp/work/fmriprep_22_1_wf/single_subject_02_wf/anat_preproc_wf/anat_template_wf/n4_correct/mapflow/_n4_correct0/sub-02_ses-01_acq-AXIAL_T1w_ras_corrected.nii )

           -- Original : (0.5, 0.500044, 0.500044)mm and (480, 480, 480) voxels.
           -- Resampled: (0.5, 0.5, 0.5)mm and (480, 481, 481) voxels.
           -- Reslicing using cubic bspline 
    MRItoBSpline degree 3
           -- Original : (0.5, 0.5, 0.5)mm and (480, 480, 480) voxels.
           -- Resampled: (0.5, 0.5, 0.5)mm and (480, 481, 481) voxels.
           -- Reslicing using cubic bspline 
    MRItoBSpline degree 3

       - Max Resolution used: 2
         -- gpS ( 120 , 120 , 120 )
         -- gpT ( 120 , 120 , 120 )
       - running loop to estimate saturation parameter:

       - Max Resolution used: 2
         -- gpS ( 120 , 120 , 120 )
         -- gpT ( 120 , 120 , 120 )
Stderr:
    Killed
Traceback:
    Traceback (most recent call last):
      File "/opt/conda/lib/python3.9/site-packages/nipype/interfaces/base/core.py", line 454, in aggregate_outputs
        setattr(outputs, key, val)
      File "/opt/conda/lib/python3.9/site-packages/nipype/interfaces/base/traits_extension.py", line 425, in validate
        value = super(MultiObject, self).validate(objekt, name, newvalue)
      File "/opt/conda/lib/python3.9/site-packages/traits/trait_types.py", line 2699, in validate
        return TraitListObject(self, object, name, value)
      File "/opt/conda/lib/python3.9/site-packages/traits/trait_list_object.py", line 582, in __init__
        super().__init__(
      File "/opt/conda/lib/python3.9/site-packages/traits/trait_list_object.py", line 213, in __init__
        super().__init__(self.item_validator(item) for item in iterable)
      File "/opt/conda/lib/python3.9/site-packages/traits/trait_list_object.py", line 213, in 
        super().__init__(self.item_validator(item) for item in iterable)
      File "/opt/conda/lib/python3.9/site-packages/traits/trait_list_object.py", line 865, in _item_validator
        return trait_validator(object, self.name, value)
      File "/opt/conda/lib/python3.9/site-packages/nipype/interfaces/base/traits_extension.py", line 330, in validate
        value = super(File, self).validate(objekt, name, value, return_pathlike=True)
      File "/opt/conda/lib/python3.9/site-packages/nipype/interfaces/base/traits_extension.py", line 135, in validate
        self.error(objekt, name, str(value))
      File "/opt/conda/lib/python3.9/site-packages/traits/base_trait_handler.py", line 74, in error
        raise TraitError(
    traits.trait_errors.TraitError: Each element of the 'transform_outputs' trait of a RobustTemplateOutputSpec instance must be a pathlike object or string representing an existing file, but a value of '/tmp/work/fmriprep_22_1_wf/single_subject_02_wf/anat_preproc_wf/anat_template_wf/t1w_merge/tp1.lta'  was specified.

    During handling of the above exception, another exception occurred:

    Traceback (most recent call last):
      File "/opt/conda/lib/python3.9/site-packages/nipype/interfaces/base/core.py", line 401, in run
        outputs = self.aggregate_outputs(runtime)
      File "/opt/conda/lib/python3.9/site-packages/nipype/interfaces/base/core.py", line 461, in aggregate_outputs
        raise FileNotFoundError(msg)
    FileNotFoundError: No such file or directory '['/tmp/work/fmriprep_22_1_wf/single_subject_02_wf/anat_preproc_wf/anat_template_wf/t1w_merge/tp1.lta', '/tmp/work/fmriprep_22_1_wf/single_subject_02_wf/anat_preproc_wf/anat_template_wf/t1w_merge/tp2.lta', '/tmp/work/fmriprep_22_1_wf/single_subject_02_wf/anat_preproc_wf/anat_template_wf/t1w_merge/tp3.lta']' for output 'transform_outputs' of a StructuralReference interface

Additional information / screenshots

No response

effigies commented 1 year ago

Looks like a memory issue. Have you made sure docker has access to enough memory? IIRC docker on Windows restricts to 2GB by default.

Beaconian commented 1 year ago

Yes, when I run "docker info" in the powershell it says it has more than 13GB available

effigies commented 11 months ago

Was this resolved? Apologies for not getting back to you. It looks like you are saying Docker has access to 13GB of RAM, but you are telling fMRIPrep it has 15.5GB available. It would not be surprising for that to result in a crash.