Role of chest X ray in cardiac disease evaluation and and five-step approach for thoracic wall abnormality, cardiac size, pulmonary vascularity, as well as specific sign for specific chamber enlargement and great vessel sign for... Radiology, resident preparing for DNB. Final examination. 10 marks question answer.
cardiac silhouette chest X-ray chamber enlargement cardiac contour

This diagnostic image is an anteroposterior (AP) chest radiograph showing moderate cardiomegaly in a human patient. The cardiac silhouette is enlarged with a cardiothoracic ratio of approximately 0.60, primarily involving the right-sided cardiac chambers as evidenced by the prominence of the atrial and ventricular arches. Notable clinical features include a widened mediastinal contour and progressive cardiac enlargement post-surgical correction. Despite the increased cardiac area, the pulmonary vascular markings appear within normal limits, showing no clear signs of pulmonary venous congestion or edema. The bony structures of the rib cage, the trachea, and the diaphragmatic contours are visible and appear structurally intact. This x-ray is a key educational example of postoperative cardiac monitoring and the visual manifestation of selective chamber enlargement in cardiovascular pathology.

This diagnostic image is a posterior-anterior (PA) chest X-ray demonstrating significant cardiothoracic pathology. The primary finding is marked cardiomegaly with a widened cardiac silhouette. Specific chamber enlargement is visible, including a prominent left atrial contour along the mid-left heart border and signs of biventricular enlargement. In the pulmonary fields, there is evidence of pulmonary venous congestion and interstitial edema, characterized by cephalization of the pulmonary vessels (prominence of upper lobe vessels) and increased hazy opacities throughout both lung fields. Sternal wires and a mitral valve prosthesis are visible, indicating prior cardiac surgery. This image is an educational example of advanced heart failure and valvular heart disease manifestations on radiography, illustrating the relationship between cardiac structural changes and secondary pulmonary vascular congestion.
pulmonary vascularity cephalization chest X-ray heart failure
A narrowed AP thoracic diameter is the most common cause of an innocent murmur in young adults.
| Chamber | CXR Signs |
|---|---|
| Left Atrium (LA) | Double density sign (retrocardiac opacity); widening of carina >70°; elevation of left main bronchus; posterior esophageal displacement (lateral view); convexity/bulge at LAA segment (3rd mogul sign) |
| Left Atrial Appendage (LAA) | Straightening or convexity of the left heart border just below the pulmonary artery segment ("third mogul/bump") |
| Right Atrium (RA) | Increased convexity and rightward bulge of the right heart border; globular right heart border |
| Left Ventricle (LV) | Downward, outward, and leftward displacement of the cardiac apex; boot-shaped heart in pressure overload |
| Right Ventricle (RV) | Filling of retrosternal space on lateral view; upward and leftward displacement of cardiac apex; RV enlargement rotates the heart leftward making the pulmonary trunk appear more prominent |
| Both Ventricles (biventricular) | Globular cardiomegaly with CTR > 0.5; apex displaced downward and leftward |
| Pattern | Cause | CXR Appearance |
|---|---|---|
| Increased PBF (Shunt vascularity) | L-to-R shunts: ASD, VSD, PDA | Uniform bilateral vessel dilatation; right descending pulmonary artery > 15-16 mm; "equalization" of upper and lower lobe vessels |
| Decreased PBF | PS + VSD (ToF), isolated right heart failure | Smaller, shorter pulmonary arteries; more radiolucent lungs; right descending PA < 9 mm |
| Pattern | Mechanism | Causes |
|---|---|---|
| Cephalization (redistribution) | Post-capillary PH: pulmonary venous hypertension constricts lower-lobe vessels; upper-lobe vessels dilate | Mitral stenosis, increased LVEDP, severe MR, LV failure |
| Centralization | Pre-capillary PH: pulmonary trunk and central arteries dilate; peripheral arteries prune ("pruning") | Primary PH, Eisenmenger syndrome, recurrent PE, severe emphysema |
| Lateralization | Unilateral obstruction: blood forced into one lung | Massive unilateral PE; jet effect in congenital valvular PS (flow to left lung) |
| Localization | Localized vascular abnormality | Pulmonary arteriovenous fistula |
| Collateralization | Extreme oligemia with bronchial collaterals | Pseudotruncus arteriosus, pulmonary atresia |
| Finding | Diagnosis |
|---|---|
| Selective dilatation of ascending aorta | Valvular aortic stenosis (post-stenotic dilatation) |
| Generalized dilatation of entire thoracic aorta | Aortic regurgitation and/or systemic hypertension |
| "3 sign" on aortic knob (upper bulge = pre-stenotic; lower bulge = post-stenotic) + "E sign" on barium esophagogram | Coarctation of the aorta |
| Small aortic knob | ASD, mitral stenosis (LV "crowded out" by RV) |
| Heavy calcification of ascending aortic aneurysm | Luetic (syphilitic) aortitis |
| Widened mediastinum/aortic knob | Aortic dissection, aortic aneurysm |
| Finding | Diagnosis |
|---|---|
| Enlarged pulmonary trunk | RV enlargement (most common); MS; ASD; primary PH |
| Concave/absent pulmonary trunk segment | Tetralogy of Fallot; pulmonary atresia |
Note: Pulmonary trunk prominence is a reliable secondary sign of RV enlargement, EXCEPT in: (1) ToF (RV hypertrophy but hypoplastic pulmonary trunk), (2) idiopathic pulmonary artery dilatation, (3) PDA (normal RV), (4) straight-back syndrome/pectus excavatum/scoliosis (AP compression displaces and falsely enlarges PA).
| Chamber | Key Radiographic Signs |
|---|---|
| LA | Double density sign; widened carina (>70°); elevated left main bronchus; LAA convexity (3rd mogul); posterior esophageal displacement |
| LV | Downward/leftward apex; increased CTR; boot shape (pressure overload) |
| RA | Convex right heart border; rightward bulge |
| RV | Filling of retrosternal space (lateral); apex elevation; pulmonary trunk prominence; cardiac rotation leftward |
| Both | Globular cardiomegaly; CTR > 0.5 |

Innumerate the structure forming right and left heart border on plain chest radiograph, PA view. Discuss the feature of enlargement of various cardiac chamber on plain radiograph. DNB radiology question answer. For 10 marks.
cardiac borders PA chest radiograph anatomy left right

This diagnostic image is a posterior-anterior (PA) chest radiograph demonstrating a focal pulmonary abnormality. A prominent 3 cm radiopaque mass is visible in the right upper lobe, positioned superior to the minor fissure (indicated by a blue horizontal arrow). The mass exhibits irregular borders with an infiltrative appearance extending medially toward the right hilum. The right hilum and right paratracheal soft tissues appear prominent, suggesting possible lymphadenopathy. In contrast, the left lung field is clear. Anatomical landmarks including the trachea, mediastinal contours, and hemidiaphragms are visible, with the right hemidiaphragm normally positioned slightly higher than the left. The cardiac silhouette and skeletal structures of the thorax, including the clavicles and ribs, appear unremarkable. This clinical photograph is highly relevant for medical education regarding the radiological presentation of primary bronchogenic carcinoma, specifically pulmonary adenocarcinoma. It illustrates key diagnostic findings such as lung masses, hilar prominence, and the importance of localized lobe anatomy in chest imaging interpretation.

A posterior-anterior (PA) chest X-ray illustrating the thoracic cavity and skeletal structures. The radiograph reveals a distinct anatomical anomaly: a hypoplastic or unusually small right first rib compared to the contralateral side. The primary anatomical landmarks are visible, including the clavicles, rib cage, and vertebral column. The lung fields appear largely clear and radiolucent, with normal bronchovascular markings. The cardiac silhouette is centrally located with well-defined borders and normal size. The diaphragmatic domes are intact, with a clear gastric air bubble visible beneath the left hemidiaphragm. Near the left clavicle, a radiopaque marker or artifact is noted. Clinically, such variations in the first rib anatomy are significant in the context of thoracic outlet syndrome or venous compression (Paget-Schroetter syndrome). This diagnostic image serves as an educational example of rib morphology variations and their potential relationship to vascular pathologies in the thoracic inlet.
left atrial enlargement double density sign chest X-ray mitral stenosis
right ventricular enlargement boot shaped heart tetralogy of Fallot chest radiograph
cardiomegaly biventricular enlargement PA chest X-ray heart failure

This diagnostic image is a posterior-anterior (PA) chest X-ray demonstrating significant cardiothoracic pathology. The primary finding is marked cardiomegaly with a widened cardiac silhouette. Specific chamber enlargement is visible, including a prominent left atrial contour along the mid-left heart border and signs of biventricular enlargement. In the pulmonary fields, there is evidence of pulmonary venous congestion and interstitial edema, characterized by cephalization of the pulmonary vessels (prominence of upper lobe vessels) and increased hazy opacities throughout both lung fields. Sternal wires and a mitral valve prosthesis are visible, indicating prior cardiac surgery. This image is an educational example of advanced heart failure and valvular heart disease manifestations on radiography, illustrating the relationship between cardiac structural changes and secondary pulmonary vascular congestion.

This composite clinical diagnostic image includes a chest X-ray (A) and a 12-lead electrocardiogram (B). Panel A shows a posterior-anterior (PA) view of the thorax, demonstrating a markedly enlarged cardiac silhouette consistent with cardiomegaly. The lung fields exhibit increased bronchovascular markings and subtle bilateral interstitial opacities, characteristic of mild pulmonary congestion. Panel B displays a 12-lead ECG strip showing a regular sinus rhythm. Notably, there is an absence of ST-segment elevation or significant ischemic changes across the limb leads (I, II, III, aVR, aVL, aVF) and precordial leads (V1-V6), which clinically helps rule out acute ST-elevation myocardial infarction (STEMI) in the context of acute heart failure. The primary educational focus is the correlation between radiological findings of biventricular enlargement/congestive heart failure and the corresponding baseline electrical activity of the heart.

This diagnostic image is a posterior-anterior (PA) chest X-ray of a human adult. The primary finding is significant global cardiomegaly, evidenced by a widened cardiac silhouette that occupies more than 50% of the thoracic diameter, suggesting multi-chamber enlargement. Additionally, the pulmonary vasculature is prominently increased, indicating pulmonary venous hypertension or congestion. This is characterized by increased vascular density and vessel visibility extending into the peripheral lung fields. The hilar regions appear enlarged and dense, consistent with vascular engorgement. The costophrenic angles appear relatively clear on this view, and the bony structures of the thorax are intact. This clinical photograph is used in medical education to illustrate the radiological hallmarks of congestive heart failure or advanced valvular heart disease, such as mitral regurgitation or chronic biventricular dilation.
| Structure | Level | Notes |
|---|---|---|
| 1. Superior vena cava (SVC) | Upper right border | Forms the right paratracheal stripe; straight or gently convex margin |
| 2. Ascending aorta | Upper-mid right | Partially contributes in elderly/hypertensive patients; curves into the arch |
| 3. Right atrium (RA) | Lower right border | Forms the entire lower right cardiac border; a gently convex curvilinear margin extending from the SVC to the right cardiophrenic angle |
The right cardiophrenic angle is formed by the RA and the right hemidiaphragm. The inferior vena cava (IVC) enters the RA at this level and may be faintly visible as a short oblique shadow.
| Structure | Level | Notes |
|---|---|---|
| 1. Aortic knob (aortic arch) | Uppermost left | The transverse arch of the aorta as it turns from ascending to descending; forms a distinct rounded convexity. Normally measures < 3.5 cm in width |
| 2. Main pulmonary artery (pulmonary trunk) | Just below aortic knob | A gentle convexity below the aortic knob; the "pulmonary bay" or "pulmonary segment" |
| 3. Left atrial appendage (LAA) | Between PA and LV | Normally inapparent or produces only a slight straight/flat segment just below the pulmonary trunk |
| 4. Left ventricle (LV) | Lower left border | Forms the bulk of the left heart border - a smooth, gently convex margin tapering to the cardiac apex. The apex normally points downward and to the left, resting on the left hemidiaphragm |
These four structures from top to bottom on the left border are sometimes called the "four moguls": aortic knob, pulmonary trunk, LAA, and LV.
| Chamber | Key PA View Signs | Additional/Lateral Signs |
|---|---|---|
| LA | Double density sign; subcarinal angle >70°; elevated left main bronchus; LAA convexity (3rd mogul) | Posterior esophageal displacement on barium |
| LAA | Straightening or convexity below pulmonary artery segment | - |
| LV | Apex displaced downward/laterally; rounding of left border; increased CTR | LV projects posterior to IVC on lateral |
| RV | Elevated apex; prominent pulmonary trunk; boot shape (ToF) | Fills retrosternal space on lateral |
| RA | Convex, rightward bulge of right border; increased height of right arc | - |
| Biventricular | Global cardiomegaly (CTR >0.5); all borders enlarged | - |
| Sign | Chamber/Structure | Diagnosis |
|---|---|---|
| Double density sign | LA | LA enlargement (mitral stenosis, MR) |
| Third mogul/bump | LAA | LAA enlargement (mitral valve disease) |
| Coeur en sabot (boot shape) | RV + concave pulmonary bay | Tetralogy of Fallot |
| Globular/water-bottle shape | All chambers | Pericardial effusion |
| Widened right border + straight left border | RA + LA | Severe MS with TR |
| LV aneurysm bulge | LV | LV aneurysm (post-MI) - localized bulge on left border |
| Elevated cardiac silhouette + sub-diaphragmatic lucency | - | Congenital absence of pericardium |


Create a PDF reference in 2 or 3 pages card on cardiac chamber enlargement signs for rapid exam review
ls -la /tmp/workspace/ 2>/dev/null || mkdir -p /tmp/workspace && echo "workspace ready"
mkdir -p /tmp/workspace/cardiac-xray-card && python3 << 'PYEOF' from reportlab.platypus import ( SimpleDocTemplate, Table, TableStyle, Paragraph, Spacer, HRFlowable, KeepTogether ) from reportlab.lib.styles import getSampleStyleSheet, ParagraphStyle from reportlab.lib import colors from reportlab.lib.units import mm, cm from reportlab.lib.pagesizes import A4 from reportlab.lib.enums import TA_CENTER, TA_LEFT, TA_JUSTIFY from reportlab.platypus import PageBreak OUTPUT = "/tmp/workspace/cardiac-xray-card/Cardiac_Chamber_Enlargement_CXR.pdf" # ── Colour palette (medical/academic feel) ────────────────────────── C_NAVY = colors.HexColor("#0A2540") C_BLUE = colors.HexColor("#1565C0") C_SKY = colors.HexColor("#E3F0FF") C_TEAL = colors.HexColor("#006D77") C_TEAL_LT = colors.HexColor("#D9F0F2") C_AMBER = colors.HexColor("#B45309") C_AMBER_LT= colors.HexColor("#FEF3C7") C_RED = colors.HexColor("#B91C1C") C_RED_LT = colors.HexColor("#FEE2E2") C_GREEN = colors.HexColor("#166534") C_GREEN_LT= colors.HexColor("#DCFCE7") C_PURPLE = colors.HexColor("#6B21A8") C_PURPLE_LT=colors.HexColor("#F3E8FF") C_GREY_LT = colors.HexColor("#F1F5F9") C_GREY = colors.HexColor("#64748B") C_WHITE = colors.white C_BLACK = colors.HexColor("#1E293B") W, H = A4 # 595 x 842 pt MARGIN = 14*mm doc = SimpleDocTemplate( OUTPUT, pagesize=A4, leftMargin=MARGIN, rightMargin=MARGIN, topMargin=12*mm, bottomMargin=12*mm, title="Cardiac Chamber Enlargement – CXR Signs", author="DNB Radiology Quick Reference" ) styles = getSampleStyleSheet() def S(name, **kw): return ParagraphStyle(name, parent=styles["Normal"], **kw) # ── Custom styles ──────────────────────────────────────────────────── sTitle = S("sTitle", fontSize=17, leading=21, textColor=C_WHITE, fontName="Helvetica-Bold", alignment=TA_CENTER, spaceAfter=2) sSubtitle = S("sSubtitle", fontSize=9, leading=12, textColor=colors.HexColor("#CBD5E1"), fontName="Helvetica", alignment=TA_CENTER) sSec = S("sSec", fontSize=10, leading=13, textColor=C_WHITE, fontName="Helvetica-Bold", alignment=TA_CENTER) sBullet = S("sBullet", fontSize=8.2, leading=11.5, textColor=C_BLACK, fontName="Helvetica", leftIndent=6, spaceAfter=1) sBold = S("sBold", fontSize=8.2, leading=11.5, textColor=C_BLACK, fontName="Helvetica-Bold") sNote = S("sNote", fontSize=7.5, leading=10.5, textColor=C_GREY, fontName="Helvetica-Oblique", alignment=TA_JUSTIFY) sKeyHdr = S("sKeyHdr", fontSize=9, leading=12, textColor=C_WHITE, fontName="Helvetica-Bold", alignment=TA_CENTER) sKeyCell = S("sKeyCell", fontSize=8, leading=11, textColor=C_BLACK, fontName="Helvetica") sKeyCellB = S("sKeyCellB", fontSize=8, leading=11, textColor=C_BLACK, fontName="Helvetica-Bold") sFooter = S("sFooter", fontSize=7, leading=9, textColor=C_GREY, fontName="Helvetica-Oblique", alignment=TA_CENTER) COL_W = (W - 2*MARGIN) # usable width def bullet(text, bold_prefix=None): if bold_prefix: return Paragraph(f"<b>\u2022 {bold_prefix}</b> {text}", sBullet) return Paragraph(f"\u2022 {text}", sBullet) def sp(h=3): return Spacer(1, h) def hr(color=C_BLUE, thickness=0.5): return HRFlowable(width="100%", thickness=thickness, color=color, spaceAfter=3, spaceBefore=3) # ═══════════════════════════════════════════════════════════════════ # PAGE 1 # ═══════════════════════════════════════════════════════════════════ elems = [] # ── HEADER BANNER ─────────────────────────────────────────────────── header_data = [[ Paragraph("CARDIAC CHAMBER ENLARGEMENT", sTitle), Paragraph("CXR Signs · Rapid Exam Reference · DNB Radiology", sSubtitle), ]] hdr_tbl = Table([[Paragraph("CARDIAC CHAMBER ENLARGEMENT", sTitle)], [Paragraph("CXR Signs · PA View · DNB Radiology Quick Reference", sSubtitle)]], colWidths=[COL_W]) hdr_tbl.setStyle(TableStyle([ ('BACKGROUND', (0,0), (-1,-1), C_NAVY), ('ROWPADDING', (0,0), (-1,-1), 6), ('TOPPADDING', (0,0), (-1, 0), 10), ('BOTTOMPADDING',(0,-1),(-1,-1), 8), ('ROUNDEDCORNERS', [5]), ])) elems.append(hdr_tbl) elems.append(sp(5)) # ── CARDIAC BORDERS TABLE ──────────────────────────────────────────── borders_title = Table([[Paragraph("CARDIAC BORDERS ON PA CXR", sSec)]], colWidths=[COL_W]) borders_title.setStyle(TableStyle([ ('BACKGROUND', (0,0),(-1,-1), C_TEAL), ('ROWPADDING', (0,0),(-1,-1), 5), ('ROUNDEDCORNERS',[4]), ])) elems.append(borders_title) elems.append(sp(4)) # two-column layout for borders def cell(content, bg=C_WHITE, pad=6): t = Table([[content]], colWidths=[(COL_W-4)/2]) t.setStyle(TableStyle([ ('BACKGROUND',(0,0),(-1,-1), bg), ('BOX',(0,0),(-1,-1), 0.5, C_TEAL), ('ROWPADDING',(0,0),(-1,-1), pad), ('VALIGN',(0,0),(-1,-1),'TOP'), ])) return t RIGHT_content = [ Paragraph("<b>RIGHT CARDIAC BORDER</b> (Top → Bottom)", S("rh", parent=sBold, textColor=C_TEAL, fontSize=8.5)), sp(3), bullet("Superior Vena Cava (SVC)", "1."), bullet("Ascending Aorta — partial (elderly)", "2."), bullet("Right Atrium (RA) — entire lower right border", "3."), sp(2), Paragraph("RA → right cardiophrenic angle (IVC entry point)", sNote), ] LEFT_content = [ Paragraph("<b>LEFT CARDIAC BORDER</b> (Top → Bottom)", S("lh", parent=sBold, textColor=C_BLUE, fontSize=8.5)), sp(3), bullet("Aortic Knob (Aortic Arch)", "1."), bullet("Main Pulmonary Artery (Pulmonary Trunk)", "2."), bullet("Left Atrial Appendage (LAA) — normally flat/inconspicuous", "3."), bullet("Left Ventricle (LV) — bulk of left border + apex", "4."), sp(2), Paragraph("Mnemonic: <b>A – P – L – L</b> (Aorta · PA · LAA · LV)", sNote), ] def multi_cell(items, bg, border_col, w): rows = [[i] for i in items] t = Table(rows, colWidths=[w]) t.setStyle(TableStyle([ ('BACKGROUND',(0,0),(-1,-1), bg), ('BOX',(0,0),(-1,-1), 0.8, border_col), ('LEFTPADDING',(0,0),(-1,-1), 7), ('RIGHTPADDING',(0,0),(-1,-1), 7), ('TOPPADDING',(0,0),(-1,-1), 2), ('BOTTOMPADDING',(0,0),(-1,-1), 2), ('TOPPADDING',(0,0),(-1,0), 7), ('BOTTOMPADDING',(0,-1),(-1,-1), 7), ('ROUNDEDCORNERS',[4]), ])) return t HW = (COL_W - 5) / 2 borders_row = Table( [[multi_cell(RIGHT_content, C_TEAL_LT, C_TEAL, HW), multi_cell(LEFT_content, C_SKY, C_BLUE, HW)]], colWidths=[HW, HW], hAlign='LEFT' ) borders_row.setStyle(TableStyle([ ('LEFTPADDING',(0,0),(-1,-1), 0), ('RIGHTPADDING',(0,0),(-1,-1), 0), ('VALIGN',(0,0),(-1,-1),'TOP'), ('COLPADDING', (0,0),(0,-1), 0), ('INNERGRID',(0,0),(-1,-1), 0, C_WHITE), ])) elems.append(borders_row) elems.append(sp(6)) # ── CHAMBER ENLARGEMENT SECTIONS ──────────────────────────────────── def chamber_block(title, color_hdr, color_bg, color_border, signs_pa, signs_extra, causes): title_row = Table([[Paragraph(title, sSec)]], colWidths=[COL_W]) title_row.setStyle(TableStyle([ ('BACKGROUND',(0,0),(-1,-1), color_hdr), ('ROWPADDING',(0,0),(-1,-1), 4), ('ROUNDEDCORNERS',[4]), ])) # Three sub-columns: PA Signs | Additional Signs | Causes cw = [(COL_W - 4) * 0.42, (COL_W - 4) * 0.32, (COL_W - 4) * 0.26] pa_items = [Paragraph("<b>PA VIEW SIGNS</b>", S("ph", parent=sBold, textColor=color_hdr, fontSize=7.8))] + \ [sp(2)] + [bullet(s) for s in signs_pa] ex_items = [Paragraph("<b>LATERAL / EXTRA SIGNS</b>", S("eh", parent=sBold, textColor=color_hdr, fontSize=7.8))] + \ [sp(2)] + [bullet(s) for s in signs_extra] ca_items = [Paragraph("<b>CAUSES</b>", S("ch", parent=sBold, textColor=color_hdr, fontSize=7.8))] + \ [sp(2)] + [bullet(s) for s in causes] def sub_cell(items, w, bg): rows = [[i] for i in items] t = Table(rows, colWidths=[w]) t.setStyle(TableStyle([ ('BACKGROUND',(0,0),(-1,-1), bg), ('LEFTPADDING',(0,0),(-1,-1), 6), ('RIGHTPADDING',(0,0),(-1,-1), 6), ('TOPPADDING',(0,0),(-1,-1), 2), ('BOTTOMPADDING',(0,0),(-1,-1), 2), ('TOPPADDING',(0,0),(0,0), 5), ('BOTTOMPADDING',(0,-1),(0,-1), 5), ])) return t inner = Table( [[sub_cell(pa_items, cw[0], bg=color_bg), sub_cell(ex_items, cw[1], bg=color_bg), sub_cell(ca_items, cw[2], bg=colors.HexColor("#F8FAFC"))]], colWidths=cw ) inner.setStyle(TableStyle([ ('BOX',(0,0),(-1,-1), 0.8, color_border), ('INNERGRID',(0,0),(-1,-1), 0.4, color_border), ('VALIGN',(0,0),(-1,-1),'TOP'), ('LEFTPADDING',(0,0),(-1,-1), 0), ('RIGHTPADDING',(0,0),(-1,-1), 0), ('TOPPADDING',(0,0),(-1,-1), 0), ('BOTTOMPADDING',(0,0),(-1,-1), 0), ('ROUNDEDCORNERS',[4]), ])) return [title_row, sp(3), inner, sp(5)] # ── LEFT ATRIUM ────────────────────────────────────────────────────── elems += chamber_block( "LEFT ATRIUM (LA) ENLARGEMENT", C_BLUE, C_SKY, C_BLUE, signs_pa=[ "Double density sign — retrocardiac opacity (2nd inner curvilinear shadow) on right side of heart", "Widening of subcarinal (carinal) angle > 70°", "Elevation of left main bronchus (horizontal left bronchus)", "LAA convexity — straightening or bulge below pulmonary artery = Third mogul sign", "Increased CTR if massive LA", ], signs_extra=[ "Posterior esophageal displacement (barium swallow / lateral CXR)", "Splaying of carina on lateral view", "Posterior displacement of descending aorta", ], causes=["Mitral stenosis", "Mitral regurgitation", "LV failure", "Atrial fibrillation (chronic)"] ) # ── LEFT VENTRICLE ─────────────────────────────────────────────────── elems += chamber_block( "LEFT VENTRICLE (LV) ENLARGEMENT", C_PURPLE, C_PURPLE_LT, C_PURPLE, signs_pa=[ "Cardiac apex displaced downward, outward and to the left (drooping apex)", "Rounding and increased convexity of left cardiac border", "Increased CTR > 0.5 (volume overload > pressure overload)", "Localized left border bulge = LV aneurysm (post-MI)", "Boot-shaped heart in pressure overload (AS)", ], signs_extra=[ "LV projects posterior to IVC on lateral view", "Posterior cardiac border extends > 1.8 cm behind IVC on lateral", "Volume overload: gross cardiomegaly; pressure overload: near-normal size", ], causes=["Aortic regurgitation", "Mitral regurgitation", "Dilated CMP", "Aortic stenosis", "Hypertension", "Post-MI aneurysm"] ) elems.append(PageBreak()) # ═══════════════════════════════════════════════════════════════════ # PAGE 2 # ═══════════════════════════════════════════════════════════════════ # Repeat compact header hdr2 = Table([[Paragraph("CARDIAC CHAMBER ENLARGEMENT — CXR SIGNS | Page 2", sTitle)]], colWidths=[COL_W]) hdr2.setStyle(TableStyle([ ('BACKGROUND',(0,0),(-1,-1), C_NAVY), ('ROWPADDING',(0,0),(-1,-1), 7), ('ROUNDEDCORNERS',[5]), ])) elems.append(hdr2) elems.append(sp(5)) # ── RIGHT VENTRICLE ────────────────────────────────────────────────── elems += chamber_block( "RIGHT VENTRICLE (RV) ENLARGEMENT", C_AMBER, C_AMBER_LT, C_AMBER, signs_pa=[ "Cardiac apex elevated and displaced upward/leftward", "Prominent pulmonary trunk (cardiac rotation brings PA laterally)", "Coeur en sabot (boot-shaped heart) — RV hypertrophy + concave PA bay = Tetralogy of Fallot", "Widened right cardiac contour if RV + RA both enlarged", "Reduced pulmonary vascularity (if associated PS/ToF)", ], signs_extra=[ "Retrosternal airspace obliteration on lateral view (most sensitive sign)", "RV-sternum contact > 1/3 of sternal height on lateral", "Diaphragmatic surface occupied by RV (not LV) on lateral", ], causes=["Pulmonary hypertension", "Cor pulmonale (COPD)", "ASD / VSD", "Pulmonary stenosis", "Tetralogy of Fallot", "Tricuspid regurgitation"] ) # ── RIGHT ATRIUM ───────────────────────────────────────────────────── elems += chamber_block( "RIGHT ATRIUM (RA) ENLARGEMENT", C_RED, C_RED_LT, C_RED, signs_pa=[ "Increased convexity and rightward bulging of right heart border", "Increased height of right cardiac arc", "Right cardiophrenic angle becomes rounded and widened", "Globular right heart border extending from SVC to cardiophrenic angle", "Massive RA + straightened left border = severe MS with secondary TR", ], signs_extra=[ "Dilated right cardiac border without pulmonary artery segment enlargement = tricuspid stenosis", "Ebstein anomaly: massively dilated RA with decreased pulmonary vascularity", ], causes=["Tricuspid regurgitation", "Tricuspid stenosis", "Right heart failure", "ASD", "Ebstein anomaly", "Severe MS → TR"] ) # ── BIVENTRICULAR ──────────────────────────────────────────────────── elems += chamber_block( "BIVENTRICULAR ENLARGEMENT", C_GREEN, C_GREEN_LT, C_GREEN, signs_pa=[ "Global cardiomegaly — CTR > 0.5", "All cardiac borders enlarged: right border bulges right, left border bulges left", "Apex displaced downward AND rightward border prominent", "Flask / globular shape in dilated cardiomyopathy", "Pulmonary venous congestion + Kerley B lines (CHF)", ], signs_extra=[ "Combined retrosternal filling + posterior cardiac extension on lateral", "Pericardial effusion mimics biventricular enlargement — water-bottle shape with sharp borders", ], causes=["Dilated cardiomyopathy", "Advanced valvular disease (MR + AR)", "End-stage CHF", "Myocarditis", "Viral cardiomyopathy"] ) elems.append(sp(4)) elems.append(hr(C_GREY, thickness=0.8)) elems.append(sp(3)) # ── QUICK-REFERENCE DIAGNOSTIC SIGNS TABLE ────────────────────────── qr_title = Table([[Paragraph("PATHOGNOMONIC & CLASSIC CXR SIGNS — QUICK REFERENCE", sSec)]], colWidths=[COL_W]) qr_title.setStyle(TableStyle([ ('BACKGROUND',(0,0),(-1,-1), C_NAVY), ('ROWPADDING',(0,0),(-1,-1), 5), ('ROUNDEDCORNERS',[4]), ])) elems.append(qr_title) elems.append(sp(4)) qr_data = [ [Paragraph("SIGN", sKeyHdr), Paragraph("STRUCTURE", sKeyHdr), Paragraph("DIAGNOSIS", sKeyHdr)], ["Double density sign", "Left atrium", "LA enlargement (MS, MR)"], ["Third mogul / LAA bump", "Left atrial appendage", "Mitral valve disease"], ["Widened subcarinal angle > 70°", "Left atrium / Carina", "LA enlargement"], ["Coeur en sabot (boot shape)", "RV hypertrophy + absent PA", "Tetralogy of Fallot"], ["Water-bottle / flask shape", "Pericardial sac", "Pericardial effusion"], ["Drooping/downward apex", "Left ventricle", "LV dilatation (AR, MR, DCM)"], ["Elevated uplifted apex", "Right ventricle pushing LV up", "RV enlargement"], ["Localized left border bulge", "Left ventricle wall", "LV aneurysm (post-MI)"], ["Widened Rt border + straight Lt border", "RA enlargement + LA/PA", "Severe MS → TR"], ["3-sign / E-sign on aorta/esophagus", "Aortic arch", "Coarctation of aorta"], ["Retrosternal space obliteration", "Right ventricle (lateral)", "RV enlargement"], ["Pruning of peripheral vessels", "Pulmonary arteries", "Pre-capillary PH (Eisenmenger)"], ["Kerley B lines", "Interstitial / lymphatics", "Pulmonary venous hypertension Gr II"], ["Butterfly / bat-wing edema", "Alveoli", "Acute LV failure / alveolar oedema"], ] def qr_fmt(row_idx, text): if row_idx == 0: return Paragraph(text, sKeyHdr) elif row_idx % 2 == 0: return Paragraph(text, S(f"ev{row_idx}", parent=sKeyCell, backColor=C_GREY_LT)) else: return Paragraph(text, sKeyCell) qr_rows = [] for i, row in enumerate(qr_data): if i == 0: qr_rows.append([Paragraph(c, sKeyHdr) for c in row]) else: qr_rows.append([Paragraph(c, sKeyCell) for c in row]) cw3 = [COL_W * 0.35, COL_W * 0.28, COL_W * 0.37] qr_tbl = Table(qr_rows, colWidths=cw3, repeatRows=1) row_styles = [ ('BACKGROUND', (0,0), (-1,0), C_NAVY), ('TEXTCOLOR', (0,0), (-1,0), C_WHITE), ('FONTNAME', (0,0), (-1,0), 'Helvetica-Bold'), ('FONTSIZE', (0,0), (-1,-1), 8), ('ROWPADDING', (0,0), (-1,-1), 4), ('VALIGN', (0,0), (-1,-1), 'MIDDLE'), ('INNERGRID', (0,0), (-1,-1), 0.3, C_GREY), ('BOX', (0,0), (-1,-1), 0.8, C_NAVY), ('ROUNDEDCORNERS',[4]), ] for i in range(1, len(qr_rows)): bg = C_GREY_LT if i % 2 == 0 else C_WHITE row_styles.append(('BACKGROUND', (0,i), (-1,i), bg)) qr_tbl.setStyle(TableStyle(row_styles)) elems.append(qr_tbl) elems.append(sp(5)) elems.append(PageBreak()) # ═══════════════════════════════════════════════════════════════════ # PAGE 3 — CTR + Pulmonary Vascularity + Memory Aids # ═══════════════════════════════════════════════════════════════════ hdr3 = Table([[Paragraph("CARDIAC CHAMBER ENLARGEMENT — CXR SIGNS | Page 3", sTitle)]], colWidths=[COL_W]) hdr3.setStyle(TableStyle([ ('BACKGROUND',(0,0),(-1,-1), C_NAVY), ('ROWPADDING',(0,0),(-1,-1), 7), ('ROUNDEDCORNERS',[5]), ])) elems.append(hdr3) elems.append(sp(5)) # ── CTR BOX ────────────────────────────────────────────────────────── ctr_title = Table([[Paragraph("CARDIOTHORACIC RATIO (CTR)", sSec)]], colWidths=[COL_W]) ctr_title.setStyle(TableStyle([ ('BACKGROUND',(0,0),(-1,-1), C_TEAL), ('ROWPADDING',(0,0),(-1,-1), 5), ('ROUNDEDCORNERS',[4]), ])) elems.append(ctr_title) elems.append(sp(3)) ctr_data = [ [Paragraph("<b>CTR Formula</b>", sBold), Paragraph("Max transverse cardiac diameter ÷ Max internal thoracic diameter (at same level)", sKeyCell)], [Paragraph("<b>Normal (erect PA)</b>", sBold), Paragraph("≤ 0.5", sKeyCell)], [Paragraph("<b>Cardiomegaly</b>", sBold), Paragraph("> 0.5 on PA erect CXR", sKeyCell)], [Paragraph("<b>Caution — AP CXR</b>", sBold), Paragraph("AP view OVERESTIMATES cardiac size due to magnification; CTR assessment unreliable on AP", sKeyCell)], [Paragraph("<b>Clinical note</b>", sBold), Paragraph("CTR > 0.42 on acute MI CXR is associated with worse in-hospital and long-term outcome", sKeyCell)], [Paragraph("<b>Volume vs Pressure</b>", sBold), Paragraph("Volume overload (AR, MR) → greater cardiomegaly; Pressure overload alone (AS) → near-normal size", sKeyCell)], ] ctr_tbl = Table(ctr_data, colWidths=[COL_W*0.28, COL_W*0.72]) ctr_tbl.setStyle(TableStyle([ ('BOX',(0,0),(-1,-1), 0.8, C_TEAL), ('INNERGRID',(0,0),(-1,-1), 0.3, C_TEAL_LT), ('BACKGROUND',(0,0),(0,-1), C_TEAL_LT), ('BACKGROUND',(1,0),(-1,-1), C_WHITE), ('ROWPADDING',(0,0),(-1,-1), 5), ('VALIGN',(0,0),(-1,-1),'MIDDLE'), ('ROUNDEDCORNERS',[4]), ])) elems.append(ctr_tbl) elems.append(sp(6)) # ── PULMONARY VASCULARITY TABLE ─────────────────────────────────────── pv_title = Table([[Paragraph("PULMONARY VASCULARITY PATTERNS IN CARDIAC DISEASE", sSec)]], colWidths=[COL_W]) pv_title.setStyle(TableStyle([ ('BACKGROUND',(0,0),(-1,-1), C_PURPLE), ('ROWPADDING',(0,0),(-1,-1), 5), ('ROUNDEDCORNERS',[4]), ])) elems.append(pv_title) elems.append(sp(3)) pv_data = [ [Paragraph("<b>Pattern</b>", sKeyHdr), Paragraph("<b>Mechanism</b>", sKeyHdr), Paragraph("<b>CXR Appearance</b>", sKeyHdr), Paragraph("<b>Causes</b>", sKeyHdr)], ["Cephalization\n(Redistribution)", "Post-capillary PH → lower lobe vessel constriction", "Upper lobe vessels dilated; lower lobe vessels constricted", "Mitral stenosis, LV failure, increased LVEDP"], ["Centralization", "Pre-capillary PH → central PA dilation, peripheral pruning", "Dilated pulmonary trunk + central PAs; peripheral pruning", "Primary PH, Eisenmenger, recurrent PE, severe COPD"], ["Increased PBF\n(Shunt vascularity)", "L-to-R shunt → increased pulmonary flow", "Uniform bilateral vessel dilatation; Rt PA > 16 mm", "ASD, VSD, PDA"], ["Decreased PBF", "RV outflow obstruction / right heart failure", "Small, short pulmonary arteries; lucent lungs", "Tetralogy of Fallot, isolated right heart failure"], ["Lateralization", "Unilateral obstruction", "Asymmetric PBF; one lung oligemic", "Massive unilateral PE; congenital valvular PS"], ] pv_rows = [] for i, row in enumerate(pv_data): pv_rows.append([Paragraph(str(c), sKeyHdr if i==0 else sKeyCell) for c in row]) cw4 = [COL_W*0.18, COL_W*0.24, COL_W*0.30, COL_W*0.28] pv_tbl = Table(pv_rows, colWidths=cw4, repeatRows=1) pv_styles = [ ('BACKGROUND',(0,0),(-1,0), C_PURPLE), ('TEXTCOLOR',(0,0),(-1,0), C_WHITE), ('FONTNAME',(0,0),(-1,0), 'Helvetica-Bold'), ('FONTSIZE',(0,0),(-1,-1), 7.5), ('ROWPADDING',(0,0),(-1,-1), 4), ('VALIGN',(0,0),(-1,-1),'TOP'), ('INNERGRID',(0,0),(-1,-1), 0.3, C_GREY), ('BOX',(0,0),(-1,-1), 0.8, C_PURPLE), ('ROUNDEDCORNERS',[4]), ] for i in range(1, len(pv_rows)): bg = C_GREY_LT if i % 2 == 0 else C_WHITE pv_styles.append(('BACKGROUND', (0,i), (-1,i), bg)) pv_tbl.setStyle(TableStyle(pv_styles)) elems.append(pv_tbl) elems.append(sp(6)) # ── MEMORY AIDS ────────────────────────────────────────────────────── mem_title = Table([[Paragraph("MEMORY AIDS & HIGH-YIELD EXAM FACTS", sSec)]], colWidths=[COL_W]) mem_title.setStyle(TableStyle([ ('BACKGROUND',(0,0),(-1,-1), C_AMBER), ('ROWPADDING',(0,0),(-1,-1), 5), ('ROUNDEDCORNERS',[4]), ])) elems.append(mem_title) elems.append(sp(3)) mem_data = [ ["Left border (top → bottom)", "A – P – L – L (Aorta · Pulmonary trunk · LAA · LV)"], ["Right border (top → bottom)", "S – A – R (SVC · Ascending Aorta · RA)"], ["LA enlargement signs", "Double density · Carina >70° · Elevated left bronchus · 3rd mogul · Posterior esophageal displacement"], ["RV enlargement best sign", "Retrosternal space obliteration on LATERAL view"], ["Boot-shaped heart", "RV hypertrophy + concave PA bay = Tetralogy of Fallot"], ["3-sign on aorta", "Coarctation of aorta (pre + post-stenotic dilatation)"], ["Ascending aorta dilatation only", "Valvular aortic stenosis (post-stenotic)"], ["Whole thoracic aorta enlarged", "Aortic regurgitation and/or systemic hypertension"], ["Water-bottle / flask heart", "Pericardial effusion — sharp cardiac borders (no lung markings effaced)"], ["Acute LV failure", "Alveolar oedema (butterfly pattern) + NORMAL-sized heart"], ["Chronic LV failure", "Gross cardiomegaly + cephalization + Kerley B lines"], ["Eisenmenger syndrome", "Centralization with pruning + enlarged pulmonary trunk"], ["Ebstein anomaly", "Massive RA + decreased PBF ('wall-to-wall' heart)"], ["PA > 16 mm (right descending)", "Suggests increased pulmonary blood flow / L-to-R shunt"], ] mem_rows = [[Paragraph(f"<b>{r[0]}</b>", S("mk", parent=sBold, fontSize=7.8, textColor=C_AMBER)), Paragraph(r[1], S("mv", parent=sKeyCell, fontSize=7.8))] for r in mem_data] mem_tbl = Table(mem_rows, colWidths=[COL_W*0.30, COL_W*0.70]) mem_styles = [ ('BOX',(0,0),(-1,-1), 0.8, C_AMBER), ('INNERGRID',(0,0),(-1,-1), 0.3, C_AMBER_LT), ('BACKGROUND',(0,0),(0,-1), C_AMBER_LT), ('ROWPADDING',(0,0),(-1,-1), 4), ('VALIGN',(0,0),(-1,-1),'TOP'), ('ROUNDEDCORNERS',[4]), ] for i in range(len(mem_rows)): bg = C_WHITE if i % 2 == 0 else C_GREY_LT mem_styles.append(('BACKGROUND',(1,i),(1,i), bg)) mem_tbl.setStyle(TableStyle(mem_styles)) elems.append(mem_tbl) elems.append(sp(6)) elems.append(hr(C_GREY, 0.5)) elems.append(sp(3)) # ── FOOTER ─────────────────────────────────────────────────────────── footer_tbl = Table([[ Paragraph("Sources: Fuster & Hurst's The Heart 15e · Grainger & Allison's Diagnostic Radiology · Braunwald's Heart Disease", sFooter), Paragraph("DNB Radiology Rapid Review Card", sFooter), ]], colWidths=[COL_W*0.72, COL_W*0.28]) footer_tbl.setStyle(TableStyle([ ('VALIGN',(0,0),(-1,-1),'MIDDLE'), ('LEFTPADDING',(0,0),(-1,-1), 0), ('RIGHTPADDING',(0,0),(-1,-1), 0), ])) elems.append(footer_tbl) # ── BUILD ───────────────────────────────────────────────────────────── doc.build(elems) print(f"PDF created: {OUTPUT}") PYEOF
python3 << 'PYEOF' from reportlab.platypus import ( SimpleDocTemplate, Table, TableStyle, Paragraph, Spacer, HRFlowable, PageBreak ) from reportlab.lib.styles import getSampleStyleSheet, ParagraphStyle from reportlab.lib import colors from reportlab.lib.units import mm from reportlab.lib.pagesizes import A4 from reportlab.lib.enums import TA_CENTER, TA_LEFT, TA_JUSTIFY OUTPUT = "/tmp/workspace/cardiac-xray-card/Cardiac_Chamber_Enlargement_CXR.pdf" # ── Colour palette ────────────────────────────────────────────────── C_NAVY = colors.HexColor("#0A2540") C_BLUE = colors.HexColor("#1565C0") C_SKY = colors.HexColor("#E3F0FF") C_TEAL = colors.HexColor("#006D77") C_TEAL_LT = colors.HexColor("#D9F0F2") C_AMBER = colors.HexColor("#B45309") C_AMBER_LT = colors.HexColor("#FEF3C7") C_RED = colors.HexColor("#B91C1C") C_RED_LT = colors.HexColor("#FEE2E2") C_GREEN = colors.HexColor("#166534") C_GREEN_LT = colors.HexColor("#DCFCE7") C_PURPLE = colors.HexColor("#6B21A8") C_PURP_LT = colors.HexColor("#F3E8FF") C_GREY_LT = colors.HexColor("#F1F5F9") C_GREY = colors.HexColor("#64748B") C_WHITE = colors.white C_BLACK = colors.HexColor("#1E293B") W, H = A4 MARGIN = 14*mm COL_W = W - 2*MARGIN doc = SimpleDocTemplate( OUTPUT, pagesize=A4, leftMargin=MARGIN, rightMargin=MARGIN, topMargin=12*mm, bottomMargin=12*mm, title="Cardiac Chamber Enlargement – CXR Signs", author="DNB Radiology Quick Reference" ) # ── Base style helpers (no parent kwarg conflict) ──────────────────── base = getSampleStyleSheet()["Normal"] def mkS(name, fontSize=8, leading=11, fontName="Helvetica", textColor=C_BLACK, alignment=TA_LEFT, leftIndent=0, spaceAfter=1, spaceBefore=0): return ParagraphStyle(name, fontSize=fontSize, leading=leading, fontName=fontName, textColor=textColor, alignment=alignment, leftIndent=leftIndent, spaceAfter=spaceAfter, spaceBefore=spaceBefore) sTitle = mkS("sTitle", 17, 22, "Helvetica-Bold", C_WHITE, TA_CENTER, spaceAfter=2) sSub = mkS("sSub", 8, 11, "Helvetica", colors.HexColor("#CBD5E1"), TA_CENTER) sSec = mkS("sSec", 9.5,13, "Helvetica-Bold", C_WHITE, TA_CENTER) sBold = mkS("sBold", 8.2,11.5,"Helvetica-Bold",C_BLACK) sNorm = mkS("sNorm", 8.2,11.5,"Helvetica", C_BLACK, leftIndent=6) sNote = mkS("sNote", 7.5,10.5,"Helvetica-Oblique", C_GREY, TA_JUSTIFY) sHdr = mkS("sHdr", 8, 11, "Helvetica-Bold", C_WHITE, TA_CENTER) sCell = mkS("sCell", 7.8,11, "Helvetica", C_BLACK) sCellB = mkS("sCellB", 7.8,11, "Helvetica-Bold", C_BLACK) sFooter = mkS("sFooter", 7, 9, "Helvetica-Oblique", C_GREY, TA_CENTER) def sp(h=3): return Spacer(1, h) def hr(c=C_GREY, t=0.5): return HRFlowable(width="100%", thickness=t, color=c, spaceAfter=3, spaceBefore=3) def bul(txt): return Paragraph(f"\u2022 {txt}", sNorm) def pbul(b,r): return Paragraph(f"<b>\u2022 {b}</b> {r}", sNorm) def banner(text, bg, sub=None): rows = [[Paragraph(text, sTitle)]] if sub: rows.append([Paragraph(sub, sSub)]) t = Table(rows, colWidths=[COL_W]) t.setStyle(TableStyle([ ('BACKGROUND',(0,0),(-1,-1), bg), ('TOPPADDING',(0,0),(-1,0), 9), ('BOTTOMPADDING',(0,-1),(-1,-1), 8), ('ROWPADDING',(0,0),(-1,-1), 4), ])) return t def sec_hdr(txt, bg): t = Table([[Paragraph(txt, sSec)]], colWidths=[COL_W]) t.setStyle(TableStyle([ ('BACKGROUND',(0,0),(-1,-1), bg), ('ROWPADDING',(0,0),(-1,-1), 5), ])) return t def make_inner(pa_items, ex_items, ca_items, bg, border): cw = [(COL_W-4)*0.42, (COL_W-4)*0.32, (COL_W-4)*0.26] def col(items, w): rows = [[i] for i in items] t = Table(rows, colWidths=[w]) t.setStyle(TableStyle([ ('BACKGROUND',(0,0),(-1,-1), bg), ('LEFTPADDING',(0,0),(-1,-1), 6), ('RIGHTPADDING',(0,0),(-1,-1), 6), ('TOPPADDING',(0,0),(-1,-1), 2), ('BOTTOMPADDING',(0,0),(-1,-1), 2), ('TOPPADDING',(0,0),(0,0), 5), ('BOTTOMPADDING',(0,-1),(0,-1), 5), ('VALIGN',(0,0),(-1,-1),'TOP'), ])) return t t = Table([[col(pa_items, cw[0]), col(ex_items, cw[1]), col(ca_items, cw[2])]], colWidths=cw) t.setStyle(TableStyle([ ('BOX',(0,0),(-1,-1), 0.8, border), ('INNERGRID',(0,0),(-1,-1), 0.4, border), ('VALIGN',(0,0),(-1,-1),'TOP'), ('LEFTPADDING',(0,0),(-1,-1), 0), ('RIGHTPADDING',(0,0),(-1,-1), 0), ('TOPPADDING',(0,0),(-1,-1), 0), ('BOTTOMPADDING',(0,0),(-1,-1), 0), ])) return t def sub_label(txt, c): return Paragraph(f"<b>{txt}</b>", mkS(f"sl_{txt[:4]}", 7.8, 11, "Helvetica-Bold", c)) def chamber_section(title, hdr_col, bg_col, brd_col, pa, ex, ca): elems = [] elems.append(sec_hdr(title, hdr_col)) elems.append(sp(3)) pa_col = [sub_label("PA VIEW SIGNS", hdr_col), sp(2)] + [bul(s) for s in pa] ex_col = [sub_label("LATERAL / EXTRA SIGNS", hdr_col), sp(2)] + [bul(s) for s in ex] ca_col = [sub_label("CAUSES", hdr_col), sp(2)] + [bul(s) for s in ca] elems.append(make_inner(pa_col, ex_col, ca_col, bg_col, brd_col)) elems.append(sp(5)) return elems # ═══════════════════════════════════════════ # PAGE 1 # ═══════════════════════════════════════════ E = [] E.append(banner("CARDIAC CHAMBER ENLARGEMENT",C_NAVY, "CXR Signs · PA View · DNB Radiology Rapid Exam Reference")) E.append(sp(5)) # CARDIAC BORDERS E.append(sec_hdr("CARDIAC BORDERS ON PA CXR", C_TEAL)) E.append(sp(3)) HW = (COL_W-5)/2 def border_col(items, bg, brd, w): rows = [[i] for i in items] t = Table(rows, colWidths=[w]) t.setStyle(TableStyle([ ('BACKGROUND',(0,0),(-1,-1), bg), ('BOX',(0,0),(-1,-1), 0.8, brd), ('LEFTPADDING',(0,0),(-1,-1), 8), ('RIGHTPADDING',(0,0),(-1,-1), 8), ('TOPPADDING',(0,0),(-1,-1), 2), ('BOTTOMPADDING',(0,0),(-1,-1), 2), ('TOPPADDING',(0,0),(0,0), 7), ('BOTTOMPADDING',(0,-1),(0,-1), 7), ('VALIGN',(0,0),(-1,-1),'TOP'), ])) return t right_items = [ Paragraph("<b>RIGHT CARDIAC BORDER</b> (Top \u2192 Bottom)", mkS("rh",8.5,12,"Helvetica-Bold",C_TEAL)), sp(3), Paragraph("\u2460 <b>Superior Vena Cava (SVC)</b>", sNorm), Paragraph("\u2461 <b>Ascending Aorta</b> — partial (elderly / hypertensive)", sNorm), Paragraph("\u2462 <b>Right Atrium (RA)</b> — entire lower right border", sNorm), sp(2), Paragraph("RA forms right cardiophrenic angle; IVC enters here", sNote), ] left_items = [ Paragraph("<b>LEFT CARDIAC BORDER</b> (Top \u2192 Bottom)", mkS("lh",8.5,12,"Helvetica-Bold",C_BLUE)), sp(3), Paragraph("\u2460 <b>Aortic Knob</b> (transverse aortic arch)", sNorm), Paragraph("\u2461 <b>Main Pulmonary Artery</b> (pulmonary trunk)", sNorm), Paragraph("\u2462 <b>Left Atrial Appendage (LAA)</b> — normally flat/inapparent", sNorm), Paragraph("\u2463 <b>Left Ventricle (LV)</b> — bulk of left border + apex", sNorm), sp(2), Paragraph("Mnemonic left border: <b>A \u2013 P \u2013 L \u2013 L</b> (Aorta · PA · LAA · LV)", sNote), ] brd_row = Table([[border_col(right_items,C_TEAL_LT,C_TEAL,HW), border_col(left_items, C_SKY, C_BLUE,HW)]], colWidths=[HW,HW]) brd_row.setStyle(TableStyle([ ('LEFTPADDING',(0,0),(-1,-1),0),('RIGHTPADDING',(0,0),(-1,-1),0), ('TOPPADDING',(0,0),(-1,-1),0),('BOTTOMPADDING',(0,0),(-1,-1),0), ('VALIGN',(0,0),(-1,-1),'TOP'), ])) E.append(brd_row) E.append(sp(6)) E += chamber_section( "LEFT ATRIUM (LA) ENLARGEMENT", C_BLUE, C_SKY, C_BLUE, pa=[ "Double density sign — retrocardiac 2nd opacity on right side of heart (most specific)", "Widening of subcarinal (carinal) angle > 70°", "Elevation of left main bronchus (horizontal left bronchus)", "LAA convexity / 3rd mogul sign — bulge/straightening below PA segment", "Straightening or rightward bulge of right heart border if massive LA", ], ex=[ "Posterior esophageal displacement (barium / lateral)", "Splaying of carina on lateral view", "Posterior displacement of descending aorta", "Double density best seen on well-penetrated PA", ], ca=["Mitral stenosis", "Mitral regurgitation", "LV failure (chronic)", "Atrial fibrillation (chronic)"] ) E += chamber_section( "LEFT VENTRICLE (LV) ENLARGEMENT", C_PURPLE, C_PURP_LT, C_PURPLE, pa=[ "Cardiac apex displaced downward, outward, leftward (drooping apex)", "Rounding and increased convexity of left cardiac border", "Increased CTR > 0.5 (volume overload causes more cardiomegaly than pressure overload)", "Localized left border bulge = LV aneurysm (post-MI)", "Boot-shaped heart: pressure overload hypertrophy + small PA", ], ex=[ "LV projects posterior to IVC on lateral view", "Posterior cardiac border > 1.8 cm behind IVC", "Pressure overload (AS, HTN): near-normal cardiac size despite hypertrophy", ], ca=["Aortic regurgitation", "Mitral regurgitation", "Dilated CMP", "Hypertension", "Aortic stenosis", "Post-MI aneurysm"] ) E.append(PageBreak()) # ═══════════════════════════════════════════ # PAGE 2 # ═══════════════════════════════════════════ E.append(banner("CARDIAC CHAMBER ENLARGEMENT — CXR SIGNS | Page 2", C_NAVY)) E.append(sp(5)) E += chamber_section( "RIGHT VENTRICLE (RV) ENLARGEMENT", C_AMBER, C_AMBER_LT, C_AMBER, pa=[ "Cardiac apex elevated and displaced upward/leftward (RV pushes LV up)", "Prominent pulmonary trunk — cardiac rotation brings PA laterally", "Coeur en sabot (boot-shaped heart) = RV hypertrophy + concave PA bay (Tetralogy of Fallot)", "Widened right border if RV + RA both enlarged", "Oligemic lung fields if associated PS/ToF", ], ex=[ "Retrosternal airspace obliteration on lateral view — MOST SENSITIVE sign of RV enlargement", "RV-sternum contact > 1/3 of sternal height on lateral", "Diaphragmatic surface = RV (not LV) on lateral", ], ca=["Pulmonary hypertension", "Cor pulmonale (COPD)", "ASD / VSD", "PS / Tetralogy of Fallot", "Tricuspid regurgitation", "Eisenmenger syndrome"] ) E += chamber_section( "RIGHT ATRIUM (RA) ENLARGEMENT", C_RED, C_RED_LT, C_RED, pa=[ "Increased convexity and rightward bulging of right heart border", "Increased height of right cardiac arc", "Right cardiophrenic angle becomes rounded and widened", "Globular right border extending from SVC to cardiophrenic angle", "Massive RA + straightened left border = severe MS with secondary TR", ], ex=[ "Dilated right border without PA enlargement = tricuspid stenosis", "Ebstein anomaly: massively enlarged RA + severely decreased PBF (wall-to-wall heart)", ], ca=["Tricuspid regurgitation", "Tricuspid stenosis", "Right heart failure", "ASD", "Ebstein anomaly", "Severe MS → TR"] ) E += chamber_section( "BIVENTRICULAR ENLARGEMENT", C_GREEN, C_GREEN_LT, C_GREEN, pa=[ "Global cardiomegaly — CTR > 0.5", "All cardiac borders enlarged: Rt border bulges right, Lt border bulges left", "Apex displaced downward AND right border prominent", "Flask / globular shape in dilated CMP", "Pulmonary venous congestion + Kerley B lines (CHF)", ], ex=[ "Combined retrosternal filling + posterior cardiac extension on lateral", "Pericardial effusion mimics: water-bottle shape, sharp borders, rapid size change", ], ca=["Dilated cardiomyopathy", "Advanced MR + AR", "End-stage CHF", "Myocarditis"] ) E.append(sp(4)) E.append(hr(C_GREY, 0.8)) E.append(sp(3)) # QUICK-REFERENCE TABLE E.append(sec_hdr("PATHOGNOMONIC & CLASSIC CXR SIGNS — QUICK REFERENCE", C_NAVY)) E.append(sp(4)) signs = [ ["Double density sign", "Left atrium", "LA enlargement (MS, MR)"], ["3rd mogul / LAA bump", "Left atrial appendage", "Mitral valve disease (MS/MR)"], ["Subcarinal angle > 70°", "Carina splayed by LA", "LA enlargement"], ["Coeur en sabot (boot heart)", "RV hypertrophy + absent PA", "Tetralogy of Fallot"], ["Water-bottle / flask heart", "Pericardial sac", "Pericardial effusion"], ["Drooping / downward apex", "LV dilatation", "AR, MR, DCM"], ["Elevated / uplifted apex", "RV pushing LV upward", "RV enlargement"], ["Localized left border bulge", "LV wall", "LV aneurysm (post-MI)"], ["Widened Rt + straight Lt border","RA + LA/PA", "Severe MS \u2192 TR"], ["3-sign / E-sign (aorta)", "Aortic arch", "Coarctation of aorta"], ["Retrosternal obliteration", "RV (lateral view)", "RV enlargement (most sensitive)"], ["Pruning of peripheral PAs", "Pulmonary arteries", "Pre-capillary PH / Eisenmenger"], ["Kerley B lines", "Interstitial / lymphatics","PVH Grade II (18–25 mmHg)"], ["Butterfly / bat-wing oedema", "Alveoli (perihilar)", "Acute LV failure"], ] hdr_row = [Paragraph(h, sHdr) for h in ["SIGN", "STRUCTURE", "DIAGNOSIS"]] all_rows = [hdr_row] + [[Paragraph(c, sCell) for c in r] for r in signs] cw3 = [COL_W*0.33, COL_W*0.28, COL_W*0.39] t = Table(all_rows, colWidths=cw3, repeatRows=1) ts = [ ('BACKGROUND',(0,0),(-1,0), C_NAVY), ('FONTNAME',(0,0),(-1,0),'Helvetica-Bold'), ('FONTSIZE',(0,0),(-1,-1), 7.8), ('ROWPADDING',(0,0),(-1,-1), 4), ('VALIGN',(0,0),(-1,-1),'MIDDLE'), ('INNERGRID',(0,0),(-1,-1), 0.3, C_GREY), ('BOX',(0,0),(-1,-1), 0.8, C_NAVY), ] for i in range(1, len(all_rows)): ts.append(('BACKGROUND',(0,i),(-1,i), C_GREY_LT if i%2==0 else C_WHITE)) t.setStyle(TableStyle(ts)) E.append(t) E.append(sp(5)) E.append(PageBreak()) # ═══════════════════════════════════════════ # PAGE 3 # ═══════════════════════════════════════════ E.append(banner("CARDIAC CHAMBER ENLARGEMENT — CXR SIGNS | Page 3", C_NAVY)) E.append(sp(5)) # CTR E.append(sec_hdr("CARDIOTHORACIC RATIO (CTR)", C_TEAL)) E.append(sp(3)) ctr_rows = [ ["<b>Formula</b>", "Max transverse cardiac diameter \u00f7 Max internal thoracic diameter (at same level)"], ["<b>Normal (erect PA)</b>", "\u2264 0.5"], ["<b>Cardiomegaly</b>", "> 0.5"], ["<b>AP CXR caution</b>", "AP view OVERESTIMATES cardiac size (magnification); CTR assessment unreliable on AP"], ["<b>Acute MI</b>", "CTR > 0.42 on acute MI CXR associated with worse in-hospital and long-term outcome"], ["<b>Volume vs Pressure</b>", "Volume overload (AR, MR) \u2192 significant cardiomegaly; Pressure overload alone (AS, HTN) \u2192 near-normal size despite hypertrophy"], ] ctr_tbl = Table([[Paragraph(r[0],sCell), Paragraph(r[1],sCell)] for r in ctr_rows], colWidths=[COL_W*0.26, COL_W*0.74]) ctr_ts = [ ('BOX',(0,0),(-1,-1), 0.8, C_TEAL), ('INNERGRID',(0,0),(-1,-1), 0.3, C_TEAL_LT), ('BACKGROUND',(0,0),(0,-1), C_TEAL_LT), ('ROWPADDING',(0,0),(-1,-1), 5), ('VALIGN',(0,0),(-1,-1),'MIDDLE'), ] for i in range(len(ctr_rows)): ctr_ts.append(('BACKGROUND',(1,i),(1,i), C_GREY_LT if i%2==0 else C_WHITE)) ctr_tbl.setStyle(TableStyle(ctr_ts)) E.append(ctr_tbl) E.append(sp(6)) # PULMONARY VASCULARITY E.append(sec_hdr("PULMONARY VASCULARITY PATTERNS IN CARDIAC DISEASE", C_PURPLE)) E.append(sp(3)) pv_data = [ ["Cephalization\n(Redistribution)", "Post-capillary PH; lower lobe vessel constriction", "Upper lobe vessels dilated; lower lobe constricted", "MS, LV failure, increased LVEDP"], ["Centralization", "Pre-capillary PH; central PA dilatation", "Enlarged trunk + central PAs; peripheral pruning", "Primary PH, Eisenmenger, recurrent PE, COPD"], ["Increased PBF\n(Shunt vascularity)", "L-to-R shunt; increased pulmonary flow", "Uniform bilateral vessel dilatation; Rt PA > 16 mm", "ASD, VSD, PDA"], ["Decreased PBF", "RV outflow obstruction / right heart failure", "Small, short PAs; lucent lung fields", "Tetralogy of Fallot, right heart failure"], ["Lateralization", "Unilateral PA obstruction", "Asymmetric PBF; one lung oligemic", "Massive unilateral PE; valvular PS"], ] pv_hdr = [Paragraph(h, sHdr) for h in ["Pattern","Mechanism","CXR Appearance","Causes"]] pv_rows = [pv_hdr] + [[Paragraph(c, sCell) for c in r] for r in pv_data] cw4 = [COL_W*0.17, COL_W*0.24, COL_W*0.31, COL_W*0.28] pv_tbl = Table(pv_rows, colWidths=cw4, repeatRows=1) pv_ts = [ ('BACKGROUND',(0,0),(-1,0), C_PURPLE), ('FONTNAME',(0,0),(-1,0),'Helvetica-Bold'), ('FONTSIZE',(0,0),(-1,-1), 7.5), ('ROWPADDING',(0,0),(-1,-1), 4), ('VALIGN',(0,0),(-1,-1),'TOP'), ('INNERGRID',(0,0),(-1,-1), 0.3, C_GREY), ('BOX',(0,0),(-1,-1), 0.8, C_PURPLE), ] for i in range(1, len(pv_rows)): pv_ts.append(('BACKGROUND',(0,i),(-1,i), C_GREY_LT if i%2==0 else C_WHITE)) pv_tbl.setStyle(TableStyle(pv_ts)) E.append(pv_tbl) E.append(sp(6)) # MEMORY AIDS E.append(sec_hdr("MEMORY AIDS & HIGH-YIELD EXAM FACTS", C_AMBER)) E.append(sp(3)) mem = [ ["Left border (top\u2192bottom)", "A \u2013 P \u2013 L \u2013 L (Aorta \xb7 Pulmonary trunk \xb7 LAA \xb7 LV)"], ["Right border (top\u2192bottom)", "S \u2013 A \u2013 R (SVC \xb7 Ascending Aorta \xb7 RA)"], ["LA enlargement signs (5)", "Double density \xb7 Carina >70\xb0 \xb7 Elevated left bronchus \xb7 3rd mogul \xb7 Posterior esoph. displacement"], ["RV enlargement — best sign", "Retrosternal airspace obliteration on LATERAL view"], ["Boot-shaped heart", "RV hypertrophy + concave PA bay = Tetralogy of Fallot"], ["3-sign on aorta / E-sign esophagus", "Coarctation of aorta"], ["Ascending aorta dilatation ONLY", "Valvular aortic stenosis (post-stenotic dilatation)"], ["Whole thoracic aorta enlarged", "Aortic regurgitation and/or systemic hypertension"], ["Water-bottle / flask heart", "Pericardial effusion — sharp borders, rapid change in size"], ["Acute LV failure", "Butterfly oedema + NORMAL-sized heart (no time for remodelling)"], ["Chronic LV failure", "Gross cardiomegaly + cephalization + Kerley B lines"], ["Ebstein anomaly", "Massive RA enlargement + severely decreased PBF ('wall-to-wall heart')"], ["PA trunk prominent — exceptions", "NOT RV if: ToF (PA hypoplasia), idiopathic PA dilatation, PDA, pectus excavatum / straight-back syndrome"], ["Right desc. PA > 16 mm", "Suggests increased pulmonary blood flow / L-to-R shunt"], ] mem_rows = [[Paragraph(f"<b>{r[0]}</b>", mkS(f"mk{i}",7.8,11,"Helvetica-Bold",C_AMBER)), Paragraph(r[1], sCell)] for i,r in enumerate(mem)] mem_tbl = Table(mem_rows, colWidths=[COL_W*0.30, COL_W*0.70]) mem_ts = [ ('BOX',(0,0),(-1,-1), 0.8, C_AMBER), ('INNERGRID',(0,0),(-1,-1), 0.3, C_AMBER_LT), ('BACKGROUND',(0,0),(0,-1), C_AMBER_LT), ('ROWPADDING',(0,0),(-1,-1), 4), ('VALIGN',(0,0),(-1,-1),'TOP'), ] for i in range(len(mem_rows)): mem_ts.append(('BACKGROUND',(1,i),(1,i), C_WHITE if i%2==0 else C_GREY_LT)) mem_tbl.setStyle(TableStyle(mem_ts)) E.append(mem_tbl) E.append(sp(6)) E.append(hr(C_GREY, 0.5)) E.append(sp(3)) # FOOTER ft = Table([[ Paragraph("Sources: Fuster & Hurst's The Heart 15e \xb7 Grainger & Allison's Diagnostic Radiology \xb7 Braunwald's Heart Disease", sFooter), Paragraph("DNB Radiology Rapid Review \xb7 For educational use only", sFooter), ]], colWidths=[COL_W*0.70, COL_W*0.30]) ft.setStyle(TableStyle([('VALIGN',(0,0),(-1,-1),'MIDDLE'), ('LEFTPADDING',(0,0),(-1,-1),0), ('RIGHTPADDING',(0,0),(-1,-1),0)])) E.append(ft) doc.build(E) print(f"SUCCESS: {OUTPUT}") PYEOF
Cardiac Chamber Enlargement CXR
PDF Document · PDF