File Input/Output#
Sub-package containing reading/writing routines.
DeepMR provides reading and writing routines for common k-space (currently ISMRMRD, GEHC) and image space (DICOM, NIfTI) formats.
Image I/O routines#
Read image data from file. |
|
Write image to disk. |
K-Space I/O routines#
Read kspace data from file. |
Header I/O routines#
Read acquisition header from file. |
|
Write acquisition header to file. |
Generic I/O routines#
DeepMR also contains generic I/O routines that can be used to write custom I/O functions for other formats. As a general rule, functions should have these signatures:
# Custom reading routines
image, head = read_custom_image(filepath, *args, head=None, **kwargs) # image
data, head = read_custom_rawdata(filepath, *args, head=None, **kwargs) # k-space
head = read_custom_acqheader(filepath, *args, **kwargs) # header
# Custom writing routines
write_custom_image(filepath, image, *args, **kwargs) # image
write_custom_rawdata(filepath, data, *args, **kwargs) # k-space
write_custom_acqheader(filepath, head, *args, **kwargs) # header
Read matfile as a Python dictionary. |
|
Read HDF5 file as a Python dictionary |
|
Write a given dictionary to HDF5 file. |