Giter Club home page Giter Club logo

s3segmenter's Introduction

"#S3segmenter" S3segmenter is a Matlab-based set of functions that generates single cell (nuclei and cytoplasm) label masks. Inputs are:

  1. an .ome.tif (preferably flat field corrected)
  2. a 3-class probability maps derived from a deep learning model such as UNet. Classes include background, nuclei contours, and nuclei foreground.

The centers of each nuclei are obtained by finding local maxima from the nuclei foreground. These are used for marker-controlled watershed constrained by the nuclei contours.

To segment cytoplasm, the nuclei are in turn used for a marker-controlled watershed segmentation constrained by a cytoplasmic marker such as B-catenin. The channel number of this marker must be specified. A 3-pixel annulus around each nucleus will also be used to segment cytoplasm.

How to run: In Matlab, set path to the folder of the cloned repo. Type: O2batchS3segmenterWrapperR('/path/to/files/')

Use the following name-value pairs arguments to customize the code to your experiment: ip.addParamValue('HPC','false',@(x)(ismember(x,{'true','false'}))); ip.addParamValue('fileNum',1,@(x)(numel(x) > 0 & all(x > 0 ))); % if using a cluster, this specifies which file index to work on ip.addParamValue('CytoMaskChan',[2],@(x)(numel(x) > 0 & all(x > 0 ))); % select any number of channels for cytoplasm ip.addParamValue('TissueMaskChan',[3],@(x)(numel(x) > 0 & all(x > 0 ))); % select any number of channels for tissue mask ip.addParamValue('RefineTissueMask',[0],@(x)(numel(x) > 0 & all(x > 0 ))); % constrict the tissue mask to eliminate high autofluorescent regions

ip.addParamValue('mask','tissue',@(x)(ismember(x,{'TMA','tissue','none'}))); % set to true if sample is TMA cores ip.addParamValue('crop','noCrop',@(x)(ismember(x,{'interactiveCrop','autoCrop','dearray','noCrop'}))); % interactiveCrop - a GUI-based crop selector, 'autoCrop' - takes the middle third region,'dearray', set to true if using TMA cores, 'noCrop', no cropping

ip.addParamValue('cytoMethod','distanceTransform',@(x)(ismember(x,{'RF','distanceTransform','bwdistanceTransform','ring'}))); ip.addParamValue('nucleiFilter','IntPM',@(x)(ismember(x,{'LoG','Int','IntPM','none'}))); % feature to threshold nuclei. 'IntPM' - intensity of probability map, 'Int' - intensity of DAPI channel, 'LoG', intensity of LoG filter response, 'none', accept all nuclei

ip.addParamValue('measureFeatures','false',@(x)(ismember(x,{'true','false'}))); % extracts intensity features from mask ip.addParamValue('nucleiRegion','watershedContourInt',@(x)(ismember(x,{'watershedContourDist','watershedContourInt','watershedBWDist','dilation'})));

ip.addParamValue('resizeFactor',1,@(x)(numel(x) == 1 & all(x > 0 )));
ip.addParamValue('logSigma',[2.5],@(x)(numel(x) >0 & all(x > 0 ))); % specify range of nuclei diameters in pixels ie [3 30]. ip.addParamValue('chanRange',[0],@(x)(numel(x) >0 & all(x > 0 ))); %channels for measuring features. If 0, assume all channels. ip.addParamValue('upSample',2,@(x)(numel(x) == 1 & all(x > 0 )));
ip.addParamValue('Docker','false',@(x)(ismember(x,{'true','false'}))); ip.addParamValue('dockerParams',0,@(x)(numel(x)==1));

Segmentation label masks for nuclei, cytoplasm, and cell will be saved to a subfolder under each parent image folder as a .tif file. Also saved are a 2-channel tif file with the DAPI and nuclei outlines for quality control.

s3segmenter's People

Contributors

alliecreason avatar artemsokolov avatar clarenceyapp avatar qiagu avatar yu-anchen avatar

Watchers

 avatar  avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.