Primary diagnosis..?
pulmonary tuberculosis CT cystic reticulonodular bilateral young female
pulmonary tuberculosis CT chest findings
CT chest bilateral reticulonodular cystic pattern large right upper lobe cavity 35 year old female differential diagnosis
| Finding | Detail |
|---|---|
| Large right upper lobe cavity/bulla | Giant, thin-walled, air-filled space occupying most of the right upper hemithorax |
| Bilateral reticulonodular pattern | Diffuse interstitial thickening + innumerable small nodules throughout both lungs |
| Multiple small cystic lucencies | Scattered bilaterally, upper and middle zones |
| No frank consolidation | No dense lobar airspace disease |
| No pleural effusion | Clear costophrenic angles |
| Mediastinum | Grossly midline |
| Rank | Diagnosis | Key Supporting Features | Against |
|---|---|---|---|
| 1 | Advanced Pulmonary TB | Upper lobe cavity, bilateral nodular spread, endemic region, young adult | - |
| 2 | Pulmonary Langerhans Cell Histiocytosis (LCH) | Young adult, bilateral cysts + nodules, upper zone predominance, reticulonodular pattern | Almost exclusively in smokers; cysts in LCH tend to be irregular/stellate |
| 3 | Lymphangioleiomyomatosis (LAM) | Young female, bilateral cystic disease | LAM cysts are diffuse and uniform, no upper lobe cavity, no nodules |
| 4 | Miliary TB with cavitation | Bilateral nodular pattern | True miliary TB has uniform 1-2mm nodules without dominant cavity |
| 5 | Pulmonary Sarcoidosis | Bilateral reticulonodular, upper lobe involvement | Usually perilymphatic nodules, hilar lymphadenopathy |
| 6 | Fungal infection (Aspergillosis/Histoplasmosis) | Cavitation + bilateral spread | Less likely without immunocompromise |
Clinical note: This is a radiology-based analysis only. Final diagnosis requires correlation with clinical history, symptoms (cough duration, hemoptysis, weight loss, fever, night sweats), microbiological confirmation, and treating physician judgment. Always treat this as a presumptive TB case in this epidemiological setting until proven otherwise.
Mark the area of interest
mkdir -p /tmp/workspace/ct-annotation && curl -s -o /tmp/workspace/ct-annotation/ct_chest.jpg "https://d361swluvexzqs.cloudfront.net/chats-attachments/photo-1784649145585-1784649146564-q8g15h.jpg" && echo "Downloaded" && ls -lh /tmp/workspace/ct-annotation/
cd /tmp/workspace/ct-annotation && python3 - <<'EOF' from PIL import Image, ImageDraw, ImageFont import os img = Image.open("ct_chest.jpg") w, h = img.size print(f"Image size: {w} x {h}") img.save("ct_check.png") EOF
cd /tmp/workspace/ct-annotation && python3 - <<'EOF' from PIL import Image, ImageDraw, ImageFont import math img = Image.open("ct_chest.jpg").convert("RGBA") overlay = Image.new("RGBA", img.size, (0,0,0,0)) draw = ImageDraw.Draw(overlay) W, H = img.size # Image is 1200x1600 # The CT panel sits roughly from x=175 to x=1185, y=295 to y=990 # Within the CT panel: # Right upper lobe large cavity (patient's right = image LEFT side of CT) # roughly x: 310-540, y: 310-540 # Left lung reticulonodular (image RIGHT side of CT) # roughly x: 610-1050, y: 360-860 # Right lung reticulonodular (image LEFT side of CT, lower) # roughly x: 280-560, y: 510-860 # Bilateral cystic small lesions scattered # --- 1. Large RIGHT UPPER LOBE CAVITY (patient right = image left in coronal) --- # The big black space in the upper-left of the CT scan image cavity_x1, cavity_y1, cavity_x2, cavity_y2 = 300, 300, 565, 545 draw.rectangle([cavity_x1, cavity_y1, cavity_x2, cavity_y2], outline=(255, 50, 50, 230), width=5) # Arrow pointing into the cavity arrow_tip = (cavity_x1 + (cavity_x2-cavity_x1)//2, cavity_y1 - 10) arrow_base = (cavity_x1 + (cavity_x2-cavity_x1)//2, cavity_y1 - 55) draw.line([arrow_base, arrow_tip], fill=(255,50,50,230), width=4) # arrowhead ax, ay = arrow_tip draw.polygon([(ax-8, ay-18),(ax+8, ay-18),(ax, ay)], fill=(255,50,50,230)) # Label 1 draw.rectangle([188, 228, 560, 292], fill=(255,50,50,180)) draw.text((194, 234), "1. Large Apical Cavity (RUL)", fill=(255,255,255,255)) # --- 2. Bilateral reticulonodular pattern - RIGHT lung --- rn_r_x1, rn_r_y1, rn_r_x2, rn_r_y2 = 285, 540, 575, 870 draw.rectangle([rn_r_x1, rn_r_y1, rn_r_x2, rn_r_y2], outline=(50, 220, 50, 230), width=4) draw.rectangle([188, 878, 570, 935], fill=(50,180,50,180)) draw.text((194, 884), "2. Reticulonodular Opacities (R lung)", fill=(255,255,255,255)) # --- 3. Bilateral reticulonodular pattern - LEFT lung --- rn_l_x1, rn_l_y1, rn_l_x2, rn_l_y2 = 610, 340, 1060, 870 draw.rectangle([rn_l_x1, rn_l_y1, rn_l_x2, rn_l_y2], outline=(50, 180, 255, 230), width=4) draw.rectangle([610, 878, 1055, 935], fill=(50,130,220,180)) draw.text((616, 884), "3. Bilateral Reticulonodular + Cystic Changes (L lung)", fill=(255,255,255,255)) # --- 4. Small scattered cysts - mark a few with circles --- # Scattered in both lungs cyst_centers = [ (480, 620), (430, 700), (500, 760), (360, 660), (700, 430), (800, 510), (900, 600), (750, 680), (850, 750), (680, 800), (960, 450), (1020, 550), (940, 700) ] for cx, cy in cyst_centers: r = 18 draw.ellipse([cx-r, cy-r, cx+r, cy+r], outline=(255, 220, 0, 210), width=3) # Small legend for yellow circles draw.rectangle([188, 948, 570, 1000], fill=(200,170,0,180)) draw.text((194, 954), "O Small Cystic Lucencies / Micronodules", fill=(255,255,255,255)) # Compose result = Image.alpha_composite(img, overlay).convert("RGB") result.save("ct_annotated.jpg", quality=93) print("Saved ct_annotated.jpg") EOF
ct annotated
Image Β· JPG
| Marker | Color | Finding |
|---|---|---|
| 1 - Red box + arrow | π΄ | Large Apical Cavity (Right Upper Lobe) - thin-walled, air-filled, classic TB cavity |
| 2 - Green box | π’ | Reticulonodular Opacities - Right Lung - interstitial thickening + nodular spread |
| 3 - Blue box | π΅ | Bilateral Reticulonodular + Cystic Changes - Left Lung - diffuse involvement |
| Yellow circles | π‘ | Small Cystic Lucencies / Micronodules - scattered throughout both lungs |
Arrow the diagnoses
cd /tmp/workspace/ct-annotation && python3 - <<'EOF' from PIL import Image, ImageDraw, ImageFont import math img = Image.open("ct_chest.jpg").convert("RGBA") overlay = Image.new("RGBA", img.size, (0,0,0,0)) draw = ImageDraw.Draw(overlay) W, H = img.size # 1200 x 1600 def draw_arrow(draw, start, end, color, width=4, head_size=16): """Draw an arrow from start to end with arrowhead.""" draw.line([start, end], fill=color, width=width) # Arrowhead dx = end[0] - start[0] dy = end[1] - start[1] length = math.hypot(dx, dy) if length == 0: return ux, uy = dx/length, dy/length px, py = -uy, ux # perpendicular tip = end base1 = (tip[0] - ux*head_size + px*head_size//2, tip[1] - uy*head_size + py*head_size//2) base2 = (tip[0] - ux*head_size - px*head_size//2, tip[1] - uy*head_size - py*head_size//2) draw.polygon([tip, base1, base2], fill=color) def label_box(draw, x, y, text, color, text_color=(255,255,255,255), fontsize=22): """Draw a filled label box with text.""" chars = len(text) bw = chars * 13 + 16 bh = fontsize + 14 draw.rectangle([x, y, x+bw, y+bh], fill=color) draw.text((x+8, y+7), text, fill=text_color) # βββ FINDING 1: Large Apical Cavity (Right Upper Lobe) βββββββββββββββββββββββ # The big black cavity is top-left of the CT panel ~(310,310)-(545,545) cavity_center = (428, 425) label1_pos = (80, 165) draw_arrow(draw, (label1_pos[0]+320, label1_pos[1]+18), cavity_center, color=(255, 60, 60, 240), width=5, head_size=18) label_box(draw, label1_pos[0], label1_pos[1], "1. Apical Cavity (TB) - RUL", (200, 30, 30, 220)) # βββ FINDING 2: Bilateral Reticulonodular Infiltrates - Right lung ββββββββββββ # Right lung body, mid zone ~ (380, 680) rn_right = (390, 670) label2_pos = (30, 690) draw_arrow(draw, (label2_pos[0]+350, label2_pos[1]+18), rn_right, color=(50, 210, 60, 240), width=5, head_size=18) label_box(draw, label2_pos[0], label2_pos[1], "2. Reticulonodular Infiltrates (R)", (20, 150, 30, 220)) # βββ FINDING 3: Bilateral Reticulonodular Infiltrates - Left lung βββββββββββββ # Left lung body, mid zone ~ (820, 620) rn_left = (820, 610) label3_pos = (830, 195) draw_arrow(draw, (label3_pos[0]+20, label3_pos[1]+60), rn_left, color=(50, 160, 255, 240), width=5, head_size=18) label_box(draw, label3_pos[0], label3_pos[1], "3. Reticulonodular Infiltrates (L)", (20, 100, 200, 220)) # βββ FINDING 4: Small Cystic Lucencies / Micronodules (Right lung) βββββββββββ # Pick a representative cluster in right mid lung ~(460, 590) cyst_r = (463, 588) label4_pos = (30, 560) draw_arrow(draw, (label4_pos[0]+320, label4_pos[1]+18), cyst_r, color=(255, 200, 0, 240), width=4, head_size=15) label_box(draw, label4_pos[0], label4_pos[1], "4. Cystic Lucencies / Micronodules", (180, 140, 0, 220)) # βββ FINDING 5: Bilateral Cystic Changes - Left lung representative ββββββββββ cyst_l = (940, 500) label5_pos = (720, 390) draw_arrow(draw, (label5_pos[0]+180, label5_pos[1]+18), cyst_l, color=(255, 200, 0, 240), width=4, head_size=15) label_box(draw, label5_pos[0], label5_pos[1], "4. Cystic Changes (L)", (180, 140, 0, 220)) # βββ FINDING 6: Hematogenous/Endobronchial Spread markers βββββββββββββββββββ # Lower zone bilateral spread spread_r = (340, 800) spread_l = (870, 800) label6_pos = (30, 840) draw_arrow(draw, (label6_pos[0]+320, label6_pos[1]+18), spread_r, color=(255, 120, 0, 240), width=4, head_size=15) label_box(draw, label6_pos[0], label6_pos[1], "5. Bilateral Spread (endobronchial)", (180, 70, 0, 220)) draw_arrow(draw, (label6_pos[0]+320+400, label6_pos[1]+18), spread_l, color=(255, 120, 0, 240), width=4, head_size=15) # βββ Diagnosis Banner at bottom ββββββββββββββββββββββββββββββββββββββββββββββ draw.rectangle([160, 1010, 1155, 1080], fill=(30, 30, 30, 210)) draw.text((170, 1018), "PRIMARY Dx: Advanced Pulmonary Tuberculosis (PTB)", fill=(255,80,80,255)) draw.text((170, 1048), "Pattern: Apical Cavity + Bilateral Reticulonodular + Cystic Dissemination", fill=(220,220,100,255)) # Compose and save result = Image.alpha_composite(img, overlay).convert("RGB") result.save("ct_arrowed_diagnosis.jpg", quality=94) print("Saved ct_arrowed_diagnosis.jpg") EOF
ct arrowed diagnosis
Image Β· JPG
| # | Color | Finding | Diagnostic Significance |
|---|---|---|---|
| 1 | π΄ Red | Apical Cavity - RUL | Classic TB cavity - upper lobe predilection due to high Oβ tension |
| 2 | π’ Green | Reticulonodular Infiltrates (Right lung) | Interstitial spread from primary focus |
| 3 | π΅ Blue | Reticulonodular Infiltrates (Left lung) | Bilateral involvement - hematogenous/endobronchial dissemination |
| 4 | π‘ Yellow | Cystic Lucencies / Micronodules (both lungs) | Post-inflammatory pneumatoceles or early secondary cavitation |
| 5 | π Orange | Bilateral Lower Zone Spread | Endobronchial drop-out spread of TB - carries high infectivity risk |