You're Invited:Meet the Socket Team at RSAC and BSidesSF 2026, March 23–26.RSVP
Socket
Book a DemoSign in
Socket

deepflash2

Package Overview
Dependencies
Maintainers
1
Versions
27
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

deepflash2 - pypi Package Compare versions

Comparing version
0.2.0
to
0.2.1
+3
deepflash2.egg-info/entry_points.txt
[console_scripts]
+9
-3
Metadata-Version: 2.1
Name: deepflash2
Version: 0.2.0
Version: 0.2.1
Summary: A Deep learning pipeline for segmentation of fluorescent labels in microscopy images

@@ -10,2 +10,3 @@ Home-page: https://github.com/matjesg/deepflash2

Keywords: unet,deep learning,semantic segmentation,microscopy,fluorescent labels
Platform: UNKNOWN
Classifier: Development Status :: 3 - Alpha

@@ -56,3 +57,8 @@ Classifier: Intended Audience :: Developers

> Get started in less than a minute. Watch the <a href="https://matjesg.github.io/deepflash2/tutorial.html" target="_blank">tutorials</a> for help.
#### Demo on Hugging Face Spaces
Go to the [demo space](https://huggingface.co/spaces/matjesg/deepflash2) -- inference only (no training possible).
#### Demo usage with Google Colab
For a quick start, run *deepflash2* in Google Colaboratory (Google account required).

@@ -63,4 +69,2 @@

#### Demo usage
The GUI provides a build-in use for our [sample data](https://github.com/matjesg/deepflash2/releases/tag/sample_data).

@@ -178,1 +182,3 @@

The ImagJ-Macro is available [here](https://raw.githubusercontent.com/matjesg/DeepFLaSH/master/ImageJ/Macro_create_maps.ijm).

@@ -23,4 +23,5 @@ CONTRIBUTING.md

deepflash2.egg-info/dependency_links.txt
deepflash2.egg-info/entry_points.txt
deepflash2.egg-info/not-zip-safe
deepflash2.egg-info/requires.txt
deepflash2.egg-info/top_level.txt

@@ -1,1 +0,1 @@

__version__ = "0.2.0"
__version__ = "0.2.1"

@@ -71,5 +71,3 @@ # AUTOGENERATED BY NBDEV! DO NOT EDIT!

"GRID_COLS": "08_gui.ipynb",
"COLS_PRED_KEEP": "08_gui.ipynb",
"COLS_PRED_KEEP_DS": "08_gui.ipynb",
"COLS_PRED_KEEP_CP": "08_gui.ipynb",
"COLS_PRED_REMOVE": "08_gui.ipynb",
"SAMPLE_DATA_URL": "08_gui.ipynb",

@@ -76,0 +74,0 @@ "exception_handler": "08_gui.ipynb",

@@ -80,2 +80,3 @@ # AUTOGENERATED! DO NOT EDIT! File to edit: nbs/00_config.ipynb (unless otherwise specified).

cellpose_export_class:int=1
cellpose_flow_threshold:float=0.4
instance_segmentation_metrics:bool=False

@@ -82,0 +83,0 @@

@@ -11,2 +11,3 @@ # AUTOGENERATED! DO NOT EDIT! File to edit: nbs/02_data.ipynb (unless otherwise specified).

import matplotlib.pyplot as plt
from matplotlib.patches import Rectangle

@@ -23,3 +24,4 @@ from skimage.measure import label

from fastai.vision.all import *
#from fastai.vision.all import *
from fastai.data.transforms import get_image_files
from fastcore.all import *

@@ -113,18 +115,2 @@ from fastprogress import progress_bar

# Cell
@typedispatch
def show_batch(x:TensorImage, y:tuple, samples, max_n=6, figsize=None, **kwargs):
"Show one batch (image, mask, and weights) from a `DataLoader`"
max_n = np.min((max_n, len(x)))
if figsize is None: figsize = (12, max_n * 5)
for i in range(max_n): show(x[i], y[0][i], y[1][i], figsize=figsize, **kwargs)
# Cell
@typedispatch
def show_results(x:TensorImage, y:tuple, samples, outs, max_n=4, figsize=None, **kwargs):
"Show image, mask, and weights from `max_n` items"
max_n = np.min((max_n, len(x)))
if figsize is None: figsize = (12, max_n * 5)
for i in range(max_n): show(x[i], y[0][i], outs[i][0], pred=True, figsize=figsize, **kwargs)
# Cell
# adapted from Falk, Thorsten, et al. "U-Net: deep learning for cell counting, detection, and morphometry." Nature methods 16.1 (2019): 67-70.

@@ -131,0 +117,0 @@ def preprocess_mask(clabels=None, instlabels=None, remove_connectivity=True, num_classes = 2):

@@ -229,3 +229,3 @@ # AUTOGENERATED! DO NOT EDIT! File to edit: nbs/04_inference.ipynb (unless otherwise specified).

#softmax[ox0:ox1, oy0:oy1] += batch_smx.permute(0,2,3,1)[0][ix0:ix1, iy0:iy1].to(softmax)
softmax[..., ox0:ox1, oy0:oy1] += batch_smx[0, ..., ix0:ix1, iy0:iy1].to(softmax)
softmax[0:self.num_classes, ox0:ox1, oy0:oy1] += batch_smx[0, 0:self.num_classes, ix0:ix1, iy0:iy1].to(softmax)
merge_map[ox0:ox1, oy0:oy1] += self.mw[ix0:ix1, iy0:iy1].to(merge_map)

@@ -232,0 +232,0 @@

@@ -24,2 +24,3 @@ # AUTOGENERATED! DO NOT EDIT! File to edit: nbs/03_learner.ipynb (unless otherwise specified).

from fastai.learner import Learner
from fastai.callback.all import *
from fastai.callback.tracker import SaveModelCallback

@@ -500,3 +501,3 @@ from fastai.callback.progress import CSVLogger

def get_cellpose_results(self, export_dir=None):
def get_cellpose_results(self, export_dir=None, check_missing=True):
'Get instance segmentation results using the cellpose integration'

@@ -518,4 +519,12 @@ assert self.df_ens is not None, "Please run `get_ensemble_results` first."

min_size=self.min_pixel_export,
flow_threshold=self.cellpose_flow_threshold,
gpu=torch.cuda.is_available())
# Check for missing pixels in cellpose masks
if check_missing:
for i, _ in self.df_ens.iterrows():
cp_mask_bin = (cp_masks[i]>0).astype('uint8')
n_diff = np.sum(masks[i]!=cp_mask_bin, dtype='uint8')
self.df_ens.at[i,f'cellpose_removed_pixels_class{cl}'] = n_diff
if export_dir:

@@ -522,0 +531,0 @@ export_dir = Path(export_dir)/'instance_labels'

@@ -132,3 +132,3 @@ # AUTOGENERATED! DO NOT EDIT! File to edit: nbs/01_models.ipynb (unless otherwise specified).

# Cell
def run_cellpose(probs, masks, model_type='nuclei', diameter=0, min_size=-1, gpu=True):
def run_cellpose(probs, masks, model_type='nuclei', diameter=0, min_size=-1, gpu=True, flow_threshold=0.4):
'Run cellpose on deepflash2 predictions'

@@ -148,7 +148,11 @@ check_cellpose_installation()

p = dynamics.follow_flows(-1 * dP * mask / 5., niter=niter, interp=interp, use_gpu=self.gpu)
maski = dynamics.get_masks(p, iscell=mask, flows=dP, threshold=flow_threshold if not do_3D else None)
maski = dynamics.get_masks(p, iscell=mask, flows=dP, threshold=flow_threshold)
# remove postpreocessing?
maski = utils.fill_holes_and_remove_small_masks(maski, min_size=min_size)
if resize is not None:
maski = transforms.resize_image(maski, resize[0], resize[1],
interpolation=cv2.INTER_NEAREST)
# resizing does not work
#if resize is not None:
# maski = transforms.resize_image(maski, resize[0], resize[1], interpolation=cv2.INTER_NEAREST)
return maski, p

@@ -165,2 +169,3 @@

min_size=min_size,
flow_threshold=flow_threshold,
resample=True,

@@ -167,0 +172,0 @@ channels=[0,0])

Metadata-Version: 2.1
Name: deepflash2
Version: 0.2.0
Version: 0.2.1
Summary: A Deep learning pipeline for segmentation of fluorescent labels in microscopy images

@@ -10,2 +10,3 @@ Home-page: https://github.com/matjesg/deepflash2

Keywords: unet,deep learning,semantic segmentation,microscopy,fluorescent labels
Platform: UNKNOWN
Classifier: Development Status :: 3 - Alpha

@@ -56,3 +57,8 @@ Classifier: Intended Audience :: Developers

> Get started in less than a minute. Watch the <a href="https://matjesg.github.io/deepflash2/tutorial.html" target="_blank">tutorials</a> for help.
#### Demo on Hugging Face Spaces
Go to the [demo space](https://huggingface.co/spaces/matjesg/deepflash2) -- inference only (no training possible).
#### Demo usage with Google Colab
For a quick start, run *deepflash2* in Google Colaboratory (Google account required).

@@ -63,4 +69,2 @@

#### Demo usage
The GUI provides a build-in use for our [sample data](https://github.com/matjesg/deepflash2/releases/tag/sample_data).

@@ -178,1 +182,3 @@

The ImagJ-Macro is available [here](https://raw.githubusercontent.com/matjesg/DeepFLaSH/master/ImageJ/Macro_create_maps.ijm).

@@ -36,3 +36,8 @@ # Welcome to

> Get started in less than a minute. Watch the <a href="https://matjesg.github.io/deepflash2/tutorial.html" target="_blank">tutorials</a> for help.
#### Demo on Hugging Face Spaces
Go to the [demo space](https://huggingface.co/spaces/matjesg/deepflash2) -- inference only (no training possible).
#### Demo usage with Google Colab
For a quick start, run *deepflash2* in Google Colaboratory (Google account required).

@@ -43,4 +48,2 @@

#### Demo usage
The GUI provides a build-in use for our [sample data](https://github.com/matjesg/deepflash2/releases/tag/sample_data).

@@ -47,0 +50,0 @@

@@ -11,3 +11,3 @@ [DEFAULT]

branch = master
version = 0.2.0
version = 0.2.1
min_python = 3.7

@@ -31,2 +31,3 @@ audience = Developers

tst_flags = slow
cell_spacing = 1
cell_spacing = 1

Sorry, the diff of this file is too big to display