Skip to content

Commit

Permalink
fix bug on for transform for FibulaPlane2
Browse files Browse the repository at this point in the history
  • Loading branch information
mauigna06 committed Dec 2, 2020
1 parent 4a35d9e commit 4decdb4
Showing 1 changed file with 4 additions and 5 deletions.
9 changes: 4 additions & 5 deletions BoneReconstructionPlanner/BoneReconstructionPlanner.py
Original file line number Diff line number Diff line change
Expand Up @@ -391,12 +391,11 @@ def process(self):
d = np.sqrt(vtk.vtkMath.Distance2BetweenPoints(or1,or2))

finalTransform2 = vtk.vtkTransform()
#finalTransform2.PostMultiply()
finalTransform2.Translate(lineStartPos)
finalTransform2.Concatenate(rotMatrix)
finalTransform2.PostMultiply()
finalTransform2.Translate(-lineStartPos[0], -lineStartPos[1], -lineStartPos[2])
#I don't know why this doesn't make FibulaPlane2 be over the line
finalTransform2.Translate(-d*lineDirectionVector)
finalTransform2.Concatenate(rotMatrix)
finalTransform2.Translate(lineStartPos)
finalTransform2.Translate(d*lineDirectionVector)

transformFid2.SetMatrixTransformToParent(finalTransform2.GetMatrix())

Expand Down

1 comment on commit 4decdb4

@lassoan
Copy link
Collaborator

@lassoan lassoan commented on 4decdb4 Dec 3, 2020

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is a good start.

Important: we need to keep the module always functional. Copy-pasting the code snippet into the module caused a syntax error and the module now cannot be loaded at all.

Fix the indentation, make it a proper function. Add node selectors to the GUI so that inputs can be selected using the GUI.

I've submitted a couple of code review comments to your previous commit, please have a look at those, too.

If you just want to experiment with code snippets then you can use Jupyter notebooks. Then you don't need to copy-paste code snippets to run them. You just need to install SlicerJupyter and you can start the jupyter notebook server with a single click. You can upload notebooks in the repository.

Please sign in to comment.