Diagnosis
| Condition | Distinguishing Feature |
|---|---|
| Baker's cyst (most likely) | Posteromedial, communicates with joint, classic location |
| Popliteal artery aneurysm | Pulsatile, vascular on Doppler |
| Lipoma | Non-fluid signal, no connection to joint |
| Ganglion cyst | May be more peripheral, no effusion |
| DVT / pseudothrombophlebitis | Clinical: calf swelling, pain (can coexist if cyst ruptures) |
Per Firestein & Kelley's Textbook of Rheumatology: "In an adult patient, an underlying intra-articular disorder is usually present." Treatment ranges from benign neglect, aspiration, surgical excision, to addressing the underlying pathology.
Mark the all disease
pip install --user pillow requests 2>/dev/null | tail -1
mkdir -p /tmp/workspace/mri-annotation && python3 << 'EOF' import requests from PIL import Image, ImageDraw, ImageFont import io, os # Download image url = "https://d361swluvexzqs.cloudfront.net/chats-attachments/IMG_8640-1784189729057-z7acfa.jpg" resp = requests.get(url, timeout=30) img = Image.open(io.BytesIO(resp.content)).convert("RGB") w, h = img.size print(f"Image size: {w} x {h}") draw = ImageDraw.Draw(img) # Try to get a font, fall back to default try: font = ImageFont.truetype("/usr/share/fonts/truetype/dejavu/DejaVuSans-Bold.ttf", 28) font_small = ImageFont.truetype("/usr/share/fonts/truetype/dejavu/DejaVuSans.ttf", 22) except: font = ImageFont.load_default() font_small = font # ── Helper: draw a labeled marker ────────────────────────────────────────────── def mark(cx, cy, label, color, number, arrow_dir="right"): r = 18 # Circle draw.ellipse([cx-r, cy-r, cx+r, cy+r], outline=color, width=4) # Number inside circle draw.text((cx, cy), str(number), fill=color, font=font, anchor="mm") # Arrow line + text box if arrow_dir == "right": lx1, ly1 = cx+r, cy lx2, ly2 = cx+r+60, cy tx, ty = lx2+4, ly2-14 elif arrow_dir == "left": lx1, ly1 = cx-r, cy lx2, ly2 = cx-r-60, cy tx, ty = lx2-4, ly2-14 # right-align text elif arrow_dir == "up": lx1, ly1 = cx, cy-r lx2, ly2 = cx, cy-r-50 tx, ty = cx+4, ly2-14 elif arrow_dir == "down": lx1, ly1 = cx, cy+r lx2, ly2 = cx, cy+r+50 tx, ty = cx+4, ly2 draw.line([lx1,ly1,lx2,ly2], fill=color, width=3) # text background bbox = draw.textbbox((tx, ty), label, font=font_small) pad = 4 draw.rectangle([bbox[0]-pad, bbox[1]-pad, bbox[2]+pad, bbox[3]+pad], fill=(0,0,0,200)) draw.text((tx, ty), label, fill=color, font=font_small) # ── Helper: draw a rectangle outline ───────────────────────────────────────── def rect(x1, y1, x2, y2, color, width=3): draw.rectangle([x1, y1, x2, y2], outline=color, width=width) # The monitor display area starts roughly at: # The 4 MRI panels occupy the central ~60% of the image height # Approximate panel boundaries (based on 828x1104 or similar) # Let's compute proportional coords # Panel layout (roughly): # Top panels: y ~ 0.31h to 0.52h # Bottom panels: y ~ 0.54h to 0.74h # Left panels: x ~ 0.03w to 0.50w # Right panels: x ~ 0.51w to 0.97w tl_x1, tl_y1, tl_x2, tl_y2 = int(0.03*w), int(0.30*h), int(0.50*w), int(0.52*h) # top-left panel tr_x1, tr_y1, tr_x2, tr_y2 = int(0.51*w), int(0.30*h), int(0.97*w), int(0.52*h) # top-right panel bl_x1, bl_y1, bl_x2, bl_y2 = int(0.03*w), int(0.53*h), int(0.50*w), int(0.75*h) # bottom-left panel br_x1, br_y1, br_x2, br_y2 = int(0.51*w), int(0.53*h), int(0.97*w), int(0.75*h) # bottom-right panel # ─── PANEL 1: Top-Left — Axial T2 (suprapatellar level) ────────────────────── # 1. Baker's Cyst — posteromedial, bottom-right of panel bx = int(tl_x1 + 0.72*(tl_x2-tl_x1)) by = int(tl_y1 + 0.78*(tl_y2-tl_y1)) mark(bx, by, "1. Baker's Cyst", (255, 80, 80), 1, "left") # 2. Joint Effusion (suprapatellar) — anterior/top area of axial panel ex = int(tl_x1 + 0.45*(tl_x2-tl_x1)) ey = int(tl_y1 + 0.22*(tl_y2-tl_y1)) mark(ex, ey, "2. Joint Effusion", (255, 200, 0), 2, "right") # 3. Lateral retinaculum edema — right side of panel lrx = int(tl_x1 + 0.80*(tl_x2-tl_x1)) lry = int(tl_y1 + 0.45*(tl_y2-tl_y1)) mark(lrx, lry, "3. Lat. Retinaculum Edema", (80, 200, 255), 3, "right") # ─── PANEL 2: Top-Right — Axial GRE (patellofemoral level) ─────────────────── # 4. Lateral patellar subluxation/tilt — center of panel px = int(tr_x1 + 0.50*(tr_x2-tr_x1)) py = int(tr_y1 + 0.42*(tr_y2-tr_y1)) mark(px, py, "4. Patellar Subluxation/Tilt", (255, 130, 0), 4, "right") # 5. Patellar cartilage thinning — lateral facet, slightly right of center pcx = int(tr_x1 + 0.60*(tr_x2-tr_x1)) pcy = int(tr_y1 + 0.52*(tr_y2-tr_y1)) mark(pcx, pcy, "5. Cartilage Thinning", (180, 255, 80), 5, "right") # ─── PANEL 3: Bottom-Left — Sagittal T2 ────────────────────────────────────── # 6. Suprapatellar effusion — top portion of panel sex = int(bl_x1 + 0.30*(bl_x2-bl_x1)) sey = int(bl_y1 + 0.15*(bl_y2-bl_y1)) mark(sex, sey, "6. Suprapatellar Effusion", (255, 200, 0), 6, "right") # 7. ACL abnormal signal — center of panel (intercondylar notch) acl_x = int(bl_x1 + 0.52*(bl_x2-bl_x1)) acl_y = int(bl_y1 + 0.52*(bl_y2-bl_y1)) mark(acl_x, acl_y, "7. ACL Mucoid/Sprain", (255, 80, 200), 7, "right") # 8. Posterior tibial plateau BME — bottom center bmx = int(bl_x1 + 0.55*(bl_x2-bl_x1)) bmy = int(bl_y1 + 0.80*(bl_y2-bl_y1)) mark(bmx, bmy, "8. Tibial BME", (100, 255, 200), 8, "left") # ─── PANEL 4: Bottom-Right — Sagittal T2 (mid-joint) ───────────────────────── # 9. ACL partial tear / mucoid degeneration — center intercondylar acl2x = int(br_x1 + 0.48*(br_x2-br_x1)) acl2y = int(br_y1 + 0.50*(br_y2-br_y1)) mark(acl2x, acl2y, "9. ACL Partial Tear", (255, 80, 200), 9, "right") # 10. Infrapatellar (Hoffa's fat pad) fluid — mid-left of panel hfx = int(br_x1 + 0.25*(br_x2-br_x1)) hfy = int(br_y1 + 0.52*(br_y2-br_y1)) mark(hfx, hfy, "10. Hoffa's Fat Pad Fluid", (80, 200, 255), 10, "left") # 11. Posterior capsule fluid — bottom-right of panel pcfx = int(br_x1 + 0.68*(br_x2-br_x1)) pcfy = int(br_y1 + 0.72*(br_y2-br_y1)) mark(pcfx, pcfy, "11. Post. Capsule Fluid", (255, 200, 0), 11, "right") # ─── Legend box ─────────────────────────────────────────────────────────────── legend_items = [ ("1", "Baker's Cyst (Popliteal Cyst)", (255, 80, 80)), ("2", "Joint Effusion (Suprapatellar)", (255, 200, 0)), ("3", "Lateral Retinaculum Edema", (80, 200, 255)), ("4", "Lateral Patellar Subluxation/Tilt", (255, 130, 0)), ("5", "Patellar Articular Cartilage Thinning",(180, 255, 80)), ("6", "Suprapatellar Effusion (Sagittal)", (255, 200, 0)), ("7", "ACL Mucoid Degeneration/Sprain", (255, 80, 200)), ("8", "Posterior Tibial Plateau BME", (100, 255, 200)), ("9", "ACL Partial Tear (Mid-sagittal)", (255, 80, 200)), ("10","Hoffa's Fat Pad Fluid", (80, 200, 255)), ("11","Posterior Capsule Fluid", (255, 200, 0)), ] lx = int(0.03*w) ly = int(0.77*h) line_h = 32 box_w = int(0.55*w) box_h = line_h * (len(legend_items) + 1) + 16 draw.rectangle([lx-8, ly-8, lx+box_w, ly+box_h], fill=(0,0,0,210), outline=(200,200,200), width=2) draw.text((lx+4, ly), "MRI FINDINGS — ANNOTATED", fill=(255,255,255), font=font) ly += line_h + 4 for num, text, color in legend_items: draw.ellipse([lx, ly+2, lx+22, ly+24], outline=color, width=3) draw.text((lx+11, ly+13), num, fill=color, font=font_small, anchor="mm") draw.text((lx+30, ly+4), text, fill=(255,255,255), font=font_small) ly += line_h out_path = "/tmp/workspace/mri-annotation/annotated_mri.jpg" img.save(out_path, quality=95) print(f"Saved to {out_path}, size={os.path.getsize(out_path)//1024}KB") EOF
annotated mri
Image · JPG
| # | Finding | Significance |
|---|---|---|
| 1 | Baker's Cyst (Popliteal Cyst) | Posteromedial, between medial gastrocnemius & semimembranosus. Primary diagnosis. Secondary to intra-articular pathology. |
| 2 | Joint Effusion (Suprapatellar) | Large fluid collection distending the suprapatellar recess anteriorly — drives the Baker's cyst |
| 3 | Lateral Retinaculum Edema | Increased signal along lateral soft tissues — suggests patellar instability event or sprain |
| # | Finding | Significance |
|---|---|---|
| 4 | Lateral Patellar Subluxation/Tilt | Patella tilted laterally out of trochlear groove — suggests patellofemoral instability |
| 5 | Patellar Articular Cartilage Thinning | Thinning at lateral facet — early chondromalacia patellae |
| # | Finding | Significance |
|---|---|---|
| 6 | Suprapatellar Effusion | Confirmed on sagittal view — large anterior fluid pocket |
| 7 | ACL Mucoid Degeneration / Sprain | Hazy increased signal within ACL fibers — low-grade tear or mucoid change |
| 8 | Posterior Tibial Plateau Bone Marrow Edema (BME) | Subchondral hyperintensity — likely bone contusion from impaction injury |
| # | Finding | Significance |
|---|---|---|
| 9 | ACL Partial Tear | Thickened ACL with increased internal signal — partial tear pattern (mid-sagittal view) |
| 10 | Hoffa's Fat Pad Fluid | Fluid tracking posterior to patellar tendon into Hoffa's fat pad — indicates anterior impingement/inflammation |
| 11 | Posterior Capsule Fluid | Fluid along posterior joint capsule extending toward popliteal fossa |
Clinical note: This constellation of findings (ACL injury + bone marrow edema + lateral retinaculum tear + lateral patellar subluxation) is consistent with a pivoting knee injury or patellar dislocation event. Arthroscopic evaluation and orthopaedic review are recommended.