Skip to content

Commit 0c8946c

Browse files
committed
fix(segment groups): fix typing
1 parent b255b0c commit 0c8946c

File tree

3 files changed

+8
-1
lines changed

3 files changed

+8
-1
lines changed

src/components/vtk/VtkLayerSliceRepresentation.vue

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -73,7 +73,9 @@ const applyLayerColoring = () => {
7373
if (!config) return;
7474
7575
const cfun = sliceRep.property.getRGBTransferFunction(0);
76-
const ofun = sliceRep.property.getScalarOpacity(0);
76+
const ofun = sliceRep.property.getPiecewiseFunction(0);
77+
78+
if (!cfun || !ofun) throw new Error('Missing transfer functions');
7779
7880
applyColoring({
7981
props: {

src/components/vtk/VtkSegmentationSliceRepresentation.vue

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -105,6 +105,8 @@ const applySegmentColoring = () => {
105105
const cfun = sliceRep.property.getRGBTransferFunction(0);
106106
const ofun = sliceRep.property.getPiecewiseFunction(0);
107107
108+
if (!cfun || !ofun) throw new Error('Missing transfer functions');
109+
108110
cfun.removeAllPoints();
109111
ofun.removeAllPoints();
110112
@@ -142,10 +144,12 @@ const config = computed(() =>
142144
);
143145
144146
const outlineThickness = computed(() => config.value?.outlineThickness ?? 2);
147+
// @ts-expect-error vtk.js types are incomplete
145148
sliceRep.property.setUseLabelOutline(true);
146149
sliceRep.property.setUseLookupTableScalarRange(true);
147150
148151
watchEffect(() => {
152+
// @ts-expect-error vtk.js types are incomplete
149153
sliceRep.property.setLabelOutlineOpacity(config.value?.outlineOpacity ?? 1);
150154
});
151155

src/io/state-file/schema.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -218,6 +218,7 @@ const LayersConfig = z.object({
218218

219219
const SegmentGroupConfig = z.object({
220220
outlineOpacity: z.number(),
221+
outlineThickness: z.number(),
221222
}) satisfies z.ZodType<SegmentGroupConfig>;
222223

223224
const ViewConfig = z.object({

0 commit comments

Comments
 (0)