Skip to content

napari_cellseg3d.code_models.models.model_TRAILMAP_MS

TRAILMAP model, reimplemented in PyTorch.

Classes:

Name Description
TRAILMAP_MS_

TRAILMAP_MS wrapper for napari_cellseg3d.

TRAILMAP_MS_

Bases: UNet3D

TRAILMAP_MS wrapper for napari_cellseg3d.

Methods:

Name Description
__init__

Create a TRAILMAP_MS model.

Source code in napari_cellseg3d/code_models/models/model_TRAILMAP_MS.py
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
class TRAILMAP_MS_(UNet3D):
    """TRAILMAP_MS wrapper for napari_cellseg3d."""

    weights_file = "TRAILMAP_MS_best_metric.pth"
    default_threshold = 0.15

    # original model from Liqun Luo lab, transferred to pytorch and trained on mesoSPIM-acquired data (mostly TPH2 as of July 2022)

    def __init__(self, in_channels=1, out_channels=1, **kwargs):
        """Create a TRAILMAP_MS model.

        Args:
        in_channels (int): number of input channels
        out_channels (int): number of output channels.
        **kwargs: additional arguments to UNet3D.
        """
        try:
            super().__init__(
                in_channels=in_channels, out_channels=out_channels, **kwargs
            )
        except TypeError as e:
            logger.warning(f"Caught TypeError: {e}")
            super().__init__(in_channels=in_channels, out_channels=out_channels)

__init__

__init__(in_channels=1, out_channels=1, **kwargs)

Create a TRAILMAP_MS model.

Args: in_channels (int): number of input channels out_channels (int): number of output channels. **kwargs: additional arguments to UNet3D.

Source code in napari_cellseg3d/code_models/models/model_TRAILMAP_MS.py
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
def __init__(self, in_channels=1, out_channels=1, **kwargs):
    """Create a TRAILMAP_MS model.

    Args:
    in_channels (int): number of input channels
    out_channels (int): number of output channels.
    **kwargs: additional arguments to UNet3D.
    """
    try:
        super().__init__(
            in_channels=in_channels, out_channels=out_channels, **kwargs
        )
    except TypeError as e:
        logger.warning(f"Caught TypeError: {e}")
        super().__init__(in_channels=in_channels, out_channels=out_channels)