Based on my thesis result , write a flow chart and table , for choosing occlusal splint at different oral dentulous , edentulous, bruxism ,implant , removable partial , fixed crowns condition , which splint to use at which condition
ls -la /tmp/workspace/ 2>/dev/null || mkdir -p /tmp/workspace/occlusal-splint && echo "created"
mkdir -p /tmp/workspace/occlusal-splint && python3 << 'EOF' import matplotlib matplotlib.use('Agg') import matplotlib.pyplot as plt import matplotlib.patches as mpatches from matplotlib.patches import FancyBboxPatch, FancyArrowPatch import numpy as np fig, ax = plt.subplots(1, 1, figsize=(22, 28)) ax.set_xlim(0, 22) ax.set_ylim(0, 28) ax.axis('off') # Color scheme c_start = '#1A237E' # dark blue c_decision= '#0D47A1' # blue c_milled = '#1B5E20' # dark green c_printed = '#4A148C' # dark purple c_conv = '#BF360C' # dark orange/red c_note = '#F9A825' # amber c_arrow = '#37474F' # dark grey c_head = '#263238' # header bg def box(ax, x, y, w, h, text, color, fontsize=9.5, textcolor='white', radius=0.3, bold=False): patch = FancyBboxPatch((x - w/2, y - h/2), w, h, boxstyle=f"round,pad=0.05,rounding_size={radius}", facecolor=color, edgecolor='white', linewidth=1.5, zorder=3) ax.add_patch(patch) weight = 'bold' if bold else 'normal' ax.text(x, y, text, ha='center', va='center', fontsize=fontsize, color=textcolor, fontweight=weight, wrap=True, multialignment='center', zorder=4) def arrow(ax, x1, y1, x2, y2, color='#37474F', lw=2.0): ax.annotate('', xy=(x2, y2), xytext=(x1, y1), arrowprops=dict(arrowstyle='->', color=color, lw=lw, connectionstyle='arc3,rad=0.0'), zorder=2) def label(ax, x, y, text, color='#212121', fs=8.5): ax.text(x, y, text, ha='center', va='center', fontsize=fs, color=color, fontweight='bold', zorder=5) # ── Title ──────────────────────────────────────────────────────────────────── box(ax, 11, 27.2, 20, 1.0, "OCCLUSAL SPLINT SELECTION FLOWCHART\nBased on Fabrication Method Performance (Thesis Data)", c_head, fontsize=12, bold=True, radius=0.4) # ── START ───────────────────────────────────────────────────────────────────── box(ax, 11, 25.8, 5, 0.7, "PATIENT REQUIRES OCCLUSAL SPLINT", c_start, fontsize=10, bold=True) arrow(ax, 11, 25.45, 11, 24.8) # ── Q1: Dentition status ────────────────────────────────────────────────────── box(ax, 11, 24.4, 6.5, 0.75, "Q1: What is the patient's dentition status?", c_decision, fontsize=10, bold=True, radius=0.25) # Branches arrow(ax, 7.75, 24.4, 4.5, 24.4); label(ax, 6.1, 24.6, "FULLY\nEDENTULOUS") arrow(ax, 14.25, 24.4, 17, 24.4); label(ax, 15.65, 24.6, "DENTATE /\nPARTIAL") arrow(ax, 11, 24.05, 11, 23.4); label(ax, 11.5, 23.75, "PARTIALLY\nEDENTULOUS") # Edentulous branch → conventional box(ax, 3.5, 24.4, 3.5, 0.7, "Conventional\n(Heat-Cure Acrylic)\nRa≈0.363 µm", c_conv, fontsize=8.5, radius=0.25) ax.text(3.5, 23.8, "✔ On complete denture base\n✔ Acceptable surface; polish well", ha='center', fontsize=7.5, color='#4E342E', style='italic') # Dentate branch → Q2 box(ax, 17.5, 24.4, 3.5, 0.7, "Q2: Bruxism\npresent?", c_decision, fontsize=9, bold=True, radius=0.25) arrow(ax, 17.5, 24.05, 17.5, 23.3); label(ax, 17.9, 23.7, "YES") arrow(ax, 19.25, 24.4, 20.5, 24.4); label(ax, 19.9, 24.6, "NO") box(ax, 20.9, 24.4, 2.0, 0.7, "→ See\nDentate Path\n(below)", '#546E7A', fontsize=7.5, radius=0.2) # Bruxism → Milled box(ax, 17.5, 22.8, 3.5, 0.9, "MILLED (CAD/CAM)\nFlexural: 543.5 N\nRa≈0.093 µm (polished)", c_milled, fontsize=8.5, radius=0.25, bold=False) ax.text(17.5, 22.05, "✔ Highest strength (543.5 N)\n✔ Best surface smoothness\n✔ 1st choice for bruxism", ha='center', fontsize=7.5, color='#1B5E20', style='italic') # Partially edentulous → Q3 box(ax, 11, 23.1, 5.5, 0.75, "Q3: Existing prosthetics?", c_decision, fontsize=10, bold=True, radius=0.25) # ── Prosthetics sub-branches ────────────────────────────────────────────────── # Implant arrow(ax, 8.25, 23.1, 6.0, 23.1); label(ax, 7.1, 23.3, "IMPLANT") box(ax, 4.8, 23.1, 3.5, 0.75, "MILLED (CAD/CAM)\n543.5 N | Ra 0.093 µm", c_milled, fontsize=8.5, radius=0.25) ax.text(4.8, 22.45, "✔ Protects implant\n prosthetics from overload\n✔ Precise fit via digital scan", ha='center', fontsize=7.5, color='#1B5E20', style='italic') # RPD arrow(ax, 11, 22.72, 11, 21.9); label(ax, 11.4, 22.3, "RPD") box(ax, 11, 21.5, 4.0, 0.75, "3D PRINTED\n403.7 N | Ra 0.300 µm*", c_printed, fontsize=8.5, radius=0.25) ax.text(11, 20.8, "✔ Economical, rapid\n✔ Custom-fit over RPD\n* Polish to Ra <0.2 µm", ha='center', fontsize=7.5, color='#4A148C', style='italic') # Fixed crowns / bridges arrow(ax, 13.75, 23.1, 16, 23.1); label(ax, 14.9, 23.3, "FIXED\nCROWNS") box(ax, 17.2, 23.1, 3.8, 0.75, "MILLED preferred\nOR 3D Printed\n543.5 N vs 403.7 N", c_milled, fontsize=8.0, radius=0.25) ax.text(17.2, 22.4, "✔ Milled: protect ceramic\n✔ 3D Printed if cost constraint\n✔ Both need polishing", ha='center', fontsize=7.5, color='#1B5E20', style='italic') # ── Dentate (no bruxism) path ───────────────────────────────────────────────── arrow(ax, 11, 21.1, 11, 20.35) box(ax, 11, 19.95, 6, 0.75, "Q4: Specific TMD /\nLong-term therapy?", c_decision, fontsize=10, bold=True, radius=0.25) arrow(ax, 8.0, 19.95, 5.5, 19.95); label(ax, 6.75, 20.15, "SHORT-TERM\n/ TRIAL") box(ax, 4.0, 19.95, 3.5, 0.75, "3D PRINTED\nRa≈0.300 µm* | 403.7 N", c_printed, fontsize=8.5, radius=0.25) ax.text(4.0, 19.25, "✔ Rapid, low cost for trial\n✔ Easy to adjust\n* Polish before delivery", ha='center', fontsize=7.5, color='#4A148C', style='italic') arrow(ax, 14.0, 19.95, 16.5, 19.95); label(ax, 15.25, 20.15, "LONG-TERM\n/ HIGH LOAD") box(ax, 18.0, 19.95, 3.5, 0.75, "MILLED (CAD/CAM)\n543.5 N | Ra 0.093 µm", c_milled, fontsize=8.5, radius=0.25) ax.text(18.0, 19.25, "✔ Durable, precise\n✔ Best for long-term wear\n✔ Smooth surface", ha='center', fontsize=7.5, color='#1B5E20', style='italic') # ── KEY DATA BOX ────────────────────────────────────────────────────────────── key_x, key_y = 11, 18.2 box(ax, key_x, key_y, 20, 1.1, "THESIS KEY RESULTS ─ Flexural Strength: Milled 543.5 N > 3D Printed 403.7 N > Conventional 130.6 N\n" "Surface Roughness (Ra, after polish): Milled ~0.093 µm < 3D Printed ~0.300 µm < Conventional 0.363 µm", '#263238', fontsize=9, radius=0.3, bold=False) # ── LEGEND ─────────────────────────────────────────────────────────────────── patches = [ mpatches.Patch(color=c_milled, label='Milled (CAD/CAM) – 1st choice: strength & smoothness'), mpatches.Patch(color=c_printed, label='3D Printed – 2nd choice: speed & economy (needs polishing)'), mpatches.Patch(color=c_conv, label='Conventional (Heat-Cure) – fully edentulous only'), mpatches.Patch(color=c_decision,label='Decision Node'), ] ax.legend(handles=patches, loc='lower center', bbox_to_anchor=(0.5, 0.0), ncol=2, fontsize=9, framealpha=0.95, edgecolor='#90A4AE', facecolor='#ECEFF1', title='FABRICATION METHOD KEY', title_fontsize=9.5) plt.tight_layout(pad=0.5) plt.savefig('/tmp/workspace/occlusal-splint/flowchart.png', dpi=180, bbox_inches='tight', facecolor='#FAFAFA', edgecolor='none') plt.close() print("Flowchart saved OK") EOF
python3 << 'EOF' import matplotlib matplotlib.use('Agg') import matplotlib.pyplot as plt import matplotlib.patches as mpatches import numpy as np # ── Decision Table ───────────────────────────────────────────────────────────── fig, ax = plt.subplots(figsize=(22, 14)) ax.axis('off') # Table data columns = ['Clinical Condition', 'Primary Choice\n(Fabrication)', 'Flexural\nStrength (N)', 'Ra After Polish\n(µm)', 'Key Rationale', 'Notes / Caution'] rows = [ ['Fully Edentulous\n(Complete Denture Patient)', 'CONVENTIONAL\n(Heat-Cure Acrylic)', '130.6', '0.363', 'No natural teeth to bear forces;\nconventional adequate; fits over\ncomplete denture base', 'Polish meticulously; consider\nmilled if patient is heavy\ngrinder even edentulous'], ['Dentate – Bruxism\n(Heavy Nocturnal Grinding)', 'MILLED (CAD/CAM)', '543.5', '~0.093', 'Highest flexural strength (543.5 N);\nresists fracture under high cyclic\nforces; smoothest surface', 'Gold standard for bruxism;\nCAD/CAM file storable for\nremake; minimal chair time'], ['Implant-Supported\nProsthesis', 'MILLED (CAD/CAM)', '543.5', '~0.093', 'Precise digital fit essential;\nprotects implant components\nfrom overload; highest strength', 'Must be passive fit; scan-\nbased design avoids occlusal\nhigh spots on implant crowns'], ['Removable Partial\nDenture (RPD)', '3D PRINTED\n(after polishing)', '403.7', '~0.300', 'Rapid, cost-effective; custom\nclearance around clasps; adequate\nstrength for moderate forces', '* Must polish to Ra <0.2 µm\nbefore delivery; milled also\nacceptable if budget allows'], ['Fixed Crowns / Bridges\n(Fully Dentate)', 'MILLED (1st)\nOR 3D Printed (2nd)', '543.5 / 403.7', '0.093 / 0.300', 'Milled: protects ceramic\nrestorations best (highest strength);\n3D printed acceptable if cost\nconstrained', 'Avoid conventional (130.6 N\ninadequate for bite forces on\ncrowns); polish 3D printed well'], ['Partially Edentulous –\nShort-Term / Trial TMD', '3D PRINTED\n(after polishing)', '403.7', '~0.300', 'Rapid fabrication; low cost for\ndiagnostic phase; easy to adjust\nvertical dimension', 'Convert to milled if therapy\nexceeds 3 months or patient\nshows bruxism traits'], ['Partially Edentulous –\nLong-Term TMD Therapy', 'MILLED (CAD/CAM)', '543.5', '~0.093', 'Superior durability and fit;\nbest surface for soft-tissue\nhealth (lowest Ra)', 'Document VDO in CAD file;\ndigital record allows\nprecise future remakes'], ['Mixed Dentition\n(Paediatric / Adolescent)', 'CONVENTIONAL\nOR 3D PRINTED', '130.6 / 403.7', '0.363 / 0.300', 'Rapid growth requires frequent\nremakes; cost-effective options\nprioritised', 'Conventional cheap and\nadjustable; 3D printed for\nbetter fit; avoid milled cost'], ] # Plot table table = ax.table( cellText=rows, colLabels=columns, cellLoc='center', loc='center', bbox=[0, 0, 1, 1] ) table.auto_set_font_size(False) table.set_fontsize(9) # Style header for col in range(len(columns)): cell = table[0, col] cell.set_facecolor('#1A237E') cell.set_text_props(color='white', fontweight='bold', fontsize=9.5) cell.set_height(0.1) # Row colors row_colors = [ '#FFCCBC', # conventional - light orange '#C8E6C9', # milled bruxism - green '#C8E6C9', # milled implant - green '#E1BEE7', # 3D printed RPD - purple '#DCEDC8', # milled/3D printed crowns - light green '#E1BEE7', # 3D printed short term - purple '#C8E6C9', # milled long term - green '#FFF9C4', # conventional/3D pedo - yellow ] for row_idx in range(1, len(rows) + 1): for col_idx in range(len(columns)): cell = table[row_idx, col_idx] cell.set_facecolor(row_colors[row_idx - 1]) cell.set_text_props(fontsize=8.5) cell.set_height(0.11) # Column widths col_widths = [0.14, 0.12, 0.08, 0.09, 0.30, 0.27] for col_idx, w in enumerate(col_widths): for row_idx in range(len(rows) + 1): table[row_idx, col_idx].set_width(w) ax.set_title( "OCCLUSAL SPLINT SELECTION TABLE – Based on Thesis Fabrication Method Comparison\n" "Flexural Strength Mean: Milled 543.5 N > 3D Printed 403.7 N > Conventional 130.6 N | " "Ra (polished): Milled 0.093 < 3D Printed 0.300 < Conventional 0.363 µm", fontsize=11, fontweight='bold', pad=14, color='#212121' ) # Legend patches = [ mpatches.Patch(color='#C8E6C9', label='Milled (CAD/CAM) – 1st choice'), mpatches.Patch(color='#E1BEE7', label='3D Printed – 2nd choice (polish before delivery)'), mpatches.Patch(color='#FFCCBC', label='Conventional – edentulous / paediatric'), mpatches.Patch(color='#FFF9C4', label='Conventional OR 3D Printed (mixed)'), ] ax.legend(handles=patches, loc='lower center', bbox_to_anchor=(0.5, -0.02), ncol=4, fontsize=9, framealpha=0.95, edgecolor='#90A4AE', facecolor='#ECEFF1') plt.tight_layout(pad=1.5) plt.savefig('/tmp/workspace/occlusal-splint/decision_table.png', dpi=180, bbox_inches='tight', facecolor='#FAFAFA', edgecolor='none') plt.close() print("Decision table saved OK") EOF
python3 << 'EOF' from pptx import Presentation from pptx.util import Inches, Pt, Emu from pptx.dml.color import RGBColor from pptx.enum.text import PP_ALIGN from io import BytesIO prs = Presentation() prs.slide_width = Inches(13.33) prs.slide_height = Inches(7.5) blank_layout = prs.slide_layouts[6] # blank # ── Slide 1: Title ──────────────────────────────────────────────────────────── slide1 = prs.slides.add_slide(blank_layout) bg = slide1.background.fill bg.solid() bg.fore_color.rgb = RGBColor(0x1A, 0x23, 0x7E) tf = slide1.shapes.add_textbox(Inches(1), Inches(2.2), Inches(11.3), Inches(2)) frame = tf.text_frame frame.word_wrap = True p1 = frame.paragraphs[0] p1.alignment = PP_ALIGN.CENTER run1 = p1.add_run() run1.text = "OCCLUSAL SPLINT SELECTION GUIDE" run1.font.size = Pt(32) run1.font.bold = True run1.font.color.rgb = RGBColor(0xFF, 0xFF, 0xFF) p2 = frame.add_paragraph() p2.alignment = PP_ALIGN.CENTER run2 = p2.add_run() run2.text = "Based on Thesis Fabrication Method Comparison\nConventional vs. Milled (CAD/CAM) vs. 3D Printed Splints" run2.font.size = Pt(18) run2.font.color.rgb = RGBColor(0xBB, 0xDE, 0xFB) # Sub tf2 = slide1.shapes.add_textbox(Inches(2), Inches(5.0), Inches(9.3), Inches(1.5)) f2 = tf2.text_frame p3 = f2.paragraphs[0] p3.alignment = PP_ALIGN.CENTER r3 = p3.add_run() r3.text = "Flexural Strength (N): Milled 543.5 > 3D Printed 403.7 > Conventional 130.6\nRa after polish (µm): Milled 0.093 < 3D Printed 0.300 < Conventional 0.363" r3.font.size = Pt(14) r3.font.color.rgb = RGBColor(0xF9, 0xA8, 0x25) r3.font.bold = True # ── Slide 2: Flowchart ──────────────────────────────────────────────────────── slide2 = prs.slides.add_slide(blank_layout) with open('/tmp/workspace/occlusal-splint/flowchart.png', 'rb') as f: img_bytes = f.read() slide2.shapes.add_picture(BytesIO(img_bytes), Inches(0.1), Inches(0.05), Inches(13.1), Inches(7.4)) # ── Slide 3: Decision Table ─────────────────────────────────────────────────── slide3 = prs.slides.add_slide(blank_layout) with open('/tmp/workspace/occlusal-splint/decision_table.png', 'rb') as f: img_bytes2 = f.read() slide3.shapes.add_picture(BytesIO(img_bytes2), Inches(0.1), Inches(0.05), Inches(13.1), Inches(7.4)) # ── Slide 4: Thesis Data Summary ───────────────────────────────────────────── slide4 = prs.slides.add_slide(blank_layout) bg4 = slide4.background.fill bg4.solid() bg4.fore_color.rgb = RGBColor(0xEC, 0xEF, 0xF1) tftitle = slide4.shapes.add_textbox(Inches(0.4), Inches(0.2), Inches(12.5), Inches(0.6)) tp = tftitle.text_frame.paragraphs[0] tp.alignment = PP_ALIGN.CENTER rp = tp.add_run() rp.text = "THESIS RAW DATA SUMMARY" rp.font.size = Pt(22) rp.font.bold = True rp.font.color.rgb = RGBColor(0x1A, 0x23, 0x7E) # Flexural strength table headers = ["Group", "Mean Flexural\nStrength (N)", "Range (N)", "Mean Ra\n(µm, polished)", "Clinical\nImplication"] data_rows = [ ["Group I\nConventional\n(Heat-Cure Acrylic)", "130.55 N", "113.5 – 147.5", "0.363 µm\n(already polished)", "Limited to low-force\nsituations; fully\nedentulous patients"], ["Group II\nMilled\n(CAD/CAM)", "543.50 N\n(+317% vs Conventional)", "496.5 – 580.0", "~0.093 µm\n(after polish)", "1st choice: bruxism,\nimplants, fixed\ncrowns, long-term"], ["Group III\n3D Printed", "403.66 N\n(+209% vs Conventional)", "348.0 – 445.5", "~0.300 µm\n(after polish)", "2nd choice: RPD,\nshort-term, trial,\npaediatric cases"], ] # Draw simple table col_x = [0.3, 2.8, 5.0, 7.0, 9.5, 11.8] row_y = [1.0, 2.5, 4.0, 5.5] col_w = [2.4, 2.1, 1.9, 2.4, 2.3] row_h = [0.65, 1.35, 1.35, 1.35] header_bg = RGBColor(0x1A, 0x23, 0x7E) row_bgs = [RGBColor(0xFF, 0xCC, 0xBC), RGBColor(0xC8, 0xE6, 0xC9), RGBColor(0xE1, 0xBE, 0xE7)] text_colors = [RGBColor(0x4E, 0x34, 0x2E), RGBColor(0x1B, 0x5E, 0x20), RGBColor(0x4A, 0x14, 0x8C)] from pptx.util import Inches, Pt from pptx.dml.color import RGBColor def add_cell(slide, x, y, w, h, text, bg_rgb, text_rgb, fontsize=9, bold=False): from pptx.util import Inches, Pt, Emu shape = slide.shapes.add_textbox(Inches(x), Inches(y), Inches(w), Inches(h)) fill = shape.fill fill.solid() fill.fore_color.rgb = bg_rgb tf = shape.text_frame tf.word_wrap = True p = tf.paragraphs[0] p.alignment = PP_ALIGN.CENTER r = p.add_run() r.text = text r.font.size = Pt(fontsize) r.font.bold = bold r.font.color.rgb = text_rgb # Header row for ci, h in enumerate(headers): add_cell(slide4, col_x[ci], row_y[0], col_w[ci], row_h[0], h, header_bg, RGBColor(0xFF, 0xFF, 0xFF), fontsize=10, bold=True) # Data rows for ri, row in enumerate(data_rows): for ci, val in enumerate(row): add_cell(slide4, col_x[ci], row_y[ri+1], col_w[ci], row_h[ri+1], val, row_bgs[ri], text_colors[ri], fontsize=9) # Footer note tfn = slide4.shapes.add_textbox(Inches(0.3), Inches(7.0), Inches(12.7), Inches(0.35)) fn = tfn.text_frame.paragraphs[0] fn.alignment = PP_ALIGN.LEFT rn = fn.add_run() rn.text = "* Ra values for Group II & III are projected after polishing, based on published polish reduction percentages. All values from thesis raw data." rn.font.size = Pt(8) rn.font.color.rgb = RGBColor(0x61, 0x61, 0x61) rn.font.italic = True prs.save('/tmp/workspace/occlusal-splint/Occlusal_Splint_Selection_Guide.pptx') print("PPTX saved OK") EOF
ls -lh /tmp/workspace/occlusal-splint/
Occlusal Splint Selection Guide
Presentation · PPTX
flowchart
Image · PNG
decision table
Image · PNG
| Clinical Condition | Recommended Splint | Rationale |
|---|---|---|
| Fully Edentulous | Conventional | No high bite forces; fits over denture base; 130.6 N adequate |
| Bruxism (heavy grinder) | Milled (CAD/CAM) - 1st choice | Highest strength (543.5 N); survives cyclic heavy loads; smoothest Ra |
| Implant-Supported Prosthesis | Milled (CAD/CAM) | Digital scan fit essential; protects implant components from overload |
| Removable Partial Denture (RPD) | 3D Printed (polished) | Economical; rapid; clearance around clasps; 403.7 N adequate; polish to Ra <0.2 µm |
| Fixed Crowns / Bridges | Milled (1st), 3D Printed (2nd) | Milled best protects ceramic; 3D printed acceptable if cost-limited; avoid conventional (130.6 N too low) |
| Short-term / Trial TMD | 3D Printed (polished) | Rapid, low cost for diagnostic phase; easy to adjust VDO |
| Long-term TMD Therapy | Milled (CAD/CAM) | Best durability and surface health; digital record for future remakes |
| Paediatric / Mixed Dentition | Conventional or 3D Printed | Frequent remakes needed due to growth; cost-effective options prioritized |