-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
8 changed files
with
93 additions
and
44 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -2,4 +2,4 @@ | |
|
||
|
||
class DatasetsConfig(AppConfig): | ||
name = 'cloud_ilastik.datasets' | ||
name = "cloud_ilastik.datasets" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,22 @@ | ||
import enum | ||
|
||
|
||
@enum.unique | ||
class ChannelType(enum.Enum): | ||
Intensity = "intensity" | ||
IndexedColor = "indexed" | ||
|
||
@classmethod | ||
def choices(cls): | ||
return tuple((item.name, item.value) for item in cls) | ||
|
||
@classmethod | ||
def values(cls): | ||
return tuple(item.value for item in cls) | ||
|
||
|
||
@enum.unique | ||
class ColorTable(enum.Enum): | ||
ILASTIK = "ilastik" | ||
RGB = "rgb" | ||
GRAYSCALE = "grayscale" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Empty file.
14 changes: 14 additions & 0 deletions
14
tests/test_cloud_ilastik/test_datasets/test_neuroglancer.py
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,14 @@ | ||
from cloud_ilastik.datasets import neuroglancer as ng, types | ||
|
||
|
||
def test_indexed_color_shader(): | ||
colors = ng._Color.get_colors(None, types.ColorTable.RGB) | ||
shader = ng._create_indexed_color_fragment_shader(colors) | ||
expected_shader = f"""vec4 COLOR_MASKS[4] = vec4[]( | ||
vec4(0.0, 0.0, 0.0, 0.0),vec4(1.0, 0.0, 0.0, 1.0),vec4(0.0, 1.0, 0.0, 1.0),vec4(0.0, 0.0, 1.0, 1.0) | ||
); | ||
void main() {{ | ||
uint val = toRaw(getDataValue()); | ||
emitRGB(COLOR_MASKS[val]); | ||
}}""" | ||
assert shader == expected_shader |