diff --git a/MAMMARYGLAND.md b/MAMMARYGLAND.md index 49187b3..e2195fc 100644 --- a/MAMMARYGLAND.md +++ b/MAMMARYGLAND.md @@ -1 +1,3 @@ -# Segmentation of mammary gland cells \ No newline at end of file +# 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. \ No newline at end of file diff --git a/README.md b/README.md index caeb07b..1f3969f 100644 --- a/README.md +++ b/README.md @@ -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 diff --git a/SPHEROIDS.md b/SPHEROIDS.md index 71ea62f..b33150b 100644 --- a/SPHEROIDS.md +++ b/SPHEROIDS.md @@ -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). diff --git a/XENOPUS.md b/XENOPUS.md index 3fa0a99..d0fc533 100644 --- a/XENOPUS.md +++ b/XENOPUS.md @@ -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) diff --git a/scripts/01_membrane_segmentation.py b/scripts/cellpose_stardist_membrane.py similarity index 100% rename from scripts/01_membrane_segmentation.py rename to scripts/cellpose_stardist_membrane.py diff --git a/scripts/mammary_gland_us.py b/scripts/mammary_gland_us.py new file mode 100644 index 0000000..f30165f --- /dev/null +++ b/scripts/mammary_gland_us.py @@ -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() \ No newline at end of file diff --git a/scripts/01_segmentation_corrections.py b/scripts/segmentation_corrections.py similarity index 100% rename from scripts/01_segmentation_corrections.py rename to scripts/segmentation_corrections.py diff --git a/scripts/01_joint_membrane_nuclei_segmentation.py b/scripts/spheroid_nuclei_membrane_segmentation.py similarity index 100% rename from scripts/01_joint_membrane_nuclei_segmentation.py rename to scripts/spheroid_nuclei_membrane_segmentation.py diff --git a/scripts/01_timelapse_joint_membrane_nuclei_segmentation.py b/scripts/timelapse_spheroids_joint_segmentation.py similarity index 100% rename from scripts/01_timelapse_joint_membrane_nuclei_segmentation.py rename to scripts/timelapse_spheroids_joint_segmentation.py diff --git a/scripts/01_nuclei_segmentation.py b/scripts/xenopus_nuclei.py similarity index 100% rename from scripts/01_nuclei_segmentation.py rename to scripts/xenopus_nuclei.py