Closed adamkewley closed 1 year ago
This is the link to Peter Bishop's paper "How to build a dinosaur": https://www.cambridge.org/core/journals/paleobiology/article/how-to-build-a-dinosaur-musculoskeletal-modeling-and-simulation-of-locomotor-biomechanics-in-extinct-animals/CE84BB804E697DF47C0A3A367CC16B22 And here is where you can access the supplementary material, including the open access matlab code, which also includes the primitive shape fitting algorithm: https://datadryad.org/stash/dataset/doi:10.5061/dryad.73n5tb2v9
Based on a couple of discussions, it looks like the UI needs to support (minimum viable product):
e.g. the software would ultimately be defining data that would be serialized like this:
[landmarks]
[landmarks.l1]
type = "basic"
location = [20.0, 0.0, 3.7]
[landmarks.l2]
type = "basic"
location = [20.0, 0.0, 3.7]
[landmarks.middle]
type = "midpoint"
first_landmark = "l1"
second_landmark = "l2"
# cached_location = [30.0, 20.0, 10.0] # TODO: caching for error recovery
[landmarks.external_l3]
type = "external"
external_file = "some_other_landmark_file"
landmark_name_in_external_file = "l3"
# cached_location = [30.0, 20.0, 10.0] # TODO: caching for error recovery
[landmarks.external_l4]
type = "external"
external_file = "some_other_landmark_file"
landmark_name_in_external_file = "l4"
# cached_location = [30.0, 20.0, 10.0] # TODO: caching for error recovery
# extensibility example: not MVP
#
# e.g. would show a sphere in the UI that the user can use to eyeball locations
# but it would ultimately resolve to the sphere's origin for frame
# calculations
[landmarks.sphere]
type = "sphere"
origin = [0.5, 5.0, 7.0]
radius = 5.0
# cached_location = [30.0, 20.0, 10.0] # TODO: caching for error recovery
[frames]
[frames.f1]
type = "grood_suntay"
e1_start = "external_l3"
e1_end = "external_l4"
e3_start = "l1"
e3_end = "l2"
# e2 is the common perpendicular "floating" axis (F): F = normalize(cross(e3, e1))
The core original paper:
E.S. Grood, A Joint Coordinate System for the Clinical Description of Three-Dimensional Motions: Application to the Knee, 1983
Is what most of the other ISB standards are effectively based on. The original spec appears to be "looser" than its concrete usage in the ISB standards, though, because it defines (e.g.) the two edges ("fixed" axes) potentially on different bodies in different coordinate systems, and it seems to rigidly define angles? Probably needs to be studied before going through each ISB recommendation.
Note: up to p138
The commit onslaught above effectively:
OpenSim::Component
FrameDefinitionTab
that houses this workflowModelEditorViewPanel
,
ModelEditorViewPanel
(big refactor)
osc::ModelEditorViewPanel::addLayer
)ModelEditorViewerPanel
's internal code for decoration generation, rendering, hittesting, etc. into separate APIs under src/OpenSimCreator/Graphics
(e.g. OverlayDecorationGenerator
, OpenSimDecorationGenerator
, ComponentAbsPathDecorationTagger
, etc.)
@JuliaVanBeesel / @pepbos / @aseth1 initial prototyping of the frame definition UI is underway and is being continuously deployed to the main branch as a custom tab (press +
in OSC's tab bar experimental
, OpenSim/FrameDefinition
).
The current in-development version needs some work (more actions, easier interaction when moving things around) but the current idea is:
Demo video:
(green spheres: "landmarks", teal spheres: "midpoints", "green plane": cross product plane - all user defined points are moveable and all derived quantities (edges, cross products, midpoints, etc.) automatically recompute while editing happens.
In-development builds are available on the actions page under the main
branch:
@JuliaVanBeesel / @aseth1 this top-level feature-push issue will now be closed (it will remain here, online, but further work will be done under different issues).
I have updated the original issue post with what parts of the original feature idea have been implemented/DROPPED/LIMITED so that it's clear how development proceeded (the ~50 code commits are harder to read).
The reason some things are DROPPED/LIMITED may be due to time constraints. The delivery date of this feature was scheduled for approximately 2 weeks before TGCS/ISB, so that the overall project, which includes:
Can be done in the remaining 1-2 weeks.
Rough project schedule here: https://github.com/orgs/ComputationalBiomechanicsLab/projects/9/views/1
I'll repost any important (but, unreleaseable within the desired timeframe) changes/fixes/steps etc. as separate issues. Those issues will then be prioritized according to the general OSC project schedule etc.
Individual nice-to-haves were broken out into new issues that will be assigned as part of project development - it might be that a few of the easier ones make this window.
This issue was broken out from #467 , which was originally an all encompassing issue for building an OpenSim model warping UI.
Issue Background
It turned out that creating a warping UI will require a lot of auxiliary tooling+code to do robustly, so that UI idea was broken into three separate pieces that were deemed to be handy in isolation:
Work List
High-Level Work List
osim
osim
without compatability issues)Detailed Work List
FrameDefinitionPoint
base class componentFrameDefinitionSphere
componentOpenSim::Sphere
, but inherits fromFrameDefinitionPoint
FrameDefinitionMidpoint
componentFrameDefinitionPoint
that sockets to twoFrameDefinitionPoint
s to compute a midpointFrameDefinitionEdge
componentFrameDefinitionPointToPointEdge
componentFrameDefinitionEdge
that sockets twoFrameDefinitionPoint
s to compute an edge vectorFrameDefinitionCrossProductEdge
componentFrameDefinitionEdge
that sockets twoFrameDefinitionEdge
s to compute a new cross-product (plane) edgeLandmarkDefinedFrame
FrameDefinitionEdge
sVirtualPoint
edit
menu that should be moved somewhere more obvious (#713 )Feature Specification List
[x] Can import multiple meshes:
[x] Ability to define named 3D locations in mesh-space (i.e. "basic points"):
[x] Ability to define named scene elements that may host points (i.e. "virtual point hosts"):
Sphere
and use its center point in edge definitionMidpoint
, which is dependent on two other virtual points, and then use that midpoint in edge definition[x] Ability to define directed and named edges between two (basic/virtual) points:
[x] Ability to define edges by cross-producting two other edges? (might be useful for reference lines?)
[x] Ability to define named, ordered, and specialized frames from the edges:
Example Frame Definition Cases
Knee (Grood, 1983)
Tibia (Frame, Body-Fixed Axis (
e3
), and Reference Axis (e3r
)Rough dependency diagram (gist):
Femur (Frame, Body-Fixed Axis (
e1
) and Reference Axis (e1r
)Rough dependency diagram (gist)
Knee Joint (excl. translations)
Rough dependency diagram (gist)
Academic References
Software References
isfm_installer.zip
: https://media.isbweb.org/images/documents/standards/isfm_installer.zipbiokinepy
: https://pypi.org/project/biokinepybiokinepy.segment_cs
UECombined
: https://github.com/orat/UECombined