You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
38 lines
901 B
38 lines
901 B
import functools |
|
import numpy |
|
import re |
|
|
|
from collections import namedtuple |
|
|
|
from .luts import FIRE_LUT # noqa: F401 |
|
|
|
|
|
IMG_MAX_INTENSITY = 65535 # 2^16 - 1 |
|
|
|
LABEL_SELECTED = "selected" |
|
LABEL_DISCARDED = "discarded" |
|
|
|
OUTPUT_FOLDER_NAMES = ( |
|
"colored", |
|
"cuts", |
|
f"cuts_{LABEL_DISCARDED}", |
|
f"cuts_{LABEL_SELECTED}", |
|
"data", |
|
) |
|
|
|
RE_DIGITS = re.compile(r"(\d+)") |
|
|
|
ROI_STATISTIC_FUNCTIONS = { |
|
"min": numpy.amin, |
|
"max": numpy.amax, |
|
"1quantile": functools.partial(numpy.percentile, q=25), |
|
"2quantile": functools.partial(numpy.percentile, q=50), |
|
"3quantile": functools.partial(numpy.percentile, q=75), |
|
"average": numpy.average, |
|
"median": numpy.median, |
|
"std": numpy.std, |
|
} |
|
|
|
TifImage = namedtuple("TifImage", ["path", "frame"]) |
|
TifArray = namedtuple("TifArray", ["path", "frame", "data"]) |
|
WorkflowResult = namedtuple("WorkflowResult", ["data", "parameters"])
|
|
|