annotool.io
Class LabelReader

java.lang.Object
  extended by annotool.io.LabelReader

public class LabelReader
extends java.lang.Object

Read labels (targets) from a file.


Constructor Summary
LabelReader(int nsample, java.util.ArrayList<java.lang.String> annoLabels)
           
 
Method Summary
 java.util.ArrayList<java.lang.Integer> calNumOfClasses(int[][] targets)
           
 java.util.ArrayList<java.lang.String> getAnnotations()
           
 java.util.HashMap<java.lang.String,java.lang.String> getClassnames()
           
 int getNumOfAnnotations()
           
 int getNumOfClasses()
           
 int[][] getTargets(java.lang.String targetfilename, java.lang.String[] filenames)
           
static int infoNumOfClasses(int[] targets)
           
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

LabelReader

public LabelReader(int nsample,
                   java.util.ArrayList<java.lang.String> annoLabels)
Method Detail

getTargets

public int[][] getTargets(java.lang.String targetfilename,
                          java.lang.String[] filenames)
                   throws java.io.FileNotFoundException,
                          java.lang.NumberFormatException
Throws:
java.io.FileNotFoundException
java.lang.NumberFormatException

getAnnotations

public java.util.ArrayList<java.lang.String> getAnnotations()
                                                     throws java.lang.Exception
Throws:
java.lang.Exception

getClassnames

public java.util.HashMap<java.lang.String,java.lang.String> getClassnames()
                                                                   throws java.lang.Exception
Throws:
java.lang.Exception

getNumOfAnnotations

public int getNumOfAnnotations()

getNumOfClasses

public int getNumOfClasses()

calNumOfClasses

public java.util.ArrayList<java.lang.Integer> calNumOfClasses(int[][] targets)

infoNumOfClasses

public static int infoNumOfClasses(int[] targets)