Maybe bug in 3dLocalstat with nii file output and hist option

AFNI version info (afni -ver):
Precompiled binary linux_openmp_64: Feb 13 2023 (Version AFNI_23.0.04 'Commodus')

I think there may be a bug in 3dLocalstat when using nii file output and hist option.
I get this error: ERROR: nifti_image_write_engine: NBL does not match nim
and the output file is created but size zero.
It works fine if I use a BRIK output. I can provide the file if needed, but it seems to happen with all files I've tried.

Thanks for your help!

Here is the example:

3dLocalstat -overwrite -prefix out.nii -stat hist:-5.0:5.0:30:1 test.nii

++ 3dLocalstat: AFNI version=AFNI_23.0.04 (Feb 13 2023) [64-bit]
++ Authored by: Emperor Zhark
++ Using default neighborhood = self + 6 neighbors
++ Neighborhood comprises 7 voxels
++ Start sub-brick [0]
++ Start sub-brick [1]
++ Start sub-brick [30]
** ERROR: nifti_image_write_engine: NBL does not match nim
++ Output dataset ./out.nii


Thanks very much for pointing that out! I can see the same, and it definitely seems like some bugby behavior. it happens for some, but not all, -stat .. calls. We will chase this up and report back.


Thanks, @Philip. Paul and I looked into this and indeed any input time dimension was not being cleared when running localstat. This should be fixed with the next build.
Thanks again,

  • rick