Class TreeColorMapper

java.lang.Object
sc.fiji.snt.analysis.ColorMapper
sc.fiji.snt.analysis.TreeColorMapper
Direct Known Subclasses:
MultiTreeColorMapper, Viewer2D

public class TreeColorMapper extends ColorMapper
Class for color coding Trees.
Author:
Tiago Ferreira
  • Field Details

  • Constructor Details

    • TreeColorMapper

      public TreeColorMapper(org.scijava.Context context)
      Instantiates the mapper.
      Parameters:
      context - the SciJava application context providing the services required by the class
    • TreeColorMapper

      public TreeColorMapper()
      Instantiates the mapper. Note that because the instance is not aware of any context, script-friendly methods that use string as arguments may fail to retrieve referenced Scijava objects.
  • Method Details

    • getMetrics

      public static List<String> getMetrics()
      Gets the list of supported mapping metrics.
      Returns:
      the list of mapping metrics.
    • getColorTable

      public net.imglib2.display.ColorTable getColorTable(String lut)
    • mapToProperty

      protected void mapToProperty(String measurement, net.imglib2.display.ColorTable colorTable)
    • map

      public void map(Tree tree, Profile profile, net.imglib2.display.ColorTable colorTable)
      Colorizes a tree using Sholl data.
      Parameters:
      tree - the tree to be colorized
      profile - the mapping Sholl profile
      colorTable - the color table specifying the color mapping. Null not allowed.
    • map

      public void map(Tree tree, LinearProfileStats stats, net.imglib2.display.ColorTable colorTable)
      Colorizes a tree using Sholl data.
      Parameters:
      tree - the tree to be colorized
      stats - the LinearProfileStats instance containing the mapping profile. if a polynomial fit has been successfully performed, mapping is done against the fitted data, otherwise sampled intersections are used.
      colorTable - the color table specifying the color mapping. Null not allowed.
    • map

      public void map(Tree tree, String measurement, net.imglib2.display.ColorTable colorTable)
      Colorizes a tree after the specified measurement.
      Parameters:
      tree - the tree to be mapped
      measurement - the measurement (PATH_ORDER }PATH_LENGTH, etc.)
      colorTable - the color table specifying the color mapping. Null not allowed.
    • map

      public void map(Collection<? extends PointInImage> points, String measurement, String lut)
      Colorizes a collection of points after the specified measurement. Mapping bounds are automatically determined. This is a convenience method to extend color mapping to point clouds.
      Parameters:
      points - the points to be mapped
      measurement - the measurement (Z_COORDINATES, etc.). Note that if points do not encode a valid Tree only metrics applicable to coordinates are expected.
      lut - the lookup table specifying the color mapping
    • getNormalizedMeasurement

      protected static String getNormalizedMeasurement(String measurement)
    • map

      public void map(Tree tree, String measurement, String lut)
      Colorizes a tree after the specified measurement. Mapping bounds are automatically determined.
      Parameters:
      tree - the tree to be mapped
      measurement - the measurement (PATH_ORDER }PATH_LENGTH, etc.)
      lut - the lookup table specifying the color mapping
    • mapTrees

      public void mapTrees(List<Tree> trees, String lut)
      Colorizes a list of trees, with each tree being assigned a LUT index.
      Parameters:
      trees - the list of trees to be colorized
      lut - the lookup table specifying the color mapping
    • getAvailableLuts

      public Set<String> getAvailableLuts()
      Gets the available LUTs.
      Returns:
      the set of keys, corresponding to the set of LUTs available
    • getMultiViewer

      public MultiViewer2D getMultiViewer()
      Assembles a Multi-pane viewer using all the Trees mapped so far.
      Returns:
      the multi-viewer instance
    • isNodeMapping

      public boolean isNodeMapping()
    • main

      public static void main(String... args)