AFNI Message Board

Dear AFNI users-

We are very pleased to announce that the new AFNI Message Board framework is up! Please join us at:

https://discuss.afni.nimh.nih.gov

Existing user accounts have been migrated, so returning users can login by requesting a password reset. New users can create accounts, as well, through a standard account creation process. Please note that these setup emails might initially go to spam folders (esp. for NIH users!), so please check those locations in the beginning.

The current Message Board discussion threads have been migrated to the new framework. The current Message Board will remain visible, but read-only, for a little while.

Sincerely, AFNI HQ

History of AFNI updates  

|
May 20, 2021 11:21AM
Hi Folks,

We're in the process of updating several pieces of various pipelines, and one issue came up this morning.

We're transitioning our QA to be housed within an XNAT instance. Currently, AFNI datasets (time-series of EPI data) for the QA are generated in real-time by Dimon on our real-time PCs. However, when all data are already present in the XNAT instance, it seems to make more sense to do the conversion to NIFTI with dcm2niix within that environment.

This morning, when I was checking the 2 outputs, things looked reasonable. For the Dimon-generated dataset, the output of 3dinfo is:

++ 3dinfo: AFNI version=AFNI_18.1.09 (Apr 30 2018) [64-bit]

Dataset File: epiRTnih_scan_0003_20210513_181030__002+orig
Identifier Code: XYZ_HYCpswPFEf8JDcwNLBmMzA Creation Date: Thu May 13 18:10:37 2021
Template Space: ORIG
Dataset Type: Echo Planar (-epan)
Byte Order: LSB_FIRST [this CPU native = LSB_FIRST]
Storage Mode: BRIK
Storage Space: 108,864,000 (109 million [mega]) bytes
Geometry String: "MATRIX(3,0,0,-104.116,0,3,0,-134.274,0,0,3,-36.776):72,72,35"
Data Axes Tilt: Plumb
Data Axes Orientation:
first (x) = Right-to-Left
second (y) = Anterior-to-Posterior
third (z) = Inferior-to-Superior [-orient RAI]
R-to-L extent: -104.116 [R] -to- 108.884 [L] -step- 3.000 mm [ 72 voxels]
A-to-P extent: -134.274 [A] -to- 78.726 [P] -step- 3.000 mm [ 72 voxels]
I-to-S extent: -36.776 -to- 65.224 [S] -step- 3.000 mm [ 35 voxels]
Number of time steps = 300 Time step = 2.00000s Origin = 0.00000s
-- At sub-brick #0 '#0' datum type is short: 0 to 5965
-- At sub-brick #1 '#1' datum type is short: 0 to 5773
-- At sub-brick #2 '#2' datum type is short: 0 to 5763
** For info on all 300 sub-bricks, use '3dinfo -verb' **

----- HISTORY -----
[rtuser@afnipc: Thu May 13 18:10:37 2021] plug_realtime: creation


When I converted the DICOM data with dcm2niix, the output of 3dinfo on the resulting NIFTI data set is:

++ 3dinfo: AFNI version=AFNI_18.1.09 (Apr 30 2018) [64-bit]

Dataset File: DICOM_NIH_epiRT_phantom_QA_scan_20210513180749_2.nii
Identifier Code: NII_h3IQB_cuvU0luOtCJ5KdzA Creation Date: Thu May 20 10:59:13 2021
Template Space: ORIG
Dataset Type: Echo Planar (-epan)
Byte Order: LSB_FIRST {assumed} [this CPU native = LSB_FIRST]
Storage Mode: NIFTI
Storage Space: 108,864,000 (109 million [mega]) bytes
Geometry String: "MATRIX(3,0,0,-104.116,0,-3,0,78.726,0,0,3,-36.776):72,72,35"
Data Axes Tilt: Plumb
Data Axes Orientation:
first (x) = Right-to-Left
second (y) = Posterior-to-Anterior
third (z) = Inferior-to-Superior [-orient RPI]
R-to-L extent: -104.116 [R] -to- 108.884 [L] -step- 3.000 mm [ 72 voxels]
A-to-P extent: -134.274 [A] -to- 78.726 [P] -step- 3.000 mm [ 72 voxels]
I-to-S extent: -36.776 -to- 65.224 [S] -step- 3.000 mm [ 35 voxels]
Number of time steps = 300 Time step = 2.00000s Origin = 0.00000s
-- At sub-brick #0 '?' datum type is short
-- At sub-brick #1 '?' datum type is short
-- At sub-brick #2 '?' datum type is short
** For info on all 300 sub-bricks, use '3dinfo -verb' **


The extents of the datasets seemed to match perfectly, and the only difference I could really see what the "second(y)" axis, where in the Dimon-generated dataset, it is "Anterior-to-Posterior", whereas in the dcm2niix-generated dataset, it is the opposite, i.e. "Posterior-to-Anterior". So I tried to make that equivalent with:

3dcalc -RAI -a DICOM_NIH_epiRT_phantom_QA_scan_20210513180749_2.nii -expr "a * 1" -prefix DICOM_NIH_epiRT_phantom_QA_scan_20210513180749_2_RAI.nii

and the output of 3dinfo on the "RAI-ized" dcm2niiix-generated dataset is:

++ 3dinfo: AFNI version=AFNI_18.1.09 (Apr 30 2018) [64-bit]

Dataset File: DICOM_NIH_epiRT_phantom_QA_scan_20210513180749_2_RAI.nii
Identifier Code: XYZ_ZW8VejrefxaTur7jH1xXEg Creation Date: Thu May 20 10:04:14 2021
Template Space: ORIG
Dataset Type: Echo Planar (-epan)
Byte Order: LSB_FIRST {assumed} [this CPU native = LSB_FIRST]
Storage Mode: NIFTI
Storage Space: 108,864,000 (109 million [mega]) bytes
Geometry String: "MATRIX(3,0,0,-104.116,0,-3,0,78.726,0,0,3,-36.776):72,72,35"
Data Axes Tilt: Plumb
Data Axes Orientation:
first (x) = Right-to-Left
second (y) = Posterior-to-Anterior
third (z) = Inferior-to-Superior [-orient RPI]
R-to-L extent: -104.116 [R] -to- 108.884 [L] -step- 3.000 mm [ 72 voxels]
A-to-P extent: -134.274 [A] -to- 78.726 [P] -step- 3.000 mm [ 72 voxels]
I-to-S extent: -36.776 -to- 65.224 [S] -step- 3.000 mm [ 35 voxels]
Number of time steps = 300 Time step = 2.00000s Origin = 0.00000s
-- At sub-brick #0 '?' datum type is short: 0 to 5965
-- At sub-brick #1 '?' datum type is short: 0 to 5773
-- At sub-brick #2 '?' datum type is short: 0 to 5763
** For info on all 300 sub-bricks, use '3dinfo -verb' **

----- HISTORY -----
[me@mymachine: Thu May 20 10:04:14 2021] {AFNI_18.1.09:macosx_10.7_Intel_64} 3dcalc -RAI -a DICOM_NIH_epiRT_phantom_QA_scan_20210513180749_2.nii -expr 'a * 1' -prefix DICOM_NIH_epiRT_phantom_QA_scan_20210513180749_2_RAI.nii


which seems identical to the Dimon-generated dataset. However, when I try to compute the difference between the Dimon-generated dataset and the dcm2niix (both original and RAI-ized) datasets, the resulting difference is non-zero, and very apparently so. I can see the outline of the phantom, and the difference is definitely what I would say is above noise-threshold. When I run the 3dcalc command, I get this:

++ 3dcalc: AFNI version=AFNI_18.1.09 (Apr 30 2018) [64-bit]
++ Authored by: A cast of thousands
*+ WARNING: dataset 'b'=DICOM_NIH_epiRT_phantom_QA_scan_20210513180749_2_RAI.nii grid mismatch with ./epiRTnih_scan_0003_20210513_181030__002+orig.BRIK
++ Output dataset ./dimon-dcm2niix-diffs.nii


I am concerned about that "grid mismatch" message, despite all appearances (from the output of 3dinfo) that this should not be the case.

Can anyone shed any insights as to why 3dcalc is computing large differences between what should be the same data, just assembled by 2 different tools? For completeness, here's the output of 3dinfo on the "difference" dataset:

++ 3dinfo: AFNI version=AFNI_18.1.09 (Apr 30 2018) [64-bit]

Dataset File: dimon-dcm2niix-diffs.nii
Identifier Code: XYZ_gux8KsSFuoGrfvNKmqhdTA Creation Date: Thu May 20 10:05:01 2021
Template Space: ORIG
Dataset Type: Echo Planar (-epan)
Byte Order: LSB_FIRST {assumed} [this CPU native = LSB_FIRST]
Storage Mode: NIFTI
Storage Space: 108,864,000 (109 million [mega]) bytes
Geometry String: "MATRIX(3,0,0,-104.116,0,3,0,-134.274,0,0,3,-36.776):72,72,35"
Data Axes Tilt: Plumb
Data Axes Orientation:
first (x) = Right-to-Left
second (y) = Anterior-to-Posterior
third (z) = Inferior-to-Superior [-orient RAI]
R-to-L extent: -104.116 [R] -to- 108.884 [L] -step- 3.000 mm [ 72 voxels]
A-to-P extent: -134.274 [A] -to- 78.726 [P] -step- 3.000 mm [ 72 voxels]
I-to-S extent: -36.776 -to- 65.224 [S] -step- 3.000 mm [ 35 voxels]
Number of time steps = 300 Time step = 2.00000s Origin = 0.00000s
-- At sub-brick #0 '#0' datum type is short: -4812 to 4812
-- At sub-brick #1 '#1' datum type is short: -4708 to 4708
-- At sub-brick #2 '#2' datum type is short: -4702 to 4702
** For info on all 300 sub-bricks, use '3dinfo -verb' **

----- HISTORY -----
[me@mymachine: Thu May 20 10:05:01 2021] ===================================
[me@mymachine: Thu May 20 10:05:01 2021] === History of inputs to 3dcalc ===
[me@mymachine: Thu May 20 10:05:01 2021] === Input a:
[me@mymachine: Thu May 20 10:05:01 2021] [rtuser@afnipc: Thu May 13 18:10:37 2021] plug_realtime: creation
[me@mymachine: Thu May 20 10:05:01 2021] === Input b:
[me@mymachine: Thu May 20 10:05:01 2021]
[me@mymachine: Thu May 20 10:04:14 2021] {AFNI_18.1.09:macosx_10.7_Intel_64} 3dcalc -RAI -a DICOM_NIH_epiRT_phantom_QA_scan_20210513180749_2.nii -expr 'a * 1' -prefix DICOM_NIH_epiRT_phantom_QA_scan_20210513180749_2_RAI.nii
[me@mymachine: Thu May 20 10:05:01 2021] ===================================
[me@mymachine: Thu May 20 10:05:01 2021] {AFNI_18.1.09:macosx_10.7_Intel_64} 3dcalc -a epiRTnih_scan_0003_20210513_181030__002+orig -b DICOM_NIH_epiRT_phantom_QA_scan_20210513180749_2_RAI.nii -expr a-b -datum short -prefix dimon-dcm2niix-diffs.nii


Thanks everyone!
Subject Author Posted

Differences between datasets generated by Dimon vs dcm2niix?

roopchansinghv May 20, 2021 11:21AM

Re: Differences between datasets generated by Dimon vs dcm2niix?

rick reynolds May 21, 2021 10:20AM

Re: Differences between datasets generated by Dimon vs dcm2niix?

Peter Molfese May 21, 2021 10:27AM

Re: Differences between datasets generated by Dimon vs dcm2niix?

roopchansinghv May 21, 2021 11:17AM

Re: Differences between datasets generated by Dimon vs dcm2niix?

roopchansinghv May 21, 2021 11:15AM

Re: Differences between datasets generated by Dimon vs dcm2niix?

rick reynolds May 21, 2021 01:50PM