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

GUI: Image is not updated when switching videos #1530

Closed
1 of 3 tasks
roomrys opened this issue Oct 4, 2023 · 2 comments
Closed
1 of 3 tasks

GUI: Image is not updated when switching videos #1530

roomrys opened this issue Oct 4, 2023 · 2 comments
Labels
bug Something isn't working MultiView Stack This PR is part of the MultView stacked PRs.

Comments

@roomrys
Copy link
Collaborator

roomrys commented Oct 4, 2023

Bug description

⚠️ Only present on the multiview branch. Only present if on last frame of video when switching videos.

Argh! It was a video encoding problem with the MV test videos.

The callback for the "video" state loads the new video image at this line (but this does not happen when switching videos on the last frame prior to updating the "video" state).

self.load_queue.append(frame_idx)

This is a regression. In the past, the image would update when selecting a new video in the GUI.

Currently, users need to change frames after selecting a video to update the plotted image. This is also noticeable in start-up of the GUI where the default background image remains present even if a video is loaded.
image
Initial frame loaded correctly, but then when switching to a new video, the plot is not updated:
image

Expected behaviour

After selecting a video, the plotted image should automatically update.

Actual behaviour

The image only updates when selecting a new frame in the seekbar/arrow keys.

Your personal set up

  • OS: mac 13.4
  • Version(s): 1.3.3, python 3.9
@roomrys roomrys added the bug Something isn't working label Oct 4, 2023
@roomrys
Copy link
Collaborator Author

roomrys commented Oct 12, 2023

Trace

On initialization, the QtVideoPlayer connects the "video" state to a callback

self.state.connect("video", self.load_video)

more specifically, the QtVideoPlayer.load_video function

def load_video(self, video: Video, plot=True):

which calls QtVideoPlayer.plot

def plot(self, *args):

which uses an image loader to set the image once loaded

# Connect signal so that image will be shown after it's loaded
self._video_image_loader.result.connect(
lambda qimage: self.view.setImage(qimage)
)

Is the video state being updated when we switch video's? After a video that is missing is found?

The VideosDock.table attribute has has a function activateSelected which will change the state["video"] if table.is_activatable

def activateSelected(self, *args):
"""Activate item currently selected in table.
"Activate" means that the relevant :py:class:`GuiState` state variable
is set to the currently selected item.
"""
if self.is_activatable:
self.state[self.row_name] = self.getSelectedRowItem()

(and assuming table.row_name == "video" - which is true)

row_name="video",

we call activateSelected when a row item is double clicked

self.doubleClicked.connect(self.activateSelected)

@roomrys roomrys added the MultiView Stack This PR is part of the MultView stacked PRs. label Oct 19, 2023
@roomrys
Copy link
Collaborator Author

roomrys commented May 29, 2024

Fixed with #1787

@roomrys roomrys closed this as completed May 29, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working MultiView Stack This PR is part of the MultView stacked PRs.
Projects
None yet
Development

No branches or pull requests

1 participant