Skip to content
2 changes: 1 addition & 1 deletion deeptrack/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@

# Create a unit registry with custom pixel-related units.
units_registry = UnitRegistry(pint_definitions.split("\n"))

units = units_registry # Alias for backward compatibility

from deeptrack.backend import *

Expand Down
16 changes: 13 additions & 3 deletions deeptrack/features.py
Original file line number Diff line number Diff line change
Expand Up @@ -8231,10 +8231,16 @@ def get(
If the input `factor` is not a valid integer or tuple of integers.

"""

# TBE: this seems to create an issue with image normalization when
# only one number is give. IT automatically replicate this value in the
# 3D but pooling is actually only done in 2D. I suggest if only `factor`
# is given to transform it into (facto, factor, 1) by default.
# This should also ensure backcompatibility.

# Ensure factor is a tuple of three integers.
if np.size(factor) == 1:
factor = (factor,) * 3
# factor = (factor,) * 3
factor = (factor, factor, 1)
elif len(factor) != 3:
raise ValueError(
"Factor must be an integer or a tuple of three integers."
Expand All @@ -8245,6 +8251,10 @@ def get(
with units.context(ctx):
image = self.feature(image)


# NOTE: The downscaling step is disabled and taken care in
# deeptrack.optics since it now depends on scatter.main_property

# Downscale the result to the original resolution.
import skimage.measure

Expand Down Expand Up @@ -9707,4 +9717,4 @@ def get(
if len(res) == 1:
res = res[0]

return res
return res
Loading