Skip to content

Add SliceControl and ClipControl widgets#28

Open
Jo-Byr wants to merge 2 commits into
Kitware:mainfrom
Jo-Byr:slice-editor
Open

Add SliceControl and ClipControl widgets#28
Jo-Byr wants to merge 2 commits into
Kitware:mainfrom
Jo-Byr:slice-editor

Conversation

@Jo-Byr

@Jo-Byr Jo-Byr commented Jun 17, 2026

Copy link
Copy Markdown
Contributor

No description provided.

@Jo-Byr

Jo-Byr commented Jun 17, 2026

Copy link
Copy Markdown
Contributor Author

@luciemac

@Jo-Byr Jo-Byr force-pushed the slice-editor branch 2 times, most recently from ada7636 to 3b6fb3a Compare June 17, 2026 13:59
@Jo-Byr Jo-Byr changed the title feat(SliceControl): add SliceControl widget Add SliceControl and ClipControl widgets Jun 17, 2026
self.source = None
self.pv_filter = pv_filter
self.title = title
self.show_key = f"{namespace}_show"

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

show_key -> visibility_key?

Comment on lines +129 to +161
with (
vuetify.VTooltip("Normal to X", location="bottom"),
vuetify.Template(v_slot_activator="{ props }"),
):
vuetify.VBtn(
"X",
click=self._normal_to_x,
style="margin: 4px;",
density="comfortable",
v_bind="props",
)
with (
vuetify.VTooltip("Normal to Y", location="bottom"),
vuetify.Template(v_slot_activator="{ props }"),
):
vuetify.VBtn(
"Y",
click=self._normal_to_y,
style="margin: 4px;",
density="comfortable",
v_bind="props",
)
with (
vuetify.VTooltip("Normal to Z", location="bottom"),
vuetify.Template(v_slot_activator="{ props }"),
):
vuetify.VBtn(
"Z",
click=self._normal_to_z,
style="margin: 4px;",
density="comfortable",
v_bind="props",
)

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Can you factorized this by defining one component to reuse for X, Y and Z?

v_bind="props",
),
):
vuetify.VIcon("mdi-camera")

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Same here actually

self.plane_representation.DrawPlaneOff()

self._build_ui()
self.plane_representation.normal = self.normal_editor.value

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Don't you need the origin as well?



class PlaneWidgetEditor(html.Div):
def __init__(self, pv_filter, title: str, namespace: str = ""):

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Missing some typing

Comment on lines +195 to +197
self.plane_widget = vtk.vtkImplicitPlaneWidget2(
representation=self.plane_representation, interactor=iren
)

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Should be initialized only once

Comment thread ptc/slice_editor.py
Comment on lines +13 to +14
if any(not isinstance(v, float) for v in origin):
return

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Should handle integers as well

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants