cellfinder 1.1.1__tar.gz → 1.1.2__tar.gz

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.

Potentially problematic release.


This version of cellfinder might be problematic. Click here for more details.

Files changed (75) hide show
  1. {cellfinder-1.1.1 → cellfinder-1.1.2}/PKG-INFO +3 -3
  2. {cellfinder-1.1.1 → cellfinder-1.1.2}/cellfinder/core/download/cli.py +2 -2
  3. {cellfinder-1.1.1 → cellfinder-1.1.2}/cellfinder/core/download/download.py +39 -10
  4. {cellfinder-1.1.1 → cellfinder-1.1.2}/cellfinder/core/tools/prep.py +5 -5
  5. cellfinder-1.1.2/cellfinder/core/tools/source_files.py +27 -0
  6. {cellfinder-1.1.1 → cellfinder-1.1.2}/cellfinder.egg-info/PKG-INFO +3 -3
  7. {cellfinder-1.1.1 → cellfinder-1.1.2}/cellfinder.egg-info/requires.txt +2 -2
  8. {cellfinder-1.1.1 → cellfinder-1.1.2}/pyproject.toml +2 -2
  9. cellfinder-1.1.1/cellfinder/core/tools/source_files.py +0 -9
  10. {cellfinder-1.1.1 → cellfinder-1.1.2}/.github/workflows/test_and_deploy.yml +0 -0
  11. {cellfinder-1.1.1 → cellfinder-1.1.2}/.github/workflows/test_include_guard.yaml +0 -0
  12. {cellfinder-1.1.1 → cellfinder-1.1.2}/.gitignore +0 -0
  13. {cellfinder-1.1.1 → cellfinder-1.1.2}/.napari/config.yml +0 -0
  14. {cellfinder-1.1.1 → cellfinder-1.1.2}/CITATION.cff +0 -0
  15. {cellfinder-1.1.1 → cellfinder-1.1.2}/LICENSE +0 -0
  16. {cellfinder-1.1.1 → cellfinder-1.1.2}/MANIFEST.in +0 -0
  17. {cellfinder-1.1.1 → cellfinder-1.1.2}/README.md +0 -0
  18. {cellfinder-1.1.1 → cellfinder-1.1.2}/cellfinder/__init__.py +0 -0
  19. {cellfinder-1.1.1 → cellfinder-1.1.2}/cellfinder/cli_migration_warning.py +0 -0
  20. {cellfinder-1.1.1 → cellfinder-1.1.2}/cellfinder/core/__init__.py +0 -0
  21. {cellfinder-1.1.1 → cellfinder-1.1.2}/cellfinder/core/classify/__init__.py +0 -0
  22. {cellfinder-1.1.1 → cellfinder-1.1.2}/cellfinder/core/classify/augment.py +0 -0
  23. {cellfinder-1.1.1 → cellfinder-1.1.2}/cellfinder/core/classify/classify.py +0 -0
  24. {cellfinder-1.1.1 → cellfinder-1.1.2}/cellfinder/core/classify/cube_generator.py +0 -0
  25. {cellfinder-1.1.1 → cellfinder-1.1.2}/cellfinder/core/classify/resnet.py +0 -0
  26. {cellfinder-1.1.1 → cellfinder-1.1.2}/cellfinder/core/classify/tools.py +0 -0
  27. {cellfinder-1.1.1 → cellfinder-1.1.2}/cellfinder/core/config/__init__.py +0 -0
  28. {cellfinder-1.1.1 → cellfinder-1.1.2}/cellfinder/core/config/cellfinder.conf +0 -0
  29. {cellfinder-1.1.1 → cellfinder-1.1.2}/cellfinder/core/detect/__init__.py +0 -0
  30. {cellfinder-1.1.1 → cellfinder-1.1.2}/cellfinder/core/detect/detect.py +0 -0
  31. {cellfinder-1.1.1 → cellfinder-1.1.2}/cellfinder/core/detect/filters/__init__.py +0 -0
  32. {cellfinder-1.1.1 → cellfinder-1.1.2}/cellfinder/core/detect/filters/plane/__init__.py +0 -0
  33. {cellfinder-1.1.1 → cellfinder-1.1.2}/cellfinder/core/detect/filters/plane/classical_filter.py +0 -0
  34. {cellfinder-1.1.1 → cellfinder-1.1.2}/cellfinder/core/detect/filters/plane/plane_filter.py +0 -0
  35. {cellfinder-1.1.1 → cellfinder-1.1.2}/cellfinder/core/detect/filters/plane/tile_walker.py +0 -0
  36. {cellfinder-1.1.1 → cellfinder-1.1.2}/cellfinder/core/detect/filters/setup_filters.py +0 -0
  37. {cellfinder-1.1.1 → cellfinder-1.1.2}/cellfinder/core/detect/filters/volume/__init__.py +0 -0
  38. {cellfinder-1.1.1 → cellfinder-1.1.2}/cellfinder/core/detect/filters/volume/ball_filter.py +0 -0
  39. {cellfinder-1.1.1 → cellfinder-1.1.2}/cellfinder/core/detect/filters/volume/structure_detection.py +0 -0
  40. {cellfinder-1.1.1 → cellfinder-1.1.2}/cellfinder/core/detect/filters/volume/structure_splitting.py +0 -0
  41. {cellfinder-1.1.1 → cellfinder-1.1.2}/cellfinder/core/detect/filters/volume/volume_filter.py +0 -0
  42. {cellfinder-1.1.1 → cellfinder-1.1.2}/cellfinder/core/download/__init__.py +0 -0
  43. {cellfinder-1.1.1 → cellfinder-1.1.2}/cellfinder/core/download/models.py +0 -0
  44. {cellfinder-1.1.1 → cellfinder-1.1.2}/cellfinder/core/main.py +0 -0
  45. {cellfinder-1.1.1 → cellfinder-1.1.2}/cellfinder/core/tools/IO.py +0 -0
  46. {cellfinder-1.1.1 → cellfinder-1.1.2}/cellfinder/core/tools/__init__.py +0 -0
  47. {cellfinder-1.1.1 → cellfinder-1.1.2}/cellfinder/core/tools/array_operations.py +0 -0
  48. {cellfinder-1.1.1 → cellfinder-1.1.2}/cellfinder/core/tools/geometry.py +0 -0
  49. {cellfinder-1.1.1 → cellfinder-1.1.2}/cellfinder/core/tools/image_processing.py +0 -0
  50. {cellfinder-1.1.1 → cellfinder-1.1.2}/cellfinder/core/tools/system.py +0 -0
  51. {cellfinder-1.1.1 → cellfinder-1.1.2}/cellfinder/core/tools/tf.py +0 -0
  52. {cellfinder-1.1.1 → cellfinder-1.1.2}/cellfinder/core/tools/tiff.py +0 -0
  53. {cellfinder-1.1.1 → cellfinder-1.1.2}/cellfinder/core/tools/tools.py +0 -0
  54. {cellfinder-1.1.1 → cellfinder-1.1.2}/cellfinder/core/train/__init__.py +0 -0
  55. {cellfinder-1.1.1 → cellfinder-1.1.2}/cellfinder/core/train/train_yml.py +0 -0
  56. {cellfinder-1.1.1 → cellfinder-1.1.2}/cellfinder/core/types.py +0 -0
  57. {cellfinder-1.1.1 → cellfinder-1.1.2}/cellfinder/napari/__init__.py +0 -0
  58. {cellfinder-1.1.1 → cellfinder-1.1.2}/cellfinder/napari/curation.py +0 -0
  59. {cellfinder-1.1.1 → cellfinder-1.1.2}/cellfinder/napari/detect/__init__.py +0 -0
  60. {cellfinder-1.1.1 → cellfinder-1.1.2}/cellfinder/napari/detect/detect.py +0 -0
  61. {cellfinder-1.1.1 → cellfinder-1.1.2}/cellfinder/napari/detect/detect_containers.py +0 -0
  62. {cellfinder-1.1.1 → cellfinder-1.1.2}/cellfinder/napari/detect/thread_worker.py +0 -0
  63. {cellfinder-1.1.1 → cellfinder-1.1.2}/cellfinder/napari/images/brainglobe.png +0 -0
  64. {cellfinder-1.1.1 → cellfinder-1.1.2}/cellfinder/napari/input_container.py +0 -0
  65. {cellfinder-1.1.1 → cellfinder-1.1.2}/cellfinder/napari/napari.yaml +0 -0
  66. {cellfinder-1.1.1 → cellfinder-1.1.2}/cellfinder/napari/sample_data.py +0 -0
  67. {cellfinder-1.1.1 → cellfinder-1.1.2}/cellfinder/napari/train/__init__.py +0 -0
  68. {cellfinder-1.1.1 → cellfinder-1.1.2}/cellfinder/napari/train/train.py +0 -0
  69. {cellfinder-1.1.1 → cellfinder-1.1.2}/cellfinder/napari/train/train_containers.py +0 -0
  70. {cellfinder-1.1.1 → cellfinder-1.1.2}/cellfinder/napari/utils.py +0 -0
  71. {cellfinder-1.1.1 → cellfinder-1.1.2}/cellfinder.egg-info/SOURCES.txt +0 -0
  72. {cellfinder-1.1.1 → cellfinder-1.1.2}/cellfinder.egg-info/dependency_links.txt +0 -0
  73. {cellfinder-1.1.1 → cellfinder-1.1.2}/cellfinder.egg-info/entry_points.txt +0 -0
  74. {cellfinder-1.1.1 → cellfinder-1.1.2}/cellfinder.egg-info/top_level.txt +0 -0
  75. {cellfinder-1.1.1 → cellfinder-1.1.2}/setup.cfg +0 -0
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.1
2
2
  Name: cellfinder
3
- Version: 1.1.1
3
+ Version: 1.1.2
4
4
  Summary: Automated 3D cell detection in large microscopy images
5
5
  Author-email: "Adam Tyson, Christian Niedworok, Charly Rousseau" <code@adamltyson.com>
6
6
  License: BSD-3-Clause
@@ -22,8 +22,8 @@ Classifier: Topic :: Scientific/Engineering :: Image Recognition
22
22
  Requires-Python: >=3.9
23
23
  Description-Content-Type: text/markdown
24
24
  License-File: LICENSE
25
- Requires-Dist: brainglobe-utils
26
- Requires-Dist: brainglobe-napari-io
25
+ Requires-Dist: brainglobe-utils>=0.4.2
26
+ Requires-Dist: brainglobe-napari-io>=0.3.4
27
27
  Requires-Dist: dask[array]
28
28
  Requires-Dist: fancylog>=0.0.7
29
29
  Requires-Dist: natsort
@@ -3,7 +3,7 @@ from argparse import ArgumentDefaultsHelpFormatter, ArgumentParser
3
3
  from pathlib import Path
4
4
 
5
5
  from cellfinder.core.download import models
6
- from cellfinder.core.download.download import amend_cfg
6
+ from cellfinder.core.download.download import amend_user_configuration
7
7
 
8
8
  home = Path.home()
9
9
  DEFAULT_DOWNLOAD_DIRECTORY = home / ".cellfinder"
@@ -65,7 +65,7 @@ def main():
65
65
  model_path = models.main(args.model, args.install_path)
66
66
 
67
67
  if not args.no_amend_config:
68
- amend_cfg(new_model_path=model_path)
68
+ amend_user_configuration(new_model_path=model_path)
69
69
 
70
70
 
71
71
  if __name__ == "__main__":
@@ -7,8 +7,8 @@ from brainglobe_utils.general.config import get_config_obj
7
7
  from brainglobe_utils.general.system import disk_free_gb
8
8
 
9
9
  from cellfinder.core.tools.source_files import (
10
- source_config_cellfinder,
11
- source_custom_config_cellfinder,
10
+ default_configuration_path,
11
+ user_specific_configuration_path,
12
12
  )
13
13
 
14
14
 
@@ -75,16 +75,45 @@ def download(
75
75
  os.remove(download_path)
76
76
 
77
77
 
78
- def amend_cfg(new_model_path=None):
79
- print("Ensuring custom config file is correct")
80
-
81
- original_config = source_config_cellfinder()
82
- new_config = source_custom_config_cellfinder()
83
- if new_model_path is not None:
84
- write_model_to_cfg(new_model_path, original_config, new_config)
78
+ def amend_user_configuration(new_model_path=None) -> None:
79
+ """
80
+ Amends the user configuration to contain the configuration
81
+ in new_model_path, if specified.
85
82
 
83
+ Parameters
84
+ ----------
85
+ new_model_path : str, optional
86
+ The path to the new model configuration.
87
+ """
88
+ print("(Over-)writing custom user configuration")
86
89
 
87
- def write_model_to_cfg(new_model_path, orig_config, custom_config):
90
+ original_config = default_configuration_path()
91
+ new_config = user_specific_configuration_path()
92
+ if new_model_path is not None:
93
+ write_model_to_config(new_model_path, original_config, new_config)
94
+
95
+
96
+ def write_model_to_config(new_model_path, orig_config, custom_config):
97
+ """
98
+ Update the model path in the custom configuration file, by
99
+ reading the lines in the original configuration file, replacing
100
+ the line starting with "model_path =" and writing these
101
+ lines to the custom file.
102
+
103
+ Parameters
104
+ ----------
105
+ new_model_path : str
106
+ The new path to the model.
107
+ orig_config : str
108
+ The path to the original configuration file.
109
+ custom_config : str
110
+ The path to the custom configuration file to be created.
111
+
112
+ Returns
113
+ -------
114
+ None
115
+
116
+ """
88
117
  config_obj = get_config_obj(orig_config)
89
118
  model_conf = config_obj["model"]
90
119
  orig_path = model_conf["model_path"]
@@ -14,8 +14,8 @@ from brainglobe_utils.general.system import get_num_processes
14
14
  import cellfinder.core.tools.tf as tf_tools
15
15
  from cellfinder.core import logger
16
16
  from cellfinder.core.download import models as model_download
17
- from cellfinder.core.download.download import amend_cfg
18
- from cellfinder.core.tools.source_files import source_custom_config_cellfinder
17
+ from cellfinder.core.download.download import amend_user_configuration
18
+ from cellfinder.core.tools.source_files import user_specific_configuration_path
19
19
 
20
20
  home = Path.home()
21
21
  DEFAULT_INSTALL_PATH = home / ".cellfinder"
@@ -49,18 +49,18 @@ def prep_models(
49
49
  if model_weights_path is None:
50
50
  logger.debug("No model supplied, so using the default")
51
51
 
52
- config_file = source_custom_config_cellfinder()
52
+ config_file = user_specific_configuration_path()
53
53
 
54
54
  if not Path(config_file).exists():
55
55
  logger.debug("Custom config does not exist, downloading models")
56
56
  model_path = model_download.main(model_name, install_path)
57
- amend_cfg(new_model_path=model_path)
57
+ amend_user_configuration(new_model_path=model_path)
58
58
 
59
59
  model_weights = get_model_weights(config_file)
60
60
  if not model_weights.exists():
61
61
  logger.debug("Model weights do not exist, downloading")
62
62
  model_path = model_download.main(model_name, install_path)
63
- amend_cfg(new_model_path=model_path)
63
+ amend_user_configuration(new_model_path=model_path)
64
64
  model_weights = get_model_weights(config_file)
65
65
  else:
66
66
  model_weights = Path(model_weights_path)
@@ -0,0 +1,27 @@
1
+ from pathlib import Path
2
+
3
+
4
+ def default_configuration_path():
5
+ """
6
+ Returns the default configuration path for cellfinder.
7
+
8
+ Returns:
9
+ Path: The default configuration path.
10
+ """
11
+ return Path(__file__).parent.parent / "config" / "cellfinder.conf"
12
+
13
+
14
+ def user_specific_configuration_path():
15
+ """
16
+ Returns the path to the user-specific configuration file for cellfinder.
17
+
18
+ This function returns the path to the user-specific configuration file
19
+ for cellfinder. The user-specific configuration file is located in the
20
+ user's home directory under the ".cellfinder" folder and is named
21
+ "cellfinder.conf.custom".
22
+
23
+ Returns:
24
+ Path: The path to the custom configuration file.
25
+
26
+ """
27
+ return Path.home() / ".cellfinder" / "cellfinder.conf.custom"
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.1
2
2
  Name: cellfinder
3
- Version: 1.1.1
3
+ Version: 1.1.2
4
4
  Summary: Automated 3D cell detection in large microscopy images
5
5
  Author-email: "Adam Tyson, Christian Niedworok, Charly Rousseau" <code@adamltyson.com>
6
6
  License: BSD-3-Clause
@@ -22,8 +22,8 @@ Classifier: Topic :: Scientific/Engineering :: Image Recognition
22
22
  Requires-Python: >=3.9
23
23
  Description-Content-Type: text/markdown
24
24
  License-File: LICENSE
25
- Requires-Dist: brainglobe-utils
26
- Requires-Dist: brainglobe-napari-io
25
+ Requires-Dist: brainglobe-utils>=0.4.2
26
+ Requires-Dist: brainglobe-napari-io>=0.3.4
27
27
  Requires-Dist: dask[array]
28
28
  Requires-Dist: fancylog>=0.0.7
29
29
  Requires-Dist: natsort
@@ -1,5 +1,5 @@
1
- brainglobe-utils
2
- brainglobe-napari-io
1
+ brainglobe-utils>=0.4.2
2
+ brainglobe-napari-io>=0.3.4
3
3
  dask[array]
4
4
  fancylog>=0.0.7
5
5
  natsort
@@ -20,8 +20,8 @@ classifiers = [
20
20
  ]
21
21
  requires-python = ">=3.9"
22
22
  dependencies = [
23
- "brainglobe-utils",
24
- "brainglobe-napari-io",
23
+ "brainglobe-utils>=0.4.2",
24
+ "brainglobe-napari-io>=0.3.4",
25
25
  "dask[array]",
26
26
  "fancylog>=0.0.7",
27
27
  "natsort",
@@ -1,9 +0,0 @@
1
- from pathlib import Path
2
-
3
-
4
- def source_config_cellfinder():
5
- return Path(__file__).parent.parent / "config" / "cellfinder.conf"
6
-
7
-
8
- def source_custom_config_cellfinder():
9
- return Path(__file__).parent.parent / "config" / "cellfinder.conf.custom"
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes