Fmriprep error: makeIsotropic WARNING: not different enough, won't reslice!

Summary of what happened:

Hi,

I am running fmriprep and getting the following error. I would really appreciate any help! Please let me know if more information should be provided!

Thanks so much,
tengwen

Command used (and if a helper script was used, a link to the helper script or the command generated):

fmriprep-docker /Users/Desktop/WL_fMRI/data/BIDS /Users/Desktop/WL_fMRI/data/derivatives/fmriprep participant --participant-label sub-WLfMRI035 --fs-license-file /Users/Desktop/WL_fMRI/license.txt --bids-filter-file /Users/Desktop/WL_fMRI/anat_filter_JMS.py

Version:

Environment (Docker, Singularity / Apptainer, custom installation):

Docker

Data formatted according to a validatable standard? Please provide the output of the validator:

PASTE VALIDATOR OUTPUT HERE

Relevant log outputs (up to 20 lines):

Stderr:
	makeIsotropic WARNING: not different enough, won't reslice!
	Killed
Traceback:
	Traceback (most recent call last):
	  File "/opt/conda/envs/fmriprep/lib/python3.10/site-packages/nipype/interfaces/base/core.py", line 398, in run
	    runtime = self._post_run_hook(runtime)
	  File "/opt/conda/envs/fmriprep/lib/python3.10/site-packages/niworkflows/interfaces/freesurfer.py", line 248, in _post_run_hook
	    fix_lta_length(lta_file)
	  File "/opt/conda/envs/fmriprep/lib/python3.10/site-packages/niworkflows/interfaces/freesurfer.py", line 399, in fix_lta_length
	    lines = Path(lta_file).read_text().splitlines(keepends=True)
	  File "/opt/conda/envs/fmriprep/lib/python3.10/pathlib.py", line 1134, in read_text
	    with self.open(mode='r', encoding=encoding, errors=errors) as f:
	  File "/opt/conda/envs/fmriprep/lib/python3.10/pathlib.py", line 1119, in open
	    return self._accessor.open(self, mode, buffering, encoding, errors,
	FileNotFoundError: [Errno 2] No such file or directory: '/tmp/work/fmriprep_23_2_wf/sub_WLfMRI033_wf/anat_fit_wf/surface_recon_wf/fsnative2t1w_xfm/T1_robustreg.lta'

Screenshots / relevant information:

It seems that this happened during the Registration:

Registration::setSourceAndTarget(MRI s, MRI t, keeptype = TRUE )
	   Type Source : 0  Type Target : 3  ensure both FLOAT (3)
	   Reordering axes in mov to better fit dst... ( -1 -3 2 )
	 Determinant after swap : 1
	   Mov: (0.5, 0.5, 0.5)mm  and dim (512, 512, 512)
	   Dst: (0.5, 0.5, 0.5)mm  and dim (360, 512, 512)
	   Asserting both images: 0.5mm isotropic 
	    - reslicing Mov ...
	       -- changing data type from 0 to 3 (noscale = 0)...
	    - reslicing Dst ...
	       -- Original : (0.5, 0.5, 0.5)mm and (360, 512, 512) voxels.
	       -- Resampled: (0.5, 0.5, 0.5)mm and (512, 512, 512) voxels.
	       -- Reslicing using cubic bspline 
	MRItoBSpline degree 3
	    - WARNING: trg mri outside_val = 0  but suspected background: -0.00687514
	               If background is black or darkgray, ignore this. If white, pass --whitebgdst


	 Registration::findSaturation 
	   - computing centroids 
	   - computing initial transform
	     -- using translation info
	   - Get Gaussian Pyramid Limits ( min size: 16 max size: -1 ) 
	   - Build Gaussian Pyramid ( Limits min steps: 0 max steps: 4 ) 
	   - Build Gaussian Pyramid ( Limits min steps: 0 max steps: 4 ) 

	   - Max Resolution used: 3
	     -- gpS ( 64 , 64 , 64 )
	     -- gpT ( 64 , 64 , 64 )
	   - running loop to estimate saturation parameter:
	     -- Iteration: 1  trying sat: 16
	         min sat: 0 ( -1 ), max sat: 16 ( 0.12101 ), sat diff: 16, (wlimit=0.16)
	     -- Iteration: 2  trying sat: 8
	         min sat: 8 ( 0.324589 ), max sat: 16 ( 0.12101 ), sat diff: 8, (wlimit=0.16)
	     -- Iteration: 3  trying sat: 12
	         min sat: 12 ( 0.193726 ), max sat: 16 ( 0.12101 ), sat diff: 4, (wlimit=0.16)
	     -- Iteration: 4  trying sat: 14
	         min sat: 12 ( 0.193726 ), max sat: 14 ( 0.15173 ), sat diff: 2, (wlimit=0.16)
	     -- Iteration: 5  trying sat: 13
	         min sat: 13 ( 0.17074 ), max sat: 14 ( 0.15173 ), sat diff: 1, (wlimit=0.16)
	     -- Iteration: 6  trying sat: 13.5
	   - final SAT: 14 ( it: 6 , weight check 0.15173 <= 0.16 )


	 Registration::computeMultiresRegistration 
	   - computing centroids 
	   - computing initial transform
	     -- using translation info
	   - Get Gaussian Pyramid Limits ( min size: 16 max size: -1 ) 
	   - initial transform:
	Ti = [ ...
	 1.0000000000000                0                0  1.6982521922295 
	               0  1.0000000000000                0 -1.1595074345649 
	               0                0  1.0000000000000 -1.1415599519338 
	               0                0                0  1.0000000000000  ]

	   - initial iscale:  Ii =1

Hi @tengwen and welcome to neurostars!

For future posts like this, please use the Software Support category, which provides a prompt to organize your post. You can see I organized it for you this time.

Killed often means an out-of-memory issue. How much RAM and CPUs are you devoting to this job, and how much data (number of T1s and BOLDs) are you processing? Is this error subject-specific or across all subjects?

Best,
Steven

Hi @Steven,

Thanks for replying and for the information about the category! I will definitly pay attention to this in the future.

The RAM in Docker Desktop is set as 8GB and the CPU is 8. The number of T1s is 360 and the number of BOLDs is 40000+ (including task 1of 4 runs and task 2 of 2 runs).

The memory issue also appeared for other subjects. However, those errors explicitly reported that it was error 137 and did not report the registration or resolution stuff. So I set the CPU, Memory, Swap and Virtual disk limit in the docker the highest. It seems that the memory issue was solved but then this current error was still reported.

I am also wondering if it is because of the dimensions of the T1 data. I checked the dimensions of this problematic data and the dimensions are:

(base) 00-8a-76-eb-b5-ad:anat tengwenfan$ fslinfo sub-WLfMRI033_ses-Session1_T1w.nii
data_type	INT16
dim1		360
dim2		512
dim3		512
dim4		1
datatype	4
pixdim1		0.500000
pixdim2		0.500000
pixdim3		0.500000
pixdim4		2.621500
cal_max		0.000000
cal_min		0.000000
file_type	NIFTI-1+

while for other fmriprep-successful subjects the dimensions are like (the dim1 is lower, although not exactly consistent across all subjects):

(base) 00-8a-76-eb-b5-ad:anat tengwenfan$ fslinfo sub-WLfMRI032_ses-Session1_T1w.nii
data_type	INT16
dim1		180
dim2		512
dim3		512
dim4		1
datatype	4
pixdim1		1.000000
pixdim2		0.500000
pixdim3		0.500000
pixdim4		2.267830
cal_max		0.000000
cal_min		0.000000
file_type	NIFTI-1+

Please let me know if more information is needed!

Thanks so much!
Tengwen

That doesn’t seem right. I am asking how many .nii.gz files you have for T1w and BOLD.

That is a high resolution, I cannot say for sure if that’s what is causing your problems, but definitely would lead to more memory usage. Do any subjects succeed in processing?

Best,
Steven

Oh sorry for the mistakes. I gave the number of dicom data…

The number of .nii.gz files for T1w is 1 and for BOLD is 6.

Yes. I have succeed in processing 20 subjects (a total of 40 sessions)

Thanks,
Tengwen

Hi @tengwen,

Any chance you can try raising the RAM or only processing one Bold image for that subject to se if it’s a memory issue? And just in case use a new working directory when you do retry.

Best,
Steven

Hi @Steven.

Thanks for the suggestion. I will try it.

Hi @Steven,

We tried the following ways to solve the problem but failed.

  1. we ran fmriprep with only one .nii.gz

  2. we ran the fmriprep with --anat-only

fmriprep-docker /Users/tengwenfan/Desktop/bids_test/bids_output /Users/tengwenfan/Desktop/bids_test/fmriprep_output participant --participant-label sub-WLfMRI033 --anat-only --fs-license-file /Users/tengwenfan/Desktop/bids_test/fmriprep_output/license.txt
  1. we also ran fmriprep with both -anat-only and --mem-mb 75000
fmriprep-docker /Users/lendlab/Desktop/WL_fMRI/data/BIDS /Users/lendlab/Desktop/WL_fMRI/data/derivatives/fmriprep participant --participant-label sub-WLfMRI035 --anat-only --fs-license-file --mem-mb 75000 /Users/lendlab/Desktop/WL_fMRI/license.tx

We also tried in different computers but got the same error. Does this mean there is something wroing with the anatomical data?

Error:

132906-root-fsnative2t1w_xfm-f799b66b-fa61-4e6f-8792-96dcaf9f0ca2.txt
Traceback (most recent call last):
  File "/opt/conda/envs/fmriprep/lib/python3.10/site-packages/nipype/pipeline/plugins/multiproc.py", line 67, in run_node
    result["result"] = node.run(updatehash=updatehash)
  File "/opt/conda/envs/fmriprep/lib/python3.10/site-packages/nipype/pipeline/engine/nodes.py", line 527, in run
    result = self._run_interface(execute=True)
  File "/opt/conda/envs/fmriprep/lib/python3.10/site-packages/nipype/pipeline/engine/nodes.py", line 645, in _run_interface
    return self._run_command(execute)
  File "/opt/conda/envs/fmriprep/lib/python3.10/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 fsnative2t1w_xfm.

Cmdline:
	mri_robust_register --satit --iscale --lta /tmp/work/fmriprep_23_2_wf/sub_WLfMRI033_wf/anat_fit_wf/surface_recon_wf/fsnative2t1w_xfm/T1_robustreg.lta --mov /out/sourcedata/freesurfer/sub-WLfMRI033/mri/T1.mgz --dst /tmp/work/fmriprep_23_2_wf/sub_WLfMRI033_wf/anat_fit_wf/anat_template_wf/anat_merge/sub-WLfMRI033_ses-Session1_T1w_noise_corrected_template.nii.gz
Stdout:
	7.3.2

	--satit: Will iterate with different SAT to ensure outliers below wlimit!
	--iscale: Enabling intensity scaling!
	--lta: Output transform as /tmp/work/fmriprep_23_2_wf/sub_WLfMRI033_wf/anat_fit_wf/surface_recon_wf/fsnative2t1w_xfm/T1_robustreg.lta . 
	--mov: Using /out/sourcedata/freesurfer/sub-WLfMRI033/mri/T1.mgz as movable/source volume.
	--dst: Using /tmp/work/fmriprep_23_2_wf/sub_WLfMRI033_wf/anat_fit_wf/anat_template_wf/anat_merge/sub-WLfMRI033_ses-Session1_T1w_noise_corrected_template.nii.gz as target volume.

	reading source '/out/sourcedata/freesurfer/sub-WLfMRI033/mri/T1.mgz'...
	reading target '/tmp/work/fmriprep_23_2_wf/sub_WLfMRI033_wf/anat_fit_wf/anat_template_wf/anat_merge/sub-WLfMRI033_ses-Session1_T1w_noise_corrected_template.nii.gz'...

	Registration::setSourceAndTarget(MRI s, MRI t, keeptype = TRUE )
	   Type Source : 0  Type Target : 3  ensure both FLOAT (3)
	   Reordering axes in mov to better fit dst... ( -1 -3 2 )
	 Determinant after swap : 1
	   Mov: (0.5, 0.5, 0.5)mm  and dim (512, 512, 512)
	   Dst: (0.5, 0.5, 0.5)mm  and dim (360, 512, 512)
	   Asserting both images: 0.5mm isotropic 
	    - reslicing Mov ...
	       -- changing data type from 0 to 3 (noscale = 0)...
	    - reslicing Dst ...
	       -- Original : (0.5, 0.5, 0.5)mm and (360, 512, 512) voxels.
	       -- Resampled: (0.5, 0.5, 0.5)mm and (512, 512, 512) voxels.
	       -- Reslicing using cubic bspline 
	MRItoBSpline degree 3
	    - WARNING: trg mri outside_val = 0  but suspected background: -7.51608
	               If background is black or darkgray, ignore this. If white, pass --whitebgdst


	 Registration::findSaturation 
	   - computing centroids 
	   - computing initial transform
	     -- using translation info
	   - Get Gaussian Pyramid Limits ( min size: 16 max size: -1 ) 
	   - Build Gaussian Pyramid ( Limits min steps: 0 max steps: 4 ) 
	   - Build Gaussian Pyramid ( Limits min steps: 0 max steps: 4 ) 

	   - Max Resolution used: 3
	     -- gpS ( 64 , 64 , 64 )
	     -- gpT ( 64 , 64 , 64 )
	   - running loop to estimate saturation parameter:
	     -- Iteration: 1  trying sat: 16
	         min sat: 0 ( -1 ), max sat: 16 ( 0.109852 ), sat diff: 16, (wlimit=0.16)
	     -- Iteration: 2  trying sat: 8
	         min sat: 8 ( 0.273716 ), max sat: 16 ( 0.109852 ), sat diff: 8, (wlimit=0.16)
	     -- Iteration: 3  trying sat: 12
	         min sat: 12 ( 0.161975 ), max sat: 16 ( 0.109852 ), sat diff: 4, (wlimit=0.16)
	     -- Iteration: 4  trying sat: 14
	         min sat: 12 ( 0.161975 ), max sat: 14 ( 0.132233 ), sat diff: 2, (wlimit=0.16)
	     -- Iteration: 5  trying sat: 13
	         min sat: 12 ( 0.161975 ), max sat: 13 ( 0.145839 ), sat diff: 1, (wlimit=0.16)
	     -- Iteration: 6  trying sat: 12.5
	   - final SAT: 12.5 ( it: 6 , weight check 0.153489 <= 0.16 )


	 Registration::computeMultiresRegistration 
	   - computing centroids 
	   - computing initial transform
	     -- using translation info
	   - Get Gaussian Pyramid Limits ( min size: 16 max size: -1 ) 
	   - initial transform:
	Ti = [ ...
	 1.0000000000000                0                0  3.0744623783108 
	               0  1.0000000000000                0  3.7667386212574 
	               0                0  1.0000000000000  2.1936019285701 
	               0                0                0  1.0000000000000  ]

	   - initial iscale:  Ii =1

	Resolution: 4  S( 32 32 32 )  T( 32 32 32 )
	 Iteration(f): 1
	     -- intensity log diff: abs(-0.901743) 
	     -- diff. to prev. transform: 1.69241
	 Iteration(f): 2
	     -- intensity log diff: abs(-0.0097902) 
	     -- diff. to prev. transform: 1.03286
	 Iteration(f): 3
	     -- intensity log diff: abs(8.83302e-05)  <= 0.001  :-)
	     -- diff. to prev. transform: 0.0654907
	 Iteration(f): 4
	     -- intensity log diff: abs(8.08687e-05)  <= 0.001  :-)
	     -- diff. to prev. transform: 0.0268022
	 Iteration(f): 5
	     -- intensity log diff: abs(2.18618e-05)  <= 0.001  :-)
	     -- diff. to prev. transform: 0.00672208  <= 0.01   :-)

	Resolution: 3  S( 64 64 64 )  T( 64 64 64 )
	 Iteration(f): 1
	     -- intensity log diff: abs(0.00353354) 
	     -- diff. to prev. transform: 0.883289
	 Iteration(f): 2
	     -- intensity log diff: abs(-0.000193012)  <= 0.001  :-)
	     -- diff. to prev. transform: 0.0858979
	 Iteration(f): 3
	     -- intensity log diff: abs(-0.000194984)  <= 0.001  :-)
	     -- diff. to prev. transform: 0.0533291
	 Iteration(f): 4
	     -- intensity log diff: abs(7.4e-06)  <= 0.001  :-)
	     -- diff. to prev. transform: 0.00392589  <= 0.01   :-)

	Resolution: 2  S( 128 128 128 )  T( 128 128 128 )
	 Iteration(f): 1
	     -- intensity log diff: abs(-0.0019143) 
	     -- diff. to prev. transform: 0.664716
	 Iteration(f): 2
	     -- intensity log diff: abs(-0.0005898)  <= 0.001  :-)
	     -- diff. to prev. transform: 0.146981
	 Iteration(f): 3
	     -- intensity log diff: abs(-0.000227192)  <= 0.001  :-)
	     -- diff. to prev. transform: 0.0383372
	 Iteration(f): 4
	     -- intensity log diff: abs(-8.15441e-05)  <= 0.001  :-)
	     -- diff. to prev. transform: 0.0102479
	 Iteration(f): 5
	     -- intensity log diff: abs(-2.59574e-05)  <= 0.001  :-)
	     -- diff. to prev. transform: 0.00275758  <= 0.01   :-)

	Resolution: 1  S( 256 256 256 )  T( 256 256 256 )
	 Iteration(f): 1
	     -- intensity log diff: abs(-0.00156114) 
	     -- diff. to prev. transform: 0.284622
	 Iteration(f): 2
	     -- intensity log diff: abs(-0.000390021)  <= 0.001  :-)
	     -- diff. to prev. transform: 0.0423204
	 Iteration(f): 3
	     -- intensity log diff: abs(-9.44061e-05)  <= 0.001  :-)
	     -- diff. to prev. transform: 0.00599962  <= 0.01   :-)

	Resolution: 0  S( 512 512 512 )  T( 512 512 512 )
	 Iteration(f): 1
Stderr:
	makeIsotropic WARNING: not different enough, won't reslice!
	Killed
Traceback:
	Traceback (most recent call last):
	  File "/opt/conda/envs/fmriprep/lib/python3.10/site-packages/nipype/interfaces/base/core.py", line 398, in run
	    runtime = self._post_run_hook(runtime)
	  File "/opt/conda/envs/fmriprep/lib/python3.10/site-packages/niworkflows/interfaces/freesurfer.py", line 248, in _post_run_hook
	    fix_lta_length(lta_file)
	  File "/opt/conda/envs/fmriprep/lib/python3.10/site-packages/niworkflows/interfaces/freesurfer.py", line 399, in fix_lta_length
	    lines = Path(lta_file).read_text().splitlines(keepends=True)
	  File "/opt/conda/envs/fmriprep/lib/python3.10/pathlib.py", line 1134, in read_text
	    with self.open(mode='r', encoding=encoding, errors=errors) as f:
	  File "/opt/conda/envs/fmriprep/lib/python3.10/pathlib.py", line 1119, in open
	    return self._accessor.open(self, mode, buffering, encoding, errors,
	FileNotFoundError: [Errno 2] No such file or directory: '/tmp/work/fmriprep_23_2_wf/sub_WLfMRI033_wf/anat_fit_wf/surface_recon_wf/fsnative2t1w_xfm/T1_robustreg.lta'


Best,
Tengwen

Hi @tengwen,

I doubt this will help, but did you try updating to 24.0.1? (clean workdir and FS subjects dir if you do) This question might be better suited for the FreeSurfer support mailing list (FreeSurferSupport - Free Surfer Wiki).

Best,
Steven

Hi @Steven,

Thanks for suggestions for updating and the FressSurfer!

For upgrading, we tried but had a little problem. We upgraded the fmriprep-docker. But, when we check the fmriprep version, it still shows the old version.

(base) 00-8a-76-eb-b5-ad:~ tengwenfan$ pip3 install --upgrade --user -v fmriprep-docker
Using pip 23.2.1 from /Users/tengwenfan/anaconda3/lib/python3.11/site-packages/pip (python 3.11)
Requirement already satisfied: fmriprep-docker in ./.local/lib/python3.11/site-packages (24.0.1)
(base) 00-8a-76-eb-b5-ad:~ tengwenfan$ fmriprep --version
You are using fMRIPrep-23.1.4, and a newer version of fMRIPrep is available: 24.0.1.
Please check out our documentation about how and when to upgrade:
https://fmriprep.readthedocs.io/en/latest/faq.html#upgrading
fMRIPrep v23.1.4

We also did not find other codes for upgrading in the link FAQ - Frequently Asked Questions — fmriprep version documentation. In addition, we noticed that the link suggests the whole dataset should be processed with the same version. We ran some data in version 23.2.3 on one Mac and the rest with the versions 23.1.4 on another Mac. I am wondering if this will affect the following analyses? Do we need to re-run some of them to make sure the version consistent?

Thanks again and we will also seek help from FreeSurfer!

Best
Tengwen