Skip to content

Commit

Permalink
Colormap: Make lutService accessible and correctly revert to built-in…
Browse files Browse the repository at this point in the history
… colormaps if given colormap is not found in LUTService
  • Loading branch information
skalarproduktraum committed Apr 16, 2024
1 parent 300f0ae commit f29210e
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/main/kotlin/graphics/scenery/volumes/Colormap.kt
Original file line number Diff line number Diff line change
Expand Up @@ -57,7 +57,7 @@ class Colormap(val buffer: ByteBuffer, val width: Int, val height: Int) {
val logger by lazyLogger()

@Parameter
protected var lutService: LUTService? = null
var lutService: LUTService? = null

/**
* Creates a new color map from a [ByteBuffer], with dimensions given as [width] and [height].
Expand Down Expand Up @@ -153,7 +153,7 @@ class Colormap(val buffer: ByteBuffer, val width: Int, val height: Int) {
try {
val luts = lutService?.findLUTs()
val colorTable = luts?.let {
val url = it[name]
val url = it[name] ?: throw IOException("Color map $name not found in ImageJ colormaps")
lutService?.loadLUT(url)
} ?: throw IOException("Color map $name not found in ImageJ colormaps")

Expand Down

0 comments on commit f29210e

Please sign in to comment.