Skip to content

prediction_signal

Prediction parameters set by the user.

PredictionSignal dataclass #

Prediction signal class.

This class holds the parameters required to run the prediction thread. These parameters should be set whenever the user interact with the corresponding UI elements. An instance of the class is then passed to the prediction worker.

Source code in src/careamics_napari/signals/prediction_signal.py
@evented
@dataclass
class PredictionSignal:
    """Prediction signal class.

    This class holds the parameters required to run the prediction thread. These
    parameters should be set whenever the user interact with the corresponding UI
    elements. An instance of the class is then passed to the prediction worker.
    """

    load_from_disk: bool = True
    """Whether to load the images from disk or from the viewer."""

    if _has_napari:
        layer_pred: Image = None
        """Layer containing the data on which to predict."""

    path_pred: str = ""
    """Path to the data on which to predict."""

    is_3d: bool = False
    """Whether the data is 3D or 2D."""

    tiled: bool = False
    """Whether to predict the data in tiles."""

    tile_size_xy: int = 64
    """Size of the tiles along the X and Y dimensions."""

    tile_size_z: int = 8
    """Size of the tiles along the Z dimension."""

    tile_overlap_xy: int = 48  # TODO currently fixed
    """Overlap between the tiles along the X and Y dimensions."""

    tile_overlap_z: int = 4  # TODO currently fixed
    """Overlap between the tiles along the Z dimension."""

    batch_size: int = 1
    """Batch size."""

batch_size = 1 class-attribute instance-attribute #

Batch size.

is_3d = False class-attribute instance-attribute #

Whether the data is 3D or 2D.

layer_pred = None class-attribute instance-attribute #

Layer containing the data on which to predict.

load_from_disk = True class-attribute instance-attribute #

Whether to load the images from disk or from the viewer.

path_pred = '' class-attribute instance-attribute #

Path to the data on which to predict.

tile_overlap_xy = 48 class-attribute instance-attribute #

Overlap between the tiles along the X and Y dimensions.

tile_overlap_z = 4 class-attribute instance-attribute #

Overlap between the tiles along the Z dimension.

tile_size_xy = 64 class-attribute instance-attribute #

Size of the tiles along the X and Y dimensions.

tile_size_z = 8 class-attribute instance-attribute #

Size of the tiles along the Z dimension.

tiled = False class-attribute instance-attribute #

Whether to predict the data in tiles.