LION.utils.spyrit_import

Import spyrit only where its operators are needed.

spyrit (single-pixel imaging) gives LION the fast Walsh-Hadamard transform of the Walsh-Hadamard and photocurrent mapping operators. Like tomosipo (CT) and mrpro (MRI), it is imported through import_spyrit where it is used, so that import LION does not load it, nor torchvision and sympy, which it imports, and a missing installation gives a clear error at the point of use.

Functions

import_spyrit([module, feature])

The module module (spyrit or one of its submodules, e.g. spyrit.core.torch), imported, or an ImportError that says what is missing and how to install it.


LION.utils.spyrit_import.import_spyrit(module='spyrit', feature='This operator')[source]

The module module (spyrit or one of its submodules, e.g. spyrit.core.torch), imported, or an ImportError that says what is missing and how to install it. feature: what needs it, for the message (e.g. “WalshHadamard2D”).