Jun 24 2022 (Version AFNI_22.1.14 'Antoninus Pius')
When running 2dImReg I get the following error:
Notice 2dImreg: nx=82 ny=82 nz=56 dx=3.024390 dy=-3.024391 dz=3.000000
Dataset does not have square slices
I'd like to identify where 2dImReg.c code is failing and how to fix the dimensions so 2dImReg will run. AFNI tools don't have sufficient precision to tell me what is wrong.
2dImReg.c
nx = old_dset->daxes->nxx ; dx = old_dset->daxes->xxdel ;
ny = old_dset->daxes->nyy ; dy = old_dset->daxes->yydel ; npix = nx*ny ;
nz = old_dset->daxes->nzz ; dz = old_dset->daxes->zzdel ;
if( nx != ny || fabs(dx) != fabs(dy) ){
/* No need to quit, works fine. ZSS 07
* Only if nx >= ny (so fix might be easy). 12 Jan 2010 [rickr] */
if (opt->debug)
fprintf(stderr,"\nNotice 2dImreg: nx=%d ny=%d nz=%d dx=%f dy=%f dz=%f\n",
nx,ny,nz,dx,dy,dz ) ;
return "***********************************\n"
"Dataset does not have square slices\n"
"***********************************" ;
Results from original dicom header of the bold data:
dicom_hdr
0018 1310 8 [7970 ] // ACQ Acquisition Matrix// 82 0 0 82
0028 0030 32 [9272 ] // IMG Pixel Spacing//3.0243902206421\3.0243902206421
So, square out to 13 places?
nifti_tool -disp_hdr
dim 40 8 4 82 82 56 572 1 1 1
intent_p1 56 1 0.0
intent_p2 60 1 0.0
intent_p3 64 1 0.0
intent_code 68 1 0
datatype 70 1 512
bitpix 72 1 16
slice_start 74 1 0
pixdim 76 8 -1.0 3.02439 3.02439 3.0 0.48 0.0 0.0 0.0
nifti_tool -disp_nim
dim 64 8 4 82 82 56 572 1 1 1
nvox 128 1 215383168
nbyper 136 1 2
datatype 140 1 512
dx 144 1 3.02439
dy 152 1 3.02439
dz 160 1 3.0
dt 168 1 0.48
du 176 1 0.0
dv 184 1 0.0
dw 192 1 0.0
pixdim 200 8 0.0 3.02439 3.02439 3.0 0.48 0.0 0.0 0.0
I have tried to fix with AFNI tools with no success:
nifti_tool -mod_nim -prefix mod_nim_dx_dy -infiles bold.nii.gz -mod_field dx 3.0243902206421 -mod_field dy 3.0243902206421 -mod_field pixdim '0.0 3.0243902206421 3.0243902206421 3.0 0.48 0.0 0.0 0.0'
2dImReg -input mod_nim_dx_dy.nii -prefix test.nii.gz -debug
Notice 2dImreg: nx=82 ny=82 nz=56 dx=3.024390 dy=-3.024391 dz=3.000000
Dataset does not have square slices
Seems like the issue could be in the THD_3dim_dataset code.
Could you help me identify where and why 'dy' becomes '3.024391' so I can fix it?
thanks