Skip to content

Data lower limb extraction#331

Open
Brehana-Naidu wants to merge 63 commits intomainfrom
data-lower-limb-extraction
Open

Data lower limb extraction#331
Brehana-Naidu wants to merge 63 commits intomainfrom
data-lower-limb-extraction

Conversation

@Brehana-Naidu
Copy link
Copy Markdown
Collaborator

Pull Request Summary

Closes #219 and #293

This PR cleans up and improves the bone data extraction pipeline by removing the hardcoded pelvis-specific logic and making it flexible enough to work with different anatomical regions. Before this change, the scripts were tightly tied to a single bone set, which made it difficult to reuse or extend. Now, the system is driven by configuration files, so adding support for new datasets like the lower limb, upper limb, spine, or skull doesn’t require changing the core Python code.

To make this work, I introduced JSON-based configuration files and updated the extraction scripts to load bone keywords and fallback names dynamically using a --bone-set-config parameter. I also refactored the core functions to accept these configurable inputs and built a more general pipeline that can handle different datasets. I tested everything by running the pipeline with multiple configurations (like lower limb and spine), and it produced the expected results.

Key Changes
All extraction scripts now accept a --bone-set-config parameter and dynamically load configuration data
Added JSON configuration files for multiple anatomical regions:
bone_set_config.json (Lower Limb: Femur, Patella, Tibia, Fibula, Foot)
upper_limb_config.json (Upper Limb: Humerus, Radius, Ulna, Hand)
spine_config.json (Spine: Atlas, Axis, Cervical, Thoracic, Lumbar, Sacrum)
skull_config.json (Skull: Frontal, Parietal, Temporal, Occipital, Sphenoid)
Refactored core functions:
get_slide_bone_name() now accepts bone_keywords and fallback_name
extract_descriptions_from_slide() uses configurable parameters instead of hardcoded values
Implemented a generic extraction pipeline to handle multiple datasets seamlessly
Fixed Unicode encoding issues that previously caused pipeline failures
Removed hardcoded bone set constants while preserving DataPelvis/ as the output destination
Cleanup
Removed all temporary testing directories (test_, spine_test, etc.)
Retained only essential components:
Configuration files
Core extraction scripts and pipeline
Valid dataset directories (lower_limb/, upper_limb/)
Source data (vertebrae_powerpoint/)
Resulting codebase is clean and production-ready
Testing
Verified individual scripts function correctly with different configurations
Successfully executed the generic pipeline across multiple bone sets
Confirmed correct output labeling (e.g., "atlas" for spine data)

Santosh-Iragavarapu and others added 30 commits October 1, 2024 14:42
Update pubic_rami_description.json
…o data

   Merge remote changes with local image array updates
leandrumartin and others added 28 commits February 17, 2026 22:16
Added various entries to ignore node dependencies, logs, environment files, build outputs, OS/editor files, and cache files.
Rename annotation files to standardized naming convention: <boneId>_t…
Update text annotations with files that were being served locally before
- Replace incompatible GitHub files with correct local files
- Files use proper EMU coordinate system (4166564 x 4100124)
- Follow bone_id naming pattern: {bone_id}_colored_regions.json
- 15 files covering all anatomical regions:
  - bony_pelvis, iliac_crest, anterior/posterior iliac spines
  - iliac spine variants (superior/inferior/posterior)
  - auricular surface, ischial tuberosity, ischial spine
  - sciatic notches, ramus/pubic rami, pectineal line
  - symphyseal surface, pubic tubercle
- Enables API endpoint to fetch from GitHub instead of local fallback
- Improves maintainability by decoupling from bone ID hardcoding
…tabase

Remove unneeded data from database
Moved files to new Branch to merge into the Data branch
Add vertebrae data to database
Copy link
Copy Markdown
Collaborator

@leandrumartin leandrumartin left a comment

Choose a reason for hiding this comment

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

This looks like it resolves only #293, not #219 as you wrote in the summary. Those changes should be set to merge into the data branch, not main.

But when I set this to merge into the data branch, GitHub told me that there were not changes between this branch and data:

20260330-1911-34.9182625.mp4

So it seems to me that you haven't actually added anything new on this branch.

You already have a PR open for adding the lower limb data—#312. So it would probably be simpler to just keep working in that branch.

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.

Refactor in preparation for adding new bone sets

7 participants