Class AnnotationMapper
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:
-
Field Summary
Fields inherited from class sc.fiji.snt.analysis.ColorMapper
colorTable, integerScale, luts, lutService, max, min -
Constructor Summary
ConstructorsConstructorDescriptionAnnotationMapper(Collection<Annotation3D> annotations) Constructs an AnnotationMapper for the specified collection of 3D annotations. -
Method Summary
Modifier and TypeMethodDescriptionvoidMaps annotation properties to colors using the specified color table.voidsetTransparency(double transparencyPercent) Sets the transparency level for mapped annotations.Methods inherited from class sc.fiji.snt.analysis.ColorMapper
getColor, getColorRGB, getColorTable, getMinMax, getNaNColor, initLuts, isIntegerScale, setMinMax, setNaNColor, unMap, unMap
-
Constructor Details
-
AnnotationMapper
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
Maps annotation properties to colors using the specified color table. This method performs the color mapping in two phases:- Determines the value range across all annotations to establish proper scaling
- 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:
mapin classColorMapper- 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
-