Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 0 additions & 1 deletion docs/source/conf.py
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,6 @@
import sys
import types


sys.path.insert(0, os.path.abspath("../../src"))


Expand Down
1 change: 0 additions & 1 deletion examples/scripts/registration/image_registration_class.py
Original file line number Diff line number Diff line change
Expand Up @@ -105,4 +105,3 @@ def main_class_based():

if __name__ == "__main__":
main_class_based()

1 change: 0 additions & 1 deletion examples/scripts/registration/register_round_function.py
Original file line number Diff line number Diff line change
Expand Up @@ -73,4 +73,3 @@ def main_functional():

if __name__ == "__main__":
main_functional()

1 change: 0 additions & 1 deletion setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,6 @@

from setuptools import setup


if sys.version_info[:2] != (3, 12):
detected = ".".join(str(part) for part in sys.version_info[:3])
raise RuntimeError(
Expand Down
1 change: 0 additions & 1 deletion src/clearex/context/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -23,4 +23,3 @@
# IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
# ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
# POSSIBILITY OF SUCH DAMAGE.

21 changes: 14 additions & 7 deletions src/clearex/detect/pipeline.py
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,14 @@


DetectionsArray = np.ndarray
RegionBounds = tuple[tuple[int, int], tuple[int, int], tuple[int, int], tuple[int, int], tuple[int, int], tuple[int, int]]
RegionBounds = tuple[
tuple[int, int],
tuple[int, int],
tuple[int, int],
tuple[int, int],
tuple[int, int],
tuple[int, int],
]
ProgressCallback = Callable[[int, str], None]

_PARTICLE_COLUMNS = (
Expand Down Expand Up @@ -134,9 +141,7 @@ def _normalize_particle_parameters(
normalized["remove_close_particles"] = bool(
normalized.get("remove_close_particles", False)
)
normalized["min_distance_sigma"] = float(
normalized.get("min_distance_sigma", 10.0)
)
normalized["min_distance_sigma"] = float(normalized.get("min_distance_sigma", 10.0))
overlap_zyx = normalized.get("overlap_zyx", [0, 0, 0])
if not isinstance(overlap_zyx, (tuple, list)) or len(overlap_zyx) != 3:
raise ValueError(
Expand All @@ -162,12 +167,13 @@ def _axis_chunk_bounds(size: int, chunk_size: int) -> list[tuple[int, int]]:
Ordered ``(start, stop)`` bounds covering the full axis.
"""
return [
(start, min(start + chunk_size, size))
for start in range(0, size, chunk_size)
(start, min(start + chunk_size, size)) for start in range(0, size, chunk_size)
]


def _region_to_slices(region: RegionBounds) -> tuple[slice, slice, slice, slice, slice, slice]:
def _region_to_slices(
region: RegionBounds,
) -> tuple[slice, slice, slice, slice, slice, slice]:
"""Convert six-axis integer bounds into Python slices.

Parameters
Expand Down Expand Up @@ -635,6 +641,7 @@ def run_particle_detection_analysis(
ValueError
If required source data are missing or channel index is out of bounds.
"""

def _emit(percent: int, message: str) -> None:
if progress_callback is None:
return
Expand Down
1 change: 0 additions & 1 deletion src/clearex/file_operations/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -23,4 +23,3 @@
# IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
# ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
# POSSIBILITY OF SUCH DAMAGE.

1 change: 0 additions & 1 deletion src/clearex/filter/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -23,4 +23,3 @@
# IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
# ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
# POSSIBILITY OF SUCH DAMAGE.

4 changes: 2 additions & 2 deletions src/clearex/filter/filters.py
Original file line number Diff line number Diff line change
Expand Up @@ -32,11 +32,11 @@
import numpy as np
from skimage import filters as skfilters


# Local Imports


def fwhm_to_sigma(fwhm_px: float) -> float:
""" Convert from FWHM to sigma.
"""Convert from FWHM to sigma.

FWHM = 2*sqrt(2*ln2)*sigma ≈ 2.35482*sigma

Expand Down
2 changes: 1 addition & 1 deletion src/clearex/filter/kernels.py
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,7 @@ def make_3d_structured_element(radius: int, shape: str = "sphere") -> np.ndarray

radius = int(radius)
structured_element = np.zeros((radius, radius, radius))
(z_len, y_len, x_len) = structured_element.shape
z_len, y_len, x_len = structured_element.shape

if shape == "sphere":
for i in range(int(z_len)):
Expand Down
Loading
Loading