This package implements a simple 4dfp-reading function Fourdfp.load(filename)
for the Julia language.
4dfp is a format for storing volumetric fMRI images, developed at Washington University in St. Louis by Avi Snyder. For further information, see its documentation.
Within Julia:
using Pkg
Pkg.add("Fourdfp")
Just call Fourdfp.load(filename)
, optionally with a byte_order
keyword argument (LittleEndian
or BigEndian
). If the latter is omitted, the package will attempt to determine your file's byte order by parsing its .ifh (inter-file header) file. Since 4dfp files come in sets of 3 or 4 (.4dfp.img, .4dfp.ifh, .4dfp.hdr), the filename you specify can be any one of that set or for brevity you can just omit the .4dfp.* file extension.
using Fourdfp
my_data_array = Fourdfp.load(filename; byte_order = LittleEndian)
The return value will be an Array{Float32, 4}, where the dimensions represent x, y, z, and time.