public class CalcStructureStatistics extends MTBOperator
For each structure region a corresponding region in the given cell segmentation result is detected and the structure region assigned to it. Note that structure regions along image borders are ignored. In addition, optionally also regions in given nuclei regions might be excluded if a mask with detected nuclei regions is available.
In parts the code of this file has been copied from Oliver's tool 'EvalParticleDetection'. However, this class is more generic in the sense that only a single cell segmentation result and a single structure segmentation result are processed on call of this tool.
Modifier and Type | Class and Description |
---|---|
static class |
CalcStructureStatistics.StructureCountMode
Mode how to assign structures to cell regions.
|
Modifier and Type | Field and Description |
---|---|
private MTBImageByte |
cellLabelImg
Label image of cell areas.
|
private CalcStructureStatistics.StructureCountMode |
countMode
Mode for assigning structures to regions.
|
private HashMap<Integer,MTBRegion2DSet> |
cparticles |
private int |
height |
private boolean |
ignoreStructsAtBorder
Flag to ignore structures along border.
|
private boolean |
ignoreStructsInNuclei |
private int |
minStructureSize
Minimal size of structure regions to be considered.
|
private MTBImageByte |
nucleiMask
Nuclei mask.
|
private HashMap<Integer,Double> |
resultDataAreaFractions
Result data: area fractions.
|
private HashMap<Integer,Double> |
resultDataAvgSize
Result data: average size.
|
private HashMap<Integer,Integer> |
resultDataCellSizes
Result data: cell sizes.
|
private HashMap<Integer,Integer> |
resultDataCounts
Result data: counts.
|
private HashMap<Integer,Integer> |
resultDataTotalSize
Result data: total structure size per cell.
|
private MTBImageByte |
structureMask
Structure mask.
|
private int |
width |
Modifier | Constructor and Description |
---|---|
protected |
CalcStructureStatistics()
Default constructor.
|
|
CalcStructureStatistics(MTBImageByte sMask,
MTBImageByte nMask,
MTBImageByte labelImg)
Default constructor.
|
|
CalcStructureStatistics(MTBImageByte sMask,
MTBImageByte nMask,
MTBImageByte labelImg,
boolean ignoreNuclei)
Deprecated.
|
Modifier and Type | Method and Description |
---|---|
private void |
assignStructsToCell_com(MTBRegion2DSet regs)
Assigns the given set of structure regions to individual cells.
|
private void |
assignStructsToCell_overlap(MTBRegion2DSet regions)
Assigns the given set of structure regions to individual cells.
|
HashMap<Integer,Double> |
getResultDataAreaFractions()
Returns result data object with area fractions per cell.
|
HashMap<Integer,Double> |
getResultDataAvgSize()
Returns result data object with average size per cell.
|
HashMap<Integer,Integer> |
getResultDataCellSizes()
Returns result data object with areas per cell.
|
HashMap<Integer,Integer> |
getResultDataCounts()
Returns result data object with counts per cell.
|
HashMap<Integer,Integer> |
getResultDataTotalSize()
Returns result data object with total structure size per cell.
|
protected void |
operate() |
void |
setCountMode(CalcStructureStatistics.StructureCountMode m)
Specify mode how to assign structures to cells.
|
void |
setIgnoreBorderFlag(boolean f)
Set flag to include/ignore structures along image border.
|
void |
setMinimalRegionSize(int minsize)
Specify minimal size of regions considered.
|
readResolve
addOperatorExecutionProgressEventListener, addParameter, addParameter, addParameterUnconditioned, fieldContained, fireOperatorExecutionProgressEvent, getALDPortHashAccessKey, getConstructionMode, getDocumentation, getHidingMode, getInactiveParameterNames, getInInoutNames, getInInoutNames, getInNames, getInOutNames, getMissingRequiredInputs, getName, getNumParameters, getOutInoutNames, getOutNames, getParameter, getParameterDescriptor, getParameterDescriptorUnconditioned, getParameterNames, getParameterUnconditioned, getSupplementalNames, getVerbose, getVersion, handleOperatorExecutionProgressEvent, hasInOutParameters, hasParameter, isAnnotatedParameter, isConfigured, print, print, print, printInterface, printInterface, readHistory, reinitializeParameterDescriptors, removeOperatorExecutionProgressEventListener, removeParameter, runOp, runOp, runOp, setConstructionMode, setConstructionMode, setConstructionMode, setHidingMode, setName, setParameter, setParameterUnconditioned, setVerbose, toStringVerbose, unconfiguredItems, validate, validateCustom, validateGeneric, writeHistory, writeHistory, writeHistory
@Parameter(label="structureMask", required=true, direction=IN, description="Binary mask of structures.") private MTBImageByte structureMask
@Parameter(label="nucleiMask", required=false, direction=IN, description="Binary mask of nuclei.") private MTBImageByte nucleiMask
@Parameter(label="cellLabelImg", required=true, direction=IN, description="Label image of cell areas.") private MTBImageByte cellLabelImg
@Parameter(label="countMode", required=false, direction=IN, description="Mode for assigning structures to regions.") private CalcStructureStatistics.StructureCountMode countMode
@Parameter(label="minStructureSize", required=false, direction=IN, description="Minimal size of structure regions to be considered.") private int minStructureSize
@Parameter(label="ignoreStructsAtBorder", required=false, direction=IN, description="Flag for ignoring structures along image border.") private boolean ignoreStructsAtBorder
@Parameter(label="resultDataCounts", required=true, direction=OUT, description="Result data for counts per cell.") private HashMap<Integer,Integer> resultDataCounts
@Parameter(label="resultDataTotalSize", required=true, direction=OUT, description="Result data for total structure size per cell.") private HashMap<Integer,Integer> resultDataTotalSize
@Parameter(label="resultDataAvgSize", required=true, direction=OUT, description="Result data for average size per cell.") private HashMap<Integer,Double> resultDataAvgSize
@Parameter(label="resultDataAreaFractions", required=true, direction=OUT, description="Result data for area fraction per cell.") private HashMap<Integer,Double> resultDataAreaFractions
@Parameter(label="resultDataCellSizes", required=true, direction=OUT, description="Result data for size per cell.") private HashMap<Integer,Integer> resultDataCellSizes
private int width
private int height
private HashMap<Integer,MTBRegion2DSet> cparticles
private boolean ignoreStructsInNuclei
protected CalcStructureStatistics() throws de.unihalle.informatik.Alida.exceptions.ALDOperatorException
de.unihalle.informatik.Alida.exceptions.ALDOperatorException
@Deprecated public CalcStructureStatistics(MTBImageByte sMask, MTBImageByte nMask, MTBImageByte labelImg, boolean ignoreNuclei) throws de.unihalle.informatik.Alida.exceptions.ALDOperatorException
sMask
- Binary mask of detected structures.nMask
- Binary mask of detected nuclei.labelImg
- Label image of detected cell areas.ignoreNuclei
- Flag for ignoring nuclei regions.de.unihalle.informatik.Alida.exceptions.ALDOperatorException
public CalcStructureStatistics(MTBImageByte sMask, MTBImageByte nMask, MTBImageByte labelImg) throws de.unihalle.informatik.Alida.exceptions.ALDOperatorException
sMask
- Binary mask of detected structures.nMask
- Binary mask of detected nuclei.labelImg
- Label image of detected cell areas.de.unihalle.informatik.Alida.exceptions.ALDOperatorException
public void setCountMode(CalcStructureStatistics.StructureCountMode m)
public void setMinimalRegionSize(int minsize)
public void setIgnoreBorderFlag(boolean f)
public HashMap<Integer,Integer> getResultDataCounts()
public HashMap<Integer,Integer> getResultDataTotalSize()
public HashMap<Integer,Double> getResultDataAreaFractions()
public HashMap<Integer,Integer> getResultDataCellSizes()
public HashMap<Integer,Double> getResultDataAvgSize()
protected void operate() throws de.unihalle.informatik.Alida.exceptions.ALDOperatorException, de.unihalle.informatik.Alida.exceptions.ALDProcessingDAGException
operate
in class de.unihalle.informatik.Alida.operator.ALDOperator
de.unihalle.informatik.Alida.exceptions.ALDOperatorException
de.unihalle.informatik.Alida.exceptions.ALDProcessingDAGException
private void assignStructsToCell_com(MTBRegion2DSet regs)
For the assignment the center of mass of each region is calculated and the corresponding cell region chosen according to its location.
private void assignStructsToCell_overlap(MTBRegion2DSet regions)
For the assignment the overlap of each region to all cell regions is calculated and the cell with largest overlap is chosen as corresponding cell region.
Copyright © 2010–2020 Martin Luther University Halle-Wittenberg, Institute of Computer Science, Pattern Recognition and Bioinformatics. All rights reserved.