Skip to content

Commit

Permalink
update mammary gland page
Browse files Browse the repository at this point in the history
  • Loading branch information
kapoorlab committed Sep 3, 2023
1 parent 82feb5d commit f559504
Show file tree
Hide file tree
Showing 10 changed files with 66 additions and 21 deletions.
4 changes: 3 additions & 1 deletion MAMMARYGLAND.md
Original file line number Diff line number Diff line change
@@ -1 +1,3 @@
# Segmentation of mammary gland cells
# Segmentation of mammary gland cells

VollSeg specializes with its seed pooling approach to segment irregular shapes of [mammary gland cells](https://github.com/kapoorlab/VollSeg/blob/main/images/Seg_pipe-git.png) from human or mouse samples. In the orignal algorithm we use a CARE trained denoising model and eaither use the U-Net model for semantic segmentation or use the denoising model for the semantic segmentation depending on which model has a better prediction. For using combination of (U-Net, CARE and StarDist) model with U-Net as the model for semantic segmentation use this [script](scripts/mammary_gland_us.py) if you want to use the denoised image as the base image for creating the semantic segmentation map using Otsu threshold set the parameter ```dounet=False``` in that same script.
19 changes: 1 addition & 18 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -15,31 +15,14 @@ This project provides the [napari](https://napari.org/) plugin for [VollSeg](htt
For detailed demo of the plugin see these [videos](https://www.youtube.com/watch?v=W_gKrLWKNpQ) and a short video about the [parameter selection](https://www.youtube.com/watch?v=7tQMn_u8_7s&t=1s)



## Installation & Usage

Install the plugin with `pip install vollseg-napari` or from within napari via `Plugins > Install/Uninstall Package(s)…`. If you want GPU-accelerated prediction, please read the more detailed [installation instructions](https://github.com/kapoorlab/vollseg-napari#gpu_installation) for VollSeg.
Install the plugin with `pip install vollseg-napari` or from within napari via `Plugins > Install/Uninstall Package(s)…`.

You can activate the plugin in napari via `Plugins > VollSeg: VollSeg`. Example images for testing are provided via `File > Open Sample > VollSeg`.

If you use this plugin for your research, please [cite us](http://conference.scipy.org/proceedings/scipy2021/varun_kapoor.html).

## GPU_Installation

This package is compatible with Python 3.6 - 3.9.

1. Please first [install TensorFlow](https://www.tensorflow.org/install)
(TensorFlow 2) by following the official instructions.
For [GPU support](https://www.tensorflow.org/install/gpu), it is very
important to install the specific versions of CUDA and cuDNN that are
compatible with the respective version of TensorFlow. (If you need help and can use `conda`, take a look at [this](https://github.com/CSBDeep/CSBDeep/tree/master/extras#conda-environment).)

2. *VollSeg* can then be installed with `pip`:

- If you installed TensorFlow 2 (version *2.x.x*):

pip install vollseg


## Examples

Expand Down
2 changes: 1 addition & 1 deletion SPHEROIDS.md
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ The method used to segment the dual channels relies on the VollOne method inside

## Script

The script used for this step is: [script](01_joint_membrane_nuclei_segmentation.py).
The script used for this step are: [script](scripts/spheroid_nuclei_membrane_segmentation.py) and [script](scripts/timelapse_spheroids_joint_segmentation.py).



2 changes: 1 addition & 1 deletion XENOPUS.md
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ For the membrane segmetation we have a trained cellpose model that segments the

## Script

The scripts used for this step are: [membrane segmentation script](01_membrane_segmentation.py), [nuclei segmentation script](01_nuclei_segmentation.py)
The scripts used for this step are: [membrane segmentation script](scripts/cellpose_stardist_membrane.py), [nuclei segmentation script](scripts/xenopus_nuclei.py)



File renamed without changes.
60 changes: 60 additions & 0 deletions scripts/mammary_gland_us.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,60 @@
import os
import glob
from tifffile import imread
from vollseg import StarDist3D, UNET, CARE
from vollseg.utils import VollSeg
from pathlib import Path
def main():

image_dir = '/path/toimagedir'
model_dir = '/path/tomodeldir/'
save_dir = os.path.join(image_dir, 'VollSeg')
Path(save_dir).mkdir(exist_ok=True)

unet_model_name = 'unet_nuclei_model_name'
star_model_name = 'star_nuclei_model_name'
noise_model_name = 'noise_nuclei_model_name'

unet_model = UNET(config = None, name = unet_model_name, basedir = model_dir)
star_model = StarDist3D(config = None, name = star_model_name, basedir = model_dir)
noise_model = CARE(config = None, name = noise_model_name, basedir = model_dir)
Raw_path = os.path.join(image_dir, '.tif')
filesRaw = glob.glob(Raw_path)
filesRaw.sort
min_size = 10
min_size_mask = 10
max_size = 10000
n_tiles = (1,1,1)
dounet = True
seedpool = True
slice_merge = False
UseProbability = True
donormalize = True
axes = 'ZYX'
ExpandLabels = False
for fname in filesRaw:

image = imread(fname)
Name = os.path.basename(os.path.splitext(fname)[0])
VollSeg( image,
unet_model = unet_model,
star_model = star_model,
noise_model = noise_model,
seedpool = seedpool,
axes = axes,
min_size = min_size,
min_size_mask = min_size_mask,
max_size = max_size,
donormalize=donormalize,
n_tiles = n_tiles,
ExpandLabels = ExpandLabels,
slice_merge = slice_merge,
UseProbability = UseProbability,
save_dir = save_dir,
Name = Name,
dounet = dounet)



if __name__ == '__main__':
main()
File renamed without changes.
File renamed without changes.

0 comments on commit f559504

Please sign in to comment.