Skip to content

microsplit_algorithm_model

MicroSplit algorithm configuration.

MicroSplitAlgorithm #

Bases: VAEBasedAlgorithm

MicroSplit algorithm configuration.

Source code in src/careamics/config/algorithms/microsplit_algorithm_model.py
class MicroSplitAlgorithm(VAEBasedAlgorithm):
    """MicroSplit algorithm configuration."""

    model_config = ConfigDict(validate_assignment=True)

    algorithm: Literal["microsplit"] = "microsplit"

    loss: LVAELossConfig

    model: LVAEModel  # TODO add validators

    is_supervised: bool = False

    def get_algorithm_friendly_name(self) -> str:
        """
        Get the algorithm friendly name.

        Returns
        -------
        str
            Friendly name of the algorithm.
        """
        return MICROSPLIT

    def get_algorithm_keywords(self) -> list[str]:
        """
        Get algorithm keywords.

        Returns
        -------
        list[str]
            List of keywords.
        """
        return [
            "restoration",
            "VAE",
            "self-supervised",
            "3D" if self.model.is_3D() else "2D",
            "CAREamics",
            "pytorch",
        ]

    def get_algorithm_references(self) -> str:
        """
        Get the algorithm references.

        This is used to generate the README of the BioImage Model Zoo export.

        Returns
        -------
        str
            Algorithm references.
        """
        return MICROSPLIT_REF.text + " doi: " + MICROSPLIT_REF.doi

    def get_algorithm_citations(self) -> list[CiteEntry]:
        """
        Return a list of citation entries of the current algorithm.

        This is used to generate the model description for the BioImage Model Zoo.

        Returns
        -------
        List[CiteEntry]
            List of citation entries.
        """
        return [MICROSPLIT_REF]

    def get_algorithm_description(self) -> str:
        """
        Get the algorithm description.

        Returns
        -------
        str
            Algorithm description.
        """
        return MICROSPLIT_DESCRIPTION

get_algorithm_citations() #

Return a list of citation entries of the current algorithm.

This is used to generate the model description for the BioImage Model Zoo.

Returns:

Type Description
List[CiteEntry]

List of citation entries.

Source code in src/careamics/config/algorithms/microsplit_algorithm_model.py
def get_algorithm_citations(self) -> list[CiteEntry]:
    """
    Return a list of citation entries of the current algorithm.

    This is used to generate the model description for the BioImage Model Zoo.

    Returns
    -------
    List[CiteEntry]
        List of citation entries.
    """
    return [MICROSPLIT_REF]

get_algorithm_description() #

Get the algorithm description.

Returns:

Type Description
str

Algorithm description.

Source code in src/careamics/config/algorithms/microsplit_algorithm_model.py
def get_algorithm_description(self) -> str:
    """
    Get the algorithm description.

    Returns
    -------
    str
        Algorithm description.
    """
    return MICROSPLIT_DESCRIPTION

get_algorithm_friendly_name() #

Get the algorithm friendly name.

Returns:

Type Description
str

Friendly name of the algorithm.

Source code in src/careamics/config/algorithms/microsplit_algorithm_model.py
def get_algorithm_friendly_name(self) -> str:
    """
    Get the algorithm friendly name.

    Returns
    -------
    str
        Friendly name of the algorithm.
    """
    return MICROSPLIT

get_algorithm_keywords() #

Get algorithm keywords.

Returns:

Type Description
list[str]

List of keywords.

Source code in src/careamics/config/algorithms/microsplit_algorithm_model.py
def get_algorithm_keywords(self) -> list[str]:
    """
    Get algorithm keywords.

    Returns
    -------
    list[str]
        List of keywords.
    """
    return [
        "restoration",
        "VAE",
        "self-supervised",
        "3D" if self.model.is_3D() else "2D",
        "CAREamics",
        "pytorch",
    ]

get_algorithm_references() #

Get the algorithm references.

This is used to generate the README of the BioImage Model Zoo export.

Returns:

Type Description
str

Algorithm references.

Source code in src/careamics/config/algorithms/microsplit_algorithm_model.py
def get_algorithm_references(self) -> str:
    """
    Get the algorithm references.

    This is used to generate the README of the BioImage Model Zoo export.

    Returns
    -------
    str
        Algorithm references.
    """
    return MICROSPLIT_REF.text + " doi: " + MICROSPLIT_REF.doi