Class AllenCompartment

java.lang.Object
sc.fiji.snt.annotation.AllenCompartment
All Implemented Interfaces:
BrainAnnotation

public class AllenCompartment extends Object implements 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
  • Constructor Details

    • AllenCompartment

      public AllenCompartment(UUID uuid)
      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

      protected AllenCompartment(org.json.JSONObject jsonObj, UUID uuid)
  • Method Details

    • depth

      protected int depth()
    • graphOrder

      protected int graphOrder()
    • getStructureIdPath

      protected String getStructureIdPath()
    • getParentStructureId

      protected int getParentStructureId()
    • isChildOf

      public boolean isChildOf(BrainAnnotation parentCompartment)
      Assesses if this annotation is a child of a specified compartment.
      Specified by:
      isChildOf in interface BrainAnnotation
      Parameters:
      parentCompartment - the compartment to be tested
      Returns:
      true, if successful, i.e., parentCompartment is not this compartment and getTreePath() contains parentCompartment
    • isParentOf

      public boolean isParentOf(BrainAnnotation childCompartment)
      Assesses if this annotation is the parent of the specified compartment.
      Specified by:
      isParentOf in interface BrainAnnotation
      Parameters:
      childCompartment - the compartment to be tested
      Returns:
      true, if successful, i.e., childCompartment is not this compartment and is present in getChildren()
    • includes

      public boolean includes(BrainAnnotation other)
    • getTreePath

      public List<AllenCompartment> 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 by getAncestors().
      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:
      getOntologyDepth in interface BrainAnnotation
      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 of 8).
    • getParent

      public AllenCompartment getParent()
      Gets the parent of this compartment.
      Specified by:
      getParent in interface BrainAnnotation
      Returns:
      the parent of this compartment, of null if this compartment is root.
    • getAncestors

      public List<AllenCompartment> getAncestors()
      Gets the ancestor ontologies of this compartment as a flat (non-hierarchical) list.
      Returns:
      the "flattened" list of ancestors
      See Also:
    • getAncestor

      public AllenCompartment getAncestor(int level)
      Gets the nth ancestor of this compartment.
      Specified by:
      getAncestor in interface BrainAnnotation
      Parameters:
      level - the ancestor level as negative 1-based index. E.g., -1 retrieves the last ancestor (parent), -2 retrieves the second to last, etc., all the way down to -getOntologyDepth(), which retrieves the root ontology ("Whole Brain")
      Returns:
      the nth ancestor
    • getChildren

      public List<AllenCompartment> getChildren()
      Gets the child ontologies of this compartment as a flat (non-hierarchical) list.
      Returns:
      the "flattened" ontologies list
    • getChildren

      public List<AllenCompartment> getChildren(int level)
      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: BrainAnnotation
      Returns the compartment's unique id.
      Specified by:
      id in interface BrainAnnotation
    • name

      public String name()
      Description copied from interface: BrainAnnotation
      Returns the compartment's name.
      Specified by:
      name in interface BrainAnnotation
    • acronym

      public String acronym()
      Description copied from interface: BrainAnnotation
      Returns the compartment's acronym.
      Specified by:
      acronym in interface BrainAnnotation
    • aliases

      public String[] aliases()
      Description copied from interface: BrainAnnotation
      Returns the compartment's alias(es).
      Specified by:
      aliases in interface BrainAnnotation
    • isMeshAvailable

      public boolean isMeshAvailable()
      Checks whether a mesh is known to be available for this compartment.
      Specified by:
      isMeshAvailable in interface BrainAnnotation
      Returns:
      true, if a mesh is available.
    • getMesh

      public OBJMesh getMesh()
      Description copied from interface: BrainAnnotation
      Returns the mesh associated with this compartment.
      Specified by:
      getMesh in interface BrainAnnotation
    • getUUID

      public UUID getUUID()
    • toString

      public String toString()
      Overrides:
      toString in class Object
    • hashCode

      public int hashCode()
      Overrides:
      hashCode in class Object
    • equals

      public boolean equals(Object obj)
      Overrides:
      equals in class Object
    • main

      public static void main(String[] args)
    • color

      public org.scijava.util.ColorRGB color()
      Description copied from interface: BrainAnnotation
      Returns the display color of this compartment (if known).
      Specified by:
      color in interface BrainAnnotation