AFNI version info (afni -ver):
Precompiled binary macos_13_ARM: May 19 2026 (Version AFNI_26.1.02 'Balbinus')
I am converting monkey CT and MRI scans from DICOMs to AFNI
I have always used Dimon for that, and it worked great for me, and still works great for T1 MRI, T2 MRI, and CT. Orientation is wrong but I fix it with 3drefit.
I now started converting TOF scans (acquired in the same session as T1 and T2), and my standard Dimon call does not get the slice distance right. Instead of 0.4 mm, I get 12.8 mm.
Here is how I call Dimon:
set noglob
dimon -infile_pattern *.dcm \
-dicom_org \
-gert_create_dataset \
-gert_to3d_prefix ${subjname}_${scan_type}
unset noglob
And the output is: (note that Dimon reports z_delta 0.4 which I think is correct, but to3d reports Voxel dimensions: 0.1953 X 0.1953 X 12.8000 mm
Dimon version 4.36 (March 28, 2025) running, use <ctrl-c> to quit...
-- scanning for first volume
.
-- first volume found (136 slices)
-- scanning for additional volumes...
-- run 4: 1
final run statistics:
volume info :
slices : 136
z_first : -20.05
z_last : 33.95
z_delta : 0.4
oblique : no
mos_nslices : 0
run # 4 : volumes = 1, first file (#0) = Leclerc_4_1_DumO11.dcm
++ writing dimon file list to dimon.files.run.004
set OutlierCheck =
to3d -prefix LECL_TOF -@
++ to3d: AFNI version=AFNI_26.1.02 (May 19 2026) [64-bit]
++ Authored by: RW Cox
++ It is best to use to3d via the Dimon program.
++ Counting images: total=136 2D slices
*+ WARNING: If images are wrong, try using '-assume_dicom_mosaic'?
++ Each 2D slice is 464 X 512 pixels
++ Voxel dimensions: 0.1953 X 0.1953 X 12.8000 mm
++ Image data type = short
++ Reading images: ..................................
++ 3D dataset written to disk
I tried the -use_slice_loc option, but it did not fix the issue (and it messed up Dimon-ing the CT, which uses the same script).
Currently I am brute-force fixing it with an additional 3drefit:
if ($scan_type == TOF ) then
3drefit -zdel 0.4 \
${subjname}_${scan_type}+orig
endif
3drefit -orient $orient_string ${subjname}_${scan_type}+orig
but I was wondering if there is a way of fixing it at the source?
Also, reading 3drefit help:
-xdel dimx Makes the size of the voxel the given dimension,
-ydel dimy for the given axis (x,y,z); dimensions in mm.
-zdel dimz ** WARNING: if you change a voxel dimension, you will
probably have to change the origin as well.
-keepcen When changing a voxel dimension with -xdel (etc.),
also change the corresponding origin to keep the
center of the dataset at the same coordinate location.
I thought I should use -keepcen, but I found out that -keepcen puts the origin in a wrong location. When the crosshair was in the brain, z was around -750 mm, and when I did not use keepcen everything was fine. Am I misunderstanding something, or is -keepcen doing the opposite of the documentation?
