@ALDAOperator(genericExecutionMode=ALL) public class MTBRSMLProjectImporter extends MTBOperator
The importer assumes that all files belong to a single project or time-series.
| Modifier and Type | Field and Description |
|---|---|
private boolean |
allUnified
Flag indicating if identifiers in a time-series are unified.
|
private static byte |
default_statuslabel
Default status label for segments.
|
private static Double |
EPSILON
Maximal distance allowed for parent nodes to deviate from precise location.
|
private static String |
FUNCTION_NAME_DIAMETER |
private static String |
FUNCTION_NAME_STATUSLABEL |
private static String |
opIdentifier
Operator identifier.
|
private static String |
PROPERTY_NAME_PARENTNODE |
protected de.unihalle.informatik.Alida.datatypes.ALDDirectoryString |
rsmlDir
Directory of RSML files.
|
protected MTBRSMLProjectInfo |
rsmlProjectInfo
Resulting info object containing all information parsed from input files.
|
static int |
STATUS_CONNECTOR
Segments of a connector treeline.
|
static int |
STATUS_UNDEFINED
Undefined status.
|
static int |
STATUS_VIRTUAL
to represent (virtual) segments to connect
branches (polylines) of a root to form one (connected) treeline
used to represent genuine rizoTrak virtual segments |
static int |
STATUS_VIRTUAL_RSML
to represent (virtual) segments created on import from RSML to connect all
branches (polylines) of a root to form one (connected) treeline
*
used to represent virtual segments create for/from RSML |
| Constructor and Description |
|---|
MTBRSMLProjectImporter()
Default constructor.
|
| Modifier and Type | Method and Description |
|---|---|
private MTBRootTree |
createTreeForRoot(RootType root)
Create a root tree from the given root object.
|
private void |
fillTreeFromRoot(RootType root,
MTBRootTree tree,
HashMap<Integer,MTBTreeNode> parentTreelineNodes)
Recursively parses all polylines belonging to the given root.
|
private RootType.Functions.Function |
getFunctionByName(RootType root,
String name)
Get RSML function by name.
|
private int |
getParentNodeIndex(RootType root)
Parse the parent node or parent node attribute from the root.
|
private float |
getRadiusFromRsml(RootType.Functions.Function diameters,
int pointIndex)
Get the radius for index
pointIndex from the function diameters. |
MTBRSMLProjectInfo |
getRSMLProjectInfo()
Get resulting info object.
|
private BigDecimal |
getSampleValue(Element element)
Get the value of a sample element in a function.
|
private byte |
getStatuslabelFromRsml(RootType.Functions.Function statuslabels,
int pointIndex)
Get status label for index
pointIndex from the function statuslabels. |
private HashMap<Integer,String> |
getStatusLabelMappingFromScene(Rsml rsml)
Parse the status label mapping from given RSML file.
|
private boolean |
isStatuslabelFromRsmlDefined(RootType.Functions.Function statuslabels,
int pointIndex) |
protected void |
operate() |
private MTBRSMLFileInfo |
parseRsmlFile(Rsml rsml)
Parse the given RSML file.
|
void |
setInputDirectory(de.unihalle.informatik.Alida.datatypes.ALDDirectoryString dir)
Specify input directory.
|
readResolveaddOperatorExecutionProgressEventListener, addParameter, addParameter, addParameterUnconditioned, fieldContained, fireOperatorExecutionProgressEvent, getALDPortHashAccessKey, getConstructionMode, getDocumentation, 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, writeHistoryprivate static final String FUNCTION_NAME_DIAMETER
private static final String FUNCTION_NAME_STATUSLABEL
private static final String PROPERTY_NAME_PARENTNODE
public static final int STATUS_UNDEFINED
public static final int STATUS_CONNECTOR
public static final int STATUS_VIRTUAL
public static final int STATUS_VIRTUAL_RSML
private static byte default_statuslabel
private static final Double EPSILON
private static String opIdentifier
private boolean allUnified
@Parameter(label="RSML Directory",
required=true,
direction=IN,
dataIOOrder=0,
mode=STANDARD,
description="RSML input directory.")
protected de.unihalle.informatik.Alida.datatypes.ALDDirectoryString rsmlDir
@Parameter(label="Result RSML Info Object",
direction=OUT,
dataIOOrder=0,
description="RSML info object.")
protected MTBRSMLProjectInfo rsmlProjectInfo
public MTBRSMLProjectImporter()
throws de.unihalle.informatik.Alida.exceptions.ALDOperatorException
de.unihalle.informatik.Alida.exceptions.ALDOperatorException - Thrown in case of failure.public void setInputDirectory(de.unihalle.informatik.Alida.datatypes.ALDDirectoryString dir)
dir - Input directory where to find the RSML files.public MTBRSMLProjectInfo getRSMLProjectInfo()
protected void operate()
throws de.unihalle.informatik.Alida.exceptions.ALDOperatorException
operate in class de.unihalle.informatik.Alida.operator.ALDOperatorde.unihalle.informatik.Alida.exceptions.ALDOperatorExceptionprivate HashMap<Integer,String> getStatusLabelMappingFromScene(Rsml rsml)
rsml - RSML file.private MTBRSMLFileInfo parseRsmlFile(Rsml rsml)
rsml - RSML data structure read from file.private MTBRootTree createTreeForRoot(RootType root)
root - Root object to convert to MTBRootTree.private void fillTreeFromRoot(RootType root, MTBRootTree tree, HashMap<Integer,MTBTreeNode> parentTreelineNodes)
root - Root object to be parsed.tree - Target root tree.parentTreelineNodes - Map of root tree nodes indexed by IDs from RSML.private int getParentNodeIndex(RootType root)
root - Root to analyze.-1 if not found.private byte getStatuslabelFromRsml(RootType.Functions.Function statuslabels, int pointIndex)
pointIndex from the function statuslabels.statuslabels - RSML function.pointIndex - Index of point for which to get the status label.default_statuslabel if function is null or index out of range.private boolean isStatuslabelFromRsmlDefined(RootType.Functions.Function statuslabels, int pointIndex)
private RootType.Functions.Function getFunctionByName(RootType root, String name)
root - Root object.name - Function name.name, null if none exists.private float getRadiusFromRsml(RootType.Functions.Function diameters, int pointIndex)
pointIndex from the function diameters.diameters - Function.pointIndex - Index of point for which to get the diameter.diameters is null or index out of range.private BigDecimal getSampleValue(Element element)
element - Element to process.Copyright © 2010–2025 Martin Luther University Halle-Wittenberg, Institute of Computer Science, Pattern Recognition and Bioinformatics. All rights reserved.