@ALDAOperator(genericExecutionMode=ALL, level=APPLICATION, allowBatchMode=false, shortDescription="Performs an unsupervised analysis of actin microfilament structures in sets of microscopy images.") public class ActinAnalyzer2D 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 Vector<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 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 double[][] |
distroData
Cluster distribution data, rows refer to clusters and columns to
cells.
|
protected boolean |
doFeatureCalculation
Flag for calculating features.
|
protected boolean |
doPCA
Perform PCA in second stage?
|
protected de.unihalle.informatik.Alida.datatypes.ALDDirectoryString |
featureDir
Feature directory.
|
protected CytoskeletonFeatureExtractor |
featureExtractor
Feature extractor to apply.
|
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
Directory with (cell) masks.
|
protected CytoskeletonFeatureExtractor.CellMaskFormat |
maskFormat
Format of provided cell masks.
|
protected de.unihalle.informatik.Alida.datatypes.ALDDirectoryString |
outDir
Output and working directory.
|
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 |
---|
ActinAnalyzer2D()
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 |
calculatePairwiseDistances()
Calculates pairwise Euclidean distances between all feature vectors.
|
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() |
private MTBImage |
readMaskImage(String basename,
double xmin,
double ymin,
double xmax,
double ymax)
Read mask data from disk if available.
|
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
@Parameter(label="Image directory", 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="Mask directory", required=true, dataIOOrder=-9, direction=IN, description="Cell mask directory.", mode=STANDARD) protected de.unihalle.informatik.Alida.datatypes.ALDDirectoryString maskDir
@Parameter(label="Mask format", required=true, dataIOOrder=-8, direction=IN, description="Format of cell masks.", mode=STANDARD) protected CytoskeletonFeatureExtractor.CellMaskFormat maskFormat
@Parameter(label="Output and working directory", required=true, dataIOOrder=-7, direction=IN, description="Output and working directory.", mode=STANDARD) protected de.unihalle.informatik.Alida.datatypes.ALDDirectoryString outDir
@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 set to false, the name of a directory containing the features must be provided.
@Parameter(label="Feature Extractor", required=true, dataIOOrder=1, direction=IN, description="Select type of features to apply.", mode=STANDARD) protected CytoskeletonFeatureExtractor featureExtractor
@Parameter(label="Feature Input Directory", required=true, dataIOOrder=2, direction=IN, mode=STANDARD, description="Feature directory, may be the same as output directory.") protected de.unihalle.informatik.Alida.datatypes.ALDDirectoryString featureDir
@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=ADVANCED, description="Tile shift in x-direction.") protected int tileShiftX
@Parameter(label="Tile shift y", required=true, dataIOOrder=6, direction=IN, mode=ADVANCED, description="Tile shift in y-direction.") protected int tileShiftY
@Parameter(label="Number of feature clusters", required=true, dataIOOrder=10, direction=IN, mode=ADVANCED, description="Number of feature clusters.") protected int clusterNum
@Parameter(label="Do PCA in stage II?", required=true, dataIOOrder=11, direction=IN, mode=ADVANCED, description="Enable/disable PCA prior to hierarchical clustering.") protected boolean doPCA
@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 transient Vector<String> cellGroupNames
clusterFeatures()
.private transient HashMap<String,double[]> cellwiseDistros
clusterFeatures()
.private transient Vector<HashMap<String,HashMap<String,Double>>> cellGroups
private transient double[][] distroData
private transient double[][] subspaceData
public ActinAnalyzer2D() 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 "AllImagesSubspaceFeatures.txt".
private void calculatePairwiseDistances()
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 matrix is saved to a file with name
AllImagesSubspaceFeatures.txt
in the given output directory.
private MTBImage readMaskImage(String basename, double xmin, double ymin, double xmax, double ymax) throws de.unihalle.informatik.Alida.exceptions.ALDOperatorException
The method reads segmentation data from file. It considers the specified mask format, i.e., if a label image is to be read or ImageJ 1.x ROIs. In the latter case it automatically differentiates between files ending with '.zip', i.e., containing more than one region, and files ending with '.roi' which contain exactly a single region.
basename
- Basename of the corresponding image file.xmin
- Minimum x-value of input image domain.ymin
- Minimum y-value of input image domain.xmax
- Maximum x-value of input image domain, i.e. image width - 1.ymax
- Maximum y-value of input image domain, i.e. image height - 1.de.unihalle.informatik.Alida.exceptions.ALDOperatorException
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.