ImageLoader#

class petpal.io.image.ImageLoader(loader: collections.abc.Callable[[str], ants.ANTsImage] | None = None)#

Class for reading image files, with extensions such as Nifti or MGZ.

See also: :py:docs:`~ants.image_read`.

Example

from petpal.io.image import ImageLoader

image_loader = ImageLoader()
my_img = image_loader.load('/path/to/img.nii.gz')
Variables:

_loader – Function that loads an image file as an ants.ANTsImage object.

load(filename: str) ants.ANTsImage#

Public read API that delegates to the configured reader.

Parameters:

filename (str) – Path to file that will be loaded as ANTsImage.

Returns:

img (ants.ANTsImage) – Image object loaded into Python.

__call__(filename: str) ants.ANTsImage#