Skip to content

Commit 9555211

Browse files
correct dependencies for imwrite, imread in preprocessing routine
1 parent 4198a3c commit 9555211

5 files changed

+11
-12
lines changed

notebooks/distance-closest-object.ipynb

+4-5
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@
77
"# Notebook to perform segmentation of either cells or nuclei with cellpose.\n",
88
"* Requires that `cellpose` and the code of this respository are installed. One way to do this is with a pip install (recommended in a dedicated conda environment as explained in the documentation).\n",
99
" ```\n",
10-
" pip install git+https://github.com/muellerflorian/segmentation/ --upgrade\n",
10+
" pip install git+https://github.com/muellerflorian/fq-segmentation/ --upgrade\n",
1111
" ```"
1212
]
1313
},
@@ -30,18 +30,17 @@
3030
"metadata": {},
3131
"outputs": [],
3232
"source": [
33-
"# >> Function call\n",
33+
"# >>>> Function call\n",
3434
"\n",
35-
"# Parameters\n",
35+
"# >> Parameters\n",
3636
"path_scan = Path(r'paste-path-to-data') # For example data: example_data\\analysis\\segmentation-input\n",
3737
"\n",
3838
"str_label = 'mask__nuclei__'\n",
3939
"strs_save = ('nuclei_close_ind__', 'nuclei_close_dist__')\n",
4040
"truncate_distance = 255 # Distance above which distances will be truncated. \n",
4141
"path_save = None\n",
4242
"\n",
43-
"\n",
44-
"# Call processing function\n",
43+
"# >> Call processing function\n",
4544
"importlib.reload(utils_masks)\n",
4645
"utils_masks.create_img_closest_obj(path_scan=path_scan,\n",
4746
" str_label=str_label,\n",

notebooks/pre-processing.ipynb

+1-1
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@
88
"* Takes 3D images and performs a 2D projection to obtain 2D png that can be used in the segmentation algorithm.\n",
99
"* Requires that `cellpose` and the code of this respository are installed. One way to do this is with a pip install (recommended in a dedicated conda environment as explained in the documentation).\n",
1010
" ```\n",
11-
" pip install git+https://github.com/muellerflorian/segmentation/ --upgrade\n",
11+
" pip install git+https://github.com/muellerflorian/fq-segmentation/ --upgrade\n",
1212
" ```"
1313
]
1414
},

segwrap/__init__.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -12,4 +12,4 @@
1212
# MINOR: new features
1313
# PATCH: backwards compatible bug fixes
1414
# MAJOR.MINOR.PATCHdev means a version under development
15-
__version__ = "0.3.2"
15+
__version__ = "0.3.3"

segwrap/utils_cellpose.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@
99
import cv2
1010

1111
# Imports of CellPose specific libraries
12-
from cellpose import models, utils, io, plot
12+
from cellpose import models, io, plot
1313
from segwrap.utils_general import log_message, create_output_path
1414

1515
# Call predict function

segwrap/utils_segmentation.py

+4-4
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,8 @@
11
# Imports
22
import pathlib
33
import json
4-
from skimage.io import imread, imsave
5-
4+
#from skimage.io import imread, imsave
5+
from cellpose.io import imread, imsave
66
from segwrap.utils_general import log_message, create_output_path
77

88
# Functions
@@ -107,7 +107,7 @@ def folder_prepare_prediction(path_process, channel_ident, img_ext, path_save, p
107107

108108
if name_save.is_file():
109109
log_message(f'File already exists. Will be overwritten {name_save}', callback_fun=callback_log)
110-
imsave(name_save, img[i, :, :])
110+
imsave(str(name_save), img[i, :, :])
111111

112112
else:
113113

@@ -121,4 +121,4 @@ def folder_prepare_prediction(path_process, channel_ident, img_ext, path_save, p
121121

122122
if name_save.is_file():
123123
log_message(f'File already exists. Will be overwritten {name_save}', callback_fun=callback_log)
124-
imsave(name_save, img_proj.astype('uint16'))
124+
imsave(str(name_save), img_proj.astype('uint16'))

0 commit comments

Comments
 (0)