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

Hide slider when image dimension is 1 #432

Merged
merged 6 commits into from
Oct 8, 2024
Merged

Conversation

DanicaSTFC
Copy link
Collaborator

closes #421

@DanicaSTFC DanicaSTFC added this to the Version 24.0.2 milestone Aug 7, 2024
@DanicaSTFC DanicaSTFC self-assigned this Aug 7, 2024
@DanicaSTFC DanicaSTFC requested a review from paskino August 7, 2024 14:32
@paskino
Copy link
Collaborator

paskino commented Aug 20, 2024

This PR seems to fix the last point at #365 (comment)

From email from @DanicaSTFC

I know you have a flag for this already but I preferr to keep the hide/show flag separate from the creation flag.

At the time I did not find a way to hide the slider widget, which you seem to have found. I used EnabledOn.

sw = vtk.vtkSliderWidget()
sw.SetInteractor(self.getInteractor())
sw.SetRepresentation(sr)
sw.SetAnimationModeToAnimate()
sw.EnabledOn()

It would be useful to add a method setSliderWidgetEnabled to be able to control the visibility of the slider widget. This would allow a proper treatment of the visibility and creation of the widget.

@DanicaSTFC
Copy link
Collaborator Author

This PR seems to fix the last point at #365 (comment)

From email from @DanicaSTFC

I know you have a flag for this already but I preferr to keep the hide/show flag separate from the creation flag.

At the time I did not find a way to hide the slider widget, which you seem to have found. I used EnabledOn.

sw = vtk.vtkSliderWidget()
sw.SetInteractor(self.getInteractor())
sw.SetRepresentation(sr)
sw.SetAnimationModeToAnimate()
sw.EnabledOn()

It would be useful to add a method setSliderWidgetEnabled to be able to control the visibility of the slider widget. This would allow a proper treatment of the visibility and creation of the widget.

I did not create a new method to control the visibility as the SetEnabled method already exists. The creation of the widget in a viewer is a different matter. I was not sure what you wanted to do with the enabled parameter. Perhaps we can discuss this in a meeting.

@DanicaSTFC DanicaSTFC merged commit 44c554f into master Oct 8, 2024
@DanicaSTFC DanicaSTFC deleted the hide-slider-dim1 branch October 8, 2024 14:37
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.

Slider should disappear when only 1 slice is visualised
2 participants