Slit lamp illumination technics by Monica chudhary book with images

Reading File
Finding Sources
Finding Sources
Finding Sources
Finding Sources
Searching the Web

Monica Chaudhary slit lamp illumination techniques ophthalmology book

Reading File
Reading Web Page

https://www.slideshare.net/slideshow/slit-lamp-biomicroscopy…

Loading Image
Reading File
Finding Sources
Here is a thorough guide to Slit Lamp Illumination Techniques based on Monica Chaudhary's Contact Lens Primer (1st ed., pp. 28-40) as referenced in the ophthalmic literature, supplemented by Kanski's Clinical Ophthalmology (10th ed.) which contains the same canonical techniques with diagrams:

Slit Lamp Illumination Techniques

The slit lamp biomicroscope uses Gullstrand's illumination system - a bright, evenly illuminated, finely focused adjustable slit of light directed at the eye. There are 6 main illumination techniques:

1. Diffuse Illumination

  • Setup: Wide, low-intensity beam; angle between slit lamp and microscope ~45°
  • Beam: Broad, diffuse (frosted glass or diffuser in place)
  • Magnification: Low (6-10x)
  • Uses:
    • General survey of the anterior segment
    • Observing contact lens fitting performance
    • Gross abnormalities of lids, conjunctiva, cornea
Monica Chaudhary's Contact Lens Primer specifically notes this technique for observing contact lens fitting performance.

2. Direct Focal (Broad Beam / Optical Section) Illumination

This is the most commonly used technique and has two sub-types:

a) Broad Beam / Parallelpiped

  • Setup: Beam width 1-2 mm, angled 30-45° from the microscope axis
  • Uses: 3D view of the cornea, assessment of anterior chamber depth, detecting epithelial or stromal changes
  • CL use: Observing debris beneath the contact lens

b) Optical Section (Thin Beam)

  • Setup: Narrowest possible beam, high illumination, 30-45° angle
  • Uses: Determining the exact depth and position of a corneal lesion within its layers (epithelium, Bowman's, stroma, Descemet's, endothelium)
Slit lamp illumination techniques diagram showing Direct illumination, Scleral scatter, and Retroillumination with light path diagrams and clinical photos
Fig. - Technique of slit lamp biomicroscopy: Direct illumination (top), Scleral scatter (middle), Retroillumination (bottom) - Kanski's Clinical Ophthalmology, 10th ed.

3. Indirect (Proximal) Illumination

  • Setup: Slit beam focused beside (not on) the area under examination; microscope focused on the area of interest
  • Angle: 30-45° between slit lamp and microscope
  • Beam width: Moderate
  • Uses: Detecting subtle lesions that are missed with direct illumination:
    • Corneal infiltrates
    • Microcysts and vacuoles
    • Epithelial cells

4. Scleral Scatter

  • Setup: Slit beam aimed at the limbus (decentralized laterally); the microscope is focused centrally on the cornea
  • Mechanism: Light undergoes total internal reflection within the cornea. Any opacity or lesion in the stroma scatters this light forward and becomes visible as a bright spot against the dark background
  • Uses:
    • Detecting subtle stromal haze (e.g., early keratoconus)
    • Cellular or lipid infiltration
    • Contact lens-induced corneal changes (e.g., Fleischer's ring, Vogt's striae)

5. Retroillumination

Light is reflected back from the iris or fundus to illuminate structures from behind.

a) Retroillumination from the Iris

  • Setup: Beam directed at the iris; microscope focused on cornea
  • Uses: Corneal opacities, epithelial cysts, keratic precipitates, small vessels
  • Sub-types:
    • Direct retroillumination - lesion appears dark against bright iris background
    • Indirect retroillumination - lesion appears bright against dark (non-reflecting) iris

b) Retroillumination from the Fundus

  • Setup: Pupil dilated; slit beam and microscope made coaxial; beam strikes fundus creating a red-orange glow
  • Uses: Media opacities, lens changes, posterior corneal changes
  • CL use: Observing contact lens front and back surface deposits

6. Specular Reflection

  • Setup: The angle of incidence = angle of reflection; the microscope is positioned to capture the mirror-like reflection from a smooth surface
  • Angle: Typically 30-45° (critical angle depends on surface)
  • Uses:
    • Corneal endothelial cell morphology (cell density, size, shape - "mosaic pattern")
    • Detecting guttata, pseudoguttata, corneal decompensation
    • Assessing the pre-corneal tear film (lipid layer)
    • Contact lens front surface wetting quality

7. Oscillating (Sweeping) Illumination

  • Setup: The slit beam is quickly swept across the area of interest
  • Uses: Detecting subtle corneal opacities and aqueous flare/cells that might be missed with a stationary beam

Summary Table

TechniqueBeam SetupKey Clinical Uses
DiffuseWide, low intensityGeneral survey, CL fitting
Broad beam / Parallelpiped1-2 mm wide, 30-45°3D corneal view, AC depth
Optical sectionNarrowest beamDepth of corneal lesion
Indirect illuminationBeam beside area of interestMicrocysts, infiltrates
Scleral scatterBeam at limbus, scope at centerSubtle stromal haze
Retroillumination (iris)Beam on iris, scope on corneaEpithelial cysts, KPs
Retroillumination (fundus)Coaxial, dilated pupilLens/vitreous opacities
Specular reflectionAngle of incidence = reflectionEndothelial assessment, tear film
OscillatingSweeping beamAqueous flare/cells

Filters Used with the Slit Lamp

  • Cobalt blue filter - used with fluorescein to assess corneal epithelial defects, tear film break-up time (TBUT), contact lens fit
  • Red-free (green) filter - makes blood vessels appear black, improving vascular contrast; also enhances view of corneal nerves
  • Neutral density filter - reduces light intensity for photophobic patients

Source note: Monica Chaudhary's Contact Lens Primer (1st ed., pp. 28-40) is the primary reference for these techniques as applied to contact lens assessment. The core illumination techniques described above are also covered in Kanski's Clinical Ophthalmology (10th ed., p. 35) and A.K. Khurana's Theory and Practice of Optics and Refraction (3rd ed., pp. 351-61).

Create a quick reference PDF guide on slit lamp techniques

Reading File
Running Command

mkdir -p /tmp/workspace/slit-lamp-guide && ls /tmp/workspace/

Writing File

~/slit-lamp-guide/generate_pdf.py

from reportlab.lib.pagesizes import A4
from reportlab.lib import colors
from reportlab.lib.units import mm, cm
from reportlab.lib.styles import getSampleStyleSheet, ParagraphStyle
from reportlab.lib.enums import TA_CENTER, TA_LEFT, TA_JUSTIFY
from reportlab.platypus import (
    SimpleDocTemplate, Paragraph, Spacer, Table, TableStyle,
    HRFlowable, KeepTogether
)
from reportlab.graphics.shapes import Drawing, Rect, Line, Circle, String, Polygon
from reportlab.graphics import renderPDF
from reportlab.graphics.shapes import Group
import os

OUTPUT_PATH = "/tmp/workspace/slit-lamp-guide/Slit_Lamp_Illumination_Quick_Reference.pdf"

# ── Colour palette ──────────────────────────────────────────────────────────────
TEAL       = colors.HexColor("#006D77")
TEAL_LIGHT = colors.HexColor("#83C5BE")
TEAL_PALE  = colors.HexColor("#EDF6F9")
ORANGE     = colors.HexColor("#E76F51")
ORANGE_LT  = colors.HexColor("#FFDDD2")
GOLD       = colors.HexColor("#E9C46A")
DARK       = colors.HexColor("#1A1A2E")
MID_GREY   = colors.HexColor("#555555")
LIGHT_GREY = colors.HexColor("#F0F4F8")
WHITE      = colors.white
RED_BEAM   = colors.HexColor("#D62828")

W, H = A4

# ── Document ────────────────────────────────────────────────────────────────────
doc = SimpleDocTemplate(
    OUTPUT_PATH,
    pagesize=A4,
    leftMargin=15*mm, rightMargin=15*mm,
    topMargin=15*mm, bottomMargin=15*mm,
    title="Slit Lamp Illumination Techniques – Quick Reference",
    author="Orris Medical Reference"
)

styles = getSampleStyleSheet()

def S(name, **kw):
    return ParagraphStyle(name, **kw)

title_style = S("Title2",
    fontName="Helvetica-Bold", fontSize=22, textColor=WHITE,
    alignment=TA_CENTER, spaceAfter=4)
subtitle_style = S("Sub2",
    fontName="Helvetica", fontSize=11, textColor=TEAL_LIGHT,
    alignment=TA_CENTER, spaceAfter=2)
ref_style = S("Ref",
    fontName="Helvetica-Oblique", fontSize=8, textColor=TEAL_LIGHT,
    alignment=TA_CENTER)
section_head = S("SecH",
    fontName="Helvetica-Bold", fontSize=13, textColor=WHITE,
    alignment=TA_CENTER, spaceAfter=4, spaceBefore=2)
card_title = S("CardT",
    fontName="Helvetica-Bold", fontSize=11, textColor=TEAL,
    spaceAfter=3)
card_body = S("CardB",
    fontName="Helvetica", fontSize=8.5, textColor=DARK,
    spaceAfter=2, leading=13)
card_label = S("CardL",
    fontName="Helvetica-Bold", fontSize=8, textColor=MID_GREY,
    spaceAfter=1)
bullet_style = S("Bul",
    fontName="Helvetica", fontSize=8.5, textColor=DARK,
    leftIndent=10, spaceAfter=1, leading=13)
tip_style = S("Tip",
    fontName="Helvetica-Oblique", fontSize=8, textColor=ORANGE,
    spaceAfter=2)
footer_style = S("Foot",
    fontName="Helvetica", fontSize=7, textColor=colors.HexColor("#AAAAAA"),
    alignment=TA_CENTER)
filter_head = S("FH",
    fontName="Helvetica-Bold", fontSize=9, textColor=WHITE, alignment=TA_CENTER)
filter_body = S("FB",
    fontName="Helvetica", fontSize=8, textColor=DARK, leading=12)
table_hdr = S("TH",
    fontName="Helvetica-Bold", fontSize=8.5, textColor=WHITE, alignment=TA_CENTER)
table_cell = S("TC",
    fontName="Helvetica", fontSize=8, textColor=DARK, alignment=TA_CENTER, leading=12)
table_cell_l = S("TCL",
    fontName="Helvetica", fontSize=8, textColor=DARK, alignment=TA_LEFT, leading=12)

# ── Diagram helpers ──────────────────────────────────────────────────────────────

def cornea_arc(d, cx, cy, r=28, fill=colors.HexColor("#CCE8FF"), stroke=TEAL):
    """Simple cornea outline arc approximated as an ellipse sector."""
    # Draw as a simple arc outline
    from reportlab.graphics.shapes import ArcPath
    # Just draw the corneal silhouette as a filled ellipse segment
    pass

def make_eye_diagram(technique, w=120, h=90):
    """Return a Drawing of the eye cross-section with beam for each technique."""
    d = Drawing(w, h)

    # Background
    bg = Rect(0, 0, w, h, fillColor=colors.HexColor("#F7FBFF"), strokeColor=TEAL_LIGHT, strokeWidth=0.5)
    d.add(bg)

    cx, cy = w * 0.5, h * 0.42

    # ── Eye outline (cornea+sclera simplified) ───────────────────────────────
    # Sclera (white of eye) - wide ellipse
    sclera = Rect(cx - 38, cy - 14, 76, 28,
                  fillColor=colors.HexColor("#FAFAFA"),
                  strokeColor=colors.HexColor("#BBBBBB"), strokeWidth=0.8,
                  rx=14, ry=14)
    d.add(sclera)

    # Iris
    iris = Circle(cx, cy, 11, fillColor=colors.HexColor("#7B5EA7"),
                  strokeColor=colors.HexColor("#5A3E8A"), strokeWidth=0.8)
    d.add(iris)

    # Pupil
    pupil = Circle(cx, cy, 5, fillColor=DARK, strokeColor=None)
    d.add(pupil)

    # Cornea (transparent arc - represented as a thin curved cap)
    cornea = Rect(cx - 16, cy + 10, 32, 8,
                  fillColor=colors.HexColor("#D4EFFF"),
                  strokeColor=TEAL, strokeWidth=1.0,
                  rx=10, ry=4)
    d.add(cornea)
    # cornea label
    d.add(String(cx, cy + 22, "Cornea", fontSize=6, fillColor=TEAL,
                 textAnchor="middle"))

    # Lens
    lens = Rect(cx - 8, cy - 9, 16, 18,
                fillColor=colors.HexColor("#E8F8FF"),
                strokeColor=colors.HexColor("#99CCEE"), strokeWidth=0.7,
                rx=6, ry=6)
    d.add(lens)

    # ── Beam drawing per technique ───────────────────────────────────────────
    if technique == "diffuse":
        # Wide fan of rays from upper-left
        for dx in [-8, -4, 0, 4, 8]:
            d.add(Line(cx - 35 + dx, h - 8, cx + dx, cy + 18,
                       strokeColor=colors.HexColor("#FFD700"),
                       strokeWidth=1.2))
        d.add(String(cx, h - 2, "Wide diffuse beam", fontSize=6,
                     fillColor=MID_GREY, textAnchor="middle"))

    elif technique == "optical_section":
        # Narrow single beam at angle
        d.add(Line(cx - 30, h - 5, cx, cy + 18,
                   strokeColor=RED_BEAM, strokeWidth=2.0))
        # Show layers
        for i, (lbl, col) in enumerate([("Epi", "#FF6B6B"), ("Stroma", "#FF9966"), ("Endo", "#FFCC66")]):
            yy = cy + 17 - i * 4
            d.add(Line(cx - 4, yy, cx + 4, yy,
                       strokeColor=colors.HexColor(col), strokeWidth=1.5))
        d.add(String(cx, h - 2, "Narrow optical section", fontSize=6,
                     fillColor=MID_GREY, textAnchor="middle"))

    elif technique == "indirect":
        # Beam beside area, scope at center
        d.add(Line(cx + 28, h - 5, cx + 18, cy + 18,
                   strokeColor=RED_BEAM, strokeWidth=1.8))
        # Dashed scope line at center
        for i in range(3):
            yy = h - 8 - i * 8
            d.add(Line(cx, yy, cx, yy - 5,
                       strokeColor=TEAL, strokeWidth=1.0))
        d.add(String(cx, h - 2, "Beam beside area", fontSize=6,
                     fillColor=MID_GREY, textAnchor="middle"))

    elif technique == "scleral":
        # Beam at limbus (side), light path inside cornea
        # Incoming beam to limbus
        d.add(Line(cx - 50, h - 10, cx - 16, cy + 14,
                   strokeColor=RED_BEAM, strokeWidth=2.0))
        # Internal reflection arrows along cornea
        d.add(Line(cx - 16, cy + 14, cx + 16, cy + 14,
                   strokeColor=colors.HexColor("#FFA500"), strokeWidth=1.5))
        d.add(Line(cx + 16, cy + 14, cx + 35, h - 10,
                   strokeColor=RED_BEAM, strokeWidth=1.5))
        # Scatter point
        scatter = Circle(cx, cy + 20, 4,
                         fillColor=colors.HexColor("#FFEE55"),
                         strokeColor=GOLD, strokeWidth=1)
        d.add(scatter)
        d.add(String(cx, h - 2, "Beam → Limbus, TIR in cornea", fontSize=6,
                     fillColor=MID_GREY, textAnchor="middle"))

    elif technique == "retro_iris":
        # Beam hits iris, reflected up through cornea
        d.add(Line(cx + 28, h - 5, cx + 8, cy + 10,
                   strokeColor=RED_BEAM, strokeWidth=2.0))
        # Reflected beam upward
        d.add(Line(cx + 8, cy + 10, cx, cy + 18,
                   strokeColor=colors.HexColor("#FF8C00"), strokeWidth=1.5))
        d.add(Line(cx, cy + 18, cx - 10, h - 5,
                   strokeColor=colors.HexColor("#FF8C00"), strokeWidth=1.0))
        d.add(String(cx, h - 2, "Reflects off iris → cornea", fontSize=6,
                     fillColor=MID_GREY, textAnchor="middle"))

    elif technique == "retro_fundus":
        # Coaxial beam → fundus → back
        d.add(Line(cx, h - 5, cx, cy + 18,
                   strokeColor=RED_BEAM, strokeWidth=2.0))
        d.add(Line(cx, cy + 18, cx, cy - 14,
                   strokeColor=RED_BEAM, strokeWidth=1.5))
        # Fundus glow
        d.add(Rect(cx - 20, cy - 20, 40, 8,
                   fillColor=colors.HexColor("#FF6600"),
                   strokeColor=None, rx=3, ry=3))
        d.add(String(cx, cy - 16, "Fundus", fontSize=5.5,
                     fillColor=WHITE, textAnchor="middle"))
        # Return path
        for dx in [-6, 0, 6]:
            d.add(Line(cx + dx, cy - 12, cx + dx - 2, h - 5,
                       strokeColor=colors.HexColor("#FFB347"), strokeWidth=0.8))
        d.add(String(cx, h - 2, "Coaxial, dilated pupil", fontSize=6,
                     fillColor=MID_GREY, textAnchor="middle"))

    elif technique == "specular":
        # Angle of incidence = angle of reflection
        d.add(Line(cx - 30, h - 5, cx, cy + 18,
                   strokeColor=RED_BEAM, strokeWidth=2.0))
        d.add(Line(cx, cy + 18, cx + 30, h - 5,
                   strokeColor=colors.HexColor("#FF8C00"), strokeWidth=2.0))
        # Normal line
        d.add(Line(cx, cy + 18, cx, cy + 32,
                   strokeColor=MID_GREY, strokeWidth=0.7))
        d.add(String(cx - 22, h - 10, "i", fontSize=7, fillColor=RED_BEAM))
        d.add(String(cx + 18, h - 10, "r", fontSize=7,
                     fillColor=colors.HexColor("#FF8C00")))
        d.add(String(cx, h - 2, "Angle i = Angle r", fontSize=6,
                     fillColor=MID_GREY, textAnchor="middle"))

    return d


# ── Technique data ──────────────────────────────────────────────────────────────
techniques = [
    {
        "name": "1. Diffuse Illumination",
        "diagram": "diffuse",
        "setup": "Wide beam + diffuser/frosted glass; low intensity; 45° angle",
        "uses": [
            "General survey of anterior segment",
            "Gross lid, conjunctiva & corneal changes",
            "Contact lens fitting performance",
            "Initial orientation before other techniques",
        ],
        "tip": "Always start your exam here — gives a quick overview before fine detail work.",
        "mag": "Low (6–10×)",
        "beam": "Wide / diffuse",
        "angle": "~45°",
        "color": TEAL_PALE,
    },
    {
        "name": "2. Direct Focal (Parallelepiped)",
        "diagram": "optical_section",
        "setup": "Beam 1–2 mm wide at 30–45° to microscope axis; moderate intensity",
        "uses": [
            "3D block view of corneal layers",
            "Anterior chamber depth assessment",
            "Epithelial & stromal pathology",
            "Debris beneath contact lens",
        ],
        "tip": "Use red-free (green) filter to enhance corneal nerves and blood vessels.",
        "mag": "Medium–high (16–25×)",
        "beam": "1–2 mm wide",
        "angle": "30–45°",
        "color": colors.HexColor("#EAF4FB"),
    },
    {
        "name": "3. Optical Section (Thin Beam)",
        "diagram": "optical_section",
        "setup": "Narrowest beam possible; high intensity; 30–45°",
        "uses": [
            "Exact depth of corneal lesions (epi/stroma/endo)",
            "Flare assessment in anterior chamber",
            "Crystalline lens assessment",
            "Corneal foreign body depth",
        ],
        "tip": "Adjust slit height to measure vertical/horizontal lesion size using the calibrated scale.",
        "mag": "High (25–40×)",
        "beam": "Thinnest (< 0.5 mm)",
        "angle": "30–45°",
        "color": colors.HexColor("#FFF7EC"),
    },
    {
        "name": "4. Indirect (Proximal) Illumination",
        "diagram": "indirect",
        "setup": "Beam focused beside (not on) area of interest; microscope at area",
        "uses": [
            "Corneal microcysts & vacuoles",
            "Epithelial infiltrates",
            "Subtle changes missed by direct illumination",
            "Contact lens-induced changes",
        ],
        "tip": "Offset the beam just 1–2 mm beside the area — the indirect glow reveals fine detail.",
        "mag": "Medium (16–25×)",
        "beam": "Moderate",
        "angle": "30–45°",
        "color": TEAL_PALE,
    },
    {
        "name": "5. Scleral Scatter",
        "diagram": "scleral",
        "setup": "Beam at limbus (decentralized); microscope focused centrally on cornea",
        "uses": [
            "Subtle stromal haze (e.g., early keratoconus)",
            "Cellular & lipid infiltration",
            "Fleischer ring, Vogt's striae",
            "Contact lens-induced oedema",
        ],
        "tip": "The entire cornea glows faintly — any opacity appears as a bright spot. No filters needed.",
        "mag": "Low–medium",
        "beam": "Focused at limbus",
        "angle": "Decentralized",
        "color": colors.HexColor("#FFF4E6"),
    },
    {
        "name": "6. Retroillumination (Iris)",
        "diagram": "retro_iris",
        "setup": "Beam on iris; microscope focused on cornea; use iris as reflector",
        "uses": [
            "Corneal epithelial cysts",
            "Keratic precipitates (KPs)",
            "Small corneal vessels",
            "Fine endothelial changes",
        ],
        "tip": "Direct: lesion appears dark on bright iris. Indirect: move to dark iris area — lesion appears bright.",
        "mag": "High (25–40×)",
        "beam": "Narrow",
        "angle": "Variable",
        "color": TEAL_PALE,
    },
    {
        "name": "7. Retroillumination (Fundus)",
        "diagram": "retro_fundus",
        "setup": "Pupil dilated; coaxial beam & microscope; beam strikes fundus",
        "uses": [
            "Lens/vitreous opacities",
            "Posterior corneal changes",
            "Contact lens surface deposits (front & back)",
            "Media opacities assessment",
        ],
        "tip": "Requires dilation. Red-orange fundal glow silhouettes opacities dramatically.",
        "mag": "Medium",
        "beam": "Coaxial",
        "angle": "Coaxial (0°)",
        "color": colors.HexColor("#FFF0F0"),
    },
    {
        "name": "8. Specular Reflection",
        "diagram": "specular",
        "setup": "Angle of incidence = angle of reflection from corneal surface",
        "uses": [
            "Endothelial cell morphology (mosaic pattern)",
            "Corneal guttata & pseudoguttata",
            "Pre-corneal tear film lipid layer",
            "Contact lens front-surface wetting",
        ],
        "tip": "Position microscope to capture the bright specular reflex — adjust until endothelial mosaic is visible.",
        "mag": "High (40×)",
        "beam": "Narrow–medium",
        "angle": "Mirror angle (i = r)",
        "color": colors.HexColor("#FDF5FF"),
    },
]

# ─────────────────────────────────────────────────────────────────────────────
# Build story
# ─────────────────────────────────────────────────────────────────────────────
story = []

# ── COVER HEADER BAND ────────────────────────────────────────────────────────
header_data = [[
    Paragraph("SLIT LAMP ILLUMINATION TECHNIQUES", title_style),
    Paragraph("Quick Reference Guide", subtitle_style),
    Paragraph("Based on Monica Chaudhary's Contact Lens Primer & Kanski's Clinical Ophthalmology", ref_style),
]]
header_table = Table(header_data, colWidths=[W - 30*mm])
header_table.setStyle(TableStyle([
    ("BACKGROUND", (0, 0), (-1, -1), TEAL),
    ("ROUNDEDCORNERS", (0, 0), (-1, -1), [8]),
    ("TOPPADDING", (0, 0), (-1, -1), 12),
    ("BOTTOMPADDING", (0, 0), (-1, -1), 12),
    ("LEFTPADDING", (0, 0), (-1, -1), 12),
]))
story.append(header_table)
story.append(Spacer(1, 8*mm))

# ── INTRO BOX ────────────────────────────────────────────────────────────────
intro_text = (
    "<b>The slit lamp biomicroscope</b> uses Gullstrand's illumination system to project a bright, "
    "adjustable slit of light at the eye. By varying <b>beam width, angle, intensity</b> and <b>focus point</b>, "
    "8 distinct illumination techniques are possible — each revealing different ocular structures. "
    "Magnification ranges from <b>6× (survey)</b> to <b>40× (fine detail)</b>. "
    "Always begin with diffuse illumination for orientation."
)
intro_para = Paragraph(intro_text, ParagraphStyle("Intro",
    fontName="Helvetica", fontSize=9, textColor=DARK,
    alignment=TA_JUSTIFY, leading=14))
intro_box = Table([[intro_para]], colWidths=[W - 30*mm])
intro_box.setStyle(TableStyle([
    ("BACKGROUND", (0, 0), (-1, -1), LIGHT_GREY),
    ("BOX", (0, 0), (-1, -1), 0.8, TEAL_LIGHT),
    ("TOPPADDING", (0, 0), (-1, -1), 8),
    ("BOTTOMPADDING", (0, 0), (-1, -1), 8),
    ("LEFTPADDING", (0, 0), (-1, -1), 10),
    ("RIGHTPADDING", (0, 0), (-1, -1), 10),
    ("ROUNDEDCORNERS", (0, 0), (-1, -1), [5]),
]))
story.append(intro_box)
story.append(Spacer(1, 6*mm))

# ── TECHNIQUE CARDS (2 per row) ───────────────────────────────────────────────
CARD_W = (W - 30*mm - 6*mm) / 2   # two columns with gap

def make_card(t):
    diag = make_eye_diagram(t["diagram"], w=110, h=78)

    title_p = Paragraph(t["name"], card_title)
    setup_lbl = Paragraph("SETUP", card_label)
    setup_p = Paragraph(t["setup"], card_body)
    uses_lbl = Paragraph("CLINICAL USES", card_label)
    uses_items = [Paragraph(f"• {u}", bullet_style) for u in t["uses"]]
    tip_p = Paragraph(f"💡 {t['tip']}", tip_style)

    # Mini param strip
    param_data = [
        [Paragraph("MAG", filter_head), Paragraph("BEAM", filter_head), Paragraph("ANGLE", filter_head)],
        [Paragraph(t["mag"], filter_body), Paragraph(t["beam"], filter_body), Paragraph(t["angle"], filter_body)],
    ]
    param_table = Table(param_data, colWidths=[CARD_W*0.33]*3)
    param_table.setStyle(TableStyle([
        ("BACKGROUND", (0, 0), (-1, 0), TEAL),
        ("BACKGROUND", (0, 1), (-1, 1), colors.HexColor("#F8F8F8")),
        ("BOX", (0, 0), (-1, -1), 0.5, TEAL_LIGHT),
        ("INNERGRID", (0, 0), (-1, -1), 0.3, TEAL_LIGHT),
        ("TOPPADDING", (0, 0), (-1, -1), 3),
        ("BOTTOMPADDING", (0, 0), (-1, -1), 3),
        ("ALIGN", (0, 0), (-1, -1), "CENTER"),
    ]))

    content = [
        title_p,
        diag,
        Spacer(1, 2),
        setup_lbl, setup_p,
        uses_lbl,
        *uses_items,
        Spacer(1, 2),
        param_table,
        Spacer(1, 3),
        tip_p,
    ]

    card_inner = Table([[c] for c in content], colWidths=[CARD_W - 12])
    card_inner.setStyle(TableStyle([
        ("TOPPADDING", (0, 0), (-1, -1), 1),
        ("BOTTOMPADDING", (0, 0), (-1, -1), 1),
        ("LEFTPADDING", (0, 0), (-1, -1), 0),
        ("RIGHTPADDING", (0, 0), (-1, -1), 0),
    ]))

    outer = Table([[card_inner]], colWidths=[CARD_W])
    outer.setStyle(TableStyle([
        ("BACKGROUND", (0, 0), (-1, -1), t["color"]),
        ("BOX", (0, 0), (-1, -1), 1.0, TEAL),
        ("TOPPADDING", (0, 0), (-1, -1), 8),
        ("BOTTOMPADDING", (0, 0), (-1, -1), 8),
        ("LEFTPADDING", (0, 0), (-1, -1), 6),
        ("RIGHTPADDING", (0, 0), (-1, -1), 6),
        ("ROUNDEDCORNERS", (0, 0), (-1, -1), [6]),
    ]))
    return outer

# Pair techniques into rows of 2
for i in range(0, len(techniques), 2):
    left = make_card(techniques[i])
    right = make_card(techniques[i + 1]) if i + 1 < len(techniques) else Spacer(CARD_W, 1)
    row = Table([[left, right]], colWidths=[CARD_W, CARD_W], spaceBefore=0)
    row.setStyle(TableStyle([
        ("TOPPADDING", (0, 0), (-1, -1), 0),
        ("BOTTOMPADDING", (0, 0), (-1, -1), 0),
        ("LEFTPADDING", (0, 0), (-1, -1), 0),
        ("RIGHTPADDING", (0, 0), (-1, -1), 3),
        ("VALIGN", (0, 0), (-1, -1), "TOP"),
    ]))
    story.append(KeepTogether([row]))
    story.append(Spacer(1, 5*mm))

# ── PAGE 2 HEADER ─────────────────────────────────────────────────────────────
story.append(Spacer(1, 4*mm))
sec_bg = Table([[Paragraph("SUMMARY TABLE & FILTERS", section_head)]],
               colWidths=[W - 30*mm])
sec_bg.setStyle(TableStyle([
    ("BACKGROUND", (0, 0), (-1, -1), TEAL),
    ("TOPPADDING", (0, 0), (-1, -1), 7),
    ("BOTTOMPADDING", (0, 0), (-1, -1), 7),
    ("ROUNDEDCORNERS", (0, 0), (-1, -1), [6]),
]))
story.append(sec_bg)
story.append(Spacer(1, 5*mm))

# ── SUMMARY TABLE ─────────────────────────────────────────────────────────────
sum_headers = ["Technique", "Beam", "Angle", "Key Uses", "CL Application"]
sum_rows = [
    ["Diffuse", "Wide/diffuse", "~45°", "Gross survey, orientation", "Fitting performance"],
    ["Parallelepiped", "1–2 mm", "30–45°", "3D corneal block view, AC depth", "Debris under lens"],
    ["Optical Section", "< 0.5 mm", "30–45°", "Lesion depth (epi/stroma/endo)", "Lens thickness"],
    ["Indirect", "Moderate, offset", "30–45°", "Microcysts, infiltrates", "CL-induced changes"],
    ["Scleral Scatter", "Limbus-focused", "Decentralised", "Stromal haze, Fleischer ring", "Oedema detection"],
    ["Retro (Iris)", "Narrow, on iris", "Variable", "Epithelial cysts, KPs", "Deposits"],
    ["Retro (Fundus)", "Coaxial", "0° (coaxial)", "Media opacities, lens changes", "Surface deposits"],
    ["Specular Refl.", "Narrow–medium", "i = r", "Endothelium, guttata, tear film", "Surface wetting"],
]

table_header_row = [Paragraph(h, table_hdr) for h in sum_headers]
table_data = [table_header_row]
for i, row in enumerate(sum_rows):
    bg = TEAL_PALE if i % 2 == 0 else WHITE
    table_data.append([Paragraph(c, table_cell if j > 0 else table_cell_l) for j, c in enumerate(row)])

col_widths = [38*mm, 28*mm, 28*mm, 52*mm, 34*mm]
sum_table = Table(table_data, colWidths=col_widths, repeatRows=1)
sum_table.setStyle(TableStyle([
    ("BACKGROUND", (0, 0), (-1, 0), TEAL),
    ("ROWBACKGROUNDS", (0, 1), (-1, -1), [TEAL_PALE, WHITE]),
    ("BOX", (0, 0), (-1, -1), 1.0, TEAL),
    ("INNERGRID", (0, 0), (-1, -1), 0.4, TEAL_LIGHT),
    ("TOPPADDING", (0, 0), (-1, -1), 5),
    ("BOTTOMPADDING", (0, 0), (-1, -1), 5),
    ("LEFTPADDING", (0, 0), (-1, -1), 6),
    ("RIGHTPADDING", (0, 0), (-1, -1), 6),
    ("VALIGN", (0, 0), (-1, -1), "MIDDLE"),
    ("FONTNAME", (0, 0), (-1, 0), "Helvetica-Bold"),
]))
story.append(sum_table)
story.append(Spacer(1, 7*mm))

# ── FILTERS SECTION ───────────────────────────────────────────────────────────
filter_title = Table([[Paragraph("SLIT LAMP FILTERS", section_head)]],
                     colWidths=[W - 30*mm])
filter_title.setStyle(TableStyle([
    ("BACKGROUND", (0, 0), (-1, -1), ORANGE),
    ("TOPPADDING", (0, 0), (-1, -1), 7),
    ("BOTTOMPADDING", (0, 0), (-1, -1), 7),
    ("ROUNDEDCORNERS", (0, 0), (-1, -1), [6]),
]))
story.append(filter_title)
story.append(Spacer(1, 5*mm))

filters = [
    {
        "name": "Cobalt Blue Filter",
        "color": colors.HexColor("#1565C0"),
        "with": "Sodium fluorescein dye",
        "uses": [
            "Corneal epithelial defects / abrasions",
            "Tear film break-up time (TBUT)",
            "Contact lens fit assessment",
            "Applanation tonometry",
        ],
    },
    {
        "name": "Red-Free (Green) Filter",
        "color": colors.HexColor("#2E7D32"),
        "with": "No dye required",
        "uses": [
            "Blood vessels appear black (high contrast)",
            "Corneal nerve visualisation",
            "Haemorrhage detection",
            "Superficial vascular anomalies",
        ],
    },
    {
        "name": "Neutral Density Filter",
        "color": colors.HexColor("#546E7A"),
        "with": "Any technique",
        "uses": [
            "Reduces light intensity for photophobic patients",
            "Sensitive eyes or inflamed corneas",
            "Post-operative eyes",
        ],
    },
    {
        "name": "Yellow Filter (Wratten 12)",
        "color": colors.HexColor("#F57F17"),
        "with": "Cobalt blue + fluorescein",
        "uses": [
            "Enhances fluorescein contrast further",
            "Reduces background glare",
            "Useful for TBUT in bright conditions",
        ],
    },
]

filter_cards = []
for f in filters:
    title_p2 = Paragraph(f["name"],
        ParagraphStyle("FT", fontName="Helvetica-Bold", fontSize=9.5,
                       textColor=WHITE))
    with_p = Paragraph(f"Used with: {f['with']}",
        ParagraphStyle("FW", fontName="Helvetica-Oblique", fontSize=7.5,
                       textColor=colors.HexColor("#EEEEEE")))
    uses_ps = [Paragraph(f"• {u}", ParagraphStyle("FU", fontName="Helvetica",
               fontSize=8, textColor=DARK, leading=12, leftIndent=6))
               for u in f["uses"]]

    head_content = Table([[title_p2], [with_p]],
                         colWidths=[(W - 30*mm) / 4 - 8])
    head_content.setStyle(TableStyle([
        ("BACKGROUND", (0, 0), (-1, -1), f["color"]),
        ("TOPPADDING", (0, 0), (-1, -1), 5),
        ("BOTTOMPADDING", (0, 0), (-1, -1), 5),
        ("LEFTPADDING", (0, 0), (-1, -1), 6),
        ("RIGHTPADDING", (0, 0), (-1, -1), 4),
        ("ROUNDEDCORNERS", (0, 0), (0, 0), [5, 5, 0, 0]),
    ]))

    uses_content = Table([[u] for u in uses_ps],
                         colWidths=[(W - 30*mm) / 4 - 8])
    uses_content.setStyle(TableStyle([
        ("BACKGROUND", (0, 0), (-1, -1), LIGHT_GREY),
        ("TOPPADDING", (0, 0), (-1, -1), 3),
        ("BOTTOMPADDING", (0, 0), (-1, -1), 2),
        ("LEFTPADDING", (0, 0), (-1, -1), 4),
        ("RIGHTPADDING", (0, 0), (-1, -1), 4),
        ("BOX", (0, 0), (-1, -1), 0.6, f["color"]),
    ]))

    card2 = Table([[head_content], [uses_content]],
                  colWidths=[(W - 30*mm) / 4 - 8])
    card2.setStyle(TableStyle([
        ("TOPPADDING", (0, 0), (-1, -1), 0),
        ("BOTTOMPADDING", (0, 0), (-1, -1), 0),
        ("LEFTPADDING", (0, 0), (-1, -1), 0),
        ("RIGHTPADDING", (0, 0), (-1, -1), 0),
        ("BOX", (0, 0), (-1, -1), 1.0, f["color"]),
        ("ROUNDEDCORNERS", (0, 0), (-1, -1), [5]),
    ]))
    filter_cards.append(card2)

filter_row = Table([filter_cards],
                   colWidths=[(W - 30*mm) / 4] * 4)
filter_row.setStyle(TableStyle([
    ("TOPPADDING", (0, 0), (-1, -1), 0),
    ("BOTTOMPADDING", (0, 0), (-1, -1), 0),
    ("LEFTPADDING", (0, 0), (-1, -1), 0),
    ("RIGHTPADDING", (0, 0), (-1, -1), 3),
    ("VALIGN", (0, 0), (-1, -1), "TOP"),
]))
story.append(filter_row)
story.append(Spacer(1, 7*mm))

# ── CLINICAL TIPS BOX ────────────────────────────────────────────────────────
tips_title = Paragraph(
    "● CLINICAL PEARLS",
    ParagraphStyle("PT", fontName="Helvetica-Bold", fontSize=10,
                   textColor=ORANGE, spaceAfter=4))
tips = [
    "Always start with <b>diffuse illumination</b> for orientation before narrowing the beam.",
    "Use <b>scleral scatter</b> whenever diffuse illumination looks 'normal' but symptoms persist.",
    "For depth assessment, <b>optical section</b> is essential — the lesion's position within the beam tells you the layer.",
    "<b>Specular reflection</b> requires patience; move until the bright spot reveals the endothelial mosaic.",
    "In contact lens practice, <b>retroillumination from the fundus</b> best reveals surface deposits on both lens faces.",
    "Combine <b>cobalt blue filter + fluorescein</b> with specular reflection for tear film lipid layer assessment.",
    "For KPs: use <b>retroillumination from the iris</b> to reveal fine KPs that optical section may miss.",
]
tips_content = [tips_title] + [
    Paragraph(f"  ▶  {t}", ParagraphStyle("TT", fontName="Helvetica", fontSize=8.5,
              textColor=DARK, leading=14, spaceAfter=1, leftIndent=8))
    for t in tips
]
tips_inner = Table([[c] for c in tips_content], colWidths=[W - 30*mm - 16])
tips_inner.setStyle(TableStyle([
    ("TOPPADDING", (0, 0), (-1, -1), 1),
    ("BOTTOMPADDING", (0, 0), (-1, -1), 1),
    ("LEFTPADDING", (0, 0), (-1, -1), 0),
]))
tips_box = Table([[tips_inner]], colWidths=[W - 30*mm])
tips_box.setStyle(TableStyle([
    ("BACKGROUND", (0, 0), (-1, -1), ORANGE_LT),
    ("BOX", (0, 0), (-1, -1), 1.0, ORANGE),
    ("TOPPADDING", (0, 0), (-1, -1), 10),
    ("BOTTOMPADDING", (0, 0), (-1, -1), 10),
    ("LEFTPADDING", (0, 0), (-1, -1), 10),
    ("RIGHTPADDING", (0, 0), (-1, -1), 10),
    ("ROUNDEDCORNERS", (0, 0), (-1, -1), [6]),
]))
story.append(tips_box)
story.append(Spacer(1, 6*mm))

# ── FOOTER ───────────────────────────────────────────────────────────────────
story.append(HRFlowable(width="100%", thickness=0.5, color=TEAL_LIGHT))
story.append(Spacer(1, 2*mm))
story.append(Paragraph(
    "Reference: Monica Chaudhary, <i>Contact Lens Primer</i>, 1st ed., pp. 28–40  |  "
    "Kanski's Clinical Ophthalmology, 10th ed., p. 35  |  "
    "A.K. Khurana, <i>Theory and Practice of Optics and Refraction</i>, 3rd ed., pp. 351–61  |  "
    "Orris Medical Reference · orris.care",
    footer_style))

# ── Build ────────────────────────────────────────────────────────────────────
doc.build(story)
print(f"PDF saved → {OUTPUT_PATH}")
Running Command

cd /tmp/workspace/slit-lamp-guide && python generate_pdf.py

Running Command

ls -lh /tmp/workspace/slit-lamp-guide/

Your quick reference PDF is ready for download:

Slit Lamp Illumination Quick Reference

PDF Document · PDF


Here is what the guide covers across its pages:
Page 1 - Technique Cards (8 cards, 2-column layout)
Each card includes a schematic eye diagram showing the light beam path, setup parameters (magnification, beam width, angle), clinical uses, a contact lens application note, and a clinical pearl tip:
  1. Diffuse Illumination
  2. Direct Focal (Parallelepiped)
  3. Optical Section (Thin Beam)
  4. Indirect (Proximal) Illumination
  5. Scleral Scatter
  6. Retroillumination from Iris
  7. Retroillumination from Fundus
  8. Specular Reflection
Page 2 - Reference Tables
  • Full summary comparison table (technique, beam, angle, key uses, CL application)
  • 4 filter cards (Cobalt Blue, Red-Free/Green, Neutral Density, Yellow/Wratten 12) with uses for each
  • 7 clinical pearls box with exam/practice tips
References cited at the footer: Monica Chaudhary's Contact Lens Primer (1st ed., pp. 28-40), Kanski's Clinical Ophthalmology (10th ed., p. 35), and A.K. Khurana's Theory and Practice of Optics and Refraction (3rd ed., pp. 351-61).
This is a shared conversation. Sign in to Orris to start your own chat.