|
|||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object viper.descriptors.Converter
Class for converting from old .gtf format to new XML format.
Field Summary | |
static double |
DROP_DESCRIPTOR
Used with the deform option, this is the probability of dropping a descriptor. |
static double |
GROW_SHAPE
Used with the deform option, this is the probability of increasing the size of a shape attribute. |
static double |
SHRINK_SHAPE
Used with the deform option, this is the probability of shrinking a shape attribute. |
static double |
SPLIT_BBOX
Used with the deform option, this is the probability of splitting any bounding box. |
static double |
SPLIT_DESCRIPTOR
Used with the deform option, this is the probability of splitting a descriptor over time. |
Constructor Summary | |
Converter(DescriptorData descriptors,
java.util.Properties props)
Create a new converter object for the given set of descriptor lists. |
Method Summary | |
void |
clip()
Sets each descriptor to its first frame. |
void |
cropFrames(int n)
Crops all frames >= n |
void |
deform()
Deforms the data. |
protected void |
deformList(DescriptorList data)
Deformer works by applying list-level, descriptor-level, and attribute-level deformations: the list level ones basically consist of dropping random descriptors. |
static DescriptorConfigs |
getConfigs(org.w3c.dom.Document root)
Gets the descriptor schema described in the give viper xml file. |
static RuleHolder |
getRuleHolder(DescriptorConfigs gtCfgs,
java.lang.String filterName)
Parses in the given rules file. |
static void |
main(java.lang.String[] args)
Converts some gtf files into another format. |
static void |
printUsage(java.io.PrintWriter output)
Prints the usage statement for the gtf file conversion application. |
static void |
saveAsXml(java.lang.String gtfName,
java.io.PrintWriter out)
Converts a GTF to an XML file. |
void |
setDimensions(int[] dims)
Modifies the dimension of all the input canonical file descriptors. |
void |
shift(int n)
Shifts each framespan by n. |
void |
split()
Splits descriptors into contiguous objects. |
void |
writeGtf(java.io.PrintWriter out)
Writes the current data in the ViPER GTF format |
void |
writeXml(java.io.PrintWriter out,
boolean header)
Writes the current data in the ViPER XML format. |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
public static final double DROP_DESCRIPTOR
public static final double SPLIT_DESCRIPTOR
public static final double SPLIT_BBOX
public static final double GROW_SHAPE
public static final double SHRINK_SHAPE
Constructor Detail |
public Converter(DescriptorData descriptors, java.util.Properties props)
descriptors
- The data to manipulate and write out.props
- the java properties to use while construction the
converterMethod Detail |
public static void printUsage(java.io.PrintWriter output)
output
- the stream to receive the usage statement.public static void saveAsXml(java.lang.String gtfName, java.io.PrintWriter out) throws java.io.IOException
gtfName
- the name of the file to be saved as XMLout
- the stream to which the method will write the XML output.
java.io.IOException
public static void main(java.lang.String[] args) throws java.io.IOException
args
- see the usage statement
java.io.IOException
- if there is an error while reading from
or writing to the input or output filespublic void writeXml(java.io.PrintWriter out, boolean header) throws java.io.IOException
out
- The output stream.header
- true
will include the xml header string.
java.io.IOException
public void writeGtf(java.io.PrintWriter out)
out
- The output stream.public void setDimensions(int[] dims)
dims
- the new width and height (in that order)public void split()
public void clip()
public void shift(int n)
n
- the number of frames to shift bypublic void cropFrames(int n)
n
- one after the last frame in the outputpublic static DescriptorConfigs getConfigs(org.w3c.dom.Document root) throws BadDataException
root
- the viper xml data
BadDataException
- if there is an error in the configs,
or no configs node.public static RuleHolder getRuleHolder(DescriptorConfigs gtCfgs, java.lang.String filterName) throws java.io.IOException
gtCfgs
- the associated descriptor schemafilterName
- the name of the filter file
java.io.IOException
- if there is an error while reading
from the given file, or if the file does not existpublic void deform()
protected void deformList(DescriptorList data)
data
- the data to deform
|
|||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |