Class AnnotationMapper

java.lang.Object
sc.fiji.snt.analysis.ColorMapper
sc.fiji.snt.analysis.AnnotationMapper

public class AnnotationMapper extends ColorMapper
A specialized ColorMapper for applying color-coded mappings to 3D annotations.

AnnotationMapper enables quantitative visualization of 3D annotations by mapping their properties to colors using lookup tables (LUTs). This is particularly useful for visualizing brain regions, anatomical compartments, or other 3D structures with color-coding based on their quantitative properties.

The mapper supports transparency control and automatically determines the value range across all annotations to ensure proper color scaling. Currently, only volume-based mapping is supported, but the architecture allows for future extension to other annotation properties.

Example usage:
 Collection<Annotation3D> annotations = getAnnotations();
 AnnotationMapper mapper = new AnnotationMapper(annotations);
 mapper.setTransparency(50.0); // 50% transparency
 mapper.map("volume", colorTable);
 
Author:
Tiago Ferreira
See Also:
  • Constructor Details

    • AnnotationMapper

      public AnnotationMapper(Collection<Annotation3D> annotations)
      Constructs an AnnotationMapper for the specified collection of 3D annotations.

      The mapper will apply color mappings to all annotations in the provided collection based on their quantitative properties.

      Parameters:
      annotations - the collection of Annotation3D objects to be color-mapped
      Throws:
      IllegalArgumentException - if annotations is null
  • Method Details

    • setTransparency

      public void setTransparency(double transparencyPercent)
      Sets the transparency level for mapped annotations.

      This transparency value will be applied to all annotations when colors are mapped, allowing for semi-transparent visualization that can reveal underlying structures or overlapping annotations.

      Parameters:
      transparencyPercent - the color transparency as a percentage (0-100), where 0 is fully opaque and 100 is fully transparent
    • map

      public void map(String measurement, net.imglib2.display.ColorTable colorTable)
      Maps annotation properties to colors using the specified color table. This method performs the color mapping in two phases:
      1. Determines the value range across all annotations to establish proper scaling
      2. Applies colors to each annotation based on its value and the color table

      Currently, only volume-based mapping is supported. The method automatically calculates the minimum and maximum values across all annotations to ensure proper color scaling across the full range of the color table.

      Overrides:
      map in class ColorMapper
      Parameters:
      measurement - the measurement type to map (currently only "volume" is supported)
      colorTable - the ColorTable defining the color mapping scheme
      Throws:
      IllegalArgumentException - if measurement or colorTable is null