de.unihalle.informatik.MiToBo.apps.scratchAssay
Class ScratchAssayAnalyzer

java.lang.Object
  extended by de.unihalle.informatik.Alida.operator.ALDOperator
      extended by de.unihalle.informatik.MiToBo.core.operator.MTBOperator
          extended by de.unihalle.informatik.MiToBo.apps.scratchAssay.ScratchAssayAnalyzer
All Implemented Interfaces:
de.unihalle.informatik.Alida.datatypes.ALDConfigurationValidator

@ALDAOperator(genericExecutionMode=ALL,
              level=APPLICATION,
              allowBatchMode=false)
public class ScratchAssayAnalyzer
extends MTBOperator

class for analyzing the scratch area in several scratch assay images

Author:
glass

Nested Class Summary
static class ScratchAssayAnalyzer.ScratchOrientation
           
 
Nested classes/interfaces inherited from class de.unihalle.informatik.Alida.operator.ALDOperator
de.unihalle.informatik.Alida.operator.ALDOperator.HidingMode
 
Field Summary
private  java.lang.Double deltaX
           
private  java.lang.Double deltaY
           
private  java.lang.Boolean doBatch
           
private  java.lang.Integer entropyFilterSize
           
private  de.unihalle.informatik.Alida.datatypes.ALDFileString fileName
           
private  java.lang.Boolean isHorizontal
           
private  java.lang.Integer maxIter
           
private  java.lang.Boolean noCheck
           
private  ScratchAssayAnalyzer.ScratchOrientation orientation
           
private  MTBTableModel resultsTable
           
private  java.lang.Integer sigma
           
private  java.lang.Boolean silent
           
private  de.unihalle.informatik.Alida.datatypes.ALDFileString svmFile
           
private  java.lang.String unitXY
           
private  java.lang.Boolean useExternalSVM
           
 
Fields inherited from class de.unihalle.informatik.Alida.operator.ALDOperator
completeDAG, name, portHashAccess, verbose, versionProvider
 
Constructor Summary
ScratchAssayAnalyzer()
           
ScratchAssayAnalyzer(java.lang.String fileName, int sigma, int entropyFilterSize, boolean isHorizontal, boolean noCheck, boolean doBatch, int maxIter)
           
 
Method Summary
 void isSilent(boolean silent)
          should results be saved without user interaction
private  MTBTableModel makeTable(java.util.Vector<java.lang.String> scratchFiles, java.util.Vector<java.lang.Double> scratchAreas, java.util.Vector<java.lang.Double> totalAreas, double refArea, java.util.Vector<java.lang.Integer> numIterations, java.util.Vector<java.lang.Long> runtimes)
          create results table
 void operate()
           
private  MTBImage readImage(java.lang.String path)
           
 void setSVMFile(java.lang.String path)
          sets the path to a svm model file used for classification
private  void writeImage(MTBImage img, java.lang.String path)
          writes the given image to a file with the specified path
 
Methods inherited from class de.unihalle.informatik.MiToBo.core.operator.MTBOperator
readResolve
 
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, 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

deltaX

@Parameter(label="pixel length, x-direction",
           required=false,
           direction=IN,
           supplemental=false,
           description="pixel length in x-direction",
           dataIOOrder=5)
private java.lang.Double deltaX

deltaY

@Parameter(label="pixel length, y-direction",
           required=false,
           direction=IN,
           supplemental=false,
           description="pixel length in y-direction",
           dataIOOrder=6)
private java.lang.Double deltaY

doBatch

@Parameter(label="batch mode",
           required=false,
           direction=IN,
           supplemental=false,
           description="should all image files in the given directory be analyzed",
           mode=STANDARD,
           dataIOOrder=2)
private java.lang.Boolean doBatch

entropyFilterSize

@Parameter(label="entropy filter size",
           required=true,
           direction=IN,
           supplemental=false,
           description="size of entropy filter mask",
           mode=STANDARD,
           dataIOOrder=3)
private java.lang.Integer entropyFilterSize

fileName

@Parameter(label="first image file",
           required=true,
           direction=IN,
           supplemental=false,
           description="name of the first scratch assay image",
           mode=STANDARD,
           dataIOOrder=0)
private de.unihalle.informatik.Alida.datatypes.ALDFileString fileName

isHorizontal

private java.lang.Boolean isHorizontal

maxIter

@Parameter(label="maximum iterations",
           required=false,
           direction=IN,
           supplemental=false,
           description="maximum number of iterations for level set segmentation",
           mode=ADVANCED,
           dataIOOrder=0)
private java.lang.Integer maxIter

noCheck

@Parameter(label="don\'t check for scratch presence",
           required=false,
           direction=IN,
           supplemental=false,
           description="don\'t check for scratch presence prior to segmentation",
           mode=STANDARD,
           dataIOOrder=1)
private java.lang.Boolean noCheck

orientation

@Parameter(label="scratch orientation",
           required=true,
           direction=IN,
           supplemental=false,
           description="is scratch horizontally or vertically oriented",
           mode=STANDARD,
           dataIOOrder=1)
private ScratchAssayAnalyzer.ScratchOrientation orientation

resultsTable

@Parameter(label="results table",
           required=true,
           direction=OUT,
           supplemental=false,
           description="table containing the resulting values")
private MTBTableModel resultsTable

sigma

@Parameter(label="\u03c3",
           required=true,
           direction=IN,
           supplemental=false,
           description="standard deviation of gauss filter",
           mode=STANDARD,
           dataIOOrder=2)
private java.lang.Integer sigma

silent

@Parameter(label="silent",
           required=false,
           direction=IN,
           supplemental=false,
           description="should results be stored automatically",
           mode=STANDARD)
private java.lang.Boolean silent

svmFile

@Parameter(label="external svm file",
           required=false,
           direction=IN,
           supplemental=false,
           description="absolute path to external svm model file",
           mode=ADVANCED,
           dataIOOrder=4)
private de.unihalle.informatik.Alida.datatypes.ALDFileString svmFile

unitXY

@Parameter(label="unit x/y",
           required=false,
           direction=IN,
           supplemental=false,
           description="unit x/y",
           dataIOOrder=7)
private java.lang.String unitXY

useExternalSVM

@Parameter(label="use external svm file",
           required=false,
           direction=IN,
           supplemental=false,
           description="should an external svm file be used for classification",
           mode=ADVANCED,
           dataIOOrder=3)
private java.lang.Boolean useExternalSVM
Constructor Detail

ScratchAssayAnalyzer

public ScratchAssayAnalyzer()
                     throws de.unihalle.informatik.Alida.exceptions.ALDOperatorException
Throws:
de.unihalle.informatik.Alida.exceptions.ALDOperatorException

ScratchAssayAnalyzer

public ScratchAssayAnalyzer(java.lang.String fileName,
                            int sigma,
                            int entropyFilterSize,
                            boolean isHorizontal,
                            boolean noCheck,
                            boolean doBatch,
                            int maxIter)
                     throws de.unihalle.informatik.Alida.exceptions.ALDOperatorException
Parameters:
fileName - name of the first scratch assay image
sigma - standard deviation of gauss filter
entropyFilterSize - size of entropy filter mask
isHorizontal - is scratch horizontally oriented (assumed to be vertically oriented else)
noCheck - should scratch present not be checked
doBatch - should all image files in the given directory be analyzed
maxIter - maximum number of iterations for level set segmentation
Throws:
de.unihalle.informatik.Alida.exceptions.ALDOperatorException
Method Detail

isSilent

public void isSilent(boolean silent)
should results be saved without user interaction

Parameters:
silent -

makeTable

private MTBTableModel makeTable(java.util.Vector<java.lang.String> scratchFiles,
                                java.util.Vector<java.lang.Double> scratchAreas,
                                java.util.Vector<java.lang.Double> totalAreas,
                                double refArea,
                                java.util.Vector<java.lang.Integer> numIterations,
                                java.util.Vector<java.lang.Long> runtimes)
create results table

Parameters:
scratchFiles -
scratchAreas -
totalAreas -
refArea -
Returns:
table containing the results

operate

public void operate()
             throws de.unihalle.informatik.Alida.exceptions.ALDOperatorException,
                    de.unihalle.informatik.Alida.exceptions.ALDProcessingDAGException
Specified by:
operate in class de.unihalle.informatik.Alida.operator.ALDOperator
Throws:
de.unihalle.informatik.Alida.exceptions.ALDOperatorException
de.unihalle.informatik.Alida.exceptions.ALDProcessingDAGException

readImage

private MTBImage readImage(java.lang.String path)
Parameters:
path -
Returns:
image read from given path (if it points to a valid image)

setSVMFile

public void setSVMFile(java.lang.String path)
sets the path to a svm model file used for classification

Parameters:
path -

writeImage

private void writeImage(MTBImage img,
                        java.lang.String path)
writes the given image to a file with the specified path

Parameters:
img - MTBImage to save
path - absolute path for storing