[3D Visualizer] Searchable label picker + subcortical field PLY export#132
Open
idossha wants to merge 3 commits into
Open
[3D Visualizer] Searchable label picker + subcortical field PLY export#132idossha wants to merge 3 commits into
idossha wants to merge 3 commits into
Conversation
- Subcortical label lookup now opens AtlasRegionFinderDialog (the shared
searchable/multi-select widget used by flex and analyzer); selected label
ids merge into the 'Labels to extract' field.
- nifti_to_mesh: add mask_to_surface(), sample_field_at_points(), and
nifti_to_field_ply() to color a subcortical surface by a sampled field
volume (per-vertex colors via tit.blender.io helpers).
- Subcortical export now also writes subcortical_{suffix}.ply when a
simulation field volume is found, mirroring the cortical STL+PLY export.
…omponent path The <=1 component branch returned a bare ndarray while both callers unpack two values, raising on clean_components=True for a single-component mask.
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.
Summary
Two improvements to the 3D Visual Exporter GUI extension (
tit/gui/extensions/visual_exporter.py) and mesh tooling (tit/tools/nifti_to_mesh.py):1. Reuse the shared searchable label picker
The subcortical "Show Label Lookup Table" button (a static, read-only table) is replaced with "Search & Select Labels...", which opens
AtlasRegionFinderDialog— the same searchable, multi-select widget the flex optimizer and analyzer already use.merge_into_lineedit._parse_lut_entries()parseslabeling_LUT.txtinto(id, name, rgb)tuples.2. Subcortical PLY with local field
Subcortical structures come from a label segmentation volume with no field, so previously only STL/MSH geometry was exported. Now, mirroring the cortical STL+PLY export, a field-colored PLY is written by sampling the simulation's field volume at each surface vertex.
tit/tools/nifti_to_mesh.py: extractedmask_to_surface(), addedsample_field_at_points()(trilinear sampling) andnifti_to_field_ply()(per-vertex colors via sharedtit/blender/io.pyhelpers).TI_max) +_find_field_nifti()locate the subject-space*_subject_{field}.nii.gzvolume for the selected simulation.subcortical_{suffix}.plyis written alongside STL/MSH; otherwise geometry-only export is unchanged (logs a note).Testing
Notes
The
AtlasRegionFinderDialogandmerge_into_lineeditimports are intentionally local to_show_lut_table—main.py's extension-class discovery scans the module namespace and would otherwise mistake the importedQDialogfor the extension widget.