Skip to content

Commit

Permalink
fix(segment groups): fix typing
Browse files Browse the repository at this point in the history
  • Loading branch information
PaulHax committed Nov 7, 2024
1 parent c6b83b5 commit f8b3425
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 1 deletion.
4 changes: 3 additions & 1 deletion src/components/vtk/VtkLayerSliceRepresentation.vue
Original file line number Diff line number Diff line change
Expand Up @@ -73,7 +73,9 @@ const applyLayerColoring = () => {
if (!config) return;
const cfun = sliceRep.property.getRGBTransferFunction(0);
const ofun = sliceRep.property.getScalarOpacity(0);
const ofun = sliceRep.property.getPiecewiseFunction(0);
if (!cfun || !ofun) throw new Error('Missing transfer functions');
applyColoring({
props: {
Expand Down
4 changes: 4 additions & 0 deletions src/components/vtk/VtkSegmentationSliceRepresentation.vue
Original file line number Diff line number Diff line change
Expand Up @@ -105,6 +105,8 @@ const applySegmentColoring = () => {
const cfun = sliceRep.property.getRGBTransferFunction(0);
const ofun = sliceRep.property.getPiecewiseFunction(0);
if (!cfun || !ofun) throw new Error('Missing transfer functions');
cfun.removeAllPoints();
ofun.removeAllPoints();
Expand Down Expand Up @@ -142,10 +144,12 @@ const config = computed(() =>
);
const outlineThickness = computed(() => config.value?.outlineThickness ?? 2);
// @ts-expect-error vtk.js types are incomplete
sliceRep.property.setUseLabelOutline(true);
sliceRep.property.setUseLookupTableScalarRange(true);
watchEffect(() => {
// @ts-expect-error vtk.js types are incomplete
sliceRep.property.setLabelOutlineOpacity(config.value?.outlineOpacity ?? 1);
});
Expand Down
1 change: 1 addition & 0 deletions src/io/state-file/schema.ts
Original file line number Diff line number Diff line change
Expand Up @@ -218,6 +218,7 @@ const LayersConfig = z.object({

const SegmentGroupConfig = z.object({
outlineOpacity: z.number(),
outlineThickness: z.number(),
}) satisfies z.ZodType<SegmentGroupConfig>;

const ViewConfig = z.object({
Expand Down

0 comments on commit f8b3425

Please sign in to comment.