Code Monkey home page Code Monkey logo

Comments (18)

lassoan avatar lassoan commented on August 11, 2024 2

MandiblePlane2MandiblePlaneStraight will be needed when we implement automatic plane placement from a single point. We will determine MandiblePlaneStraight plane from the centerline and the user-defined point and set MandiblePlane2MandiblePlaneStraight to a slight rotation by default. The user will then just need to do small adjustments (if anything).

from slicerbonereconstructionplanner.

mauigna06 avatar mauigna06 commented on August 11, 2024 1

Yes. I have thought a little about this and your explanation comes in hand. I'd like to set up a dynamic GUI so that the cutting plane selectors can be created based on the number of bone segments selected on a ComboBox. After the planes are selected in the selectors a click on an apply button would create all the fibula planes over the fibula line with the corresponding transform so they are in the right position. It may take some time to do this because I have never set up a dynamic GUI and I have to add the planes to a list that I would apply a list of transforms to and I think is kinda hard

from slicerbonereconstructionplanner.

cmfsx avatar cmfsx commented on August 11, 2024 1

@lassoan and @mauigna06 I am just thinking, don't we already have enough information to generate the cutting planes? Once we define the resection planes at two ends, with the mandibular curve markup we define each segment ends (fiducial points). Then based on the angle can't we calculate the two planes we need to cut the bone? I don't think we need any more information to make the cutting planes. This GUI is good as it is. But the calculation part will have to be programmed.

@mauigna06 if this is not clear I can come to zoom.

3

Screenshot from 2020-12-05 18-13-51

from slicerbonereconstructionplanner.

lassoan avatar lassoan commented on August 11, 2024 1

Yes, mandible cutting planes fully define fibula cutting planes, we just need to specify the fibula line, fibula backplane orientation (or use a plane to define both), starting point along the fibula line, and small offsets between segments.

from slicerbonereconstructionplanner.

mauigna06 avatar mauigna06 commented on August 11, 2024 1

I'll explore how the qMRMLSubjectHierarchyTreeView works and I'll add it to the GUI so folders with the planes inside them can be shown.
Then I'll try to set up the fibula planes and their corresponding transforms iterating though a list.
Also I'll try to make interaction handles appear by default.
These changes may take me a couple of days because I'm studying also.

from slicerbonereconstructionplanner.

lassoan avatar lassoan commented on August 11, 2024 1

A little problem is that the fibula planes are too small to visualize them properly. I don't know how to resize them

Plane extent along its x and y axes are determined by the second and third control positions (first control position is the origin, second is the endpoint of its x axis, third one determines the plane orientation and extent along the y axis).

from slicerbonereconstructionplanner.

lassoan avatar lassoan commented on August 11, 2024 1

It could be useful if you could add a separate issue here for markups plane improvements that you would like to see, just to make sure that we are aware of what you have in mind.

from slicerbonereconstructionplanner.

mauigna06 avatar mauigna06 commented on August 11, 2024 1

I think I have found the right formula to transform the mandible planes to fibula planes as it was desired (contact surface area maximazed) and specified on the picture. I have it on paper.
101910352-cb778500-3b8c-11eb-92df-2c894d8f416c
I'll program it when I have some time because I have to edit the previous version because I have to make some angle checks to make sure the transforms are set up properly.


It is not enough to reproduce the total "Segment angle" rotation between bone segments but we need to reproduce the two rotation angle components (rotation along MandiblePlainStraight x and y axes)

Let me reference to this picture:
mandibule2fibula__

Till now we have a MandiblePlane2FibulaPlane transform. @lassoan, are you saying that you also want a MandiblePlane2MandiblePlaneStraight transform?

from slicerbonereconstructionplanner.

lassoan avatar lassoan commented on August 11, 2024

I would recommend to organize data in subject hierarchy folders. For example, one folder for mandible cutting planes, another folder for the automatically generated fibula cutting planes, etc.

In the module, you can add a subject hierarchy tree widget that shows all the nodes that are in one folder, thereby avoiding the need to create a dynamic GUI manually. You can use that to select existing planes for editing or remove them.

I would not add a combobox for predefining number of mandible cutting planes, you can just have buttons for adding/removing a plane.

from slicerbonereconstructionplanner.

mauigna06 avatar mauigna06 commented on August 11, 2024

I investigated inside the classes: qSlicerMarkupsPlaceWidget, qSlicerMarkupsModuleWidget, vtkSlicerMarkupsLogic, vtkMRMLInteractionNode, vtkMRMLMarkupsPlaneNode, vtkMRMLSubjectHierarchyNode

And I haven't found how to create the planes nodes inside a folder by default with starting name myPlane through the qSlicerMarkupsPlaceWidget
I'd like the created planes to be shown in the qMRMLSubjectHierarchyTreeView like this:

myFolder/myPlane_1
myFolder/myPlane_2
myFolder/myPlane_3
myFolder/myPlane_4

(I know how to move a plane inside a folder after it has been created)

shNode = slicer.mrmlScene.GetSubjectHierarchyNode()
mID = shNode.CreateFolderItem(sceneItemID,"MyFolder")
shNode.CreateItem(mID,planeNode) #planeNode is moved to myFolder

I think if I was able to get the vtkMRMLNode reference of each plane created by the qSlicerMarkupsPlaceWidget I would put them inside a list to iterate through and I would be able to rename them and append them inside myFolder

from slicerbonereconstructionplanner.

lassoan avatar lassoan commented on August 11, 2024

And I haven't found how to create the planes nodes inside a folder by default with starting name myPlane through the qSlicerMarkupsPlaceWidget

There is no function that does everything like this "by default". You implement it yourself: add an "Add cut plane" button, when the user clicks on it then you create the markups plane node, set its name, subject hierarchy parent, add an observer, etc.

When the user places a point of the plane then the observer will call your callback function. In that function you can set the plane orientation, hide control points & show interaction arrows (if there is at least one placed control point), update the corresponding fibula plane's position and orientation, etc.

from slicerbonereconstructionplanner.

mauigna06 avatar mauigna06 commented on August 11, 2024

I haven't thought about it that way. Thank you Andras. I was able to make it work. I just have to update the transforms when mandibular planes are modified. I will do that on the following days.

from slicerbonereconstructionplanner.

mauigna06 avatar mauigna06 commented on August 11, 2024

In the last commit you can create any number of mandibular planes and the fibula planes with its transforms will be created.
A little problem is that the fibula planes are too small to visualize them properly. I don't know how to resize them

from slicerbonereconstructionplanner.

lassoan avatar lassoan commented on August 11, 2024

I've updated the Design.pptx slide with the cutting plane angles (now it is editable in the pptx):

image

A few things to note:

  • User has complete freedom in choosing first and last mandible plane angle
  • There is very little freedom in choosing all other mandible plane angles, because if mandible plane 2 does not half the angle between bone segment 1 and bone segment 2 then there is a mismatch in cross-section area (as you move away from half angle, one of the cross-section is getting smaller, the other is getting larger)
  • It is not enough to reproduce the total "Segment angle" rotation between bone segments but we need to reproduce the two rotation angle components (rotation along MandiblePlainStraight x and y axes)
  • A small space must be added between origin of FibulaPlane1B and FibulaPlane2A. It can be determined by getting the two plane/segmentation intersections (using vtkCutter), transform it to the fibula coordinate system (vtkTransform), get the two bounding boxes (polydata->GetBounds()), the overlap of z coordinate range tells how much space must be added to avoid overlap.

from slicerbonereconstructionplanner.

cmfsx avatar cmfsx commented on August 11, 2024

first control position is the origin, second is the endpoint of its x axis, third one determines the plane orientation and extent along the y axis

I have left out all the problems I have associated with plane markup as I believe it is been revamp by Kyle Sunderland
and Rafael Palomar and hoping when they improve it automatically it will improve the functionality here.

from slicerbonereconstructionplanner.

cmfsx avatar cmfsx commented on August 11, 2024

I found this video which will give a fair idea about how this is done. Right now our calculations are spot on but I thought this might help you to gain a better insight!

https://www.youtube.com/watch?v=O2tHpkxZ1F0

https://www.youtube.com/watch?v=GCbzM1tUrDo

from slicerbonereconstructionplanner.

mauigna06 avatar mauigna06 commented on August 11, 2024

Thank you Manjula. The videos were useful in understanding the surgical process

from slicerbonereconstructionplanner.

mauigna06 avatar mauigna06 commented on August 11, 2024

I have updated the transforms to match the required positioning of the fibula planes. I'll close the issue.
(If you want to follow the conversation here because we were discussing also other topics please do)

from slicerbonereconstructionplanner.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.