Package sc.fiji.snt.annotation
Class AllenCompartment
java.lang.Object
sc.fiji.snt.annotation.AllenCompartment
- All Implemented Interfaces:
BrainAnnotation
Defines an Allen Reference Atlas (ARA) [Allen Mouse Common Coordinate
Framework] annotation. A Compartment is defined by either a UUID (as per
MouseLight's database) or its unique integer identifier. To improve
performance, a compartment's metadata (reference to its mesh, its aliases,
etc.) are not loaded at initialization, but retrieved only when such getters
are called.
- Author:
- Tiago Ferreira, Cameron Arshadi
-
Field Summary
Fields inherited from interface sc.fiji.snt.annotation.BrainAnnotation
ANY_HEMISPHERE, LEFT_HEMISPHERE, RIGHT_HEMISPHERE -
Constructor Summary
ConstructorsModifierConstructorDescriptionAllenCompartment(int id) Instantiates a new ARA annotation from its identifier.AllenCompartment(UUID uuid) Instantiates a new ARA annotation from a UUID (as used by MouseLight's database).protectedAllenCompartment(org.json.JSONObject jsonObj, UUID uuid) -
Method Summary
Modifier and TypeMethodDescriptionacronym()Returns the compartment's acronym.String[]aliases()Returns the compartment's alias(es).org.scijava.util.ColorRGBcolor()Returns the display color of this compartment (if known).protected intdepth()booleangetAncestor(int level) Gets the nth ancestor of this compartment.Gets the ancestor ontologies of this compartment as a flat (non-hierarchical) list.Gets the child ontologies of this compartment as a flat (non-hierarchical) list.getChildren(int level) Gets the child ontologies of this compartment as a flat (non-hierarchical) list.getMesh()Returns the mesh associated with this compartment.intGets the ontology depth of this compartment.Gets the parent of this compartment.protected intprotected StringGets the tree path of this compartment.getUUID()protected intinthashCode()intid()Returns the compartment's unique id.booleanincludes(BrainAnnotation other) booleanisChildOf(BrainAnnotation parentCompartment) Assesses if this annotation is a child of a specified compartment.booleanChecks whether a mesh is known to be available for this compartment.booleanisParentOf(BrainAnnotation childCompartment) Assesses if this annotation is the parent of the specified compartment.static voidname()Returns the compartment's name.toString()
-
Constructor Details
-
AllenCompartment
Instantiates a new ARA annotation from a UUID (as used by MouseLight's database).- Parameters:
uuid- the ML UUID identifying the annotation
-
AllenCompartment
public AllenCompartment(int id) Instantiates a new ARA annotation from its identifier.- Parameters:
id- the integer identifying the annotation
-
AllenCompartment
-
-
Method Details
-
depth
protected int depth() -
graphOrder
protected int graphOrder() -
getStructureIdPath
-
getParentStructureId
protected int getParentStructureId() -
isChildOf
Assesses if this annotation is a child of a specified compartment.- Specified by:
isChildOfin interfaceBrainAnnotation- Parameters:
parentCompartment- the compartment to be tested- Returns:
- true, if successful, i.e.,
parentCompartmentis not this compartment andgetTreePath()containsparentCompartment
-
isParentOf
Assesses if this annotation is the parent of the specified compartment.- Specified by:
isParentOfin interfaceBrainAnnotation- Parameters:
childCompartment- the compartment to be tested- Returns:
- true, if successful, i.e.,
childCompartmentis not this compartment and is present ingetChildren()
-
includes
-
getTreePath
Gets the tree path of this compartment. The TreePath is the list of parent compartments that uniquely identify this compartment in the ontologies hierarchical tree. The elements of the list are ordered with the root ('Whole Brain') as the first element of the list. In practice, this is equivalent to appending this compartment to the list returned bygetAncestors().- Returns:
- the tree path that uniquely identifies this compartment as a node in the CCF ontologies tree
-
getOntologyDepth
public int getOntologyDepth()Gets the ontology depth of this compartment.- Specified by:
getOntologyDepthin interfaceBrainAnnotation- Returns:
- the ontological depth of this compartment, i.e., its ontological
distance relative to the root (e.g., a compartment of hierarchical
level
9, has a depth of8).
-
getParent
Gets the parent of this compartment.- Specified by:
getParentin interfaceBrainAnnotation- Returns:
- the parent of this compartment, of null if this compartment is root.
-
getAncestors
Gets the ancestor ontologies of this compartment as a flat (non-hierarchical) list.- Returns:
- the "flattened" list of ancestors
- See Also:
-
getAncestor
Gets the nth ancestor of this compartment.- Specified by:
getAncestorin interfaceBrainAnnotation- Parameters:
level- the ancestor level as negative 1-based index. E.g.,-1retrieves the last ancestor (parent),-2retrieves the second to last, etc., all the way down to-getOntologyDepth(), which retrieves the root ontology ("Whole Brain")- Returns:
- the nth ancestor
-
getChildren
Gets the child ontologies of this compartment as a flat (non-hierarchical) list.- Returns:
- the "flattened" ontologies list
-
getChildren
Gets the child ontologies of this compartment as a flat (non-hierarchical) list.- Parameters:
level- maximum depth that should be considered.- Returns:
- the "flattened" ontologies list
-
id
public int id()Description copied from interface:BrainAnnotationReturns the compartment's unique id.- Specified by:
idin interfaceBrainAnnotation
-
name
Description copied from interface:BrainAnnotationReturns the compartment's name.- Specified by:
namein interfaceBrainAnnotation
-
acronym
Description copied from interface:BrainAnnotationReturns the compartment's acronym.- Specified by:
acronymin interfaceBrainAnnotation
-
aliases
Description copied from interface:BrainAnnotationReturns the compartment's alias(es).- Specified by:
aliasesin interfaceBrainAnnotation
-
isMeshAvailable
public boolean isMeshAvailable()Checks whether a mesh is known to be available for this compartment.- Specified by:
isMeshAvailablein interfaceBrainAnnotation- Returns:
- true, if a mesh is available.
-
getMesh
Description copied from interface:BrainAnnotationReturns the mesh associated with this compartment.- Specified by:
getMeshin interfaceBrainAnnotation
-
getUUID
-
toString
-
hashCode
public int hashCode() -
equals
-
main
-
color
public org.scijava.util.ColorRGB color()Description copied from interface:BrainAnnotationReturns the display color of this compartment (if known).- Specified by:
colorin interfaceBrainAnnotation
-