omni.interface#

Python/C++ Interface for Omni.

This file contains the python side wrapper for the underlying C++ code.

Classes

OmniInterface(*args, **kwargs)

Wrapper for interface object.

class omni.interface.OmniInterface(*args, **kwargs)[source]#

Wrapper for interface object.

Does python level preprocessing before hand over to the C++ backend.

Attributes:
link

Returns the _interface object for direct access.

Methods

set_img:

Sets an image to pass into the C++ interface.

get_img:

Gets an image from the C++ interface.

get_img(name: str, affine: Optional[ndarray] = None, ref: Optional[Nifti1Image] = None, clip: Optional[List[float]] = None) Nifti1Image[source]#

Returns a Nifti1Image from the array stored at “name”.

Uses default nibabel image header information if affine/header is not defined. The ref variable can also be used to specify the image header information.

Parameters:
name: str

Key for image to get from C++ interface table.

affine: np.ndarray

Affine to use for returned image.

ref: nib.Nifti1Image

Reference image to use for header of returned image.

clip: List[float]

Clipping limits to apply to image data.

Returns:
nib.Nifti1Image

Return image represented by key from C++ interface.

Returns the _interface object for direct access.

set_img(name: str, image: Nifti1Image) None[source]#

Stores a Nifti1Image in omnireg database at “name”.

Parameters:
name: str

Key to save the image at in C++ interface table.

image: nib.Nifti1Image

Image to save.