spacr 0.4.3__tar.gz → 0.4.5__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.
Files changed (267) hide show
  1. {spacr-0.4.3 → spacr-0.4.5}/MANIFEST.in +10 -0
  2. {spacr-0.4.3/spacr.egg-info → spacr-0.4.5}/PKG-INFO +1 -1
  3. {spacr-0.4.3 → spacr-0.4.5}/setup.py +1 -1
  4. {spacr-0.4.3 → spacr-0.4.5}/spacr/core.py +11 -10
  5. {spacr-0.4.3 → spacr-0.4.5}/spacr/io.py +67 -34
  6. {spacr-0.4.3 → spacr-0.4.5}/spacr/settings.py +24 -9
  7. {spacr-0.4.3 → spacr-0.4.5}/spacr/utils.py +16 -13
  8. {spacr-0.4.3 → spacr-0.4.5/spacr.egg-info}/PKG-INFO +1 -1
  9. {spacr-0.4.3 → spacr-0.4.5}/.readthedocs.yaml +0 -0
  10. {spacr-0.4.3 → spacr-0.4.5}/LICENSE +0 -0
  11. {spacr-0.4.3 → spacr-0.4.5}/README.rst +0 -0
  12. {spacr-0.4.3 → spacr-0.4.5}/deploy_docs.sh +0 -0
  13. {spacr-0.4.3 → spacr-0.4.5}/docs/requirements.txt +0 -0
  14. {spacr-0.4.3 → spacr-0.4.5}/docs/source/Makefile +0 -0
  15. {spacr-0.4.3 → spacr-0.4.5}/docs/source/_build/doctrees/environment.pickle +0 -0
  16. {spacr-0.4.3 → spacr-0.4.5}/docs/source/_build/html/_sources/index.rst.txt +0 -0
  17. {spacr-0.4.3 → spacr-0.4.5}/docs/source/_build/html/_static/_sphinx_javascript_frameworks_compat.js +0 -0
  18. {spacr-0.4.3 → spacr-0.4.5}/docs/source/_build/html/_static/basic.css +0 -0
  19. {spacr-0.4.3 → spacr-0.4.5}/docs/source/_build/html/_static/css/badge_only.css +0 -0
  20. {spacr-0.4.3 → spacr-0.4.5}/docs/source/_build/html/_static/css/fonts/Roboto-Slab-Bold.woff +0 -0
  21. {spacr-0.4.3 → spacr-0.4.5}/docs/source/_build/html/_static/css/fonts/Roboto-Slab-Bold.woff2 +0 -0
  22. {spacr-0.4.3 → spacr-0.4.5}/docs/source/_build/html/_static/css/fonts/Roboto-Slab-Regular.woff +0 -0
  23. {spacr-0.4.3 → spacr-0.4.5}/docs/source/_build/html/_static/css/fonts/Roboto-Slab-Regular.woff2 +0 -0
  24. {spacr-0.4.3 → spacr-0.4.5}/docs/source/_build/html/_static/css/fonts/fontawesome-webfont.eot +0 -0
  25. {spacr-0.4.3 → spacr-0.4.5}/docs/source/_build/html/_static/css/fonts/fontawesome-webfont.svg +0 -0
  26. {spacr-0.4.3 → spacr-0.4.5}/docs/source/_build/html/_static/css/fonts/fontawesome-webfont.ttf +0 -0
  27. {spacr-0.4.3 → spacr-0.4.5}/docs/source/_build/html/_static/css/fonts/fontawesome-webfont.woff +0 -0
  28. {spacr-0.4.3 → spacr-0.4.5}/docs/source/_build/html/_static/css/fonts/fontawesome-webfont.woff2 +0 -0
  29. {spacr-0.4.3 → spacr-0.4.5}/docs/source/_build/html/_static/css/fonts/lato-bold-italic.woff +0 -0
  30. {spacr-0.4.3 → spacr-0.4.5}/docs/source/_build/html/_static/css/fonts/lato-bold-italic.woff2 +0 -0
  31. {spacr-0.4.3 → spacr-0.4.5}/docs/source/_build/html/_static/css/fonts/lato-bold.woff +0 -0
  32. {spacr-0.4.3 → spacr-0.4.5}/docs/source/_build/html/_static/css/fonts/lato-bold.woff2 +0 -0
  33. {spacr-0.4.3 → spacr-0.4.5}/docs/source/_build/html/_static/css/fonts/lato-normal-italic.woff +0 -0
  34. {spacr-0.4.3 → spacr-0.4.5}/docs/source/_build/html/_static/css/fonts/lato-normal-italic.woff2 +0 -0
  35. {spacr-0.4.3 → spacr-0.4.5}/docs/source/_build/html/_static/css/fonts/lato-normal.woff +0 -0
  36. {spacr-0.4.3 → spacr-0.4.5}/docs/source/_build/html/_static/css/fonts/lato-normal.woff2 +0 -0
  37. {spacr-0.4.3 → spacr-0.4.5}/docs/source/_build/html/_static/css/theme.css +0 -0
  38. {spacr-0.4.3 → spacr-0.4.5}/docs/source/_build/html/_static/doctools.js +0 -0
  39. {spacr-0.4.3 → spacr-0.4.5}/docs/source/_build/html/_static/documentation_options.js +0 -0
  40. {spacr-0.4.3 → spacr-0.4.5}/docs/source/_build/html/_static/file.png +0 -0
  41. {spacr-0.4.3 → spacr-0.4.5}/docs/source/_build/html/_static/fonts/Lato/lato-bold.eot +0 -0
  42. {spacr-0.4.3 → spacr-0.4.5}/docs/source/_build/html/_static/fonts/Lato/lato-bold.ttf +0 -0
  43. {spacr-0.4.3 → spacr-0.4.5}/docs/source/_build/html/_static/fonts/Lato/lato-bold.woff +0 -0
  44. {spacr-0.4.3 → spacr-0.4.5}/docs/source/_build/html/_static/fonts/Lato/lato-bold.woff2 +0 -0
  45. {spacr-0.4.3 → spacr-0.4.5}/docs/source/_build/html/_static/fonts/Lato/lato-bolditalic.eot +0 -0
  46. {spacr-0.4.3 → spacr-0.4.5}/docs/source/_build/html/_static/fonts/Lato/lato-bolditalic.ttf +0 -0
  47. {spacr-0.4.3 → spacr-0.4.5}/docs/source/_build/html/_static/fonts/Lato/lato-bolditalic.woff +0 -0
  48. {spacr-0.4.3 → spacr-0.4.5}/docs/source/_build/html/_static/fonts/Lato/lato-bolditalic.woff2 +0 -0
  49. {spacr-0.4.3 → spacr-0.4.5}/docs/source/_build/html/_static/fonts/Lato/lato-italic.eot +0 -0
  50. {spacr-0.4.3 → spacr-0.4.5}/docs/source/_build/html/_static/fonts/Lato/lato-italic.ttf +0 -0
  51. {spacr-0.4.3 → spacr-0.4.5}/docs/source/_build/html/_static/fonts/Lato/lato-italic.woff +0 -0
  52. {spacr-0.4.3 → spacr-0.4.5}/docs/source/_build/html/_static/fonts/Lato/lato-italic.woff2 +0 -0
  53. {spacr-0.4.3 → spacr-0.4.5}/docs/source/_build/html/_static/fonts/Lato/lato-regular.eot +0 -0
  54. {spacr-0.4.3 → spacr-0.4.5}/docs/source/_build/html/_static/fonts/Lato/lato-regular.ttf +0 -0
  55. {spacr-0.4.3 → spacr-0.4.5}/docs/source/_build/html/_static/fonts/Lato/lato-regular.woff +0 -0
  56. {spacr-0.4.3 → spacr-0.4.5}/docs/source/_build/html/_static/fonts/Lato/lato-regular.woff2 +0 -0
  57. {spacr-0.4.3 → spacr-0.4.5}/docs/source/_build/html/_static/fonts/RobotoSlab/roboto-slab-v7-bold.eot +0 -0
  58. {spacr-0.4.3 → spacr-0.4.5}/docs/source/_build/html/_static/fonts/RobotoSlab/roboto-slab-v7-bold.ttf +0 -0
  59. {spacr-0.4.3 → spacr-0.4.5}/docs/source/_build/html/_static/fonts/RobotoSlab/roboto-slab-v7-bold.woff +0 -0
  60. {spacr-0.4.3 → spacr-0.4.5}/docs/source/_build/html/_static/fonts/RobotoSlab/roboto-slab-v7-bold.woff2 +0 -0
  61. {spacr-0.4.3 → spacr-0.4.5}/docs/source/_build/html/_static/fonts/RobotoSlab/roboto-slab-v7-regular.eot +0 -0
  62. {spacr-0.4.3 → spacr-0.4.5}/docs/source/_build/html/_static/fonts/RobotoSlab/roboto-slab-v7-regular.ttf +0 -0
  63. {spacr-0.4.3 → spacr-0.4.5}/docs/source/_build/html/_static/fonts/RobotoSlab/roboto-slab-v7-regular.woff +0 -0
  64. {spacr-0.4.3 → spacr-0.4.5}/docs/source/_build/html/_static/fonts/RobotoSlab/roboto-slab-v7-regular.woff2 +0 -0
  65. {spacr-0.4.3 → spacr-0.4.5}/docs/source/_build/html/_static/jquery.js +0 -0
  66. {spacr-0.4.3 → spacr-0.4.5}/docs/source/_build/html/_static/js/badge_only.js +0 -0
  67. {spacr-0.4.3 → spacr-0.4.5}/docs/source/_build/html/_static/js/theme.js +0 -0
  68. {spacr-0.4.3 → spacr-0.4.5}/docs/source/_build/html/_static/js/versions.js +0 -0
  69. {spacr-0.4.3 → spacr-0.4.5}/docs/source/_build/html/_static/language_data.js +0 -0
  70. {spacr-0.4.3 → spacr-0.4.5}/docs/source/_build/html/_static/minus.png +0 -0
  71. {spacr-0.4.3 → spacr-0.4.5}/docs/source/_build/html/_static/plus.png +0 -0
  72. {spacr-0.4.3 → spacr-0.4.5}/docs/source/_build/html/_static/pygments.css +0 -0
  73. {spacr-0.4.3 → spacr-0.4.5}/docs/source/_build/html/_static/searchtools.js +0 -0
  74. {spacr-0.4.3 → spacr-0.4.5}/docs/source/_build/html/_static/sphinx_highlight.js +0 -0
  75. {spacr-0.4.3 → spacr-0.4.5}/docs/source/_build/html/genindex.html +0 -0
  76. {spacr-0.4.3 → spacr-0.4.5}/docs/source/_build/html/index.html +0 -0
  77. {spacr-0.4.3 → spacr-0.4.5}/docs/source/_build/html/objects.inv +0 -0
  78. {spacr-0.4.3 → spacr-0.4.5}/docs/source/_build/html/search.html +0 -0
  79. {spacr-0.4.3 → spacr-0.4.5}/docs/source/_build/html/searchindex.js +0 -0
  80. {spacr-0.4.3 → spacr-0.4.5}/docs/source/conf.py +0 -0
  81. {spacr-0.4.3 → spacr-0.4.5}/docs/source/index.rst +0 -0
  82. {spacr-0.4.3 → spacr-0.4.5}/docs/source/make.bat +0 -0
  83. {spacr-0.4.3 → spacr-0.4.5}/environment.yaml +0 -0
  84. {spacr-0.4.3 → spacr-0.4.5}/fonts/OpenSans-Regular.ttf +0 -0
  85. {spacr-0.4.3 → spacr-0.4.5}/path/home/carruthers/datasets/plate1/measurements/measurements.db +0 -0
  86. {spacr-0.4.3 → spacr-0.4.5}/path/home/carruthers/datasets/plate1/settings/measure_crop_settings.csv +0 -0
  87. {spacr-0.4.3 → spacr-0.4.5}/path/settings/preprocess_generate_masks_settings.csv +0 -0
  88. {spacr-0.4.3 → spacr-0.4.5}/requirements.txt +0 -0
  89. {spacr-0.4.3 → spacr-0.4.5}/settings/measure_crop_settings.csv +0 -0
  90. {spacr-0.4.3 → spacr-0.4.5}/setup.cfg +0 -0
  91. {spacr-0.4.3 → spacr-0.4.5}/setup_docs.sh +0 -0
  92. {spacr-0.4.3 → spacr-0.4.5}/source/conf.py +0 -0
  93. {spacr-0.4.3 → spacr-0.4.5}/source/index.rst +0 -0
  94. {spacr-0.4.3 → spacr-0.4.5}/source/modules.rst +0 -0
  95. {spacr-0.4.3 → spacr-0.4.5}/source/setup.rst +0 -0
  96. {spacr-0.4.3 → spacr-0.4.5}/source/spacr.rst +0 -0
  97. {spacr-0.4.3 → spacr-0.4.5}/spacr/__init__.py +0 -0
  98. {spacr-0.4.3 → spacr-0.4.5}/spacr/__main__.py +0 -0
  99. {spacr-0.4.3 → spacr-0.4.5}/spacr/app_annotate.py +0 -0
  100. {spacr-0.4.3 → spacr-0.4.5}/spacr/app_classify.py +0 -0
  101. {spacr-0.4.3 → spacr-0.4.5}/spacr/app_make_masks.py +0 -0
  102. {spacr-0.4.3 → spacr-0.4.5}/spacr/app_mask.py +0 -0
  103. {spacr-0.4.3 → spacr-0.4.5}/spacr/app_measure.py +0 -0
  104. {spacr-0.4.3 → spacr-0.4.5}/spacr/app_sequencing.py +0 -0
  105. {spacr-0.4.3 → spacr-0.4.5}/spacr/app_umap.py +0 -0
  106. {spacr-0.4.3 → spacr-0.4.5}/spacr/cellpose.py +0 -0
  107. {spacr-0.4.3 → spacr-0.4.5}/spacr/chat_bot.py +0 -0
  108. {spacr-0.4.3 → spacr-0.4.5}/spacr/deep_spacr.py +0 -0
  109. {spacr-0.4.3 → spacr-0.4.5}/spacr/gui.py +0 -0
  110. {spacr-0.4.3 → spacr-0.4.5}/spacr/gui_core.py +0 -0
  111. {spacr-0.4.3 → spacr-0.4.5}/spacr/gui_elements.py +0 -0
  112. {spacr-0.4.3 → spacr-0.4.5}/spacr/gui_utils.py +0 -0
  113. {spacr-0.4.3 → spacr-0.4.5}/spacr/logger.py +0 -0
  114. {spacr-0.4.3 → spacr-0.4.5}/spacr/measure.py +0 -0
  115. {spacr-0.4.3 → spacr-0.4.5}/spacr/mediar.py +0 -0
  116. {spacr-0.4.3 → spacr-0.4.5}/spacr/ml.py +0 -0
  117. {spacr-0.4.3 → spacr-0.4.5}/spacr/openai.py +0 -0
  118. {spacr-0.4.3 → spacr-0.4.5}/spacr/plot.py +0 -0
  119. {spacr-0.4.3 → spacr-0.4.5}/spacr/resources/MEDIAR/.gitignore +0 -0
  120. {spacr-0.4.3 → spacr-0.4.5}/spacr/resources/MEDIAR/LICENSE +0 -0
  121. {spacr-0.4.3 → spacr-0.4.5}/spacr/resources/MEDIAR/README.md +0 -0
  122. {spacr-0.4.3 → spacr-0.4.5}/spacr/resources/MEDIAR/SetupDict.py +0 -0
  123. {spacr-0.4.3 → spacr-0.4.5}/spacr/resources/MEDIAR/config/baseline.json +0 -0
  124. {spacr-0.4.3 → spacr-0.4.5}/spacr/resources/MEDIAR/config/mediar_example.json +0 -0
  125. {spacr-0.4.3 → spacr-0.4.5}/spacr/resources/MEDIAR/config/pred/pred_mediar.json +0 -0
  126. {spacr-0.4.3 → spacr-0.4.5}/spacr/resources/MEDIAR/config/step1_pretraining/phase1.json +0 -0
  127. {spacr-0.4.3 → spacr-0.4.5}/spacr/resources/MEDIAR/config/step1_pretraining/phase2.json +0 -0
  128. {spacr-0.4.3 → spacr-0.4.5}/spacr/resources/MEDIAR/config/step2_finetuning/finetuning1.json +0 -0
  129. {spacr-0.4.3 → spacr-0.4.5}/spacr/resources/MEDIAR/config/step2_finetuning/finetuning2.json +0 -0
  130. {spacr-0.4.3 → spacr-0.4.5}/spacr/resources/MEDIAR/config/step3_prediction/base_prediction.json +0 -0
  131. {spacr-0.4.3 → spacr-0.4.5}/spacr/resources/MEDIAR/config/step3_prediction/ensemble_tta.json +0 -0
  132. {spacr-0.4.3 → spacr-0.4.5}/spacr/resources/MEDIAR/core/BasePredictor.py +0 -0
  133. {spacr-0.4.3 → spacr-0.4.5}/spacr/resources/MEDIAR/core/BaseTrainer.py +0 -0
  134. {spacr-0.4.3 → spacr-0.4.5}/spacr/resources/MEDIAR/core/Baseline/Predictor.py +0 -0
  135. {spacr-0.4.3 → spacr-0.4.5}/spacr/resources/MEDIAR/core/Baseline/Trainer.py +0 -0
  136. {spacr-0.4.3 → spacr-0.4.5}/spacr/resources/MEDIAR/core/Baseline/__init__.py +0 -0
  137. {spacr-0.4.3 → spacr-0.4.5}/spacr/resources/MEDIAR/core/Baseline/utils.py +0 -0
  138. {spacr-0.4.3 → spacr-0.4.5}/spacr/resources/MEDIAR/core/MEDIAR/EnsemblePredictor.py +0 -0
  139. {spacr-0.4.3 → spacr-0.4.5}/spacr/resources/MEDIAR/core/MEDIAR/Predictor.py +0 -0
  140. {spacr-0.4.3 → spacr-0.4.5}/spacr/resources/MEDIAR/core/MEDIAR/Trainer.py +0 -0
  141. {spacr-0.4.3 → spacr-0.4.5}/spacr/resources/MEDIAR/core/MEDIAR/__init__.py +0 -0
  142. {spacr-0.4.3 → spacr-0.4.5}/spacr/resources/MEDIAR/core/MEDIAR/utils.py +0 -0
  143. {spacr-0.4.3 → spacr-0.4.5}/spacr/resources/MEDIAR/core/__init__.py +0 -0
  144. {spacr-0.4.3 → spacr-0.4.5}/spacr/resources/MEDIAR/core/utils.py +0 -0
  145. {spacr-0.4.3 → spacr-0.4.5}/spacr/resources/MEDIAR/evaluate.py +0 -0
  146. {spacr-0.4.3 → spacr-0.4.5}/spacr/resources/MEDIAR/generate_mapping.py +0 -0
  147. {spacr-0.4.3 → spacr-0.4.5}/spacr/resources/MEDIAR/image/examples/img1.tiff +0 -0
  148. {spacr-0.4.3 → spacr-0.4.5}/spacr/resources/MEDIAR/image/examples/img2.tif +0 -0
  149. {spacr-0.4.3 → spacr-0.4.5}/spacr/resources/MEDIAR/image/failure_cases.png +0 -0
  150. {spacr-0.4.3 → spacr-0.4.5}/spacr/resources/MEDIAR/image/mediar_framework.png +0 -0
  151. {spacr-0.4.3 → spacr-0.4.5}/spacr/resources/MEDIAR/image/mediar_model.PNG +0 -0
  152. {spacr-0.4.3 → spacr-0.4.5}/spacr/resources/MEDIAR/image/mediar_results.png +0 -0
  153. {spacr-0.4.3 → spacr-0.4.5}/spacr/resources/MEDIAR/main.py +0 -0
  154. {spacr-0.4.3 → spacr-0.4.5}/spacr/resources/MEDIAR/predict.py +0 -0
  155. {spacr-0.4.3 → spacr-0.4.5}/spacr/resources/MEDIAR/requirements.txt +0 -0
  156. {spacr-0.4.3 → spacr-0.4.5}/spacr/resources/MEDIAR/train_tools/__init__.py +0 -0
  157. {spacr-0.4.3 → spacr-0.4.5}/spacr/resources/MEDIAR/train_tools/data_utils/__init__.py +0 -0
  158. {spacr-0.4.3 → spacr-0.4.5}/spacr/resources/MEDIAR/train_tools/data_utils/custom/CellAware.py +0 -0
  159. {spacr-0.4.3 → spacr-0.4.5}/spacr/resources/MEDIAR/train_tools/data_utils/custom/LoadImage.py +0 -0
  160. {spacr-0.4.3 → spacr-0.4.5}/spacr/resources/MEDIAR/train_tools/data_utils/custom/NormalizeImage.py +0 -0
  161. {spacr-0.4.3 → spacr-0.4.5}/spacr/resources/MEDIAR/train_tools/data_utils/custom/__init__.py +0 -0
  162. {spacr-0.4.3 → spacr-0.4.5}/spacr/resources/MEDIAR/train_tools/data_utils/custom/modalities.pkl +0 -0
  163. {spacr-0.4.3 → spacr-0.4.5}/spacr/resources/MEDIAR/train_tools/data_utils/datasetter.py +0 -0
  164. {spacr-0.4.3 → spacr-0.4.5}/spacr/resources/MEDIAR/train_tools/data_utils/transforms.py +0 -0
  165. {spacr-0.4.3 → spacr-0.4.5}/spacr/resources/MEDIAR/train_tools/data_utils/utils.py +0 -0
  166. {spacr-0.4.3 → spacr-0.4.5}/spacr/resources/MEDIAR/train_tools/measures.py +0 -0
  167. {spacr-0.4.3 → spacr-0.4.5}/spacr/resources/MEDIAR/train_tools/models/MEDIARFormer.py +0 -0
  168. {spacr-0.4.3 → spacr-0.4.5}/spacr/resources/MEDIAR/train_tools/models/__init__.py +0 -0
  169. {spacr-0.4.3 → spacr-0.4.5}/spacr/resources/MEDIAR/train_tools/utils.py +0 -0
  170. {spacr-0.4.3 → spacr-0.4.5}/spacr/resources/data/lopit.csv +0 -0
  171. {spacr-0.4.3 → spacr-0.4.5}/spacr/resources/data/toxoplasma_metadata.csv +0 -0
  172. {spacr-0.4.3 → spacr-0.4.5}/spacr/resources/font/open_sans/OFL.txt +0 -0
  173. {spacr-0.4.3 → spacr-0.4.5}/spacr/resources/font/open_sans/OpenSans-Italic-VariableFont_wdth,wght.ttf +0 -0
  174. {spacr-0.4.3 → spacr-0.4.5}/spacr/resources/font/open_sans/OpenSans-VariableFont_wdth,wght.ttf +0 -0
  175. {spacr-0.4.3 → spacr-0.4.5}/spacr/resources/font/open_sans/README.txt +0 -0
  176. {spacr-0.4.3 → spacr-0.4.5}/spacr/resources/font/open_sans/static/OpenSans-Bold.ttf +0 -0
  177. {spacr-0.4.3 → spacr-0.4.5}/spacr/resources/font/open_sans/static/OpenSans-BoldItalic.ttf +0 -0
  178. {spacr-0.4.3 → spacr-0.4.5}/spacr/resources/font/open_sans/static/OpenSans-ExtraBold.ttf +0 -0
  179. {spacr-0.4.3 → spacr-0.4.5}/spacr/resources/font/open_sans/static/OpenSans-ExtraBoldItalic.ttf +0 -0
  180. {spacr-0.4.3 → spacr-0.4.5}/spacr/resources/font/open_sans/static/OpenSans-Italic.ttf +0 -0
  181. {spacr-0.4.3 → spacr-0.4.5}/spacr/resources/font/open_sans/static/OpenSans-Light.ttf +0 -0
  182. {spacr-0.4.3 → spacr-0.4.5}/spacr/resources/font/open_sans/static/OpenSans-LightItalic.ttf +0 -0
  183. {spacr-0.4.3 → spacr-0.4.5}/spacr/resources/font/open_sans/static/OpenSans-Medium.ttf +0 -0
  184. {spacr-0.4.3 → spacr-0.4.5}/spacr/resources/font/open_sans/static/OpenSans-MediumItalic.ttf +0 -0
  185. {spacr-0.4.3 → spacr-0.4.5}/spacr/resources/font/open_sans/static/OpenSans-Regular.ttf +0 -0
  186. {spacr-0.4.3 → spacr-0.4.5}/spacr/resources/font/open_sans/static/OpenSans-SemiBold.ttf +0 -0
  187. {spacr-0.4.3 → spacr-0.4.5}/spacr/resources/font/open_sans/static/OpenSans-SemiBoldItalic.ttf +0 -0
  188. {spacr-0.4.3 → spacr-0.4.5}/spacr/resources/font/open_sans/static/OpenSans_Condensed-Bold.ttf +0 -0
  189. {spacr-0.4.3 → spacr-0.4.5}/spacr/resources/font/open_sans/static/OpenSans_Condensed-BoldItalic.ttf +0 -0
  190. {spacr-0.4.3 → spacr-0.4.5}/spacr/resources/font/open_sans/static/OpenSans_Condensed-ExtraBold.ttf +0 -0
  191. {spacr-0.4.3 → spacr-0.4.5}/spacr/resources/font/open_sans/static/OpenSans_Condensed-ExtraBoldItalic.ttf +0 -0
  192. {spacr-0.4.3 → spacr-0.4.5}/spacr/resources/font/open_sans/static/OpenSans_Condensed-Italic.ttf +0 -0
  193. {spacr-0.4.3 → spacr-0.4.5}/spacr/resources/font/open_sans/static/OpenSans_Condensed-Light.ttf +0 -0
  194. {spacr-0.4.3 → spacr-0.4.5}/spacr/resources/font/open_sans/static/OpenSans_Condensed-LightItalic.ttf +0 -0
  195. {spacr-0.4.3 → spacr-0.4.5}/spacr/resources/font/open_sans/static/OpenSans_Condensed-Medium.ttf +0 -0
  196. {spacr-0.4.3 → spacr-0.4.5}/spacr/resources/font/open_sans/static/OpenSans_Condensed-MediumItalic.ttf +0 -0
  197. {spacr-0.4.3 → spacr-0.4.5}/spacr/resources/font/open_sans/static/OpenSans_Condensed-Regular.ttf +0 -0
  198. {spacr-0.4.3 → spacr-0.4.5}/spacr/resources/font/open_sans/static/OpenSans_Condensed-SemiBold.ttf +0 -0
  199. {spacr-0.4.3 → spacr-0.4.5}/spacr/resources/font/open_sans/static/OpenSans_Condensed-SemiBoldItalic.ttf +0 -0
  200. {spacr-0.4.3 → spacr-0.4.5}/spacr/resources/font/open_sans/static/OpenSans_SemiCondensed-Bold.ttf +0 -0
  201. {spacr-0.4.3 → spacr-0.4.5}/spacr/resources/font/open_sans/static/OpenSans_SemiCondensed-BoldItalic.ttf +0 -0
  202. {spacr-0.4.3 → spacr-0.4.5}/spacr/resources/font/open_sans/static/OpenSans_SemiCondensed-ExtraBold.ttf +0 -0
  203. {spacr-0.4.3 → spacr-0.4.5}/spacr/resources/font/open_sans/static/OpenSans_SemiCondensed-ExtraBoldItalic.ttf +0 -0
  204. {spacr-0.4.3 → spacr-0.4.5}/spacr/resources/font/open_sans/static/OpenSans_SemiCondensed-Italic.ttf +0 -0
  205. {spacr-0.4.3 → spacr-0.4.5}/spacr/resources/font/open_sans/static/OpenSans_SemiCondensed-Light.ttf +0 -0
  206. {spacr-0.4.3 → spacr-0.4.5}/spacr/resources/font/open_sans/static/OpenSans_SemiCondensed-LightItalic.ttf +0 -0
  207. {spacr-0.4.3 → spacr-0.4.5}/spacr/resources/font/open_sans/static/OpenSans_SemiCondensed-Medium.ttf +0 -0
  208. {spacr-0.4.3 → spacr-0.4.5}/spacr/resources/font/open_sans/static/OpenSans_SemiCondensed-MediumItalic.ttf +0 -0
  209. {spacr-0.4.3 → spacr-0.4.5}/spacr/resources/font/open_sans/static/OpenSans_SemiCondensed-Regular.ttf +0 -0
  210. {spacr-0.4.3 → spacr-0.4.5}/spacr/resources/font/open_sans/static/OpenSans_SemiCondensed-SemiBold.ttf +0 -0
  211. {spacr-0.4.3 → spacr-0.4.5}/spacr/resources/font/open_sans/static/OpenSans_SemiCondensed-SemiBoldItalic.ttf +0 -0
  212. {spacr-0.4.3 → spacr-0.4.5}/spacr/resources/icons/abort.png +0 -0
  213. {spacr-0.4.3 → spacr-0.4.5}/spacr/resources/icons/annotate.png +0 -0
  214. {spacr-0.4.3 → spacr-0.4.5}/spacr/resources/icons/cellpose_all.png +0 -0
  215. {spacr-0.4.3 → spacr-0.4.5}/spacr/resources/icons/cellpose_masks.png +0 -0
  216. {spacr-0.4.3 → spacr-0.4.5}/spacr/resources/icons/classify.png +0 -0
  217. {spacr-0.4.3 → spacr-0.4.5}/spacr/resources/icons/convert.png +0 -0
  218. {spacr-0.4.3 → spacr-0.4.5}/spacr/resources/icons/default.png +0 -0
  219. {spacr-0.4.3 → spacr-0.4.5}/spacr/resources/icons/dna_matrix.mp4 +0 -0
  220. {spacr-0.4.3 → spacr-0.4.5}/spacr/resources/icons/download.png +0 -0
  221. {spacr-0.4.3 → spacr-0.4.5}/spacr/resources/icons/logo.pdf +0 -0
  222. {spacr-0.4.3 → spacr-0.4.5}/spacr/resources/icons/logo_spacr.png +0 -0
  223. {spacr-0.4.3 → spacr-0.4.5}/spacr/resources/icons/logo_spacr_1.png +0 -0
  224. {spacr-0.4.3 → spacr-0.4.5}/spacr/resources/icons/make_masks.png +0 -0
  225. {spacr-0.4.3 → spacr-0.4.5}/spacr/resources/icons/map_barcodes.png +0 -0
  226. {spacr-0.4.3 → spacr-0.4.5}/spacr/resources/icons/mask.png +0 -0
  227. {spacr-0.4.3 → spacr-0.4.5}/spacr/resources/icons/measure.png +0 -0
  228. {spacr-0.4.3 → spacr-0.4.5}/spacr/resources/icons/ml_analyze.png +0 -0
  229. {spacr-0.4.3 → spacr-0.4.5}/spacr/resources/icons/plaque.png +0 -0
  230. {spacr-0.4.3 → spacr-0.4.5}/spacr/resources/icons/recruitment.png +0 -0
  231. {spacr-0.4.3 → spacr-0.4.5}/spacr/resources/icons/regression.png +0 -0
  232. {spacr-0.4.3 → spacr-0.4.5}/spacr/resources/icons/run.png +0 -0
  233. {spacr-0.4.3 → spacr-0.4.5}/spacr/resources/icons/sequencing.png +0 -0
  234. {spacr-0.4.3 → spacr-0.4.5}/spacr/resources/icons/settings.png +0 -0
  235. {spacr-0.4.3 → spacr-0.4.5}/spacr/resources/icons/train_cellpose.png +0 -0
  236. {spacr-0.4.3 → spacr-0.4.5}/spacr/resources/icons/umap.png +0 -0
  237. {spacr-0.4.3 → spacr-0.4.5}/spacr/resources/images/plate1_E01_T0001F001L01A01Z01C02.tif +0 -0
  238. {spacr-0.4.3 → spacr-0.4.5}/spacr/resources/images/plate1_E01_T0001F001L01A02Z01C01.tif +0 -0
  239. {spacr-0.4.3 → spacr-0.4.5}/spacr/resources/images/plate1_E01_T0001F001L01A03Z01C03.tif +0 -0
  240. {spacr-0.4.3 → spacr-0.4.5}/spacr/sequencing.py +0 -0
  241. {spacr-0.4.3 → spacr-0.4.5}/spacr/sim.py +0 -0
  242. {spacr-0.4.3 → spacr-0.4.5}/spacr/sp_stats.py +0 -0
  243. {spacr-0.4.3 → spacr-0.4.5}/spacr/submodules.py +0 -0
  244. {spacr-0.4.3 → spacr-0.4.5}/spacr/timelapse.py +0 -0
  245. {spacr-0.4.3 → spacr-0.4.5}/spacr/toxo.py +0 -0
  246. {spacr-0.4.3 → spacr-0.4.5}/spacr/version.py +0 -0
  247. {spacr-0.4.3 → spacr-0.4.5}/spacr.egg-info/SOURCES.txt +0 -0
  248. {spacr-0.4.3 → spacr-0.4.5}/spacr.egg-info/dependency_links.txt +0 -0
  249. {spacr-0.4.3 → spacr-0.4.5}/spacr.egg-info/entry_points.txt +0 -0
  250. {spacr-0.4.3 → spacr-0.4.5}/spacr.egg-info/requires.txt +0 -0
  251. {spacr-0.4.3 → spacr-0.4.5}/spacr.egg-info/top_level.txt +0 -0
  252. {spacr-0.4.3 → spacr-0.4.5}/tests/test_annotate_app.py +0 -0
  253. {spacr-0.4.3 → spacr-0.4.5}/tests/test_core.py +0 -0
  254. {spacr-0.4.3 → spacr-0.4.5}/tests/test_gui_classify_app.py +0 -0
  255. {spacr-0.4.3 → spacr-0.4.5}/tests/test_gui_mask_app.py +0 -0
  256. {spacr-0.4.3 → spacr-0.4.5}/tests/test_gui_measure_app.py +0 -0
  257. {spacr-0.4.3 → spacr-0.4.5}/tests/test_gui_sim_app.py +0 -0
  258. {spacr-0.4.3 → spacr-0.4.5}/tests/test_gui_utils.py +0 -0
  259. {spacr-0.4.3 → spacr-0.4.5}/tests/test_io.py +0 -0
  260. {spacr-0.4.3 → spacr-0.4.5}/tests/test_mask_app.py +0 -0
  261. {spacr-0.4.3 → spacr-0.4.5}/tests/test_measure.py +0 -0
  262. {spacr-0.4.3 → spacr-0.4.5}/tests/test_plot.py +0 -0
  263. {spacr-0.4.3 → spacr-0.4.5}/tests/test_sim.py +0 -0
  264. {spacr-0.4.3 → spacr-0.4.5}/tests/test_timelapse.py +0 -0
  265. {spacr-0.4.3 → spacr-0.4.5}/tests/test_train.py +0 -0
  266. {spacr-0.4.3 → spacr-0.4.5}/tests/test_umap.py +0 -0
  267. {spacr-0.4.3 → spacr-0.4.5}/tests/test_utils.py +0 -0
@@ -35,3 +35,13 @@ prune notebooks
35
35
  prune spacr/notebooks
36
36
  prune spacr/datasets
37
37
 
38
+ # Exclude model files from distribution
39
+ #exclude spacr/resources/models/cp/*
40
+ #prune spacr/resources/models/cp
41
+
42
+ # Exclude all notebooks (including old ones)
43
+ prune notebooks
44
+ prune spacr/notebooks
45
+ prune spacr/notebooks/submodules
46
+ prune spacr/notebooks/old
47
+
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.1
2
2
  Name: spacr
3
- Version: 0.4.3
3
+ Version: 0.4.5
4
4
  Summary: Spatial phenotype analysis of crisp screens (SpaCr)
5
5
  Home-page: https://github.com/EinarOlafsson/spacr
6
6
  Author: Einar Birnir Olafsson
@@ -71,7 +71,7 @@ dependencies = [
71
71
 
72
72
  setup(
73
73
  name="spacr",
74
- version="0.4.3",
74
+ version="0.4.5",
75
75
  author="Einar Birnir Olafsson",
76
76
  author_email="olafsson@med.umich.com",
77
77
  description="Spatial phenotype analysis of crisp screens (SpaCr)",
@@ -13,7 +13,7 @@ def preprocess_generate_masks(settings):
13
13
  from .plot import plot_image_mask_overlay, plot_arrays
14
14
  from .utils import _pivot_counts_table, check_mask_folder, adjust_cell_masks, print_progress, save_settings, delete_intermedeate_files, format_path_for_system, normalize_src_path
15
15
  from .settings import set_default_settings_preprocess_generate_masks
16
-
16
+
17
17
  if 'src' in settings:
18
18
  if not isinstance(settings['src'], (str, list)):
19
19
  ValueError(f'src must be a string or a list of strings')
@@ -33,9 +33,15 @@ def preprocess_generate_masks(settings):
33
33
 
34
34
  print(f'Processing folder: {source_folder}')
35
35
 
36
+ source_folder = format_path_for_system(source_folder)
37
+ settings['src'] = source_folder
38
+ src = source_folder
39
+ settings = set_default_settings_preprocess_generate_masks(settings)
40
+
36
41
  if settings['metadata_type'] == 'auto':
37
- if settings['custom_regex'] == None:
42
+ if settings['custom_regex'] != None:
38
43
  try:
44
+ print(f"using regex: {settings['custom_regex']}")
39
45
  convert_separate_files_to_yokogawa(folder=source_folder, regex=settings['custom_regex'])
40
46
  except:
41
47
  try:
@@ -52,17 +58,12 @@ def preprocess_generate_masks(settings):
52
58
  print(f'Error: {e}')
53
59
  return
54
60
 
55
- source_folder = format_path_for_system(source_folder)
56
- settings['src'] = source_folder
57
- src = source_folder
58
- settings = set_default_settings_preprocess_generate_masks(settings)
59
-
60
61
  if settings['cell_channel'] is None and settings['nucleus_channel'] is None and settings['pathogen_channel'] is None:
61
62
  print(f'Error: At least one of cell_channel, nucleus_channel or pathogen_channel must be defined')
62
63
  return
63
-
64
+
64
65
  save_settings(settings, name='gen_mask_settings')
65
-
66
+
66
67
  if not settings['pathogen_channel'] is None:
67
68
  custom_model_ls = ['toxo_pv_lumen','toxo_cyto']
68
69
  if settings['pathogen_model'] not in custom_model_ls:
@@ -82,7 +83,7 @@ def preprocess_generate_masks(settings):
82
83
  settings_df = pd.DataFrame(list(settings.items()), columns=['setting_key', 'setting_value'])
83
84
  settings_df['setting_value'] = settings_df['setting_value'].apply(str)
84
85
  display(settings_df)
85
-
86
+
86
87
  if settings['test_mode']:
87
88
  print(f'Starting Test mode ...')
88
89
 
@@ -647,7 +647,7 @@ def load_images_from_paths(images_by_key):
647
647
 
648
648
  return images_dict
649
649
 
650
- #@log_function_call
650
+ #@log_function_call
651
651
  def _rename_and_organize_image_files(src, regex, batch_size=100, pick_slice=False, skip_mode='01', metadata_type='', img_format='.tif'):
652
652
  """
653
653
  Convert z-stack images to maximum intensity projection (MIP) images.
@@ -664,13 +664,16 @@ def _rename_and_organize_image_files(src, regex, batch_size=100, pick_slice=Fals
664
664
  None
665
665
  """
666
666
 
667
+ if isinstance(img_format, str):
668
+ img_format = [img_format]
669
+
667
670
  from .utils import _extract_filename_metadata, print_progress
668
671
 
669
672
  regular_expression = re.compile(regex)
670
673
  stack_path = os.path.join(src, 'stack')
671
674
  files_processed = 0
672
675
  if not os.path.exists(stack_path) or (os.path.isdir(stack_path) and len(os.listdir(stack_path)) == 0):
673
- all_filenames = [filename for filename in os.listdir(src) if filename.endswith(img_format)]
676
+ all_filenames = [filename for filename in os.listdir(src) if any(filename.endswith(ext) for ext in img_format)]
674
677
  print(f'All files: {len(all_filenames)} in {src}')
675
678
  time_ls = []
676
679
  image_paths_by_key = _extract_filename_metadata(all_filenames, src, regular_expression, metadata_type, pick_slice, skip_mode)
@@ -729,11 +732,11 @@ def _rename_and_organize_image_files(src, regex, batch_size=100, pick_slice=Fals
729
732
  images_by_key.clear()
730
733
 
731
734
  # Move original images to a new directory
732
- valid_exts = [img_format]
733
735
  newpath = os.path.join(src, 'orig')
734
736
  os.makedirs(newpath, exist_ok=True)
735
737
  for filename in os.listdir(src):
736
- if os.path.splitext(filename)[1] in valid_exts:
738
+ #print(f"{filename}: {os.path.splitext(filename)[1]}")
739
+ if os.path.splitext(filename)[1] in img_format:
737
740
  move = os.path.join(newpath, filename)
738
741
  if os.path.exists(move):
739
742
  print(f'WARNING: A file with the same name already exists at location {move}')
@@ -1571,7 +1574,7 @@ def preprocess_img_data(settings):
1571
1574
  Returns:
1572
1575
  None
1573
1576
  """
1574
-
1577
+
1575
1578
  src = settings['src']
1576
1579
  valid_ext = ['tif', 'tiff', 'png', 'jpeg']
1577
1580
  files = os.listdir(src)
@@ -1599,11 +1602,11 @@ def preprocess_img_data(settings):
1599
1602
 
1600
1603
  mask_channels = [settings['nucleus_channel'], settings['cell_channel'], settings['pathogen_channel']]
1601
1604
  backgrounds = [settings['nucleus_background'], settings['cell_background'], settings['pathogen_background']]
1602
-
1605
+
1603
1606
  settings, metadata_type, custom_regex, nr, plot, batch_size, timelapse, lower_percentile, randomize, all_to_mip, pick_slice, skip_mode, cmap, figuresize, normalize, save_dtype, test_mode, test_images, random_test = set_default_settings_preprocess_img_data(settings)
1604
-
1607
+
1605
1608
  regex = _get_regex(metadata_type, img_format, custom_regex)
1606
-
1609
+
1607
1610
  if test_mode:
1608
1611
 
1609
1612
  print(f'Running spacr in test mode')
@@ -1612,6 +1615,8 @@ def preprocess_img_data(settings):
1612
1615
  os.rmdir(os.path.join(src, 'test'))
1613
1616
  print(f"Deleted test directory: {os.path.join(src, 'test')}")
1614
1617
  except OSError as e:
1618
+ print(f"Error deleting test directory: {e}")
1619
+ print(f"Delete manually before running test mode")
1615
1620
  pass
1616
1621
 
1617
1622
  src = _run_test_mode(settings['src'], regex, timelapse, test_images, random_test)
@@ -1628,6 +1633,7 @@ def preprocess_img_data(settings):
1628
1633
  if timelapse:
1629
1634
  _move_to_chan_folder(src, regex, timelapse, metadata_type)
1630
1635
  else:
1636
+ img_format = ['.tif', '.tiff', '.png', '.jpg', '.jpeg', '.bmp', '.nd2', '.czi', '.lif']
1631
1637
  _rename_and_organize_image_files(src, regex, batch_size, pick_slice, skip_mode, metadata_type, img_format)
1632
1638
 
1633
1639
  #Make sure no batches will be of only one image
@@ -3105,6 +3111,7 @@ def generate_dataset_from_lists(dst, class_data, classes, test_split=0.1):
3105
3111
  return os.path.join(dst, 'train'), os.path.join(dst, 'test')
3106
3112
 
3107
3113
  def convert_separate_files_to_yokogawa(folder, regex):
3114
+
3108
3115
  ROWS = "ABCDEFGHIJKLMNOP"
3109
3116
  COLS = [f"{i:02d}" for i in range(1, 25)]
3110
3117
  WELLS = [f"{r}{c}" for r in ROWS for c in COLS]
@@ -3121,13 +3128,13 @@ def convert_separate_files_to_yokogawa(folder, regex):
3121
3128
 
3122
3129
  pattern = re.compile(regex, re.I)
3123
3130
 
3124
- files_by_fov = {}
3131
+ files_by_region = {}
3125
3132
  rename_log = []
3126
3133
  csv_path = os.path.join(folder, "rename_log.csv")
3127
- used_wells = set(os.listdir(folder))
3128
- fov_to_well = {}
3134
+ used_wells = set()
3135
+ region_to_well = {}
3129
3136
 
3130
- # Group files by FOV
3137
+ # Group files by (plateID, wellID, fieldID, timeID, chanID)
3131
3138
  for file in os.listdir(folder):
3132
3139
  match = pattern.match(file)
3133
3140
  if not match:
@@ -3136,37 +3143,63 @@ def convert_separate_files_to_yokogawa(folder, regex):
3136
3143
 
3137
3144
  meta = match.groupdict()
3138
3145
 
3139
- # Extract required metadata
3140
- fov = meta['fov']
3141
- channel = int(meta['channel'])
3146
+ # Mandatory metadata
3147
+ if 'wellID' not in meta or meta['wellID'] is None:
3148
+ print(f"Skipping {file}: missing mandatory wellID.")
3149
+ continue
3150
+ wellID = meta['wellID']
3142
3151
 
3143
3152
  # Optional metadata with defaults
3144
- time = int(meta.get('time', 1))
3145
- z_slice = int(meta.get('slice', 1))
3146
-
3147
- files_by_fov.setdefault(fov, []).append((file, channel, time, z_slice))
3148
-
3149
- # Assign wells per FOV
3150
- for fov, file_list in files_by_fov.items():
3151
- if fov not in fov_to_well:
3152
- fov_to_well[fov] = _get_next_well(used_wells)
3153
- used_wells.add(fov_to_well[fov])
3154
-
3155
- well = fov_to_well[fov]
3153
+ plateID = meta.get('plateID', '1') or '1'
3154
+ fieldID = meta.get('fieldID', '1') or '1'
3155
+ timeID = int(meta.get('timeID', 1) or 1)
3156
+ chanID = int(meta.get('chanID', 1) or 1)
3157
+ sliceID = meta.get('sliceID')
3158
+ sliceID = int(sliceID) if sliceID is not None else None
3159
+
3160
+ region_key = (plateID, wellID, fieldID, timeID, chanID)
3161
+
3162
+ files_by_region.setdefault(region_key, []).append((file, sliceID))
3163
+
3164
+ # Assign wells and process files per region
3165
+ for region, file_list in files_by_region.items():
3166
+ if region[:3] not in region_to_well:
3167
+ next_well = _get_next_well(used_wells)
3168
+ region_to_well[region[:3]] = next_well
3169
+ used_wells.add(next_well)
3170
+
3171
+ assigned_well = region_to_well[region[:3]]
3172
+ plateID, wellID, fieldID, timeID, chanID = region
3173
+
3174
+ # Check if multiple slices exist and are meaningful
3175
+ slice_ids = [sid for _, sid in file_list if sid is not None]
3176
+ unique_slices = set(slice_ids)
3177
+
3178
+ images = []
3179
+ for filename, _ in sorted(file_list, key=lambda x: x[1] or 1):
3180
+ img = tifffile.imread(os.path.join(folder, filename))
3181
+ images.append(img)
3182
+
3183
+ # Perform MIP only if multiple unique slices are present
3184
+ if len(unique_slices) > 1:
3185
+ img_to_save = np.max(np.stack(images), axis=0)
3186
+ else:
3187
+ img_to_save = images[0]
3156
3188
 
3157
- for original_file, channel, time, z_slice in file_list:
3158
- img = tifffile.imread(os.path.join(folder, original_file))
3159
- dtype = img.dtype
3189
+ dtype = img_to_save.dtype
3160
3190
 
3161
- filename = f"{well}_T{time:04d}F001L01C{channel:02d}Z{z_slice:03d}.tif"
3162
- filepath = os.path.join(folder, filename)
3163
- tifffile.imwrite(filepath, img.astype(dtype))
3191
+ new_filename = f"{assigned_well}_T{timeID:04d}F{int(fieldID):03d}L01C{chanID:02d}.tif"
3192
+ new_filepath = os.path.join(folder, new_filename)
3193
+ tifffile.imwrite(new_filepath, img_to_save.astype(dtype))
3164
3194
 
3165
- rename_log.append({"Original File": original_file, "Renamed TIFF": filename})
3195
+ # Log original filenames involved in MIP or single file rename
3196
+ original_files = ";".join(f[0] for f in file_list)
3197
+ rename_log.append({"Original File(s)": original_files, "Renamed TIFF": new_filename})
3166
3198
 
3167
3199
  pd.DataFrame(rename_log).to_csv(csv_path, index=False)
3168
3200
  print(f"Processing complete. Files saved in {folder} and rename log saved as {csv_path}.")
3169
3201
 
3202
+
3170
3203
  def convert_to_yokogawa(folder):
3171
3204
  """
3172
3205
  Detects file type in the folder and converts them
@@ -1213,16 +1213,25 @@ def generate_fields(variables, scrollable_frame):
1213
1213
  "black_background": "(bool) - Whether to use a black background for plots.",
1214
1214
  "calculate_correlation": "(bool) - Whether to calculate correlations between features.",
1215
1215
  "cell_CP_prob": "(float) - The cellpose probability threshold for the cell channel. This will be used in cell segmentation.",
1216
+ "nucleus_CP_prob": "(float) - The cellpose probability threshold for the nucleus channel. This will be used in cell segmentation.",
1217
+ "pathogen_CP_prob": "(float) - The cellpose probability threshold for the pathogen channel. This will be used in cell segmentation.",
1216
1218
  "cell_FT": "(float) - The flow threshold for cell objects. This will be used to segment the cells.",
1217
- "cell_background": "(float) - The background intensity for the cell channel. This will be used to remove background noise.",
1219
+ "nucleus_FT": "(float) - The flow threshold for nucleus objects. This will be used to segment the cells.",
1220
+ "pathogen_FT": "(float) - The flow threshold for pathogen objects. This will be used to segment the cells.",
1221
+ "cell_background": "(int) - The background intensity for the cell channel. This will be used to remove background noise.",
1222
+ "nucleus_background": "(int) - The background intensity for the nucleus channel. This will be used to remove background noise.",
1223
+ "pathogen_background": "(int) - The background intensity for the pathogen channel. This will be used to remove background noise.",
1218
1224
  "cell_chann_dim": "(int) - Dimension of the channel to use for cell segmentation.",
1219
- "cell_channel": "(int) - The channel to use for the cell. If None, the cell will not be segmented.",
1225
+ "cell_channel": "(int) - The channel to use for generatin cell masks. If None, cell masks will not be generated.",
1226
+ "nucleus_channel": "(int) - The channel to use for generatin nucleus masks. If None, nucleus masks will not be generated.",
1227
+ "pathogen_channel": "(int) - The channel to use for generatin pathogen masks. If None, pathogen masks will not be generated.",
1220
1228
  "cell_intensity_range": "(list) - Intensity range for cell segmentation.",
1221
1229
  "cell_loc": "(list) - The locations of the cell types in the images.",
1222
- "cell_mask_dim": "(int) - The dimension of the array the cell mask is saved in.",
1230
+ "cell_mask_dim": "(int) - The dimension of the array the cell mask is saved in (array order:channels,cell, nucleus, pathogen, cytoplasm) array starts at dimension 0.",
1231
+ "nucleus_mask_dim": "(int) - The dimension of the array the nucleus mask is saved in (array order:channels,cell, nucleus, pathogen, cytoplasm) array starts at dimension 0.",
1223
1232
  "cell_min_size": "(int) - The minimum size of cell objects in pixels^2.",
1224
1233
  "cell_plate_metadata": "(str) - Metadata for the cell plate.",
1225
- "cell_Signal_to_noise": "(float) - The signal-to-noise ratio for the cell channel. This will be used to determine the range of intensities to normalize images to for cell segmentation.",
1234
+ "cell_Signal_to_noise": "(int) - The signal-to-noise ratio for the cell channel. This will be used to determine the range of intensities to normalize images to for cell segmentation.",
1226
1235
  "cell_size_range": "(list) - Size range for cell segmentation.",
1227
1236
  "cell_types": "(list) - Types of cells to include in the analysis.",
1228
1237
  "cells": "(list of lists) - The cell types to include in the analysis.",
@@ -1240,10 +1249,13 @@ def generate_fields(variables, scrollable_frame):
1240
1249
  "CP_prob": "(float) - Cellpose probability threshold for segmentation.",
1241
1250
  "crop_mode": "(str) - Mode to use for cropping images (cell, nucleus, pathogen, cytoplasm).",
1242
1251
  "custom_model": "(str) - Path to a custom Cellpose model.",
1243
- "custom_regex": "(str) - Custom regex pattern to extract metadata from the image names. This will only be used if 'custom' is selected for 'metadata_type'.",
1252
+ "custom_regex": "(str) - Custom regex pattern to extract metadata from the image names. This will only be used if 'custom' or 'auto' is selected for 'metadata_type'.",
1244
1253
  "cytoplasm": "(bool) - Whether to segment the cytoplasm (Cell - Nucleus + Pathogen).",
1245
1254
  "cytoplasm_min_size": "(int) - The minimum size of cytoplasm objects in pixels^2.",
1255
+ "nucleus_min_size": "(int) - The minimum size of nucleus objects in pixels^2.",
1256
+ "normalize_by": "(str) - Normalize cropped png images by png or by field of view.",
1246
1257
  "dependent_variable": "(str) - The dependent variable for the regression analysis.",
1258
+ "delete_intermediate": "(bool) - Delete intermediate folders (stack, channel, norm_channel_stack).",
1247
1259
  "diameter": "(float) - Diameter of the objects to segment.",
1248
1260
  "dialate_png_ratios": "(list) - The ratios to use for dilating the PNG images. This will determine the amount of dilation applied to the images before cropping.",
1249
1261
  "dialate_pngs": "(bool) - Whether to dilate the PNG images before saving.",
@@ -1291,7 +1303,7 @@ def generate_fields(variables, scrollable_frame):
1291
1303
  "manders_thresholds": "(list) - Thresholds for Manders' coefficients.",
1292
1304
  "mask": "(bool) - Whether to generate masks for the segmented objects. If True, masks will be generated for the nucleus, cell, and pathogen.",
1293
1305
  "measurement": "(str) - The measurement to use for the analysis.",
1294
- "metadata_type": "(str) - Type of metadata to expect in the images. This will determine how the images are processed. If 'custom' is selected, you can provide a custom regex pattern to extract metadata from the image names.",
1306
+ "metadata_type": "(str) - Type of metadata to expect in the images. If 'custom' is selected, you can provide a custom regex pattern to extract metadata from the image names. auto will attempt to automatically extract metadata from the image names. cellvoyager and cq1 will use the default metadata extraction for CellVoyager and CQ1 images.",
1295
1307
  "metadata_types": "(list) - Types of metadata to include in the analysis.",
1296
1308
  "merge_edge_pathogen_cells": "(bool) - Whether to merge cells that share pathogen objects.",
1297
1309
  "merge_pathogens": "(bool) - Whether to merge pathogen objects that share more than 75 percent of their perimeter.",
@@ -1312,7 +1324,8 @@ def generate_fields(variables, scrollable_frame):
1312
1324
  "n_jobs": "(int) - The number of n_jobs to use for processing the images. This will determine how many images are processed in parallel. Increase to speed up processing.",
1313
1325
  "n_neighbors": "(int) - Number of neighbors for UMAP.",
1314
1326
  "n_repeats": "(int) - Number of repeats for the pathogen plate.",
1315
- "pathogen_Signal_to_noise": "(float) - The signal-to-noise ratio for the pathogen channel. This will be used to determine the range of intensities to normalize images to for pathogen segmentation.",
1327
+ "pathogen_Signal_to_noise": "(int) - The signal-to-noise ratio for the pathogen channel. This will be used to determine the range of intensities to normalize images to for pathogen segmentation.",
1328
+ "nucleus_Signal_to_noise": "(int) - The signal-to-noise ratio for the nucleus channel. This will be used to determine the range of intensities to normalize images to for nucleus segmentation.",
1316
1329
  "pathogen_size_range": "(list) - Size range for pathogen segmentation.",
1317
1330
  "pathogen_types": "(list) - Types of pathogens to include in the analysis.",
1318
1331
  "pc": "(str) - Positive control identifier.",
@@ -1359,10 +1372,11 @@ def generate_fields(variables, scrollable_frame):
1359
1372
  "save_measurements": "(bool) - Whether to save the measurements to disk.",
1360
1373
  "save_png": "(bool) - Whether to save the segmented objects as PNG images.",
1361
1374
  "schedule": "(str) - Schedule for processing the data.",
1362
- "Signal_to_noise": "(float) - Signal-to-noise ratio for the images.",
1375
+ "Signal_to_noise": "(int) - Signal-to-noise ratio for the images.",
1363
1376
  "skip_mode": "(str) - The mode to use for skipping images. This will determine how to handle images that cannot be processed.",
1364
1377
  "smooth_lines": "(bool) - Whether to smooth lines in the plots.",
1365
1378
  "src": "(str, path) - Path to source directory.",
1379
+ "segmentation_mode": "(str) - Algorithm to use for segmentation (cellpose or mediar).",
1366
1380
  "target": "(str) - Target variable for the analysis.",
1367
1381
  "target_height": "(int) - Target height for resizing the images.",
1368
1382
  "target_intensity_min": "(float) - Minimum intensity for the target objects.",
@@ -1412,7 +1426,7 @@ def generate_fields(variables, scrollable_frame):
1412
1426
  "masks": "(bool) - Whether to generate masks for the segmented objects.",
1413
1427
  "timelapse": "(bool) - Whether to analyze images as a timelapse.",
1414
1428
  "pathogen_min_size": "(int) - The minimum size of pathogen objects in pixels^2.",
1415
- "pathogen_mask_dim": "(int) - The dimension of the array the pathogen mask is saved in.",
1429
+ "pathogen_mask_dim": "(int) - The dimension of the array the pathogen mask is saved in (array order:channels,cell, nucleus, pathogen, cytoplasm) array starts at dimension 0.",
1416
1430
  "use_bounding_box": "(bool) - Whether to use the bounding box for cropping the images.",
1417
1431
  "plot_points": "(bool) - Whether to plot scatterplot points.",
1418
1432
  "embedding_by_controls": "(bool) - Use the controlls to greate the embedding, then apply this embedding to all of the data.",
@@ -1442,6 +1456,7 @@ def generate_fields(variables, scrollable_frame):
1442
1456
  "shuffle": "(bool) - Shuffle the dataset bufore generating the activation maps",
1443
1457
  "correlation": "(bool) - Calculate correlation between image channels and activation maps. Data is saved to .db.",
1444
1458
  "normalize_input": "(bool) - Normalize the input images before passing them to the model.",
1459
+ "normalize_plots": "(bool) - Normalize images before plotting.",
1445
1460
  }
1446
1461
 
1447
1462
  for key, (var_type, options, default_value) in variables.items():
@@ -321,21 +321,24 @@ def load_settings(csv_file_path, show=False, setting_key='setting_key', setting_
321
321
 
322
322
  def save_settings(settings, name='settings', show=False):
323
323
 
324
- settings_df = pd.DataFrame(list(settings.items()), columns=['Key', 'Value'])
325
- if show:
326
- display(settings_df)
324
+ settings_2 = settings.copy()
327
325
 
328
- if isinstance(settings['src'], list):
329
- src = settings['src'][0]
326
+ if isinstance(settings_2['src'], list):
327
+ src = settings_2['src'][0]
330
328
  name = f"{name}_list"
331
329
  else:
332
- src = settings['src']
330
+ src = settings_2['src']
333
331
 
334
- if 'test_mode' in settings.keys():
335
- settings['test_mode'] = False
332
+ if 'test_mode' in settings_2.keys():
333
+ settings_2['test_mode'] = False
336
334
 
337
- if 'plot' in settings.keys():
338
- settings['plot'] = False
335
+ if 'plot' in settings_2.keys():
336
+ settings_2['plot'] = False
337
+
338
+ settings_df = pd.DataFrame(list(settings_2.items()), columns=['Key', 'Value'])
339
+
340
+ if show:
341
+ display(settings_df)
339
342
 
340
343
  settings_csv = os.path.join(src,'settings',f'{name}.csv')
341
344
  os.makedirs(os.path.join(src,'settings'), exist_ok=True)
@@ -554,7 +557,7 @@ def _get_cellpose_batch_size():
554
557
  def _extract_filename_metadata(filenames, src, regular_expression, metadata_type='cellvoyager', pick_slice=False, skip_mode='01'):
555
558
 
556
559
  images_by_key = defaultdict(list)
557
-
560
+
558
561
  for filename in filenames:
559
562
  match = regular_expression.match(filename)
560
563
  if match:
@@ -597,7 +600,7 @@ def _extract_filename_metadata(filenames, src, regular_expression, metadata_type
597
600
  except IndexError:
598
601
  print(f"Could not extract information from filename {filename} using provided regex")
599
602
  else:
600
- print(f"Filename {filename} did not match provided regex")
603
+ print(f"Filename {filename} did not match provided regex: {regular_expression}")
601
604
  continue
602
605
 
603
606
  return images_by_key
@@ -3144,7 +3147,7 @@ def _run_test_mode(src, regex, timelapse=False, test_images=10, random_test=True
3144
3147
 
3145
3148
  if os.path.exists(os.path.join(src, 'orig')):
3146
3149
  src = os.path.join(src, 'orig')
3147
-
3150
+
3148
3151
  all_filenames = [filename for filename in os.listdir(src) if regular_expression.match(filename)]
3149
3152
  print(f'Found {len(all_filenames)} files')
3150
3153
  images_by_set = defaultdict(list)
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.1
2
2
  Name: spacr
3
- Version: 0.4.3
3
+ Version: 0.4.5
4
4
  Summary: Spatial phenotype analysis of crisp screens (SpaCr)
5
5
  Home-page: https://github.com/EinarOlafsson/spacr
6
6
  Author: Einar Birnir Olafsson
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes