Skip to content
Open
Show file tree
Hide file tree
Changes from 8 commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 4 additions & 1 deletion .gitignore
Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

Why is this committed? This doesn't seem relevant.

Original file line number Diff line number Diff line change
Expand Up @@ -21,4 +21,7 @@ Thumbs.db

# Cache files
__pycache__/
*.pyc
*.pyc

# XML files
*.xml
2 changes: 2 additions & 0 deletions boneset-api/package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

15 changes: 13 additions & 2 deletions data_extraction/Extract_Bone_Descriptions.py
Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

Why is this committed? This doesn't seem relevant.

Original file line number Diff line number Diff line change
@@ -1,9 +1,11 @@
import xml.etree.ElementTree as ET
import json
import os
import argparse
import sys

slides_dir = "ppt/slides"
output_filename = "all_bone_descriptions.json"

def extract_descriptions_from_slide(xml_file): # Extract descriptions from a single slide XML file
try:
tree = ET.parse(xml_file)
Expand Down Expand Up @@ -206,4 +208,13 @@ def process_all_slides(ppt_dir, output_dir):

os.makedirs(args.output_dir, exist_ok=True)
success = process_all_slides(args.ppt_dir, args.output_dir)
sys.exit(0 if success else 1)
sys.exit(0 if success else 1)
with open(output_json_path, 'w') as f:
json.dump(bone_data, f, indent=4)

print(f"Descriptions saved to {output_json_path}")

# Example usage
xml_file = "/Users/joshbudzynski/Downloads/example_folder/ppt/slides/slide3.xml"
output_json = "slide3_Descriptions.json"
parse_slide_xml(xml_file, output_json)
4 changes: 3 additions & 1 deletion templates/boneset.html
Original file line number Diff line number Diff line change
Expand Up @@ -137,7 +137,9 @@ <h2>Visual Reference</h2>
</div>
<div class="images-content">
<div id="bone-image-container" role="region" aria-live="polite"></div>

<div class="image-controls">
<button id="toggle-labels-button" type="button" class="btn-secondary">Toggle Labels</button>
Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

The text in here being "Toggle Labels" has the effect that the button says "Toggle Labels" until you click on it, after which it says either "show" or "hide." The inconsistency feels a bit clunky to me

I was thinking maybe the default here should just be "hide" instead of "toggle"...but after reading Jennifer's comment I think it might be simplest just to have it always say "toggle" and never "hide" or "show," just so it never ends up saying the wrong thing

</div>
</div>
</section>
</div>
Expand Down
12 changes: 12 additions & 0 deletions templates/js/main.js
Original file line number Diff line number Diff line change
Expand Up @@ -103,6 +103,18 @@ document.addEventListener("DOMContentLoaded", async () => {
}
});

const toggleLabelsButton = document.getElementById("toggle-labels-button");
if (toggleLabelsButton) {
toggleLabelsButton.addEventListener("click", () => {
const imageContainer = document.getElementById("bone-image-container");
if (!imageContainer) return;

imageContainer.classList.toggle("labels-hidden");
const isHidden = imageContainer.classList.contains("labels-hidden");
toggleLabelsButton.textContent = isHidden ? "Show Labels" : "Hide Labels";
});
}

// (No auto-select) The UI shows the boneset placeholder and waits for user selection

// 8. Initialize display
Expand Down
4 changes: 4 additions & 0 deletions templates/style.css
Original file line number Diff line number Diff line change
Expand Up @@ -1800,6 +1800,10 @@ button:disabled {
height: 100%;
}

#bone-image-container.labels-hidden .annotation-labels {
Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

I think it would be good to also hide the pointer lines that are being overlaid on the images. It looks like they have the class name "annotation-svg", so see if hiding those works.

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

I'm actually going back on this...after looking at it I think we'd want to keep the lines, so they can see what parts of the bone is a distinctly named part. I think it would better facilitate the point of toggling the labels which is quickly quizzing oneself.

visibility: hidden !important;
}

/* In templates/style.css */

/* Lines: Use a dark color and a thin stroke */
Expand Down
Loading