FlexReg panel: joysticks from the schema, patch outline previewed locally - #5
Open
Jules-GP wants to merge 8 commits into
Open
FlexReg panel: joysticks from the schema, patch outline previewed locally#5Jules-GP wants to merge 8 commits into
Jules-GP wants to merge 8 commits into
Conversation
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
The client half of FlexReg. The patch and the registration move to the server
(sadt-tools#23); what stays here is the preview.
3307 lines removed, 408 added. The old module drove
FlexReg_CLIfrom insideSlicer and shipped 191 lines of
install_pytorch.pyto get torch onto aclinician's laptop - its patch propagation calls
.cuda()with no availabilitytest and no device argument. That is what the server is for.
The preview stays local, and had to
Dragging a pad recomputes the patch outline here, in about 18 ms on a
294,260-point arch. A round trip per gesture is not a preview. It needs nothing
but vtk, numpy and matplotlib, all of which ship with Slicer - no torch anywhere
on this path, verified by loading the module and finding
torchabsent fromsys.modules.The server is asked once, on Apply, for the real patch: geodesic propagation on
the mesh rather than a polygon fill, and what the registration runs on. The two
differ, which is the honest reason this is called a preview - 48,796 points in
the local outline against 54,030 in the server's patch, on the same arch.
The five pads come from the schema
run()declares each corner astuple[float, float]andlayout.pygives theaxes their ranges and end labels, so
formgenbuilds the joysticks with nocode in this module. It only wires them to the preview. That needed the
vec2type, which is sadt-tools#24 and slicer-remote-tool-server#17.
Each corner is one POSITION, not two settings: the knob sits where the point sits
on the arch, 0 at mid-arch and 1 on the tooth. Two number fields state two
numbers and cannot state that.
Two defects fixed on the way
named
Universal_ID, while the server's engine takes whatever labels the meshcarries - so a mesh straight out of Crown_Seg (
PredictedID) was refused bythe panel and accepted by the server. The name travels now.
FlexReg.pyimported thepreview at module scope; without numpy the module would not import at all,
rather than losing the one thing that can be done without. Imported lazily.
Verified
Six tests: the five pads built from the real schema with the right ranges, a
pair reading back in
(ratio, adjust)order, and the corner names matching theones the preview keys its centroids by - a rename on either side would build a
patch from the wrong four teeth.
test_clientandtest_formgenstill pass.