Skip to content

Commit

Permalink
first-pass at full flexibility with prelim tests (accordance with pre…
Browse files Browse the repository at this point in the history
…vious settings) passing
  • Loading branch information
vreuter committed Mar 19, 2024
1 parent 900361e commit 4eeed3a
Show file tree
Hide file tree
Showing 14 changed files with 399 additions and 290 deletions.
22 changes: 20 additions & 2 deletions poetry.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

4 changes: 3 additions & 1 deletion pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -17,14 +17,16 @@ classifiers = [
"Topic :: Scientific/Engineering :: Bio-Informatics",
"Typing :: Typed",
]
include = ["examples"]

[tool.poetry.dependencies]
# These are the main runtime dependencies.
python = "^3.10.0"
python = ">= 3.10.0, < 3.13"
numpy = [
{version = "^1.24.2", python = "<3.12"},
{version = "^1.25", python = ">=3.12"}
]
numpydoc_decorator = { git = "https://github.com/alimanfoo/numpydoc_decorator.git", branch = "main" }
pandas = "^1.5.3"
scikit-image = "^0.20.0"
scipy = "^1.10.1"
Expand Down
2 changes: 2 additions & 0 deletions spotfishing/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,12 +4,14 @@
from ._exceptions import *
from .detection_result import DetectionResult
from .detectors import detect_spots_dog, detect_spots_int
from .dog_transform import DifferenceOfGaussiansTransformation

__author__ = "Vince Reuter"
__credits__ = ["Vince Reuter", "Kai Sandoval Beckwith"]

__all__ = [
"ROI_MEAN_INTENSITY_KEY",
"DifferenceOfGaussiansTransformation",
"DimensionalityError",
"DetectionResult",
"detect_spots_dog",
Expand Down
4 changes: 4 additions & 0 deletions spotfishing/_exceptions.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,10 @@
__author__ = "Vince Reuter"
__credits__ = ["Vince Reuter"]

__all__ = [
"DimensionalityError",
]


class DimensionalityError(Exception):
"""Error subtype when dimensionality of something isn't as expected"""
2 changes: 1 addition & 1 deletion spotfishing/_numeric_types.py
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,6 @@

__all__ = ["NumpyInt", "NumpyFloat", "PixelValue"]

NumpyInt = Union[np.int8, np.int16, np.int32, np.int64]
NumpyFloat = Union[np.float16, np.float32, np.float64]
NumpyInt = Union[np.int8, np.int16, np.int32, np.int64]
PixelValue = Union[np.int8, np.int16]
153 changes: 0 additions & 153 deletions spotfishing/deprecated.py

This file was deleted.

27 changes: 12 additions & 15 deletions spotfishing/detection_result.py
Original file line number Diff line number Diff line change
@@ -1,8 +1,10 @@
"""Abstraction over the result of application of a spot detection procedure to an input image"""

import dataclasses
from dataclasses import dataclass
from typing import TYPE_CHECKING, Iterable

from numpydoc_decorator import doc # type: ignore[import-untyped]

if TYPE_CHECKING:
import numpy.typing as npt
import pandas as pd
Expand Down Expand Up @@ -39,21 +41,16 @@
]


@dataclasses.dataclass(frozen=True)
@doc(
summary="The result of applying spot detection to an input image",
parameters=dict(
table="A table of detected spot coordinates and measurements",
image="The image (after possibly some preprocessing) that was actually used in detection",
labels="Array of the same size/shape as the image, with nonnegative integer entries; a zero indicates that the pixel isn't in an ROI, and a nonzero indicates the index of the ROI to which the pixel's been assigned",
),
)
@dataclass(frozen=True, kw_only=True)
class DetectionResult:
"""
The result of applying spot detection to an input image
Parameters
----------
table : pd.DataFrame
The table of detected spot coordinates and measurements
image : np.ndarray
The image (after possibly some preprocessing) that was actually used in detection
labels : np.ndarray
Array of the same size/shape as the image, with nonnegative integer entries; a zero indicates that the pixel isn't in an ROI, and a nonzero indicates the index of the ROI to which the pixel's been assigned
"""

table: "pd.DataFrame"
image: "npt.NDArray[PixelValue]"
labels: "npt.NDArray[NumpyInt]"
Expand Down
Loading

0 comments on commit 4eeed3a

Please sign in to comment.