-
Notifications
You must be signed in to change notification settings - Fork 3
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
ENH: Add trame example application for cleaving mesh #3
base: main
Are you sure you want to change the base?
Conversation
vtkRenderer, | ||
vtkRenderWindow, | ||
vtkRenderWindowInteractor, | ||
) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
since you import vtk as vtkpackage you might want to simply use it rather than using vtkmodules?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks for the feedback, we will revisit.
Background
Since I initially thought I add to discover the relevant modules associated with each classes, in the interest of time it was easier to import from vtkpackage
, especially considering I was adapting a script written by @aronhelser.
Seems pretty cool! |
This commit adds a trame based application allowing the user to select input files (.nrrd, .vti) and cleave the meshes. Co-authored-by: Aron Helser <[email protected]>
# TODO Add a component allowing to re-order "state.input_file_names" | ||
# Possible approaches: | ||
# - v-simple-table + SortableJS | ||
# See https://codepen.io/mykysyk/pen/qBdBRMB | ||
# - v-chip + draggable | ||
# See https://github.com/vuetifyjs/vuetify/issues/11614 and https://jsfiddle.net/cjrqzkf0/ |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@jourdain I would like the ability to re-order the input. Is there a component that would allow me to do so ?
Something like this where I could drag and drop to re-order:
These are two approaches:
- v-simple-table + SortableJS. See https://codepen.io/mykysyk/pen/qBdBRMB
- v-chip + draggable. See [Feature Request] Able to sort chips inside an autocomplete component by click and drag vuetifyjs/vuetify#11614 and https://jsfiddle.net/cjrqzkf0/
Do you have any recommendation ? Should I directly use functionality from pywebvue to include sortable.js ?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
No specific recommendation and in your code base you can use enable_module
to serve some JS files and enable them in vue.js. Let me know if you need help in that JS integration.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
you can use enable_module to serve some JS files and enable them in vue.js.
Do you happen to have an example handy ?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
disabled=("!input_available || cleaver_running",), | ||
loading=("cleaver_running", True), |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The state of the button is not updated, I was not able to "force" the state to be updated on the client.
At the following location (See https://github.com/SCIInstitute/VTKCleaver/pull/3/files#r850536393), I tried to add the following without success ...
state.flush("cleaver_running")
@jourdain Would appreciate any suggestion.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Probably because your server is busy working. You need to make it async and run the C++ exec in a task so you can flush the state before your work is done.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is what I was thinking, I will then apply the approach used in https://github.com/Kitware/trame-mnist/blob/master/trame_mnist/app/engine/main.py by using ProcessPoolExecutor
...
I naively thought updating the state object would be sufficient ...
Would it make sense to have the management of state run in a dedicated process by default?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It is a tricky decision, but I have been thinking of it and I'm not sure yet on how to properly do it. BTW, you do not need ProcessPoolExecutor
. Just a task could be enough.
|
||
|
||
def cleave_inputs(): | ||
state.cleaver_running = True |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is where I updated the cleaver_running
state
This commit adds a trame based application allowing the user to select input files (
.nrrd
,.vti
) and cleave the meshes.Prerequisites: Build
vtkCleaver
python moduleTwo approaches:
Build VTKCleaver as a VTK remote module. See instructions
Build VTKCleaver as a standalone project against a VTK build tree. See instructions
Screenshots
Next steps
Trame example
Cleave Mesh
buttonloading
state is synced with the UIVTK build system
vtkModule: Do not generate files in source tree when building module externally
)CI: upload SDK on tags and weekly jobs
)VTKCleaver build system & continuous integration (CI)
VTK build system
listed above.