Skip to content

Conversation

bnmajor
Copy link
Collaborator

@bnmajor bnmajor commented Jun 30, 2022

Moving the viewer initialization into the run function prevents the viewer from being displayed as a dialog in the Jupyter Notebook and instead displays it inline as expected. This also prevents the multiple window creation that was happening in Colab. From the ImJoy docs:

  • setup() function: executed when a plugin is loaded and it initializes for the first time.
  • run() function: will be called each time a plugin is executed. When executed, an object (for JavaScript) or a dictionary (for Python) with context (named ctx) will be passed into the function. The returned result will be displayed as a new window or passed to the next op in a workflow.

I am not entirely sure why this change would affect the way that the output is displayed but this change better matches the examples that ImJoy provides (computation plugin, itk-vtk-viewer, image viewer)

@bnmajor bnmajor requested a review from thewtex June 30, 2022 16:03
@thewtex thewtex merged commit b4f04f8 into InsightSoftwareConsortium:main Jun 30, 2022
@bnmajor bnmajor deleted the notebook-bug branch July 19, 2022 15:57
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