de.unihalle.informatik.MiToBo.apps.cells2D
Class Mica2D

java.lang.Object
  extended by de.unihalle.informatik.Alida.operator.ALDOperator
      extended by de.unihalle.informatik.Alida.operator.ALDOperatorControllable
          extended by de.unihalle.informatik.MiToBo.core.operator.MTBOperatorControllable
              extended by de.unihalle.informatik.MiToBo.apps.cells2D.Mica2D
All Implemented Interfaces:
de.unihalle.informatik.Alida.datatypes.ALDConfigurationValidator, de.unihalle.informatik.Alida.operator.events.ALDConfigurationEventListener, de.unihalle.informatik.Alida.operator.events.ALDConfigurationEventReporter, de.unihalle.informatik.Alida.operator.events.ALDControlEventListener, de.unihalle.informatik.Alida.operator.events.ALDControlEventReporter, java.util.EventListener

@ALDAOperator(genericExecutionMode=ALL)
public class Mica2D
extends MTBOperatorControllable

Operator for integrated cell image analysis.

Given a multi-channel input image this operator detects nuclei, particles and the cell boundary and integrates all results to complete cell statistics.

Author:
moeller

Nested Class Summary
 
Nested classes/interfaces inherited from class de.unihalle.informatik.Alida.operator.ALDOperatorControllable
de.unihalle.informatik.Alida.operator.ALDOperatorControllable.OperatorControlStatus
 
Nested classes/interfaces inherited from class de.unihalle.informatik.Alida.operator.ALDOperator
de.unihalle.informatik.Alida.operator.ALDOperator.HidingMode
 
Field Summary
private  int cellChannel
          Channel for cell boundary detection.
private  int[] channelsToCopy
          Set of image channels to copy into result stack.
private  CytoplasmAnalyzer2D cytoDetector
          Cytoplasma detection operator.
private  boolean doGauss
          Preprocess cytoplasm channel by Gaussian smoothing.
private  boolean excludeParticlesInNuclei
          Flag to ignore particle in nuclei regions.
private  double gaussSigma
          Sigma for Gaussian smoothing.
private  boolean imagesAsMasks
          If flag is true, only masks are copied to result stack.
private  MTBImage inImg
          Multi-channel input image.
private  int nucleiChannel
          Nuclei channel.
private  MTBPolygon2DSet nucleiContours
          (Optional) initial snake contours for nuclei.
private  NucleusDetector2D nucleiDetector
          Operator for nucleus detection/separation.
private  MultiChannelParticleAnalyzer2D particleDetector
          Particle detector.
private  boolean prepareFinalResultStack
          Flag for preparing final result image(s) stack.
private  SegResult_Complete resultData
          Result data object.
private  SegResult_Cytoplasm resultDataCells
          Local container for cell cytoplasm segmentation result.
private  java.util.Vector<MTBImage> resultImages
          Local container for set of segmentation result and channel copy images.
private  Mica2DTableModel resultStats
          Result data object.
private  de.unihalle.informatik.Alida.datatypes.ALDDirectoryString saveIntermediateResultPath
          Path where to save intermediate results.
private  boolean saveIntermediateResults
          Flag for saving intermediate results to a specified directory.
private  boolean showIntermediateResults
          Flag for showing intermediate results.
private  SegResultEnums.MeasureUnit units
          Units used in measurements, default is pixels.
 
Fields inherited from class de.unihalle.informatik.Alida.operator.ALDOperatorControllable
configurationEventlistenerList, controlEventlistenerList, notifyListenersRecursively, operatorStatus, stepSize, stepWiseExecution
 
Fields inherited from class de.unihalle.informatik.Alida.operator.ALDOperator
completeDAG, name, portHashAccess, verbose, versionProvider
 
Constructor Summary
Mica2D()
          Default constructor.
Mica2D(MTBImage img, int nc, int cc)
          Default constructor.
 
Method Summary
 SegResult_Complete getResultData()
          Returns result data object.
 java.lang.String getSaveIntermediateResultPath()
          Returns path where to save intermediate results.
protected  void operate()
          Invokes analysis procedure on given image.
private  MTBImageRGB prepareResultImageStack()
          Initialize result image stack.
 void saveIntermediateResults(boolean flag)
          Set flag to save intermediate results.
 void setChannelsToCopy(int[] carray)
          Specify list of channels to copy to result stack.
 void setDoGauss(boolean _doGauss)
          Specify if cell channel is to be smoothed prior to detection.
 void setGaussSigma(double _gaussSigma)
          Specify sigma for Gaussian smoothing.
 void setInitialSnakes(MTBPolygon2DSet f)
          Specify set of initial snakes.
 void setMeasureUnits(SegResultEnums.MeasureUnit mu)
          Specify how to measure lengths and areas.
 void setSaveIntermediateResultPath(java.lang.String sIntermediateResultPath)
          Set path where to save intermediate results.
 void showIntermediateResults(boolean flag)
          Set flag to display intermediate results.
 void showMasksOnly(boolean flag)
          Set flag indicating whether to show masks or overlays in result stack.
 
Methods inherited from class de.unihalle.informatik.Alida.operator.ALDOperatorControllable
addALDConfigurationEventListener, addALDControlEventListener, fireALDConfigurationEvent, fireALDControlEvent, handleALDConfigurationEvent, handleALDControlEvent, removeALDConfigurationEventListener, removeALDControlEventListener, setNotifyRecursiveFlag
 
Methods inherited from class de.unihalle.informatik.Alida.operator.ALDOperator
deserializeFromXmlFile, fieldContained, getALDPortHashAccessKey, getConstructionMode, getInInoutNames, getInInoutNames, getInNames, getInOutNames, getMissingRequiredInputs, getName, getNumParameters, getOutInoutNames, getOutNames, getParameter, getParameterDescriptor, getParameterNames, getSupplementalNames, getVerbose, getVersion, isConfigured, parametersToXmlObject, print, print, print, printInterface, printInterface, readHistory, readResolve, reinitializeParameterDescriptors, runOp, runOp, runOp, serializeToXmlFile, setConstructionMode, setName, setParameter, setParametersFromXml, setParametersFromXml, setVerbose, toStringVerbose, unconfiguredItems, validate, validateCustom, validateGeneric, writeHistory, writeHistory, writeHistory, writeParametersToXml
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

cellChannel

@Parameter(label="Cytoplasm channel",
           required=true,
           dataIOOrder=-18,
           direction=IN,
           description="Cytoplasm channel, index starts with 1.")
private int cellChannel
Channel for cell boundary detection.


channelsToCopy

@Parameter(label="List of channel IDs to copy to result",
           supplemental=true,
           direction=IN,
           mode=ADVANCED,
           dataIOOrder=-15,
           description="Array of image channels to copy to result stack.")
private int[] channelsToCopy
Set of image channels to copy into result stack.


cytoDetector

@Parameter(label="Cytoplasm detector",
           required=false,
           dataIOOrder=-18,
           direction=IN,
           description="Cytoplasm detector.")
private CytoplasmAnalyzer2D cytoDetector
Cytoplasma detection operator.


doGauss

@Parameter(label="Apply Gauss to cytoplasm channel",
           required=false,
           direction=IN,
           dataIOOrder=-17,
           description="Apply Gaussian smoothing to cytoplasm channel.")
private boolean doGauss
Preprocess cytoplasm channel by Gaussian smoothing.


excludeParticlesInNuclei

@Parameter(label="Ignore particles in nuclei regions",
           required=false,
           dataIOOrder=-14,
           direction=IN,
           description="Ignore particles in nucleis.")
private boolean excludeParticlesInNuclei
Flag to ignore particle in nuclei regions.


gaussSigma

@Parameter(label="Gauss sigma",
           required=false,
           direction=IN,
           description="Sigma for Gaussian smoothing.",
           dataIOOrder=-16)
private double gaussSigma
Sigma for Gaussian smoothing.


imagesAsMasks

@Parameter(label="Show b/w masks",
           dataIOOrder=-16,
           direction=IN,
           supplemental=true,
           mode=ADVANCED,
           description="Flag for showing masks only instead of overlays.")
private boolean imagesAsMasks
If flag is true, only masks are copied to result stack.


inImg

@Parameter(label="Input image",
           required=true,
           direction=IN,
           description="Input image",
           dataIOOrder=-20)
private transient MTBImage inImg
Multi-channel input image.


nucleiChannel

@Parameter(label="Nucleus channel",
           required=true,
           dataIOOrder=-19,
           direction=IN,
           description="Nuclei channel (index starts with 1, -1 if none available).")
private int nucleiChannel
Nuclei channel.


nucleiContours

@Parameter(label="Nuclei contours",
           required=false,
           dataIOOrder=-19,
           direction=IN,
           description="(Optional) set of nuclei contours.")
private MTBPolygon2DSet nucleiContours
(Optional) initial snake contours for nuclei.

If a nucleus channel is available contours can be extracted automatically.


nucleiDetector

@Parameter(label="Nuclei detector",
           required=false,
           dataIOOrder=-20,
           direction=IN,
           description="Nucleus detector.")
private NucleusDetector2D nucleiDetector
Operator for nucleus detection/separation.


particleDetector

@Parameter(label="Particle detector",
           required=false,
           dataIOOrder=-15,
           direction=IN,
           description="Minimum size of particles.")
private MultiChannelParticleAnalyzer2D particleDetector
Particle detector.


prepareFinalResultStack

@Parameter(label="Show final result image stack",
           direction=IN,
           supplemental=true,
           dataIOOrder=-30,
           mode=ADVANCED,
           description="Flag to enable result image stack display.")
private boolean prepareFinalResultStack
Flag for preparing final result image(s) stack.


resultData

@Parameter(label="Result data summary",
           direction=OUT,
           description="Result segmentation masks.")
private transient SegResult_Complete resultData
Result data object.


resultDataCells

private transient SegResult_Cytoplasm resultDataCells
Local container for cell cytoplasm segmentation result.


resultImages

private transient java.util.Vector<MTBImage> resultImages
Local container for set of segmentation result and channel copy images.


resultStats

@Parameter(label="Table of result statistics",
           direction=OUT,
           description="Result statistical data.")
private transient Mica2DTableModel resultStats
Result data object.


saveIntermediateResultPath

@Parameter(label="Save intermediate results to...",
           direction=IN,
           supplemental=true,
           dataIOOrder=-18,
           mode=ADVANCED,
           description="Path where to save intermediate results.")
private de.unihalle.informatik.Alida.datatypes.ALDDirectoryString saveIntermediateResultPath
Path where to save intermediate results.


saveIntermediateResults

@Parameter(label="Save intermediate results",
           direction=IN,
           supplemental=true,
           dataIOOrder=-19,
           mode=ADVANCED,
           description="Flag for saving intermediate result image(s)/data.")
private boolean saveIntermediateResults
Flag for saving intermediate results to a specified directory.


showIntermediateResults

@Parameter(label="Show intermediate results",
           direction=IN,
           supplemental=true,
           dataIOOrder=-20,
           description="Flag for showing intermediate result image(s)/data.")
private boolean showIntermediateResults
Flag for showing intermediate results.

Be careful when using this option remote from commandline!


units

@Parameter(label="Measure Units",
           required=false,
           direction=IN,
           dataIOOrder=-10,
           description="Units for measuring areas and sizes.")
private SegResultEnums.MeasureUnit units
Units used in measurements, default is pixels.

Constructor Detail

Mica2D

public Mica2D()
       throws de.unihalle.informatik.Alida.exceptions.ALDOperatorException
Default constructor.

Throws:
de.unihalle.informatik.Alida.exceptions.ALDOperatorException

Mica2D

public Mica2D(MTBImage img,
              int nc,
              int cc)
       throws de.unihalle.informatik.Alida.exceptions.ALDOperatorException
Default constructor.

Parameters:
img - Input multi-layer image to be processed.
nc - Nuclei channel.
cc - Cytoplasm channel.
Throws:
de.unihalle.informatik.Alida.exceptions.ALDOperatorException
Method Detail

getResultData

public SegResult_Complete getResultData()
Returns result data object.


getSaveIntermediateResultPath

public java.lang.String getSaveIntermediateResultPath()
Returns path where to save intermediate results.


operate

protected void operate()
                throws de.unihalle.informatik.Alida.exceptions.ALDOperatorException,
                       de.unihalle.informatik.Alida.exceptions.ALDProcessingDAGException
Invokes analysis procedure on given image.

Overrides:
operate in class de.unihalle.informatik.Alida.operator.ALDOperatorControllable
Throws:
de.unihalle.informatik.Alida.exceptions.ALDOperatorException
de.unihalle.informatik.Alida.exceptions.ALDProcessingDAGException

prepareResultImageStack

private MTBImageRGB prepareResultImageStack()
Initialize result image stack.

Transfers result images and selected input channels to a multi-channel RGB image.


saveIntermediateResults

public void saveIntermediateResults(boolean flag)
Set flag to save intermediate results.


setChannelsToCopy

public void setChannelsToCopy(int[] carray)
Specify list of channels to copy to result stack.


setDoGauss

public void setDoGauss(boolean _doGauss)
Specify if cell channel is to be smoothed prior to detection.


setGaussSigma

public void setGaussSigma(double _gaussSigma)
Specify sigma for Gaussian smoothing.


setInitialSnakes

public void setInitialSnakes(MTBPolygon2DSet f)
Specify set of initial snakes.


setMeasureUnits

public void setMeasureUnits(SegResultEnums.MeasureUnit mu)
Specify how to measure lengths and areas.


setSaveIntermediateResultPath

public void setSaveIntermediateResultPath(java.lang.String sIntermediateResultPath)
Set path where to save intermediate results.


showIntermediateResults

public void showIntermediateResults(boolean flag)
Set flag to display intermediate results.


showMasksOnly

public void showMasksOnly(boolean flag)
Set flag indicating whether to show masks or overlays in result stack.