Skip to content

Commit

Permalink
seed correl v16 documentation + avi initial feedback changes
Browse files Browse the repository at this point in the history
  • Loading branch information
hacevedo committed Mar 27, 2018
1 parent 76d4601 commit 0c7bdd1
Show file tree
Hide file tree
Showing 7 changed files with 213 additions and 155 deletions.
3 changes: 2 additions & 1 deletion README.rst
Original file line number Diff line number Diff line change
Expand Up @@ -4,5 +4,6 @@

The 4dfp (4-dimensional floating point) format was designed for functional neuroimaging. The four dimensions typically correspond to x, y, z, and time. Three dimensional structural images can be represented in 4dfp format by setting the depth of the fourth dimension to 1.

.. TODO: add info about why 4dfp is different from other image formats
.. note:: NIFTII and 4dfp images are ALWAYS y-flipped to each other. Be sure to use 4dfp tools to convert back and forth, so that this is accounted for.
.. note:: NIfTI and 4dfp images are ALWAYS y-flipped to each other. Be sure to use 4dfp tools to convert back and forth, so that this is accounted for.
4 changes: 4 additions & 0 deletions docs/conf.py
Original file line number Diff line number Diff line change
Expand Up @@ -90,6 +90,10 @@
#
# html_theme_options = {}

html_context = {
'css_files': ['_static/style.css']
}

# Add any paths that contain custom static files (such as style sheets) here,
# relative to this directory. They are copied after the builtin static files,
# so a file named "default.css" will overwrite the builtin "default.css".
Expand Down
79 changes: 34 additions & 45 deletions docs/format.rst
Original file line number Diff line number Diff line change
Expand Up @@ -3,19 +3,18 @@ Format
------

The voxel data are stored in the form of a binary image as one UNIX file.
Consequently, 4dfp images may be directly loaded and viewed using IDL, matlab, analyze_avw, etc. Information critical to interpreting the binary data (e.g., orientation, image dimensions, voxel dimensions) are stored in separate header file(s). The 4dfp UNIX file name convention is demonstrated below ::
Consequently, 4dfp images may be directly loaded and viewed using IDL, matlab, fsleyes, etc. Information critical to interpreting the binary data (e.g., orientation, image dimensions, voxel dimensions) are stored in separate header file(s).
The 4dfp UNIX file name convention is demonstrated below, where filename is any valid filename string::

<filename>.4dfp.img # binary float voxel data
<filename>.4dfp.ifh # interfile header (ASCII text)
<filename>.4dfp.hdr # ANALYZE 7.5 header (binary)
<filename>.4dfp.img.rec # creation history
<filename>.4dfp.img.rec # creation history

where <filename> is any valid filename string.
All 4dfp based image analysis programs used at the Washington University School of Medicine Neuroimaging Laboratory (NIL) read/write interfile headers. The minimal 4dfp format is comprised of the binary image data (.img) and the interfile header (.ifh). All NIL image analysis programs maintain an additional rec file (.img.rec), which records the image creation history.

All 4dfp based image analysis programs used at the Washington University School of Medicine Neuroimaging Laboratory (NIL) read/write interfile headers. The minimal 4dfp format is comprised of the binary image data (.img) and the interfile header (.ifh). To view 4dfp images using analyze_avw it is necessary to create an ANALYZE header file (.hdr). A utility for this purpose (ifh2hdr) is available. All NIL image analysis programs maintain an additional rec file (.img.rec), which records the mage creation history.


Image Data
Image data
==========

The 4dfp file format was developed to manage human head images acquired with a Siemens MRI scanner. The imato4dfp utility converts Siemens slice-based image (.ima) files into 4dfp format. This is accomplished by extracting (without reordering) the stored pixel values, converting short int to to float and writing the results to the 4dfp image file. Within each 3D volume the Siemens .ima files are read in order of decreasing image number.
Expand All @@ -34,7 +33,7 @@ Acquired orientation Flip axes First voxel (after flipping)

The above enumerated axis flips may be effected in analyze_avw at 4dfp image load time. Alternatively, 4dfp format may be converted to ANALYZE 7.5 format using the 4dfptoanalyze utility which automatically performs the indicated axis flips as it converts the voxel value number format from float to short int. 4dfp image data loaded into analyze_avw as prescribed above will be consistently resliced by analyze_avw. That is, all Siemens acquisition orientations will be consistently displayed in all analyze orientations (transverse, coronal, sagittal).

.. note:: x, y, and z denote voxel indices as ordered in memory. That is, if the x, y, and z indices run from 0 to nx-1, 0 to ny-1, and 0 to nz-1, then coordinate (x,y,z) is stored relative to the first voxel of each frame at offset x + nx*(y + ny*z).
.. note:: x, y, and z denote voxel indices as ordered in memory. That is, if the x, y, and z indices run from 0 to nx-1, 0 to ny-1, and 0 to nz-1, then coordinate (x,y,z) is stored relative to the first voxel of each frame at offset x + nx*(y + ny*z).


Interfile header
Expand All @@ -45,34 +44,25 @@ The image data (vm6c_b1.4dfp.img) were acquired in one 128 frame fMRI run.
Each frame has dimensions 64 x 64 x 18, The acquired voxels are 3 mm cubic. ::

version of keys := 3.3
image modality := mri
originating system := MAGNETOM VISION
conversion program := imato4dfp2
program version := $Id: imato4dfp2.c,v 1.12 2000/05/05 00:56:18 avi Exp $
original institution := Washington University
name of data file := vm6c_b1
patient ID := vm6c
date := 22-FEB-1999
number format := float
conversion program := nifti_4dfp
name of data file := T1w_acpc_dc.4dfp.ifh
number of bytes per pixel := 4
orientation := 3
time series flag := 1
imagedata byte order := littleendian
orientation := 2
number of dimensions := 4
scaling factor (mm/pixel) [1] := 3.000000
scaling factor (mm/pixel) [2] := 3.000000
scaling factor (mm/pixel) [3] := 3.000000
slice thickness (mm/pixel) := 3.000000
matrix size [1] := 64
matrix size [2] := 64
matrix size [3] := 18
matrix size [4] := 128
global minimum := 0
global maximum := 4095
mri parameter file name := Initialized by sequence
mri sequence file name := /usr/users/tec/nbea_uc_tg2.ekc
mri sequence description := ep_fid
matrix size [1] := 260
matrix size [2] := 311
matrix size [3] := 260
matrix size [4] := 1
scaling factor (mm/pixel) [1] := 0.700000
scaling factor (mm/pixel) [2] := 0.700000
scaling factor (mm/pixel) [3] := 0.700000
mmppix := 0.700000 -0.700000 -0.700000
center := 92.0000 -91.7000 -110.0000

Various image analysis programs may make use of additional interfile header fields. The minimal set of fields required to interpret the voxel data is listed below ::

Various image analysis programs may make use of additional interfile header fields. The minimal set of fields required to interpret the voxel data is listed below::

number format := float
number of bytes per pixel := 4
Expand All @@ -87,7 +77,7 @@ Various image analysis programs may make use of additional interfile header fiel
matrix size [4] := 128


Rec file
rec file
========

The rec file format was designed to capture the creation history of each
Expand All @@ -104,47 +94,47 @@ particular 4dfp image. This is accomplished automatically provided that each UNI
The critical feature of the rec file convention is inclusion of antecedent rec files at all stages of processing. It follows that rec files corresponding to averaged images may grow large. The key words "rec" (first field of first line) and "endrec" (first field of last line) guarantee secure parsing of the accumulated processing history. The following is a listing of the rec file corresponding to the above illustrated interfile header after being passed through rmspike_4dfp and deband_4dfp ::

rec vm6c_b1_rmsp_dbnd.4dfp.img Thu May 18 17:16:23 2000 avi
/data/petsun4/data1/solaris/deband_4dfp -n4 vm6c_b1_rmsp
/data/petsun4/data1/solaris/deband_4dfp -n4 vm6c_b1_rmsp
$Id: deband_4dfp.c,v 1.8 1999/11/20 00:55:49 avi Exp $
Frame 1 slice multipliers: even=0.837060 odd=1.162940
Frame 2 slice multipliers: even=0.997099 odd=1.002901
Frame 3 slice multipliers: even=0.985484 odd=1.014516
Frame 4 slice multipliers: even=0.986583 odd=1.013417
Functional frame slice multipliers: even=0.986982 odd=1.013018
rec vm6c_b1_rmsp.4dfp.img Thu May 18 17:16:13 2000 avi
/data/petsun4/data1/solaris/rmspike_4dfp -n4 -x33 vm6c_b1
/data/petsun4/data1/solaris/rmspike_4dfp -n4 -x33 vm6c_b1
$Header: /data/petsun4/src_solaris/rmspike_4dfp/RCS/rmspike_4dfp.c,v 2.6 1997/05/23 00:49:24 yang Exp $
No spike found in vm6c_b1.4dfp.img
rec vm6c_b1.4dfp.img Thu May 18 17:15:18 2000 avi
/data/petsun4/data1/solaris/imato4dfp2 -fy /data/petsun23/vm6c/siem_im/bold1/5250 7 7 vm6c_b1
/data/petsun4/data1/solaris/imato4dfp2 -fy /data/petsun23/vm6c/siem_im/bold1/5250 7 7 vm6c_b1
$Id: imato4dfp2.c,v 1.12 2000/05/05 00:56:18 avi Exp $
patient_id: vm6c
institution: Washington University
manufacturer_model: MAGNETOM VISION
parameter_file_name: Initialized by sequence
sequence_file_name: /usr/users/tec/nbea_uc_tg2.ekc
sequence_description: ep_fid 90 TR 135.2 TE 37.0/1
tilts: Cor>Tra -12
4dfp_dimensions: 64 64 18 128
voxel_dimensions: 3.000000 3.000000 3.000000
tilts: Cor>Tra -12
4dfp_dimensions: 64 64 18 128
voxel_dimensions: 3.000000 3.000000 3.000000
scan_date: 22-FEB-1999
scan_time: 14:06:33-14:06:33
endrec Thu May 18 17:15:18 2000 avi
endrec
endrec Thu May 18 17:16:26 2000 avi

The brec (beautify rec file) utility parses rec files and writes to stdout a more easily readable version of the text. Here is the above rec file filtered through brec ::

1rec vm6c_b1_rmsp_dbnd.4dfp.img Thu May 18 17:16:23 2000 avi
1 /data/petsun4/data1/solaris/deband_4dfp -n4 vm6c_b1_rmsp
1 /data/petsun4/data1/solaris/deband_4dfp -n4 vm6c_b1_rmsp
1 $Id: deband_4dfp.c,v 1.8 1999/11/20 00:55:49 avi Exp $
1 Frame 1 slice multipliers: even=0.837060 odd=1.162940
1 Frame 2 slice multipliers: even=0.997099 odd=1.002901
1 Frame 3 slice multipliers: even=0.985484 odd=1.014516
1 Frame 4 slice multipliers: even=0.986583 odd=1.013417
1 Functional frame slice multipliers: even=0.986982 odd=1.013018
2 rec vm6c_b1_rmsp.4dfp.img Thu May 18 17:16:13 2000 avi
2 /data/petsun4/data1/solaris/rmspike_4dfp -n4 -x33 vm6c_b1
2 /data/petsun4/data1/solaris/rmspike_4dfp -n4 -x33 vm6c_b1
2 $Header: /data/petsun4/src_solaris/rmspike_4dfp/RCS/rmspike_4dfp.c,v 2.6 1997/05/23 00:49:24 yan
2 No spike found in vm6c_b1.4dfp.img
3 rec vm6c_b1.4dfp.img Thu May 18 17:15:18 2000 avi
Expand All @@ -156,12 +146,11 @@ The brec (beautify rec file) utility parses rec files and writes to stdout a mor
3 parameter_file_name: Initialized by sequence
3 sequence_file_name: /usr/users/tec/nbea_uc_tg2.ekc
3 sequence_description: ep_fid 90 TR 135.2 TE 37.0/1
3 tilts: Cor>Tra -12
3 4dfp_dimensions: 64 64 18 128
3 voxel_dimensions: 3.000000 3.000000 3.000000
3 tilts: Cor>Tra -12
3 4dfp_dimensions: 64 64 18 128
3 voxel_dimensions: 3.000000 3.000000 3.000000
3 scan_date: 22-FEB-1999
3 scan_time: 14:06:33-14:06:33
3 endrec Thu May 18 17:15:18 2000 avi
2 endrec
1endrec Thu May 18 17:16:26 2000 avi

29 changes: 21 additions & 8 deletions docs/global.rst
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
.. role:: required
.. |br| raw:: html

</br>
Expand Down Expand Up @@ -29,7 +30,7 @@
.. |fstd_vals| replace:: <int array>
.. |fstd_desc| replace:: list of scan numbers that map to run folders

.. |gre_vals| replace:: <array>
.. |gre_vals| replace:: <int array>
.. |gre_desc| replace:: gradient echo measured field map scan numbers (magnitude image should be first, followed by phase image)

.. |irun_vals| replace:: <str array>
Expand All @@ -39,17 +40,32 @@
.. |mprs_desc| replace:: list of mprage scan numbers

.. |patid_vals| replace:: <str>
.. |patid_desc| replace:: participant folder
.. |patid_desc| replace:: unique identifier for current subject/session

.. |pdt2_vals| replace:: <array>
.. |pdt2_vals| replace:: <int array>
.. |pdt2_desc| replace:: list containing one study number for ptd

.. |sefm_vals| replace:: <array>
.. |ROIdir_vals| replace:: <str>
.. |ROIdir_desc| replace:: directory containing ROI image(s)

.. |ROIimg_vals| replace:: <str>
.. |ROIimg_desc| replace:: base filename for single ROI image

.. |ROIlist_vals| replace:: <str array>
.. |ROIlist_desc| replace:: list of base filenames for ROI images

.. |ROIlistfile_vals| replace:: <str>
.. |ROIlistfile_desc| replace:: list file (.lst) of base filenames for ROI image

.. |sefm_vals| replace:: <int array>
.. |sefm_desc| replace:: spin echo measured field maps

.. |srcdir_vals| replace:: <str>
.. |srcdir_desc| replace:: source directory path (contains run directories)

.. |tse_vals| replace:: <int array>
.. |tse_desc| replace:: list of tse scan numbers

.. |workdir_vals| replace:: <str>
.. |workdir_desc| replace:: working directory path

Expand Down Expand Up @@ -111,7 +127,7 @@
.. |FDtype_desc| replace:: frame displacement calculation (1 = absolute value, 2 = squares)

.. |fmtfile_vals| replace:: <str>
.. |fmtfile_desc| replace:: format file (if unspecified, frame censoring will be calculated)
.. |fmtfile_desc| replace:: format file

.. |FWHM_vals| replace:: <int>
.. |FWHM_desc| replace:: full-width half maximum for spatial blur (default = 6)
Expand All @@ -131,9 +147,6 @@
.. |lomotil_vals| replace:: <int>
.. |lomotil_desc| replace:: lowpass filter specified motion parameter (:ref:`mat2dat`)

.. |MB_enable_vals| replace:: 0,1
.. |MB_enable_desc| replace:: enable slicing timing correction and debanding

.. |MB_skip_vals| replace:: 0,1
.. |MB_skip_desc| replace:: skip slice timing correction and debanding

Expand Down

0 comments on commit 0c7bdd1

Please sign in to comment.