snake.core.handlers.fov#

Handler for modifying the Field of View of the Phantom.

TODO: Add a FOV-motion handler that combines FOV and motion (moving the head is equivalent to changing the center point of FOV + angles).

Module Contents#

Classes#

FOVHandler

Handler that update the FOV of the simulation.

Functions#

extract_rotated_3d_region

Extract a rotated 3D rectangular region from a larger 3D array.

_apply_transform

API#

snake.core.handlers.fov.extract_rotated_3d_region(volume: numpy.typing.NDArray, center: snake._meta.ThreeInts, size: snake._meta.ThreeInts, angles: snake._meta.ThreeFloats, zoom_factor: snake._meta.ThreeFloats) numpy.typing.NDArray[source]#

Extract a rotated 3D rectangular region from a larger 3D array.

Parameters:
  • volume (np.ndarray) – The 3D source array.

  • center (tuple) – The center (x, y, z) of the desired region in the original array.

  • size (tuple) – The size (dx, dy, dz) of the extracted region.

  • float (tuple) – The rotation angles (rx, ry, rz) in degrees.

Returns:

np.ndarray

Return type:

The extracted 3D region.

snake.core.handlers.fov._apply_transform(input: numpy.typing.NDArray, output: numpy.typing.NDArray, i: int, center: snake._meta.ThreeInts, size: snake._meta.ThreeInts, angles: snake._meta.ThreeFloats, zoom_factor: snake._meta.ThreeFloats) None[source]#
class snake.core.handlers.fov.FOVHandler[source]#

Bases: snake.core.handlers.base.AbstractHandler

Handler that update the FOV of the simulation.

Parameters:
__handler_name__ = 'fov-select'#
center: tuple[float, float, float] = None#
size: tuple[float, float, float] = None#
angles: tuple[float, float, float] = None#
target_res: tuple[float, float, float] = None#
get_static(phantom: snake.core.phantom.Phantom, sim_conf: snake.core.simulation.SimConfig) snake.core.phantom.Phantom[source]#

Modify the FOV of the phantom.