Conversation
…t high resolution
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.
recon-all -cortribbonwas 8.07 of the 81 serial minutes in the reference 1.0mm run, more thantopology correction. Its
mris_volmaskdecides for every voxel whether it is inside the whiteand pial surfaces;
recon_surf/volmask.pyanswers the same question with a generalized windingnumber in about ten seconds.
Not a speed trick: white and pial coincide exactly at 8,653 of 141,883 lh vertices along the
medial wall, so this is not two clean closed surfaces. A winding number is a solid angle
integral per point rather than a fill, so coincident sheets and self-intersections change its
value smoothly instead of letting a region escape.
Results
Against the
ribbon.mgz,lh.ribbon.mgzandrh.ribbon.mgzfrom each subject's CI run:Every differing voxel is accounted for, in two groups.
Where inside is undefined (0 and 3 voxels). Inside is a discrete predicate, so two correct
implementations must agree wherever it is defined. The three at 0.8mm lie at distance 0.0000 mm
from a triangle. Nowhere else is it close: 0 query points fall within 0.1 of the 0.5 cut.
The hemisphere overlap (119 and 83), a bias this PR removes. A few hundred voxels near the
medial wall are inside both hemispheres.
mris_volmaskgives all of them to the left, inflatingleft cortex in the same direction in every subject. Each now goes to the hemisphere whose pial
it lies deeper inside:
Deltas mirror, so nothing is gained or lost, only reassigned. Four rules were compared; they
agree with each other only 45 to 73% against a 50% baseline, so these voxels are genuinely
ambiguous, and depth was picked for being the only one near even by construction. It costs under
half a second, running on a few hundred points. The per-hemisphere files are unchanged, since
they record each hemisphere's claim before arbitration, as
mris_volmaskdoes.Changes
recon_surf/volmask.py, new. Checks the surfaces match the reference grid, takes faceorientation from the mesh, writes nothing until everything is checked, honours the thread
budget, and evaluates in 4M point slabs so memory does not grow with resolution.
recon_surf/recon-surf.sh, replaces therecon-all -cortribboncall.recon_surf/long_compat_segmentHA.py, was still building the ribbon the slow way, about 5 ofits 8.5 minutes; now uses the same step.
tools/build/,mris_volmaskmoves fromcopy_filestolink_files, saving 2.7 MB. Itcannot simply be dropped: every
recon-allrun probes about 70 binaries with-all-infoandexits 1 if one is missing, 17 times per run for this one.
not-here.shanswers the probe andfails loudly on a real call.
pyproject.toml,requirements.txt, addlibigl.High resolution
Measured, since 0.7mm is already in use: cost is linear in query count, 21.8 s at 0.7mm and
102.9 s at 0.4mm, still four times faster than
mris_volmaskis at 1.0mm. Memory was the realconstraint, and slabbing caps a term that would otherwise reach 1.2 GB per surface at 0.4mm.
Slabbing never triggers at 1.0 and 0.8mm, so it was exercised by forcing small slabs: identical
output at 4M, 1M, 250k and 50k on both subjects.
Dependency
libigl, abi3 wheels for every platform we
ship, 13.9 MB on linux. The wheels use
std::threadrather than OpenMP on both platforms(0 of 956 dynamic symbols match
GOMP_,omp_,__kmpc) and readIGL_NUM_THREADS;OMP_NUM_THREADSis set alongside in case of a source build. Method from Jacobson et al.,SIGGRAPH 2013, with the fast evaluation from Barill et al., SIGGRAPH 2018.
Caveats
reads it; it affects label names in freeview only.
direction, it does not establish per-voxel truth.
Comparing this branch against the
devrun atb688279cis the meaningful check, since thestored reference tarballs are stale for unrelated reasons.