@ALDAOperator(genericExecutionMode=ALL, level=APPLICATION, allowBatchMode=false, shortDescription="Extracts quantative global features of cytoskeletons.") public class CytoskeletonAnalyzer2D extends MTBOperator
Modifier and Type | Field and Description |
---|---|
protected Vector<org.jfree.chart.JFreeChart> |
boxWhiskerCharts
Box-whisker plot of the group-wise cluster distributions.
|
private TreeSet<String> |
cellGroupNames
List of group names, filled in
clusterFeatures() . |
private Vector<HashMap<String,HashMap<String,Double>>> |
cellGroups
Group-wise cell distribution data, for each group the vector
contains a hash map with the following structure:
- the keys of the map are given by the cell IDs of the different
cells (without basename which is equal to the group name)
- the values are represented again as a hash map where the keys
are given by the cluster IDs and the values by the relative
frequency of the corresponding cluster in the cell
Example:
---------
cellGroups.get(0) = < 001-01, < [c1, vc1], ..., [c6, vc6] > > ,
|
private LinkedList<String> |
cellwiseDistroKeys
Sorted list of keys in
cellwiseDistros once it is filled. |
private HashMap<String,double[]> |
cellwiseDistros
Map of cluster distributions per cell, filled in
clusterFeatures() . |
protected int |
clusterNum
Number of clusters to be used in feature clustering.
|
private int |
cytoSkelChannel
Channel of input image containing stained cytoskeleton.
|
private double[][] |
distroData
Cluster distribution data, rows refer to clusters and columns to
cells.
|
private String[] |
distroDataGroups
Group names linked to entries in
distroData . |
protected boolean |
doFeatureCalculation
Flag for calculating features.
|
protected boolean |
doPCA
Perform PCA in second stage?
|
protected CytoskeletonFeatureExtractor |
featureExtractor
Feature extractor to apply.
|
private static String |
fileSep
File separator character, operating system dependent.
|
protected de.unihalle.informatik.Alida.datatypes.ALDDirectoryString |
imageDir
Input image directory.
|
private int |
imageHeight
Height of the images taking first image as reference.
|
private int |
imageWidth
Width of the images taking first image as reference.
|
protected de.unihalle.informatik.Alida.datatypes.ALDDirectoryString |
maskDir
(Optional) directory with (cell) boundaries.
|
protected CytoskeletonFeatureExtractor.CellMaskFormat |
maskFormat
Format of provided cell boundaries.
|
private static String |
operatorID
Identifier string for this operator class.
|
protected Vector<org.jfree.chart.JFreeChart> |
stackedBarCharts
Resulting stacked bar plot of cluster distributions.
|
private double[][] |
subspaceData
Dimension-reduced cluster distribution data.
|
protected int |
tileShiftX
Tile shift in x-direction.
|
protected int |
tileShiftY
Tile size in y-direction.
|
protected int |
tileSizeX
Tile size in x-direction.
|
protected int |
tileSizeY
Tile size in y-direction.
|
Constructor and Description |
---|
CytoskeletonAnalyzer2D()
Default constructor.
|
Modifier and Type | Method and Description |
---|---|
private void |
calcFeatureFlagChanged()
Callback routine to change parameters on change of flag for
enable/disable feature calculation.
|
private void |
calculateDistanceMatrices()
Calculates pairwise distance matrices and similarity network data.
|
private void |
clusterFeatures()
Performs the feature clustering via Weka's kMeans algorithm.
|
private void |
doPCA()
Performs a Karhunen-Loeve transformation on the cluster distribution data.
|
String |
getDocumentation() |
protected void |
operate() |
readResolve
addOperatorExecutionProgressEventListener, addParameter, addParameter, addParameterUnconditioned, fieldContained, fireOperatorExecutionProgressEvent, getALDPortHashAccessKey, getConstructionMode, 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
private static final String operatorID
@Parameter(label="Image file folder", required=true, dataIOOrder=-10, direction=IN, description="Input image directory.", mode=STANDARD) protected de.unihalle.informatik.Alida.datatypes.ALDDirectoryString imageDir
All files in the directory are considered. If a file cannot be opened (e.g. because it is not an image) it is skipped.
@Parameter(label="Boundary file format", required=true, dataIOOrder=-8, direction=IN, description="Format of cell boundary files.", mode=STANDARD) protected CytoskeletonFeatureExtractor.CellMaskFormat maskFormat
@Parameter(label="Cytoskeleton channel", required=true, direction=IN, dataIOOrder=-7, description="Channel with stained cytoskeleton, e.g., 1, 2 and so on.") private int cytoSkelChannel
@Parameter(label="Calculate features?", required=true, dataIOOrder=0, direction=IN, description="Flag to enable/disable feature calculation.", mode=STANDARD, callback="calcFeatureFlagChanged", paramModificationMode=MODIFIES_INTERFACE) protected boolean doFeatureCalculation
If false, features are assumed to be available already.
@Parameter(label="Feature Extractor", required=true, dataIOOrder=1, direction=IN, description="Select type of features to apply.", mode=STANDARD) protected CytoskeletonFeatureExtractor featureExtractor
@Parameter(label="Tile size x", required=true, dataIOOrder=3, direction=IN, mode=STANDARD, description="Tile size in x-direction.") protected int tileSizeX
@Parameter(label="Tile size y", required=true, dataIOOrder=4, direction=IN, mode=STANDARD, description="Tile size in y-direction.") protected int tileSizeY
@Parameter(label="Tile shift x", required=true, dataIOOrder=5, direction=IN, mode=STANDARD, description="Tile shift in x-direction.") protected int tileShiftX
@Parameter(label="Tile shift y", required=true, dataIOOrder=6, direction=IN, mode=STANDARD, description="Tile shift in y-direction.") protected int tileShiftY
@Parameter(label="Number of feature clusters", required=true, dataIOOrder=10, direction=IN, mode=STANDARD, description="Number of feature clusters.") protected int clusterNum
@Parameter(label="Do PCA in stage II?", required=true, dataIOOrder=11, direction=IN, mode=STANDARD, description="Enable/disable PCA prior to hierarchical clustering.") protected boolean doPCA
@Parameter(label="Cell boundary file folder", required=false, dataIOOrder=1, direction=IN, description="Cell mask directory.", mode=STANDARD) protected de.unihalle.informatik.Alida.datatypes.ALDDirectoryString maskDir
@Parameter(label="Resulting chart plots for each group", dataIOOrder=1, direction=OUT, description="Resulting chart plots.", mode=STANDARD) protected Vector<org.jfree.chart.JFreeChart> stackedBarCharts
@Parameter(label="Resulting box-whisker plot", dataIOOrder=1, direction=OUT, description="Resulting box-whisker plot.", mode=STANDARD) protected Vector<org.jfree.chart.JFreeChart> boxWhiskerCharts
private transient int imageWidth
private transient int imageHeight
private static String fileSep
private transient TreeSet<String> cellGroupNames
clusterFeatures()
.private transient HashMap<String,double[]> cellwiseDistros
clusterFeatures()
.private LinkedList<String> cellwiseDistroKeys
cellwiseDistros
once it is filled.private transient Vector<HashMap<String,HashMap<String,Double>>> cellGroups
private transient double[][] distroData
private transient String[] distroDataGroups
distroData
.private transient double[][] subspaceData
public CytoskeletonAnalyzer2D() throws de.unihalle.informatik.Alida.exceptions.ALDOperatorException
de.unihalle.informatik.Alida.exceptions.ALDOperatorException
- Thrown in case of failure.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 clusterFeatures() throws de.unihalle.informatik.Alida.exceptions.ALDOperatorException, de.unihalle.informatik.Alida.exceptions.ALDProcessingDAGException
The method first reads the features from the given or formerly generated
files, respectively, filters the feature vectors to exclude background
tiles, and finally applies kMeans clustering. The feature files are
expected to be located in the given feature directory.
The results are again saved to various files in the output directory:
de.unihalle.informatik.Alida.exceptions.ALDOperatorException
- Thrown in case of failure.de.unihalle.informatik.Alida.exceptions.ALDProcessingDAGException
- Thrown in case of failure.private void doPCA()
The subspace dimension is chosen so that at least 95% of the data
variance is represented within the resulting feature subspace.
The result is saved to the file AllCellsPCASubspaceStats.txt
.
private void calculateDistanceMatrices()
Calculates pairwise Euclidean distances between all feature vectors and also between average vectors of all groups. In addition, for all groups a similarity network is constructed with each group forming a node and the edges representing the similarity between the groups. The bigger the weight of an edge the larger the similarity between two groups.
If PCA is enabled for stage II the distances are calculated from the subspace feature data as extracted by the PCA. If PCA is not enabled the cluster distribution data is used directly as base for the calculations.
The resulting distance matrices are saved to files with names
AllCellsDistanceData.txt
and AllGroupsDistanceData.txt
in the root directory. The similarity network data is stored in a file
named AllGroupsSimilarityNetworkData.txt
.
private void calcFeatureFlagChanged()
public String getDocumentation()
getDocumentation
in class de.unihalle.informatik.Alida.operator.ALDOperator
Copyright © 2010–2020 Martin Luther University Halle-Wittenberg, Institute of Computer Science, Pattern Recognition and Bioinformatics. All rights reserved.