Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add Support for VTAU LookupTable #1

Merged
merged 4 commits into from
Feb 13, 2025
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
{
"min": 0,
"max": 10000,
"R": [
255, 0, 89, 89, 2, 2, 34, 34, 38, 38, 140, 140, 249, 249, 255, 255, 255, 255
],
"G": [
255, 0, 53, 53, 107, 107, 244, 244, 198, 198, 255, 255, 228, 228, 158, 158,
30, 30
],
"B": [
255, 0, 144, 144, 166, 166, 241, 241, 151, 151, 147, 147, 102, 102, 67, 67,
59, 59
],
"A": [0, 64, 64, 64, 64, 64, 64, 64, 64, 64, 64, 64, 64, 64, 64, 64, 64, 64],
"I": [
0, 68, 69, 84, 85, 105, 106, 130, 131, 156, 157, 181, 182, 205, 206, 230,
231, 255
]
}
2 changes: 2 additions & 0 deletions src/WebUI/ClientApp/src/pages/project/NiivueWrapper.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
import LookUpTable from '@/pages/project/colorMaps/LookUpTable.json';
import OpenMapTable from '@/pages/project/colorMaps/LookUpTableOpenMap.json';
import VTAUTable from '@/pages/project/colorMaps/LookUpTableVTAU.json';
import { COLOR_MAP_NIIVUE } from '@/pages/project/models/ColorMap';
import { type ProjectState } from '@/pages/project/models/ProjectState';
import {
Expand Down Expand Up @@ -77,6 +78,7 @@ export class NiivueWrapper {
public setCanvas(canvasRef: HTMLCanvasElement): void {
this.niivue.addColormap(COLOR_MAP_NIIVUE.LOOKUP_TABLE, LookUpTable);
this.niivue.addColormap(COLOR_MAP_NIIVUE.OPEN_MAP, OpenMapTable);
this.niivue.addColormap(COLOR_MAP_NIIVUE.VTAU, VTAUTable);
void this.niivue.attachToCanvas(canvasRef);
}

Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
{
"min": 0,
"max": 10000,
"R": [
255, 0, 89, 89, 2, 2, 34, 34, 38, 38, 140, 140, 249, 249, 255, 255, 255, 255
],
"G": [
255, 0, 53, 53, 107, 107, 244, 244, 198, 198, 255, 255, 228, 228, 158, 158,
30, 30
],
"B": [
255, 0, 144, 144, 166, 166, 241, 241, 151, 151, 147, 147, 102, 102, 67, 67,
59, 59
],
"A": [0, 64, 64, 64, 64, 64, 64, 64, 64, 64, 64, 64, 64, 64, 64, 64, 64, 64],
"I": [
0, 68, 69, 84, 85, 105, 106, 130, 131, 156, 157, 181, 182, 205, 206, 230,
231, 255
]
}
Original file line number Diff line number Diff line change
Expand Up @@ -66,6 +66,7 @@ export const FileSettings = observer(
COLOR_MAP_TRANSLATION.HEAT,
COLOR_MAP_TRANSLATION.LOOKUP_TABLE,
COLOR_MAP_TRANSLATION.OPEN_MAP,
COLOR_MAP_TRANSLATION.VTAU,
]}
/>
<Slider
Expand Down
13 changes: 13 additions & 0 deletions src/WebUI/ClientApp/src/pages/project/models/ColorMap.ts
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@ export enum COLOR_MAP_BACKEND {
HEAT = 'Heat',
LOOKUP_TABLE = 'LookupTable',
OPEN_MAP = 'OpenMap',
VTAU = 'Vtau',
}

/**
Expand All @@ -17,6 +18,7 @@ export enum COLOR_MAP_NIIVUE {
HEAT = 'Hot',
LOOKUP_TABLE = 'LookupTable',
OPEN_MAP = 'OpenMap',
VTAU = 'Vtau',
}

/**
Expand All @@ -27,6 +29,7 @@ export enum COLOR_MAP_TRANSLATION {
HEAT = 'Heat',
LOOKUP_TABLE = 'LookupTable',
OPEN_MAP = 'OpenMap',
VTAU = 'Vtau',
}

export class ColorMap {
Expand Down Expand Up @@ -62,6 +65,12 @@ export class ColorMap {
COLOR_MAP_NIIVUE.OPEN_MAP,
COLOR_MAP_TRANSLATION.OPEN_MAP
);
case COLOR_MAP_BACKEND.VTAU:
return new ColorMap(
colorMap,
COLOR_MAP_NIIVUE.VTAU,
COLOR_MAP_TRANSLATION.VTAU
);
}
}

Expand All @@ -76,6 +85,8 @@ export class ColorMap {
return ColorMap.from(COLOR_MAP_BACKEND.HEAT);
case COLOR_MAP_TRANSLATION.OPEN_MAP:
return ColorMap.from(COLOR_MAP_BACKEND.OPEN_MAP);
case COLOR_MAP_BACKEND.VTAU:
return ColorMap.from(COLOR_MAP_BACKEND.VTAU);
default:
throw new Error(`there is no color map for ${colorMapTranslation}`);
}
Expand All @@ -93,6 +104,8 @@ export class ColorMap {
return ColorMap.from(COLOR_MAP_BACKEND.HEAT);
case COLOR_MAP_BACKEND.OPEN_MAP:
return ColorMap.from(COLOR_MAP_BACKEND.OPEN_MAP);
case COLOR_MAP_BACKEND.VTAU:
return ColorMap.from(COLOR_MAP_BACKEND.VTAU);
default:
throw new Error(`there is no color map for ${colorMapBackend}`);
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -69,6 +69,7 @@ export class CloudVolumeFile
dto.colorMap !== COLOR_MAP_BACKEND.HEAT &&
dto.colorMap !== COLOR_MAP_BACKEND.LOOKUP_TABLE &&
dto.colorMap !== COLOR_MAP_BACKEND.OPEN_MAP &&
dto.colorMap !== COLOR_MAP_BACKEND.VTAU &&
dto.colorMap !== null
)
throw new Error(
Expand Down