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  

|
January 09, 2019 12:46PM
I have a MATLAB program that reads a 256x256x190 NIFTI image, processes it to get 4D image data, and writes the resulting 4D data out as a binary file of floating point vales. I'm then trying to use an AFNI program to convert the binary file to a NIFTI image with the same geometry and orientation as the original 3D NIFTI image, with the exception of being 4D rather then 3D. This seems like it should be a simple thing to do, and to3d almost works, but it's not setting the orientation properly. I've looked through the AFNI command line documentation, and I haven't found any solution, so any help would be appreciated. The 'to3d' command I'm trying to use and the input and resulting image formats are shown below. Thanks in advance!

Cheers,
Steve
===============

$ to3d -prefix newImg.nii -datum float -time:zt 190 3 4000 seqplus -geomparent parentIm.nii 3Df:0:0:256:256:570:temp.bin

$ 3dinfo parentIm.nii
...
Geometry String: "MATRIX(0.997633,-0.002181,-0.069076,-125.4405,0.01053,-0.982863,0.184971,64.55254,0.067951,0.184325,0.985491,-101.1443):256,256,190"
Data Axes Tilt: Oblique (11.330 deg. from plumb)
Data Axes Approximate Orientation:
first (x) = Right-to-Left
second (y) = Posterior-to-Anterior
third (z) = Inferior-to-Superior [-orient RPI]
R-to-L extent: -125.440 [R] -to- 129.560 [L] -step- 1.000 mm [256 voxels]
A-to-P extent: -190.447 [A] -to- 64.553 [P] -step- 1.000 mm [256 voxels]
I-to-S extent: -101.144 -to- 88.815 [S] -step- 1.005 mm [190 voxels]
Number of values stored at each pixel = 1
-- At sub-brick #0 '?' datum type is short

$ 3dinfo newImg.nii
...
Geometry String: "MATRIX(1,0,0,-125.4405,0,-1,0,64.55254,0,0,1.005076,-101.1443):256,256,190"
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: -125.440 [R] -to- 129.560 [L] -step- 1.000 mm [256 voxels]
A-to-P extent: -190.447 [A] -to- 64.553 [P] -step- 1.000 mm [256 voxels]
I-to-S extent: -101.144 -to- 88.815 [S] -step- 1.005 mm [190 voxels]
Number of time steps = 3 Time step = 4.00000s Origin = 0.00000s Number time-offset slices = 190 Thickness = 1.005
-- At sub-brick #0 '?' datum type is float: 0 to 2268.57
-- At sub-brick #1 '?' datum type is float: 0 to 3830.46
-- At sub-brick #2 '?' datum type is float: -1 to 1.68638e-19
Subject Author Posted

How can I create a NIFTI image with the same orientation as an existing NIFTI image

sroys January 09, 2019 12:46PM

Re: How can I create a NIFTI image with the same orientation as an existing NIFTI image

ptaylor January 09, 2019 02:03PM

Re: How can I create a NIFTI image with the same orientation as an existing NIFTI image

Phil Burton January 10, 2019 12:13PM

Re: How can I create a NIFTI image with the same orientation as an existing NIFTI image

sroys January 10, 2019 04:21PM

Re: How can I create a NIFTI image with the same orientation as an existing NIFTI image

sroys January 10, 2019 01:49PM