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
299 stars 132 forks source link

[7m** FATAL ERROR: You can't register a 1 brick dataset to itself! #1180

Closed Mtay316 closed 7 months ago

Mtay316 commented 9 months ago

Hi MRIQC team,

I am dealing with an error that I could not find anything similar to that in the forum. I am running MRIQC on my multi-shell diffusion data. I have encountered any issue below:

Stderr:

    ++ 3dvolreg: AFNI version=AFNI_22.2.07 (Aug 19 2022) [64-bit]
    ++ Authored by: RW Cox
    *+ WARNING:   If you are performing spatial transformations on an oblique dset,
      such as /nesi/nobackup/uoa04027/Processed_mtay316/.mriqc_tmp/mriqc_wf/dwiMRIQC/_in_file_..nesi..nobackup..uoa04027..Processed_mtay316..bids..sub-case14..ses-c..dwi..sub-case14_ses-c_run-001_dwi.nii.gz/hmc_shells/mapflow/_hmc_shells2/sub-case14_ses-c_run-001_dwi_valid_b0.nii.gz,
      or viewing/combining it with volumes of differing obliquity,
      you should consider running: 
         3dWarp -deoblique 
      on this and  other oblique datasets in the same session.
     See 3dWarp -help for details.
    ++ Oblique dataset:/nesi/nobackup/uoa04027/Processed_mtay316/.mriqc_tmp/mriqc_wf/dwiMRIQC/_in_file_..nesi..nobackup..uoa04027..Processed_mtay316..bids..sub-case14..ses-c..dwi..sub-case14_ses-c_run-001_dwi.nii.gz/hmc_shells/mapflow/_hmc_shells2/sub-case14_ses-c_run-001_dwi_valid_b0.nii.gz is 6.185800 degrees from plumb.
    ** FATAL ERROR: You can't register a 1 brick dataset to itself!
    ** Program compile date = Aug 19 2022
Traceback:
    Traceback (most recent call last):
      File "/opt/conda/lib/python3.9/site-packages/nipype/interfaces/base/core.py", line 453, in aggregate_outputs
        setattr(outputs, key, val)
      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: The 'oned_matrix_save' trait of a VolregOutputSpec instance must be a pathlike object or string representing an existing file, but a value of '/nesi/nobackup/uoa04027/Processed_mtay316/.mriqc_tmp/mriqc_wf/dwiMRIQC/_in_file_..nesi..nobackup..uoa04027..Processed_mtay316..bids..sub-case14..ses-c..dwi..sub-case14_ses-c_run-001_dwi.nii.gz/hmc_shells/mapflow/_hmc_shells2/sub-case14_ses-c_run-001_dwi_valid_b0.aff12.1D' <class 'str'> was specified.

I thought the error is due to the registration. After I used " -deoblique" I still got the same error. I used "-vvv" to get more verbose and see where the problem is. After checking the log, I noticed that the algorithm identified 5 volumes while I have four volume in my scan (0,1000,2000,3000). After checking my bval file, I realised that my 1000 and 2000 are fine, but my 3000 has one 2995 and two 3005 values. And interestingly, MRIQC recognises 2995 as a seperate shell [49]. Like below:

240130-01:35:50,174 nipype.workflow DEBUG:
     [Node] Hashes: [('b0_ixs', [[0, 11, 22, 33, 44, 55, 66], [1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 12, 13, 14, 15, 16], [17, 18, 19, 20, 21, 23, 24, 25, 26, 27, 28, 29, 30, 31, 32, 34, 35, 36, 37, 38], [49], [39, 40, 41, 42, 43, 45, 46, 47, 48, 50, 51, 52, 53, 54, 56, 57, 58, 59, 60, 61, 62, 63, 64, 65, 67, 68, 69, 70, 71]]), ('in_file', ('/nesi/nobackup/uoa04027/Processed_mtay316/.mriqc_tmp/mriqc_wf/dwiMRIQC/_in_file_..nesi..nobackup..uoa04027..Processed_mtay316..bids..sub-case22..ses-a..dwi..sub-case22_ses-a_run-001_dwi.nii.gz/sanitize/sub-case22_ses-a_run-001_dwi_valid.nii.gz', 'f64be40de5609380ec64644e8f3591df')), ('needed_outputs', ['out_file'])], 933a356293fe7277bbe74807c0d4fad7, /nesi/nobackup/uoa04027/Processed_mtay316/.mriqc_tmp/mriqc_wf/dwiMRIQC/_in_file_..nesi..nobackup..uoa04027..Processed_mtay316..bids..sub-case22..ses-a..dwi..sub-case22_ses-a_run-001_dwi.nii.gz/get_shells/_0x933a356293fe7277bbe74807c0d4fad7.json, ['/nesi/nobackup/uoa04027/Processed_mtay316/.mriqc_tmp/mriqc_wf/dwiMRIQC/_in_file_..nesi..nobackup..uoa04027..Processed_mtay316..bids..sub-case22..ses-a..dwi..sub-case22_ses-a_run-001_dwi.nii.gz/get_shells/_0x933a356293fe7277bbe74807c0d4fad7.json']

And most of the errors refers to shell2:

     [Node] Up-to-date cache found for "_hmc_shells0".
240130-01:35:54,430 nipype.workflow DEBUG:
     [Node] Hashes: [('args', '-Fourier -twopass'), ('in_file', ('/nesi/nobackup/uoa04027/Processed_mtay316/.mriqc_tmp/mriqc_wf/dwiMRIQC/_in_file_..nesi..nobackup..uoa04027..Processed_mtay316..bids..sub-case22..ses-a..dwi..sub-case22_ses-a_run-001_dwi.nii.gz/get_shells/mapflow/_get_shells2/sub-case22_ses-a_run-001_dwi_valid_b0.nii.gz', '7e80aa250c006fe8cfa2b0a40ba1f5d2')), ('outputtype', 'NIFTI_GZ'), ('zpad', 4)], 479dfaa3b5cbfc832a0a2a7a78cf5c08, /nesi/nobackup/uoa04027/Processed_mtay316/.mriqc_tmp/mriqc_wf/dwiMRIQC/_in_file_..nesi..nobackup..uoa04027..Processed_mtay316..bids..sub-case22..ses-a..dwi..sub-case22_ses-a_run-001_dwi.nii.gz/hmc_shells/mapflow/_hmc_shells1/_0x479dfaa3b5cbfc832a0a2a7a78cf5c08.json, ['/nesi/nobackup/uoa04027/Processed_mtay316/.mriqc_tmp/mriqc_wf/dwiMRIQC/_in_file_..nesi..nobackup..uoa04027..Processed_mtay316..bids..sub-case22..ses-a..dwi..sub-case22_ses-a_run-001_dwi.nii.gz/hmc_shells/mapflow/_hmc_shells1/_0x479dfaa3b5cbfc832a0a2a7a78cf5c08.json']
240130-01:35:54,430 nipype.workflow DEBUG:
     [Node] Up-to-date cache found for "_hmc_shells1".
240130-01:35:54,432 nipype.workflow DEBUG:
     [Node] Hashes: [('args', '-Fourier -twopass'), ('in_file', ('/nesi/nobackup/uoa04027/Processed_mtay316/.mriqc_tmp/mriqc_wf/dwiMRIQC/_in_file_..nesi..nobackup..uoa04027..Processed_mtay316..bids..sub-case22..ses-a..dwi..sub-case22_ses-a_run-001_dwi.nii.gz/get_shells/mapflow/_get_shells3/sub-case22_ses-a_run-001_dwi_valid_b0.nii.gz', '6c92870aba28440e6124b22d9502a3f8')), ('outputtype', 'NIFTI_GZ'), ('zpad', 4)], 1791a89de7c73139d8b682c4cc9fa834, /nesi/nobackup/uoa04027/Processed_mtay316/.mriqc_tmp/mriqc_wf/dwiMRIQC/_in_file_..nesi..nobackup..uoa04027..Processed_mtay316..bids..sub-case22..ses-a..dwi..sub-case22_ses-a_run-001_dwi.nii.gz/hmc_shells/mapflow/_hmc_shells2/_0x1791a89de7c73139d8b682c4cc9fa834.json, []
240130-01:35:54,433 nipype.workflow DEBUG:
     [Node] No hashfiles found in "/nesi/nobackup/uoa04027/Processed_mtay316/.mriqc_tmp/mriqc_wf/dwiMRIQC/_in_file_..nesi..nobackup..uoa04027..Processed_mtay316..bids..sub-case22..ses-a..dwi..sub-case22_ses-a_run-001_dwi.nii.gz/hmc_shells/mapflow/_hmc_shells2".
240130-01:35:54,434 nipype.workflow INFO:
     [Node] Setting-up "_hmc_shells2" in "/nesi/nobackup/uoa04027/Processed_mtay316/.mriqc_tmp/mriqc_wf/dwiMRIQC/_in_file_..nesi..nobackup..uoa04027..Processed_mtay316..bids..sub-case22..ses-a..dwi..sub-case22_ses-a_run-001_dwi.nii.gz/hmc_shells/mapflow/_hmc_shells2".
240130-01:35:54,435 nipype.workflow DEBUG:
     [Node] Hashes: [('args', '-Fourier -twopass'), ('in_file', ('/nesi/nobackup/uoa04027/Processed_mtay316/.mriqc_tmp/mriqc_wf/dwiMRIQC/_in_file_..nesi..nobackup..uoa04027..Processed_mtay316..bids..sub-case22..ses-a..dwi..sub-case22_ses-a_run-001_dwi.nii.gz/get_shells/mapflow/_get_shells3/sub-case22_ses-a_run-001_dwi_valid_b0.nii.gz', '6c92870aba28440e6124b22d9502a3f8')), ('outputtype', 'NIFTI_GZ'), ('zpad', 4)], 1791a89de7c73139d8b682c4cc9fa834, /nesi/nobackup/uoa04027/Processed_mtay316/.mriqc_tmp/mriqc_wf/dwiMRIQC/_in_file_..nesi..nobackup..uoa04027..Processed_mtay316..bids..sub-case22..ses-a..dwi..sub-case22_ses-a_run-001_dwi.nii.gz/hmc_shells/mapflow/_hmc_shells2/_0x1791a89de7c73139d8b682c4cc9fa834.json, []
240130-01:35:54,435 nipype.workflow DEBUG:
     [Node] No hashfiles found in "/nesi/nobackup/uoa04027/Processed_mtay316/.mriqc_tmp/mriqc_wf/dwiMRIQC/_in_file_..nesi..nobackup..uoa04027..Processed_mtay316..bids..sub-case22..ses-a..dwi..sub-case22_ses-a_run-001_dwi.nii.gz/hmc_shells/mapflow/_hmc_shells2".
240130-01:35:54,435 nipype.utils DEBUG:
     Removing contents of /nesi/nobackup/uoa04027/Processed_mtay316/.mriqc_tmp/mriqc_wf/dwiMRIQC/_in_file_..nesi..nobackup..uoa04027..Processed_mtay316..bids..sub-case22..ses-a..dwi..sub-case22_ses-a_run-001_dwi.nii.gz/hmc_shells/mapflow/_hmc_shells2
240130-01:35:54,437 nipype.workflow DEBUG:
     [Node] Hashes: [('args', '-Fourier -twopass'), ('in_file', ('/nesi/nobackup/uoa04027/Processed_mtay316/.mriqc_tmp/mriqc_wf/dwiMRIQC/_in_file_..nesi..nobackup..uoa04027..Processed_mtay316..bids..sub-case22..ses-a..dwi..sub-case22_ses-a_run-001_dwi.nii.gz/get_shells/mapflow/_get_shells4/sub-case22_ses-a_run-001_dwi_valid_b0.nii.gz', '9921a6a73547c768820d28e933317f4b')), ('outputtype', 'NIFTI_GZ'), ('zpad', 4)], 92407e97921e515d15f45a0729c55ca2, /nesi/nobackup/uoa04027/Processed_mtay316/.mriqc_tmp/mriqc_wf/dwiMRIQC/_in_file_..nesi..nobackup..uoa04027..Processed_mtay316..bids..sub-case22..ses-a..dwi..sub-case22_ses-a_run-001_dwi.nii.gz/hmc_shells/mapflow/_hmc_shells3/_0x92407e97921e515d15f45a0729c55ca2.json, ['/nesi/nobackup/uoa04027/Processed_mtay316/.mriqc_tmp/mriqc_wf/dwiMRIQC/_in_file_..nesi..nobackup..uoa04027..Processed_mtay316..bids..sub-case22..ses-a..dwi..sub-case22_ses-a_run-001_dwi.nii.gz/hmc_shells/mapflow/_hmc_shells3/_0x92407e97921e515d15f45a0729c55ca2.json']
240130-01:35:54,437 nipype.workflow DEBUG:
     [Node] Up-to-date cache found for "_hmc_shells3".
240130-01:35:54,456 nipype.workflow DEBUG:
     [Node] Writing pre-exec report to "/nesi/nobackup/uoa04027/Processed_mtay316/.mriqc_tmp/mriqc_wf/dwiMRIQC/_in_file_..nesi..nobackup..uoa04027..Processed_mtay316..bids..sub-case22..ses-a..dwi..sub-case22_ses-a_run-001_dwi.nii.gz/hmc_shells/mapflow/_hmc_shells2/_report/report.rst"
240130-01:35:54,458 nipype.workflow DEBUG:
     copying files to wd [execute=True, linksonly=False]
240130-01:35:54,458 nipype.utils DEBUG:
     /nesi/nobackup/uoa04027/Processed_mtay316/.mriqc_tmp/mriqc_wf/dwiMRIQC/_in_file_..nesi..nobackup..uoa04027..Processed_mtay316..bids..sub-case22..ses-a..dwi..sub-case22_ses-a_run-001_dwi.nii.gz/hmc_shells/mapflow/_hmc_shells2/sub-case22_ses-a_run-001_dwi_valid_b0.nii.gz
240130-01:35:54,458 nipype.utils DEBUG:
     Symlinking File: /nesi/nobackup/uoa04027/Processed_mtay316/.mriqc_tmp/mriqc_wf/dwiMRIQC/_in_file_..nesi..nobackup..uoa04027..Processed_mtay316..bids..sub-case22..ses-a..dwi..sub-case22_ses-a_run-001_dwi.nii.gz/hmc_shells/mapflow/_hmc_shells2/sub-case22_ses-a_run-001_dwi_valid_b0.nii.gz->/nesi/nobackup/uoa04027/Processed_mtay316/.mriqc_tmp/mriqc_wf/dwiMRIQC/_in_file_..nesi..nobackup..uoa04027..Processed_mtay316..bids..sub-case22..ses-a..dwi..sub-case22_ses-a_run-001_dwi.nii.gz/get_shells/mapflow/_get_shells3/sub-case22_ses-a_run-001_dwi_valid_b0.nii.gz
240130-01:35:54,459 nipype.utils DEBUG:
     /nesi/nobackup/uoa04027/Processed_mtay316/.mriqc_tmp/mriqc_wf/dwiMRIQC/_in_file_..nesi..nobackup..uoa04027..Processed_mtay316..bids..sub-case22..ses-a..dwi..sub-case22_ses-a_run-001_dwi.nii.gz/hmc_shells/mapflow/_hmc_shells2/sub-case22_ses-a_run-001_dwi_valid_b0.nii.gz
240130-01:35:54,459 nipype.utils DEBUG:
     File: /nesi/nobackup/uoa04027/Processed_mtay316/.mriqc_tmp/mriqc_wf/dwiMRIQC/_in_file_..nesi..nobackup..uoa04027..Processed_mtay316..bids..sub-case22..ses-a..dwi..sub-case22_ses-a_run-001_dwi.nii.gz/hmc_shells/mapflow/_hmc_shells2/sub-case22_ses-a_run-001_dwi_valid_b0.nii.gz already exists, not overwriting, copy:0
240130-01:35:54,459 nipype.workflow INFO:
     [Node] Executing "_hmc_shells2" <nipype.interfaces.afni.preprocess.Volreg>
240130-01:35:54,460 nipype.interface DEBUG:
     args_-Fourier -twopass
240130-01:35:54,460 nipype.interface DEBUG:
     in_file_/nesi/nobackup/uoa04027/Processed_mtay316/.mriqc_tmp/mriqc_wf/dwiMRIQC/_in_file_..nesi..nobackup..uoa04027..Processed_mtay316..bids..sub-case22..ses-a..dwi..sub-case22_ses-a_run-001_dwi.nii.gz/hmc_shells/mapflow/_hmc_shells2/sub-case22_ses-a_run-001_dwi_valid_b0.nii.gz
240130-01:35:54,460 nipype.interface DEBUG:
     md1d_file_sub-case22_ses-a_run-001_dwi_valid_b0_md.1D
240130-01:35:54,460 nipype.interface DEBUG:
     oned_file_sub-case22_ses-a_run-001_dwi_valid_b0.1D
240130-01:35:54,460 nipype.interface DEBUG:
     oned_matrix_save_sub-case22_ses-a_run-001_dwi_valid_b0.aff12.1D
240130-01:35:54,460 nipype.interface DEBUG:
     out_file_sub-case22_ses-a_run-001_dwi_valid_b0_volreg.nii.gz
240130-01:35:54,460 nipype.interface DEBUG:
     zpad_4
240130-01:35:54,460 nipype.interface DEBUG:
     args_-Fourier -twopass
240130-01:35:54,461 nipype.interface DEBUG:
     in_file_/nesi/nobackup/uoa04027/Processed_mtay316/.mriqc_tmp/mriqc_wf/dwiMRIQC/_in_file_..nesi..nobackup..uoa04027..Processed_mtay316..bids..sub-case22..ses-a..dwi..sub-case22_ses-a_run-001_dwi.nii.gz/hmc_shells/mapflow/_hmc_shells2/sub-case22_ses-a_run-001_dwi_valid_b0.nii.gz
240130-01:35:54,461 nipype.interface DEBUG:
     md1d_file_sub-case22_ses-a_run-001_dwi_valid_b0_md.1D
240130-01:35:54,461 nipype.interface DEBUG:
     oned_file_sub-case22_ses-a_run-001_dwi_valid_b0.1D
240130-01:35:54,461 nipype.interface DEBUG:
     oned_matrix_save_sub-case22_ses-a_run-001_dwi_valid_b0.aff12.1D
240130-01:35:54,461 nipype.interface DEBUG:
     out_file_sub-case22_ses-a_run-001_dwi_valid_b0_volreg.nii.gz
240130-01:35:54,461 nipype.interface DEBUG:
     zpad_4
240130-01:35:54,673 nipype.workflow INFO:
     [Node] Finished "_hmc_shells2", elapsed time 0.210043s.
240130-01:35:54,673 nipype.workflow DEBUG:
     Saving results file: '/nesi/nobackup/uoa04027/Processed_mtay316/.mriqc_tmp/mriqc_wf/dwiMRIQC/_in_file_..nesi..nobackup..uoa04027..Processed_mtay316..bids..sub-case22..ses-a..dwi..sub-case22_ses-a_run-001_dwi.nii.gz/hmc_shells/mapflow/_hmc_shells2/result__hmc_shells2.pklz'
240130-01:35:54,673 nipype.workflow WARNING:
     Storing result file without outputs
240130-01:35:54,674 nipype.workflow WARNING:
     [Node] Error on "_hmc_shells2" (/nesi/nobackup/uoa04027/Processed_mtay316/.mriqc_tmp/mriqc_wf/dwiMRIQC/_in_file_..nesi..nobackup..uoa04027..Processed_mtay316..bids..sub-case22..ses-a..dwi..sub-case22_ses-a_run-001_dwi.nii.gz/hmc_shells/mapflow/_hmc_shells2)
240130-01:35:54,676 nipype.utils DEBUG:
     Loading pkl: /nesi/nobackup/uoa04027/Processed_mtay316/.mriqc_tmp/mriqc_wf/dwiMRIQC/_in_file_..nesi..nobackup..uoa04027..Processed_mtay316..bids..sub-case22..ses-a..dwi..sub-case22_ses-a_run-001_dwi.nii.gz/hmc_shells/mapflow/_hmc_shells2/result__hmc_shells2.pklz
240130-01:35:56,116 nipype.utils DEBUG:
     Loading pkl: /nesi/nobackup/uoa04027/Processed_mtay316/.mriqc_tmp/mriqc_wf/dwiMRIQC/_in_file_..nesi..nobackup..uoa04027..Processed_mtay316..bids..sub-case22..ses-a..dwi..sub-case22_ses-a_run-001_dwi.nii.gz/hmc_shells/mapflow/_hmc_shells2/result__hmc_shells2.pklz
240130-01:35:56,116 nipype.workflow ERROR:
     Node _hmc_shells2 failed to run on host wmc009.
240130-01:35:56,119 nipype.workflow ERROR:
     Saving crash info to /nesi/nobackup/uoa04027/Processed_mtay316/bids/derivatives/mriqc/logs/crash-20240130-013556-mtay316-_hmc_shells2-51925ffe-53b7-42e2-8f9d-a968bdcb710d.txt
Traceback (most recent call last):
  File "/opt/conda/lib/python3.9/site-packages/mriqc/engine/plugin.py", line 60, 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 _hmc_shells2.

I am still not sure if this the issue or not. It would be great if you can help me with that.

Regards, Maryam

oesteban commented 8 months ago

Hi @maryam - is this the case that you have only one b=0 in the dataset?

oesteban commented 7 months ago

Okay, I've re-read the issue and in fact, the problem is you only have 4 volumes. In #1240 we prevented these datasets from being run. These could be addressed in the future as, e.g., EPI/PEPOLAR fieldmaps. For now, we will have to leave them out unsupported.