MIRTio.jl Documentation

Contents

Overview

File I/O routines useful for the Michigan Image Reconstruction Toolbox (MIRT)

Index

Functions

MIRTio.MIRTioModule

MIRTio I/O routines for Michigan Image Reconstruction Toolbox (MIRT)

source
MIRTio.h5_get_ESCMethod
esc = h5_get_ESC(filename::String; T::DataType = ComplexF32)

Return Array of ESC (emulated single coil) data from file.

HDF5.jl reads the data differently than Python's h5py. This is significant because the fastMRI paper says that the datasets have certain dimensionality, but the dimensions are permuted in Julia compared to Python, hence the calls to permutedims in the following functions.

source
MIRTio.h5_get_RSSMethod
rss = h5_get_RSS(filename::String; T::DataType = ComplexF32)

Return Array of RSS (root sum of squares) data from file.

source
MIRTio.h5_get_keysMethod
keys = h5_get_keys(filename::String)

Get keys from file using keys(). Returns an Array{String}

source
MIRTio.h5_get_kspaceMethod
kspace = h5_get_kspace(filename::String; T::DataType = ComplexF32))

Return Array of kspace data from file.

source
MIRTio.header_initMethod
ht = header_init(hd::Matrix{Any})

Return named tuple initialized with arbitrary values for testing

in

  • hd header definition array (N × 3), e.g., from header_example()

out

  • ht::NamedTuple
source
MIRTio.header_readMethod
ht = header_read(fid::IOStream, hd::Matrix{Any} ; seek0::Bool)

Read header from scan file

in

  • fid::IOStream from open(file, "r")
  • hd header definition array (N × 3), e.g., from header_example()

option

  • seek0::Bool seek to 0 location in file first? default true

out

  • ht::NamedTuple with header values, accessed by ht.key
source
MIRTio.header_sizeMethod
bytes = header_size(hd::Matrix{Any})

return total size of header in bytes

in

  • hd header definition array (N × 3), e.g., from header_example()

out = bytes::Int

source
MIRTio.header_stringMethod
ht = header_string(ht::NamedTuple ; strip::Bool)

Convert each Array{Cuchar} to String in NamedTuple

in

  • ht::NamedTuple from header_init() or header_read()

option

  • strip::Bool strip tail white space characters from strings? default false

out

  • ht::NamedTuple
source
MIRTio.header_writeMethod
header_write(fid::IOStream, ht::NamedTuple)

Write header to fid

in

  • fid::IOStream from open(file, "w")
  • ht::NamedTuple from header_init() or header_read()
source
MIRTio.loadpfileMethod
(dat, rdb_hdr) = loadpfile(fid::IOStream ; ...)

Load data for one or more echoes from GE MRI scan Pfile.

in

  • fid::IOStream

option

  • coils::AbstractVector{Int}

only get data for these coils; default: all coils

  • echoes::AbstractVector{Int}

only get data for these echoes; default: all echoes

  • slices::AbstractVector{Int}

only get data for these slices; default: 2:nslices (NB!) because first slice (dabslice=0 slot) may contain corrupt data.

  • views::AbstractVector{Int}

only get data for these views; default: all views

  • quiet::Bool non-verbosity, default false

out

  • dat::Array{Complex{Int16}} [ndat, ncoil, nslice, necho, nview]
  • rdb_hdr::NamedTuple header information

To save memory the output type is complex-valued Int16.

source
MIRTio.loadpfileMethod
(dat, rdb_hdr) = loadpfile(file, echo::Integer ; ...)

Load a single echo from file.

source
MIRTio.read_rdb_hdrMethod
ht = read_rdb_hdr(fid::IOStream)

Read GE raw (RDB) header for MRI scans

Returns NamedTuple ht with header values accessible by ht.key

source