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
629 stars 291 forks source link

antsAI with ITK5 error. #1866

Open iPsych opened 4 years ago

iPsych commented 4 years ago

antsAI -c [10,0.000001,10] -d 3 -x /Users/User/.cache/templateflow/tpl-MNI152NLin2009cAsym/tpl-MNI152NLin2009cAsym_res-02_desc-brain_mask.nii.gz -m Mattes[/Users/User/.cache/templateflow/tpl-MNI152NLin2009cAsym/tpl-MNI152NLin2009cAsym_res-02_desc-fMRIPrep_boldref.nii.gz,/Test/work2/fmriprep_wf/single_subject_01_wf/func_preproc_task_rest_wf/bold_reference_wf/gen_ref/ref_bold.nii.gz,32,Regular,0.200000] -o initialization.mat -p 0 -s [20.000000,0.120000] -t Affine[0.100000] -v 1

The antsAI fails to process the functional images as below. Above command is shown up with crash.

itk::ERROR: RecursiveGaussianImageFilter(0x7ff1ae1a0bd0): The number of pixels along direction 2 is less than 4. This filter requires a minimum of four pixels along the dimension to be processed.

iPsych commented 4 years ago

The error happens as below in step

bold_reference_wf.enhance_and_skullstrip_bold_wf.init_aff

File "/Library/Frameworks/Python.framework/Versions/3.6/lib/python3.6/site-packages/nipype/pipeline/plugins/multiproc.py", line 69, in run_node result['result'] = node.run(updatehash=updatehash) File "/Library/Frameworks/Python.framework/Versions/3.6/lib/python3.6/site-packages/nipype/pipeline/engine/nodes.py", line 479, in run result = self._run_interface(execute=True) File "/Library/Frameworks/Python.framework/Versions/3.6/lib/python3.6/site-packages/nipype/pipeline/engine/nodes.py", line 569, in _run_interface return self._run_command(execute) File "/Library/Frameworks/Python.framework/Versions/3.6/lib/python3.6/site-packages/nipype/pipeline/engine/nodes.py", line 662, in _run_command result = self._interface.run(cwd=outdir) File "/Library/Frameworks/Python.framework/Versions/3.6/lib/python3.6/site-packages/nipype/interfaces/base/core.py", line 382, in run runtime = self._run_interface(runtime) File "/Library/Frameworks/Python.framework/Versions/3.6/lib/python3.6/site-packages/niworkflows/interfaces/utils.py", line 199, in _run_interface message='%s (niworkflows v%s)' % (self.class.name, version)) File "/Library/Frameworks/Python.framework/Versions/3.6/lib/python3.6/site-packages/niworkflows/interfaces/utils.py", line 241, in _gen_reference reoriented_moving_img = nb.as_closest_canonical(nb.load(moving_image)) File "/Library/Frameworks/Python.framework/Versions/3.6/lib/python3.6/site-packages/nibabel/funcs.py", line 209, in as_closest_canonical img = img.as_reoriented(io_orientation(img.affine)) File "/Library/Frameworks/Python.framework/Versions/3.6/lib/python3.6/site-packages/nibabel/nifti1.py", line 2013, in as_reoriented img = super(Nifti1Pair, self).as_reoriented(ornt) File "/Library/Frameworks/Python.framework/Versions/3.6/lib/python3.6/site-packages/nibabel/spatialimages.py", line 633, in as_reoriented t_arr = apply_orientation(self.get_data(), ornt) File "/Library/Frameworks/Python.framework/Versions/3.6/lib/python3.6/site-packages/nibabel/orientations.py", line 160, in apply_orientation raise OrientationError('Data array has fewer dimensions than ' nibabel.orientations.OrientationError: Data array has fewer dimensions than orientation

effigies commented 4 years ago

What are the dimensions of your input bold images?

iPsych commented 4 years ago

What are the dimensions of your input bold images?

The original functional image as below (one 4D file)

Dimensions: 384x384x1x32 Bytes per voxel: 2 Spacing: 3.438x3.438x5.000x2.00000 Matrix [3.436 0 0.087 -656.059; -0 3.437 -0 -662.212; -0.059 0 4.999 -37.267] Description: TE=30;Time=0.000 Intensity Intercept; Slope: 0; 1

effigies commented 4 years ago

fMRIPrep isn't equipped to handle single slice images. I'm not sure what tools to suggest here. Spatial realignment is underdetermined, so head motion correction and BOLD-T1w registration aren't really going to be possible. If you assume things are already aligned, then you can proceed on those grounds and just use --anat-only to preprocess the anatomical images.

iPsych commented 4 years ago

fMRIPrep isn't equipped to handle single slice images. I'm not sure what tools to suggest here. Spatial realignment is underdetermined, so head motion correction and BOLD-T1w registration aren't really going to be possible. If you assume things are already aligned, then you can proceed on those grounds and just use --anat-only to preprocess the anatomical images.

Would you let me know what you meant with single slice images? I put the bold images came from Dicom converted to compressed 4D nifti. So, it's not a single slice image. Isn't it?

effigies commented 4 years ago

Dimensions: 384x384x1x32

This indicates 32 volumes, each of which is a single slice of 384x384 voxels. If these aren't the dimensions of the image you intended to acquire, then there may be something wrong with your DICOM-NIfTI conversion. It might be worth opening both the DICOM and NIfTI in some viewer just to see what the data look like.