Skip to content

Material coordinates - #295

Merged
rchristie merged 8 commits into
ABI-Software:mainfrom
0huitzil:material-coordinates
Sep 28, 2026
Merged

rchristie merged 8 commits into
ABI-Software:mainfrom
0huitzil:material-coordinates

Conversation

@0huitzil

Copy link
Copy Markdown
Contributor

Whole-body scaffold is in need of a material coordinates field. This pull request includes the following changes to the wholebody2 scaffold:

  • Added a material coordinates field into the scaffold (body coordinates). This is done by calling the tube generator one more time, with default settings.
  • Changes the default proportions of the 1d-network-layout scaffold to be more consistent to those of a "default" human
  • Created a script which automatically generated the network layout of the body (util/human_network_layout)
  • Subdivided arms into brachium/antebrachium
  • Subdivided legs into upper/lower leg
  • Added skin groups for hand and foot

@rchristie rchristie left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Not really a full review as this is a larger change than I expected (which was just to add material coordinates). For a larger change including upper/lower limbs etc. I will need to look at when I'm back from Mon 17.
There are some comments about unnecessary formatting changes, but little real substance due to the following:
For some reason the meshtype_3d_wholebody2 scaffold diff is unable to be rendered in the github interface. Has it caught up to the tube mesh dome changes?
I'll need you to walk me through the changes now they're a bit larger.

Comment thread src/scaffoldmaker/scaffolds.py Outdated
_allScaffoldTypes = [
MeshType_1d_bifurcationtree1,
MeshType_1d_uterus_network_layout1,
MeshType_1d_human_body_network_layout1,

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

This shouldn't be committed to the public scaffold list.
I don't expect any change to this whole file -- can you revert it?

Comment on lines +12 to +15
AnnotationGroup,
findOrCreateAnnotationGroupForTerm,
getAnnotationGroupForTerm,
)

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Don't needlessly change style like this. I don't want one line per imported function as we can get dozens from some utilities.

Comment on lines +4 to +5
import math

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

math was already being imported below -- don't change unlesss we agree on a new standard for ordering, and the current approach is that python system libraries are imported last after our own sources.

Comment on lines +15 to +35
computeCubicHermiteEndDerivative, getCubicHermiteArcLength, interpolateLagrangeHermiteDerivative,
sampleCubicHermiteCurvesSmooth, smoothCubicHermiteDerivativesLine)
computeCubicHermiteEndDerivative,
getCubicHermiteArcLength,
interpolateLagrangeHermiteDerivative,
sampleCubicHermiteCurvesSmooth,
smoothCubicHermiteDerivativesLine,
)
from scaffoldmaker.utils.networkmesh import NetworkMesh
from scaffoldmaker.utils.tubenetworkmesh import BodyTubeNetworkMeshBuilder, TubeNetworkMeshGenerateData
import math
from scaffoldmaker.utils.tubenetworkmesh import (
BodyTubeNetworkMeshBuilder,
TubeNetworkMeshGenerateData,
)

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Revert these unnecessary changes.

("abdominopelvic cavity", "UBERON:0035819"),
("upper limb", "UBERON:0001460"),
("left upper limb", "UBERON:8300002", "FMA:7186"),
("left shoulder", ""),

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Do any of these new terms have ILX or UBERON ids?
Look up on interlex...

("head core", ""),
("diaphragm", "UBERON:0001103", "ILX:0103194"),
("hand", "ILX:0104885", "FMA:9712"),
("hip", ""),

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Does hip have a real anatomical definition? Perhaps needs to be a more focused term for the level of the top of the pelvis?

@@ -0,0 +1,139 @@
#%%

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

I wouldn't have started a new utility that is used in one place, but it's OK.
However, need to have header text explaining what it is for.

'footElementsCount': 2
}

def create_segment_layout(nodeCount:int, nodeIdentifier:int,

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

This is a very generic name. Is the function able to be used for other scaffolds?
It seems like it should be a method of a class that maintains the next node identifier...


:param nodeCount: Number of nodes to add.

:param networkLayout: String containing the current network layout.

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

No such argument. A NetworkLayout is a specific class. This would logically be what we call a structure string.

@@ -0,0 +1,139 @@
#%%
# Number of elements per segment. Used to calculate the number of nodes per segment.
human_network_element_counts = {

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

This might be better done as a members of a class?
The generate function would then be a method on that class?

@0huitzil
0huitzil force-pushed the material-coordinates branch 2 times, most recently from 21f0b41 to fbd6d4e Compare August 12, 2026 22:28
@0huitzil
0huitzil force-pushed the material-coordinates branch from fbd6d4e to 709d608 Compare August 12, 2026 22:32
@0huitzil
0huitzil force-pushed the material-coordinates branch from d26e0c3 to 1379fa9 Compare August 13, 2026 00:26
@0huitzil

Copy link
Copy Markdown
Contributor Author

On a second look, the limb subdivision changes are definitely undercooked. And, given the usefulness of the material coordinates to the other projects we are working on, I decided to move the other limb subdivision changes to a separate branch, and just keep the following changes:

  • Added material coordinates to the scaffold
  • Updated default lengths of the 1d network
  • Updated the test to the new default parameters

@rchristie rchristie left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Can we change to the following default sizes in the body coordinates branch:

  • "Abdomen length": 3.0,
  • "Hand length": 2.0,
  • "Head length": 2.5,
  • "Neck length": 1.0,
  • "Shoulder width": 4.5,
  • "Thorax length": 2.5,

We'll tweak this again in subsequent stuff, but I think these will be better.
Can you make these changes, update test answers, commit and remove 'draft' from the PR.

@0huitzil
0huitzil marked this pull request as ready for review September 8, 2026 01:30
rchristie and others added 2 commits September 18, 2026 12:25
Restore previous torso depth and update test answers.

@rchristie rchristie left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Minor fixes

Comment on lines +24 to +27
("right hand", "ILX:"),
("left hand", "ILX:"),
("right hand skin epidermis outer surface", "ILX:"),
("left hand skin epidermis outer surface", "ILX:"),

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

If there is not term ID use "" (empty quotes)

Comment on lines +35 to +38
("right foot", "ILX:"),
("left foot", "ILX:"),
("right foot skin epidermis outer surface", "ILX:"),
("left foot skin epidermis outer surface", "ILX:"),

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Use blank id""

@rchristie rchristie left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Looks good.

@rchristie
rchristie merged commit e7a3ca2 into ABI-Software:main Sep 28, 2026
9 checks passed
@0huitzil
0huitzil deleted the material-coordinates branch September 29, 2026 01:46
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants