diff --git a/README.md b/README.md index 3d4b127..e78161c 100644 --- a/README.md +++ b/README.md @@ -3,7 +3,7 @@ [![Wheel](https://img.shields.io/pypi/wheel/brainglobe-segmentation.svg)](https://pypi.org/project/brainglobe-segmentation) [![Development Status](https://img.shields.io/pypi/status/brainglobe-segmentation.svg)](https://github.com/brainglobe/brainglobe-segmentation) [![Tests](https://img.shields.io/github/workflow/status/brainglobe/brainglobe-segmentation/tests)](https://github.com/brainglobe/brainglobe-segmentation/actions) -[![codecov](https://codecov.io/gh/brainglobe/brainglobe-segmentation/graph/badge.svg)](https://codecov.io/gh/brainglobe/brainglobe-segmentation) +[![codecov](https://codecov.io/gh/brainglobe/brainglobe-segmentation/graph/badge.svg?token=WP9KTPZE5R)](https://codecov.io/gh/brainglobe/brainglobe-segmentation) [![Code style: black](https://img.shields.io/badge/code%20style-black-000000.svg)](https://github.com/python/black) [![Twitter](https://img.shields.io/twitter/follow/brain_globe?style=social)](https://twitter.com/brain_globe) diff --git a/brainglobe_segmentation/image/utils.py b/brainglobe_segmentation/image/utils.py index 286bce8..970ec8c 100644 --- a/brainglobe_segmentation/image/utils.py +++ b/brainglobe_segmentation/image/utils.py @@ -4,7 +4,7 @@ def create_KDTree_from_image(image, value=0): """ - Create a KDTree of points equalling a given value + Create a KDTree of points equaling a given value :param image: Image to be converted to points :param value: Value of image to be used :return: scipy.spatial.cKDTree object diff --git a/brainglobe_segmentation/layout/gui_constants.py b/brainglobe_segmentation/layout/gui_constants.py index f82ac8a..f739afb 100644 --- a/brainglobe_segmentation/layout/gui_constants.py +++ b/brainglobe_segmentation/layout/gui_constants.py @@ -32,9 +32,3 @@ IMAGE_FILE_EXT = ".tiff" BOUNDARIES_STRING = "Boundaries" HEMISPHERES_STRING = "Hemispheres" - -# ORIENTATIONS = [ -# "asl", -# "lsa", -# "sla", -# ] # When rolling through orientations of the brain, adhere to this order diff --git a/brainglobe_segmentation/regions/IO.py b/brainglobe_segmentation/regions/IO.py index 61a6bd2..a8027da 100644 --- a/brainglobe_segmentation/regions/IO.py +++ b/brainglobe_segmentation/regions/IO.py @@ -3,6 +3,7 @@ import imio import numpy as np from brainglobe_utils.general.pathlib import append_to_pathlib_stem +from brainglobe_utils.IO.surfaces import marching_cubes_to_obj from skimage import measure @@ -26,27 +27,6 @@ def extract_and_save_object( ) -def marching_cubes_to_obj(marching_cubes_out, output_file): - """ - Saves the output of skimage.measure.marching_cubes as an .obj file - :param marching_cubes_out: tuple - :param output_file: str - """ - - verts, faces, normals, _ = marching_cubes_out - with open(output_file, "w") as f: - for item in verts: - f.write(f"v {item[0]} {item[1]} {item[2]}\n") - for item in normals: - f.write(f"vn {item[0]} {item[1]} {item[2]}\n") - for item in faces: - f.write( - f"f {item[0]}//{item[0]} {item[1]}//{item[1]} " - f"{item[2]}//{item[2]}\n" - ) - f.close() - - def volume_to_vector_array_to_obj_file( image, output_path, diff --git a/brainglobe_segmentation/segmentation_panels/regions.py b/brainglobe_segmentation/segmentation_panels/regions.py index 4b856b0..ede1f53 100644 --- a/brainglobe_segmentation/segmentation_panels/regions.py +++ b/brainglobe_segmentation/segmentation_panels/regions.py @@ -1,4 +1,3 @@ -# RegionSeg from qtpy.QtWidgets import QGridLayout, QGroupBox from brainglobe_segmentation.layout.gui_constants import ( @@ -122,9 +121,6 @@ def add_region_panel(self, row): self.region_panel.setVisible(False) def toggle_region_panel(self): - # TODO: Change color scheme directly when theme is switched - # TODO: "text-align" property should follow constant - # SEGM_METHODS_PANEL_ALIGN if self.region_panel.isVisible(): self.region_panel.setVisible(False) if self.parent.viewer.theme == "dark": diff --git a/pyproject.toml b/pyproject.toml index ef8e769..69fd20c 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -10,12 +10,11 @@ classifiers = [ "Framework :: napari", "Intended Audience :: Developers", "Intended Audience :: Science/Research", - "Operating System :: Microsoft :: Windows :: Windows 10", - "Operating System :: POSIX :: Linux", + "Operating System :: OS Independent", "Programming Language :: Python", - "Programming Language :: Python :: 3.8", "Programming Language :: Python :: 3.9", "Programming Language :: Python :: 3.10", + "Programming Language :: Python :: 3.11", ] requires-python = ">=3.9" dependencies = [ @@ -74,28 +73,8 @@ include = ["brainglobe_segmentation*"] [tool.setuptools_scm] -[tool.pytest.ini_options] -filterwarnings = [ - "error", - # Emitted by scikit-image on import, see https://github.com/scikit-image/scikit-image/issues/6663 - # This filter should be removed when scikit-image 0.20 is released - "ignore:`np.bool8` is a deprecated alias for `np.bool_`", - # Emitted by nptyping, see https://github.com/ramonhagenaars/nptyping/issues/102 - # for upstream issue - "ignore:`np.object0` is a deprecated alias for ``np.object0`", - "ignore:`np.int0` is a deprecated alias for `np.intp`", - "ignore:`np.uint0` is a deprecated alias for `np.uintp`", - "ignore:`np.void0` is a deprecated alias for `np.void`", - "ignore:`np.bytes0` is a deprecated alias for `np.bytes_`", - "ignore:`np.str0` is a deprecated alias for `np.str_`", - # Warning comes from vispy - fixed in vispy 0.12.0. napari 0.5.0 will bump - # vispy to 0.5.0, so this filter should be removed when napari 0.5.0 - # is released - "ignore:distutils Version classes are deprecated:DeprecationWarning", -] - [tool.black] -target-version = ['py38', 'py39', 'py310'] +target-version = ['py39', 'py310', 'py311'] skip-string-normalization = false line-length = 79