Export orientation help

43 views
Skip to first unread message

Mark Pinsk

unread,
Jan 12, 2023, 2:28:38 PM1/12/23
to DSI Studio
Hi Frank

I am trying to export to nifti and have the orientation, fov, etc match the original nifti input that I used to create the SRC.  I'm not having any luck, and wonder how to do this. My exported nifti does not match, and a quick look using 3dinfo shows some differences.

My commands are below, and I've uploaded a sample dataset (pinsk-sample-dataset.zip).   Thank you! Mark

# Convert nii to src
dsi_studio \
--action=src \
--source=data.nii.gz \
--bval=bvals \
--bvec=bvecs \
--up_sampling=0 \
--output=ses-01.src.gz

# Convert src to fib
dsi_studio \
--action=rec \
--source=ses-01.src.gz \
--method=4 \
--param0=1.25 \
--check_btable=1 \
--align_acpc=0 \
--other_output=all \
--output=ses-01.gqi.fib.gz

# Export QA nii
dsi_studio \
--action=exp \
--source=ses-01.gqi.fib.gz \
--export=qa



3dinfo data.nii.gz
Geometry String: "MATRIX(1.895302,0.111274,-0.073813,-125.4917,0.113576,-1.8957,0.058502,125.9683,0.07022,0.062769,1.897664,-81.11008):130,130,80"
Data Axes Tilt:  Oblique (4.030 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.492 [R] -to-   119.608 [L] -step-     1.900 mm [130 voxels]
A-to-P extent:  -119.132 [A] -to-   125.968 [P] -step-     1.900 mm [130 voxels]
I-to-S extent:   -81.110 [I] -to-    68.990 [S] -step-     1.900 mm [ 80 voxels]

3dinfo ses-01.gqi.fib.gz.qa.nii.gz
Geometry String: "MATRIX(1.9,0,0,-245.1,0,1.9,0,-245.1,0,0,1.9,0):130,130,80"
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:  -245.100 [R] -to-     0.000     -step-     1.900 mm [130 voxels]
A-to-P extent:  -245.100 [A] -to-     0.000     -step-     1.900 mm [130 voxels]
I-to-S extent:     0.000     -to-   150.100 [S] -step-     1.900 mm [ 80 voxels]



Mark Pinsk

unread,
Jan 12, 2023, 4:50:56 PM1/12/23
to DSI Studio
I made some progress:  It looks like I do a flip y (--cmd="[Step T2][Edit][Image flip y]") during reconstruction, and then use MRICRON to edit the header so it matches the input orientation, save out the nifti with the new header.

Is there a less tedious way to do this by any chance?

Fang-Cheng Yeh

unread,
Jan 12, 2023, 8:36:17 PM1/12/23
to dsi-s...@googlegroups.com
I would do similar. DSI Studio's [Tools][O1: View Image] can also overwrite header matrix.
Frank

--
You received this message because you are subscribed to the Google Groups "DSI Studio" group.
To unsubscribe from this group and stop receiving emails from it, send an email to dsi-studio+...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/dsi-studio/21a9cce1-453d-4d44-8c0d-69a0272e0736n%40googlegroups.com.

Mark Pinsk

unread,
Jan 12, 2023, 9:35:42 PM1/12/23
to DSI Studio
Great. But how do I do it in O1: View Image?   When I paste in the header values and go to File->Save Image, the updated image still has the original header when I close it and load it back into O1: View Image.  It looks like the header was not overwritten.

Mark Pinsk

unread,
Jan 12, 2023, 9:56:31 PM1/12/23
to DSI Studio
Oh I see, I paste in the Header-Set Translocation and Header-Set Transformation, and then Save.

(I was pasting into the values into Information column at first)

Fang-Cheng Yeh

unread,
Jan 13, 2023, 2:48:23 AM1/13/23
to dsi-s...@googlegroups.com
I usually copy values from another file and paste it using the "top menu function" (not in the header tab).

Mark Pinsk

unread,
Jan 13, 2023, 11:45:20 AM1/13/23
to DSI Studio
Got it, it works!

Also I just found that FSL has a convenient command-line tool that will do the same: fslcpgeom <source> <destination>
Reply all
Reply to author
Forward
0 new messages