rocca
Class RoccaClassifier

java.lang.Object
  extended by rocca.RoccaClassifier

public class RoccaClassifier
extends java.lang.Object

Rocca/Weka interface for classifying a contour

Author:
Michael Oswald

Field Summary
(package private)  boolean fieldsSet
           
(package private)  weka.classifiers.AbstractClassifier roccaClassifierModel
           
(package private)  RoccaControl roccaControl
           
(package private)  java.util.ArrayList<java.lang.String> spList
           
(package private)  weka.core.Instances trainedDataset
           
 
Constructor Summary
RoccaClassifier(RoccaProcess roccaProcess)
          Create RoccaClassifier object for RoccaProcess
 
Method Summary
 boolean areFieldsSet()
           
 void classifyContour(RoccaContourDataBlock rcdb)
          Classifies the passed contour
 weka.core.DenseInstance setAttributes(RoccaContourDataBlock rcdb)
          Sets up the available datablock fields to match the classifier model
 void setFieldsSet(boolean fieldsSet)
           
 boolean setUpClassifier()
          Loads the Classifier model from the file specified in RoccaParameters
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

roccaControl

RoccaControl roccaControl

roccaClassifierModel

weka.classifiers.AbstractClassifier roccaClassifierModel

trainedDataset

weka.core.Instances trainedDataset

fieldsSet

boolean fieldsSet

spList

java.util.ArrayList<java.lang.String> spList
Constructor Detail

RoccaClassifier

public RoccaClassifier(RoccaProcess roccaProcess)
Create RoccaClassifier object for RoccaProcess

Parameters:
roccaProcess -
Method Detail

classifyContour

public void classifyContour(RoccaContourDataBlock rcdb)
Classifies the passed contour

Checks to make sure a classifier has been loaded, then runs the setAttributes method to match the passed contour to the parameter list expected by the classifier. Once the attribute vector has been created, the classifier is run and the results are saved to the datablock's classifiedAs field.

Parameters:
rcdb - RoccaContourDataBlock to be classified

setUpClassifier

public boolean setUpClassifier()
Loads the Classifier model from the file specified in RoccaParameters

Returns:
boolean flag indicating success or failure of load

setAttributes

public weka.core.DenseInstance setAttributes(RoccaContourDataBlock rcdb)
Sets up the available datablock fields to match the classifier model

Compares the fields in the passed RoccaContourDataBlack to the fields required for the classifier. If any fields are missing, an error is displayed and the method returns false. If all the fields are available, an Instance is created matching the order of the datablock fields to the order of the classifier fields.

Parameters:
rcdb - RoccaContourDataBlock to be classified
Returns:
Instance containing the values of the rcdb parameters that match the classifier attributes

areFieldsSet

public boolean areFieldsSet()

setFieldsSet

public void setFieldsSet(boolean fieldsSet)