make laq’s and saq’s in priority wise and most repeated on this lists and arrange them in order
KNRUHS MBBS pathology previous question papers LAQ SAQ
~/
~/attachments/65500146-b40d-4cd6-af64-3cd6ae8324ac
mkdir -p "/tmp/workspace/knruhs-pathology-pyq-analysis/output" "/tmp/workspace/knruhs-pathology-pyq-analysis/src" && python -c "from pypdf import PdfReader; p='/tmp/workspace/attachments/65500146-b40d-4cd6-af64-3cd6ae8324ac/KNRUHS Pathology PYQs 2021-2026.pdf'; r=PdfReader(p); print('pages',len(r.pages)); out='\\n\\n'.join('--- PAGE %d ---\\n%s'%(i+1,(pg.extract_text() or '')) for i,pg in enumerate(r.pages)); open('/tmp/workspace/knruhs-pathology-pyq-analysis/output/extracted.txt','w',encoding='utf-8').write(out); print('chars',len(out))"
python - <<'PY' from pypdf import PdfReader p='/tmp/workspace/attachments/65500146-b40d-4cd6-af64-3cd6ae8324ac/KNRUHS Pathology PYQs 2021-2026.pdf' r=PdfReader(p) for i,pg in enumerate(r.pages,1): t=(pg.extract_text() or '').replace('\n',' ') print(f'PAGE {i}: {t[:1200]}\n') PY
python -c "from pypdf import PdfReader; p='/tmp/workspace/attachments/65500146-b40d-4cd6-af64-3cd6ae8324ac/KNRUHS Pathology PYQs 2021-2026.pdf'; r=PdfReader(p); [open('/tmp/workspace/knruhs-pathology-pyq-analysis/output/page_%02d.txt'%i,'w',encoding='utf-8').write(pg.extract_text() or '') for i,pg in enumerate(r.pages,1)]"
| Priority | LAQ topic / answer framework | Repeated in LAQ | Asked in |
|---|---|---|---|
| 1 | Bone tumours with Osteosarcoma: classification of bone tumours, gross, microscopy, osteoid, radiology | 2 | 2025 P-II, 2024 P-II |
| 1 | Alcoholic cirrhosis: classification, pathogenesis, morphology, complications | 2 | 2026 P-II, 2023 P-II |
| 1 | Haemolytic anaemia: classification and laboratory diagnosis; hereditary spherocytosis as a long case | 2 | 2025 P-I, 2024 P-I |
| 2 | Emphysema: classification, etiopathogenesis, types, gross and microscopy | 1 LAQ, repeatedly asked as SAQ/VSAQ | 2022 P-II; also 2025 P-II, 2023 P-II, 2026 P-II |
| 2 | Megaloblastic anaemia: classification of anaemia, etiopathogenesis and lab findings | 1 LAQ, repeated as short note | 2023 P-I, 2022 P-I |
| 2 | Tuberculous granuloma / granulomatous inflammation: definition, etiopathogenesis, morphology and fate | 1 LAQ, related questions recur | 2022 P-I; 2026 P-I VSAQ |
| 2 | Neoplasia: definition, benign versus malignant tumours, routes of metastasis | 1 LAQ, related topics recur | 2024 P-I; 2021 P-I |
| 2 | Nephrotic syndrome: definition, causes and pathophysiology | 1 LAQ | 2022 P-II |
| 2 | Acute post-streptococcal glomerulonephritis: diagnosis, etiopathogenesis, morphology, investigations | 1 LAQ | 2026 P-II |
| 3 | Amyloidosis: definition, secondary amyloidosis, organ morphology and stains | 1 LAQ, staining is highly repeated | 2025 P-I |
| 3 | Osteosarcoma-related tumour question: bone classification and morphology | Covered under Priority 1 | 2025 P-II, 2024 P-II |
| 3 | Pneumoconiosis with asbestosis: classification, pathology and complications | 1 LAQ | 2024 P-II |
| 3 | Necrosis: definition, types and examples | 1 LAQ, appears in brief note too | 2026 P-I, 2021 P-I |
| 3 | CNS tumours with meningioma: classification and detailed meningioma | 1 LAQ | 2023 P-II |
| 3 | CML: definition/classification of leukaemia and lab diagnosis of CML | 1 LAQ | 2022 P-I |
| 3 | Pulmonary oedema: classify oedema, pathophysiology and pathogenesis of pulmonary oedema | 1 LAQ | 2023 P-I |
| 3 | Gastric ulcer / peptic ulcer: pathogenesis, morphology and complications | 1 LAQ; related peptic ulcer repeats | 2025 P-II, 2023 P-II, 2022 P-II |
| 3 | Beta-thalassaemia major: clinical diagnosis, pathogenesis and laboratory diagnosis | 1 LAQ | 2026 P-I |
| Rank | Topic | Frequency | Previous appearances |
|---|---|---|---|
| 1 | Amyloid and stains for amyloid | 5 | 2026 P-I, 2024 P-I, 2023 P-I, 2022 P-I, 2021 P-I |
| 2 | Down syndrome | 4 | 2026 P-I, 2023 P-I, 2022 P-I, 2021 P-I |
| 3 | Osteoclastoma / Giant cell tumour of bone | 4 | 2026 P-II, 2023 P-II, 2022 P-II, 2021 P-II |
| 4 | Emphysema: types, pathology | 4 including LAQ | 2026 P-II, 2025 P-II, 2023 P-II, 2022 P-II |
| 5 | Cirrhosis and its complications | 4 including LAQ/brief note | 2026 P-II, 2025 P-II, 2023 P-II, 2021 P-II |
| 6 | Schwannoma microscopy | 3 | 2025 P-II, 2024 P-II, 2023 P-II |
| 7 | Chemical carcinogenesis / chemical carcinogens | 3 | 2024 P-I, 2023 P-I, 2022 P-I |
| 8 | Phagocytosis | 3 | 2024 P-I, 2023 P-I, 2022 P-I |
| 9 | ITP: etiopathogenesis, lab diagnosis | 3 | 2023 P-I, 2022 P-I, 2021 P-I |
| 10 | Thrombosis: formation, etiopathogenesis, Virchow triad | 3 | 2025 P-I, 2023 P-I, 2025 P-I VSAQ |
| Rank | Topic | Frequency | Previous appearances |
|---|---|---|---|
| 11 | Apoptosis | 2 | 2024 P-I, 2022 P-I |
| 12 | Basal cell carcinoma | 2 | 2025 P-II, 2022 P-II |
| 13 | Kidney changes in diabetes mellitus | 2 | 2025 P-II, 2023 P-II |
| 14 | Hashimoto thyroiditis | 2 | 2025 P-II, 2024 P-II |
| 15 | Barrett oesophagus | 2 | 2026 P-II, 2022 P-II |
| 16 | Cryptorchidism | 2 | 2026 P-II, 2025 P-II |
| 17 | Gallstones: pathology/risk factors | 2 | 2025 P-II, 2022 P-II |
| 18 | Atheroma / atherosclerosis | 2 | 2022 P-II, 2021 P-II |
| 19 | Blood transfusion reactions/complications | 2 | 2023 P-I, 2022 P-I |
| 20 | Megaloblastic anaemia: laboratory diagnosis | 2 | 2023 P-I LAQ, 2022 P-I |
| 21 | Shock: septic shock/pathophysiology | 2 plus one case | 2023 P-I, 2022 P-I, 2021 P-I |
| 22 | Wound healing: primary union, factors, complications | 3 across formats | 2026 P-I, 2023 P-I, 2021 P-I |
| 23 | CSF findings in meningitis | 2 | 2026 P-I pyogenic meningitis, 2022 P-II tubercular meningitis, 2021 P-II pyogenic meningitis |
| 24 | Rickets | 2 | 2025 P-I, 2024 P-I |
| 25 | Paraneoplastic syndromes | 2 | 2025 P-I, 2024 P-I |
| 26 | Bone marrow findings / AML-related questions | 2 or more related questions | 2026 P-I, 2024 P-I |
make laq’s and saq’s in priority wise and most repeated on this lists and arrange them in order and make a pdf according to paper wise
KNRUHS MBBS pathology question paper Paper I Paper II syllabus
~/
~/knruhs-pathology-pyq-analysis
python - <<'PY' from pathlib import Path base=Path('/tmp/workspace/knruhs-pathology-pyq-analysis') print('\n'.join(str(p) for p in base.rglob('*'))) PY
~/knruhs-pathology-pyq-analysis/src/create_priority_pdf.py
from reportlab.lib import colors
from reportlab.lib.enums import TA_CENTER, TA_LEFT
from reportlab.lib.pagesizes import A4
from reportlab.lib.styles import getSampleStyleSheet, ParagraphStyle
from reportlab.lib.units import cm
from reportlab.platypus import SimpleDocTemplate, Paragraph, Spacer, Table, TableStyle, PageBreak, KeepTogether
from reportlab.pdfbase.ttfonts import TTFont
from reportlab.pdfbase import pdfmetrics
from reportlab.lib.colors import HexColor
from pathlib import Path
OUT = Path('/tmp/workspace/knruhs-pathology-pyq-analysis/output/KNRUHS_Pathology_PYQ_Priority_Paperwise_2021_2026.pdf')
NAVY = HexColor('#12304A')
TEAL = HexColor('#007C83')
BLUE = HexColor('#EAF4F7')
GOLD = HexColor('#C59018')
LIGHT_GOLD = HexColor('#FFF7DB')
GREEN = HexColor('#EAF5EB')
GREY = HexColor('#5D6870')
LINE = HexColor('#D7E0E5')
styles = getSampleStyleSheet()
styles.add(ParagraphStyle(name='CoverTitle', parent=styles['Title'], fontName='Helvetica-Bold', fontSize=24, leading=29, alignment=TA_CENTER, textColor=NAVY, spaceAfter=10))
styles.add(ParagraphStyle(name='CoverSub', parent=styles['Normal'], fontName='Helvetica', fontSize=11.5, leading=16, alignment=TA_CENTER, textColor=GREY))
styles.add(ParagraphStyle(name='H1x', parent=styles['Heading1'], fontName='Helvetica-Bold', fontSize=18, leading=23, textColor=NAVY, spaceBefore=4, spaceAfter=10))
styles.add(ParagraphStyle(name='H2x', parent=styles['Heading2'], fontName='Helvetica-Bold', fontSize=13.3, leading=17, textColor=TEAL, spaceBefore=12, spaceAfter=7))
styles.add(ParagraphStyle(name='Bodyx', parent=styles['BodyText'], fontName='Helvetica', fontSize=9.2, leading=13, textColor=HexColor('#24323B'), spaceAfter=5))
styles.add(ParagraphStyle(name='Smallx', parent=styles['BodyText'], fontName='Helvetica', fontSize=7.8, leading=10.2, textColor=HexColor('#24323B')))
styles.add(ParagraphStyle(name='Callout', parent=styles['BodyText'], fontName='Helvetica-Bold', fontSize=9.1, leading=13, textColor=NAVY, backColor=LIGHT_GOLD, borderColor=GOLD, borderWidth=0.5, borderPadding=7, spaceBefore=5, spaceAfter=10))
styles.add(ParagraphStyle(name='Footerx', parent=styles['Normal'], fontName='Helvetica', fontSize=7.4, textColor=GREY, alignment=TA_CENTER))
def P(txt, style='Bodyx'):
return Paragraph(txt, styles[style])
def cell(txt, style='Smallx'):
return P(txt, style)
def priority_label(n):
names = {1: 'P1: MUST DO', 2: 'P2: HIGH YIELD', 3: 'P3: NEXT'}
bg = {1: HexColor('#E5F3E7'), 2: LIGHT_GOLD, 3: BLUE}
return names[n], bg[n]
def make_table(headers, rows, widths):
data = [[cell(h, 'Smallx') for h in headers]]
priorities=[]
for row in rows:
r=[]
for x in row:
r.append(cell(str(x)))
data.append(r)
priorities.append(row[0] if row else '')
t=Table(data, colWidths=widths, repeatRows=1, hAlign='LEFT')
commands=[
('BACKGROUND',(0,0),(-1,0),NAVY), ('TEXTCOLOR',(0,0),(-1,0),colors.white),
('FONTNAME',(0,0),(-1,0),'Helvetica-Bold'), ('VALIGN',(0,0),(-1,-1),'TOP'),
('GRID',(0,0),(-1,-1),0.28,LINE), ('LEFTPADDING',(0,0),(-1,-1),5),
('RIGHTPADDING',(0,0),(-1,-1),5), ('TOPPADDING',(0,0),(-1,-1),4), ('BOTTOMPADDING',(0,0),(-1,-1),4),
]
for i,p in enumerate(priorities,1):
if str(p).startswith('P1'):
commands.append(('BACKGROUND',(0,i),(-1,i),GREEN))
elif str(p).startswith('P2'):
commands.append(('BACKGROUND',(0,i),(-1,i),LIGHT_GOLD))
elif i%2==0:
commands.append(('BACKGROUND',(0,i),(-1,i),HexColor('#F7FAFB')))
t.setStyle(TableStyle(commands))
return t
def footer(canvas, doc):
canvas.saveState()
canvas.setStrokeColor(LINE)
canvas.line(doc.leftMargin, 1.22*cm, A4[0]-doc.rightMargin, 1.22*cm)
canvas.setFont('Helvetica',7.3)
canvas.setFillColor(GREY)
canvas.drawString(doc.leftMargin, .83*cm, 'KNRUHS Pathology PYQ Priority Planner | 2021 to January 2026')
canvas.drawRightString(A4[0]-doc.rightMargin, .83*cm, f'Page {doc.page}')
canvas.restoreState()
story=[]
story += [Spacer(1, 3.2*cm), P('KNRUHS PATHOLOGY', 'CoverTitle'), P('PYQ Priority Planner', 'CoverTitle'), P('Paper-wise LAQs and SAQs arranged by recurrence and examination priority', 'CoverSub'), Spacer(1, .6*cm), P('Source period: 2021 to January 2026 | Prepared from the supplied PYQ compilation', 'CoverSub'), Spacer(1, 1.15*cm)]
cover_box = Table([[P('<b>HOW TO USE THIS PDF</b><br/>Study Paper I and Paper II separately. Within each section, complete P1 before P2 and P3. Frequency is based on appearances in the supplied papers. Similar wordings and changes in marks pattern have been combined under one topic. SAQ includes Short Notes, Short Answers and Brief Notes.', 'Bodyx')]], colWidths=[16.6*cm])
cover_box.setStyle(TableStyle([('BACKGROUND',(0,0),(-1,-1),BLUE),('BOX',(0,0),(-1,-1),0.7,TEAL),('LEFTPADDING',(0,0),(-1,-1),12),('RIGHTPADDING',(0,0),(-1,-1),12),('TOPPADDING',(0,0),(-1,-1),10),('BOTTOMPADDING',(0,0),(-1,-1),10)]))
story += [cover_box, Spacer(1,.7*cm), P('<b>Priority rule:</b> P1 = repeated 3 or more times, or repeatedly tested as an LAQ. P2 = repeated twice or a major LAQ with strong exam value. P3 = asked once but still important for coverage.', 'Callout'), PageBreak()]
# Orientation
story += [P('Quick Paper-wise Map','H1x'), P('The older 2021 paper used 10-mark case questions and 4-mark short notes. From 2022 onward, the papers mostly contain 15-mark essays plus 5 or 6-mark short answers. This guide treats the case question as LAQ-equivalent and combines all short-note formats under SAQ.', 'Bodyx')]
map_rows = [
('Paper I', 'General pathology and haematology', 'Cell injury, inflammation, haemodynamic disorders, immunopathology, neoplasia, genetics, anaemias, leukaemias'),
('Paper II', 'Systemic pathology', 'Respiratory, GIT-hepatobiliary, renal, endocrine, cardiovascular, CNS, bone, breast, genital and skin pathology'),
]
story += [make_table(['Paper','Main focus','High-yield clusters'], map_rows, [2.4*cm,4.1*cm,10.1*cm]), Spacer(1,.3*cm), P('<b>Important:</b> The frequency count is not a prediction that the same question will repeat. It identifies recurring core areas that KNRUHS has tested through different question formats.', 'Callout'), PageBreak()]
# PAPER I
story += [P('PAPER I: General Pathology and Haematology','H1x'), P('Papers analysed: August 2021, September 2022, August 2023, July 2024, August 2025 and January 2026.', 'Bodyx')]
story += [P('LAQs: Priority order','H2x'), P('Prepare every P1 LAQ as a complete 15-mark answer with definition, classification where applicable, pathogenesis, morphology, investigations and suitable diagram/flowchart.', 'Bodyx')]
p1_laq = [
('P1','Haemolytic anaemia', 'Classify haemolytic anaemia. Lab diagnosis. Add hereditary spherocytosis: etiopathogenesis and investigations.', '2 LAQs', '2025, 2024'),
('P1','Megaloblastic anaemia', 'Classify anaemia. Etiopathology and laboratory findings. Correlate with bone marrow in vitamin B12 deficiency.', '1 LAQ + related SAQs', '2023; 2022, 2026'),
('P1','Neoplasia', 'Define. Benign versus malignant differences. Routes/modes of metastasis with examples.', '1 LAQ + related SAQ', '2024; 2021'),
('P2','Granulomatous inflammation / tuberculous granuloma', 'Definition, etiopathogenesis, morphology and fate of tuberculous granuloma.', '1 LAQ + related VSAQ', '2022; 2026'),
('P2','Oedema and pulmonary oedema', 'Classify oedema, pathophysiological categories and pulmonary oedema pathogenesis.', '1 LAQ + related SAQ', '2023'),
('P2','Chronic myeloid leukaemia', 'Define/classify leukaemia and write laboratory diagnosis of CML.', '1 LAQ', '2022'),
('P2','Amyloidosis', 'Define. Secondary amyloidosis: organ morphology and staining reactions.', '1 LAQ + 5 stain questions', '2025; 2021-26'),
('P3','Necrosis', 'Definition, types and examples. Practice coagulative, liquefactive, caseous, fat, fibrinoid and gangrenous necrosis.', '1 LAQ + brief note', '2026; 2021'),
('P3','Beta-thalassaemia major', 'Clinical diagnosis, pathogenesis and laboratory diagnosis.', '1 LAQ', '2026'),
]
story += [make_table(['Priority','LAQ topic','What to prepare','Frequency','Asked in'], p1_laq, [2.15*cm,3.45*cm,7.1*cm,2.1*cm,2.1*cm]), Spacer(1,.25*cm)]
story += [P('Paper I LAQ last-day order: Haemolytic anaemia -> Megaloblastic anaemia -> Neoplasia -> Tuberculous granuloma -> Oedema -> CML -> Amyloidosis.', 'Callout')]
story += [P('SAQs: Priority order','H2x')]
p1_saq = [
('P1','Amyloid: special stains / demonstration', '5', '2026, 2024, 2023, 2022, 2021'),
('P1','Down syndrome', '4', '2026, 2023, 2022, 2021'),
('P1','Phagocytosis', '3', '2024, 2023, 2022'),
('P1','Chemical carcinogenesis / carcinogens', '3', '2024, 2023, 2022'),
('P1','ITP', '3', '2023, 2022, 2021'),
('P1','Wound healing: primary union, factors, complications', '3', '2026, 2023, 2021'),
('P1','Thrombosis: formation/etiopathogenesis/Virchow triad', '3', '2025, 2023, 2025 VSAQ'),
('P1','Shock: septic shock/pathophysiology', '3', '2023, 2022, 2021 case'),
('P2','Megaloblastic anaemia / B12 marrow findings', '3 related', '2023, 2022, 2026'),
('P2','Apoptosis', '2', '2024, 2022'),
('P2','Barr body', '3', '2025, 2023, 2022'),
('P2','Transudate versus exudate', '2', '2026, 2023'),
('P2','Blood transfusion reactions/complications', '2', '2023, 2022'),
('P2','Chemotaxis and chemoattractants', '2', '2025, 2024'),
('P3','Leukemoid reaction; AML classification/PBF; Hodgkin lymphoma', '1 each', '2025, 2024, 2026'),
('P3','Rickets, Niemann-Pick disease, vWD, fat embolism, fracture healing', '1 each', '2024-2026'),
('P3','SLE, hypersensitivity, acute phase reactants, aplastic anaemia', '1 each', '2021-2024'),
]
story += [make_table(['Priority','SAQ topic','Count','Previous appearances'], p1_saq, [2.15*cm,7.4*cm,2.2*cm,5.15*cm]), PageBreak()]
# PAPER II
story += [P('PAPER II: Systemic Pathology','H1x'), P('Papers analysed: August 2021, September 2022, August 2023, February 2024, August 2025 and January 2026.', 'Bodyx')]
story += [P('LAQs: Priority order','H2x'), P('For morphology-based LAQs, always write gross and microscopy separately. Add a labelled sketch where it is easy to score, especially osteosarcoma, emphysema, cirrhosis, meningioma and glomerulonephritis.', 'Bodyx')]
p2_laq = [
('P1','Bone tumours with osteosarcoma', 'Classify bone tumours. Osteosarcoma: gross, microscopy, osteoid and radiological correlation.', '2 LAQs', '2025, 2024'),
('P1','Alcoholic cirrhosis', 'Classify cirrhosis. Pathogenesis, morphology and complications of alcoholic cirrhosis.', '2 LAQs', '2026, 2023'),
('P1','Emphysema', 'Classify. Etiopathogenesis, types, gross and microscopy.', '1 LAQ + 4 related SAQs', '2022; 2023-26'),
('P2','Nephrotic syndrome', 'Definition, causes and pathophysiology. Link with oedema mechanism.', '1 LAQ', '2022'),
('P2','Acute post-streptococcal GN', 'Diagnosis, etiopathogenesis, morphology and investigations.', '1 LAQ', '2026'),
('P2','Peptic/gastric ulcer', 'Pathogenesis, gross, microscopy and complications.', '1 LAQ + repeated SAQs', '2025; 2023, 2022'),
('P2','Pneumoconiosis with asbestosis', 'Classify pneumoconiosis. Pathology and complications of asbestosis.', '1 LAQ', '2024'),
('P2','CNS tumours with meningioma', 'Classify CNS tumours. Detailed meningioma.', '1 LAQ', '2023'),
('P3','Carcinoma stomach case', 'Diagnosis, etiopathogenesis, morphology and metastasis pattern.', '1 case LAQ', '2021'),
]
story += [make_table(['Priority','LAQ topic','What to prepare','Frequency','Asked in'], p2_laq, [2.15*cm,3.45*cm,7.1*cm,2.1*cm,2.1*cm]), Spacer(1,.25*cm)]
story += [P('Paper II LAQ last-day order: Bone tumours/osteosarcoma -> Alcoholic cirrhosis -> Emphysema -> Nephrotic syndrome -> APSGN -> Peptic ulcer -> Asbestosis -> Meningioma.', 'Callout')]
story += [P('SAQs: Priority order','H2x')]
p2_saq = [
('P1','Osteoclastoma / giant cell tumour of bone', '4', '2026, 2023, 2022, 2021'),
('P1','Emphysema: types/pathology', '4', '2026, 2025, 2023, 2022'),
('P1','Cirrhosis and complications', '4', '2026, 2025, 2023, 2021'),
('P1','Schwannoma microscopy', '3', '2025, 2024, 2023'),
('P2','Peptic/gastric ulcer', '3', '2025 LAQ, 2023, 2022'),
('P2','Kidney changes in diabetes mellitus', '2', '2025, 2023'),
('P2','Hashimoto thyroiditis', '2', '2025, 2024'),
('P2','Barrett oesophagus', '2', '2026, 2022'),
('P2','Cryptorchidism', '2', '2026, 2025'),
('P2','Gallstones: pathology/risk factors', '2', '2025, 2022'),
('P2','Atheroma/atherosclerosis', '2', '2022, 2021'),
('P2','Basal cell carcinoma', '2', '2025, 2022'),
('P2','CSF in meningitis', '2', '2022 TB; 2021 pyogenic'),
('P3','Dysgerminoma, phyllodes tumour, pheochromocytoma, Ewing sarcoma', '1-2', '2023-2026'),
('P3','Graves disease, BPH, endometrial hyperplasia, hydatidiform mole, teratoma', '1 each', '2022-2025'),
('P3','RHD, lung abscess, cor pulmonale, Goodpasture, gout, retinoblastoma', '1 each', '2024-2025'),
]
story += [make_table(['Priority','SAQ topic','Count','Previous appearances'], p2_saq, [2.15*cm,7.4*cm,2.2*cm,5.15*cm]), PageBreak()]
# Paper-wise final checklists
story += [P('Rapid Revision Checklists','H1x'), P('Use these only after completing the priority tables. The aim is to ensure that repeated topics are not left incomplete.', 'Bodyx')]
story += [P('Paper I: P1 answer checklist','H2x')]
p1check = [
'Amyloid: definition, types, Congo red, apple-green birefringence, other stains.',
'Down syndrome: karyotypes, clinical features, complications and screening concept.',
'Phagocytosis: recognition/attachment, engulfment, killing and killing defects.',
'Chemical carcinogenesis: direct versus indirect carcinogens, examples and mechanism.',
'ITP: pathogenesis, clinical features, peripheral smear/bone marrow and treatment outline only if asked.',
'Wound healing: phases, primary union, factors affecting healing and complications.',
'Thrombosis: Virchow triad, fate and differences from postmortem clot.',
'Shock: types and stages; septic shock pathogenesis.',
]
for x in p1check: story.append(P('• '+x,'Bodyx'))
story += [Spacer(1,.15*cm), P('Paper II: P1 answer checklist','H2x')]
p2check = [
'Osteosarcoma and osteoclastoma: age, site, X-ray clue, gross, microscopy and differentials.',
'Emphysema: centriacinar versus panacinar comparison; gross and microscopic changes.',
'Cirrhosis: alcoholic liver disease progression, morphology and portal hypertension complications.',
'Schwannoma: Antoni A/B areas and Verocay bodies.',
'Peptic ulcer: gross morphology, microscopy, complications and malignant ulcer distinction.',
'Diabetic nephropathy: diffuse and nodular glomerulosclerosis, vascular and infective changes.',
'Hashimoto thyroiditis: autoimmune pathogenesis and microscopy.',
'Barrett oesophagus, cryptorchidism, gallstones, atheroma and basal cell carcinoma: prepare in standard 5-6 mark format.',
]
for x in p2check: story.append(P('• '+x,'Bodyx'))
story += [Spacer(1,.3*cm), P('<b>Source note:</b> The document is an exam-priority analysis of the questions contained in the supplied KNRUHS Pathology PYQ PDF. Exact university paper wording and marks should be checked against official KNRUHS papers before the examination.', 'Callout')]
doc=SimpleDocTemplate(str(OUT), pagesize=A4, rightMargin=1.15*cm, leftMargin=1.15*cm, topMargin=1.15*cm, bottomMargin=1.65*cm, title='KNRUHS Pathology PYQ Priority Planner')
doc.build(story, onFirstPage=footer, onLaterPages=footer)
print(OUT)
python "/tmp/workspace/knruhs-pathology-pyq-analysis/src/create_priority_pdf.py" && python - <<'PY' from pypdf import PdfReader p='/tmp/workspace/knruhs-pathology-pyq-analysis/output/KNRUHS_Pathology_PYQ_Priority_Paperwise_2021_2026.pdf' r=PdfReader(p) print('exists',__import__('os').path.exists(p),'pages',len(r.pages),'size',__import__('os').path.getsize(p)) for i,pg in enumerate(r.pages,1): text=pg.extract_text() or '' print(i, len(text), text[:70].replace('\n',' | ')) PY
python - <<'PY' from pypdf import PdfReader p='/tmp/workspace/knruhs-pathology-pyq-analysis/output/KNRUHS_Pathology_PYQ_Priority_Paperwise_2021_2026.pdf' r=PdfReader(p) for i in [3,4,5,6]: print('\n---PAGE',i,'---') print(r.pages[i-1].extract_text()) PY
KNRUHS Pathology PYQ Priority Paperwise 2021 2026
PDF Document · PDF
make laq’s and saq’s in priority wise and most repeated on this lists and arrange all questions in order that atleast one repeated also and make a pdf according to paper wise
KNRUHS Pathology Paper I Paper II previous question papers 2021 2026
~/
pathology education examination assessment
.../src/create_complete_repeated_pdf.py
from pathlib import Path
from reportlab.lib import colors
from reportlab.lib.colors import HexColor
from reportlab.lib.enums import TA_CENTER
from reportlab.lib.pagesizes import A4
from reportlab.lib.styles import getSampleStyleSheet, ParagraphStyle
from reportlab.lib.units import cm
from reportlab.platypus import SimpleDocTemplate, Paragraph, Spacer, Table, TableStyle, PageBreak
OUT = Path('/tmp/workspace/knruhs-pathology-pyq-analysis/output/KNRUHS_Pathology_All_Repeated_LAQ_SAQ_Paperwise_2021_2026.pdf')
NAVY, TEAL, GOLD = HexColor('#12304A'), HexColor('#007C83'), HexColor('#B7791F')
LIGHT_BLUE, LIGHT_GOLD, LIGHT_GREEN, LINE = HexColor('#EDF6F8'), HexColor('#FFF7DF'), HexColor('#EAF6EC'), HexColor('#D6E2E6')
TEXT, GREY = HexColor('#24323B'), HexColor('#5C6970')
s = getSampleStyleSheet()
s.add(ParagraphStyle(name='TitleX', parent=s['Title'], fontName='Helvetica-Bold', fontSize=23, leading=28, textColor=NAVY, alignment=TA_CENTER, spaceAfter=9))
s.add(ParagraphStyle(name='SubX', parent=s['BodyText'], fontName='Helvetica', fontSize=10.5, leading=14, textColor=GREY, alignment=TA_CENTER, spaceAfter=6))
s.add(ParagraphStyle(name='H1X', parent=s['Heading1'], fontName='Helvetica-Bold', fontSize=17, leading=21, textColor=NAVY, spaceBefore=4, spaceAfter=8))
s.add(ParagraphStyle(name='H2X', parent=s['Heading2'], fontName='Helvetica-Bold', fontSize=12.5, leading=16, textColor=TEAL, spaceBefore=11, spaceAfter=6))
s.add(ParagraphStyle(name='BodyX', parent=s['BodyText'], fontName='Helvetica', fontSize=9.1, leading=12.5, textColor=TEXT, spaceAfter=5))
s.add(ParagraphStyle(name='CellX', parent=s['BodyText'], fontName='Helvetica', fontSize=7.55, leading=9.3, textColor=TEXT))
s.add(ParagraphStyle(name='SmallX', parent=s['BodyText'], fontName='Helvetica', fontSize=8, leading=10.4, textColor=TEXT, spaceAfter=4))
s.add(ParagraphStyle(name='FootX', parent=s['BodyText'], fontName='Helvetica', fontSize=7.3, leading=8, textColor=GREY, alignment=TA_CENTER))
def p(x, style='BodyX'): return Paragraph(str(x), s[style])
def tag(priority):
return {'P1':'<b>P1</b><br/>Most repeated','P2':'<b>P2</b><br/>Repeated','P3':'<b>P3</b><br/>Repeated'}[priority]
def table(rows, widths, title=None):
if title:
story.append(p(title, 'H2X'))
headers = ['Priority', 'Question / topic to prepare', 'How it has been asked', 'No. of appearances', 'Sessions in uploaded list']
data = [[p(h, 'CellX') for h in headers]]
for pr, topic, forms, count, sess in rows:
data.append([p(tag(pr),'CellX'), p(topic,'CellX'), p(forms,'CellX'), p(count,'CellX'), p(sess,'CellX')])
t = Table(data, colWidths=widths, repeatRows=1, hAlign='LEFT')
commands = [
('BACKGROUND',(0,0),(-1,0),NAVY), ('TEXTCOLOR',(0,0),(-1,0),colors.white),
('FONTNAME',(0,0),(-1,0),'Helvetica-Bold'), ('VALIGN',(0,0),(-1,-1),'TOP'),
('GRID',(0,0),(-1,-1),0.35,LINE), ('LEFTPADDING',(0,0),(-1,-1),4), ('RIGHTPADDING',(0,0),(-1,-1),4),
('TOPPADDING',(0,0),(-1,-1),4), ('BOTTOMPADDING',(0,0),(-1,-1),4),
]
for i, row in enumerate(rows, start=1):
bg = LIGHT_GREEN if row[0]=='P1' else LIGHT_GOLD if row[0]=='P2' else LIGHT_BLUE
commands.append(('BACKGROUND',(0,i),(0,i),bg))
if i % 2 == 0: commands.append(('BACKGROUND',(1,i),(-1,i),HexColor('#FAFCFC')))
t.setStyle(TableStyle(commands))
story.append(t); story.append(Spacer(1,8))
def bullets(items):
for x in items: story.append(p('• ' + x, 'SmallX'))
def footer(canvas, doc):
canvas.saveState(); canvas.setStrokeColor(LINE); canvas.line(1.55*cm, 1.3*cm, 19.45*cm, 1.3*cm)
canvas.setFont('Helvetica',7.4); canvas.setFillColor(GREY)
canvas.drawString(1.55*cm, .88*cm, 'KNRUHS Pathology PYQ analysis | 2021 to January 2026 | Repeated questions only')
canvas.drawRightString(19.45*cm, .88*cm, f'Page {doc.page}')
canvas.restoreState()
# Any question/topic appearing in two or more sessions is included. “SAQ” includes short notes and brief notes due to changing university formats.
paper1_laq = [
('P1','Haemolytic anaemia','Classify haemolytic anaemia and laboratory diagnosis; hereditary spherocytosis: etiopathogenesis and lab diagnosis.','2 LAQs','2025 P-I; 2024 P-I'),
('P2','Megaloblastic anaemia','Classify anaemia; etiopathology and lab findings. Related: lab diagnosis and B12 marrow picture.','1 LAQ + 2 SAQs','2023 P-I; 2022 P-I; 2026 P-I'),
('P2','Amyloidosis','Define; secondary amyloidosis morphology and staining reactions.','1 LAQ + 5 SAQs','2025 P-I; 2021-2026 P-I'),
('P2','Neoplasia and metastasis','Define neoplasia; benign vs malignant; routes of malignant spread. Related: routes of metastasis/paraneoplastic syndrome.','1 LAQ + 2 related SAQs','2024 P-I; 2021 P-I; 2024-25 P-I'),
('P2','Granuloma / tuberculous granuloma','Define granuloma; etiopathogenesis, morphology and fate of tuberculous granuloma.','1 LAQ + 1 short item','2022 P-I; 2026 P-I'),
('P3','Necrosis','Definition, types and examples.','1 LAQ + 1 brief note','2026 P-I; 2021 P-I'),
]
paper2_laq = [
('P1','Bone tumours with osteosarcoma','Classify bone tumours; osteosarcoma gross and microscopy.','2 LAQs','2025 P-II; 2024 P-II'),
('P1','Alcoholic cirrhosis','Classify cirrhosis; pathogenesis, morphology and complications of alcoholic cirrhosis.','2 LAQs','2026 P-II; 2023 P-II'),
('P2','Emphysema','Classify; etiopathogenesis, types, gross and microscopy.','1 LAQ + 3 SAQs','2022 P-II; 2023 P-II; 2025 P-II; 2026 P-II'),
('P2','Peptic / gastric ulcer','Pathogenesis, gross, microscopy and complications.','1 LAQ + 2 SAQs','2025 P-II; 2023 P-II; 2022 P-II'),
('P3','Osteoclastoma / giant cell tumour of bone','Prepare morphology, microscopy, clinical/radiological features.','0 LAQ + 4 SAQs','2026 P-II; 2023 P-II; 2022 P-II; 2021 P-II'),
]
paper1_saq = [
('P1','Amyloid stains / demonstration','Special stains used to demonstrate amyloid; include Congo red reaction.','5','2026, 2024, 2023, 2022, 2021 P-I'),
('P1','Down syndrome','Short note on Down syndrome.','4','2026, 2023, 2022, 2021 P-I'),
('P1','Thrombosis / thrombus','Etiopathogenesis or formation of thrombus; Virchow triad.','3','2025, 2023, 2025 VSAQ P-I'),
('P1','Wound healing','Complications; healing by primary union; factors affecting healing.','3','2026, 2023, 2021 P-I'),
('P1','Phagocytosis','Steps and mechanism of phagocytosis.','3','2024, 2023, 2022 P-I'),
('P1','Chemical carcinogenesis / carcinogens','Chemical carcinogenesis and chemical carcinogens.','3','2024, 2023, 2022 P-I'),
('P1','Idiopathic thrombocytopenic purpura','ITP: etiopathogenesis and lab diagnosis / short note.','3','2023, 2022, 2021 P-I'),
('P1','Shock','Septic shock, pathophysiology of shock, and septic-shock case.','3','2023, 2022, 2021 P-I'),
('P2','Megaloblastic anaemia / B12 marrow','Lab diagnosis of megaloblastic anaemia; bone marrow in B12 deficiency.','2 SAQs + linked LAQ','2022, 2026 P-I; 2023 LAQ'),
('P2','Barr body','Brief note on Barr body.','3','2025, 2023, 2022 P-I'),
('P2','Apoptosis','Short/brief note on apoptosis.','2','2024, 2022 P-I'),
('P2','Transudate vs exudate','Differences between transudate and exudate.','2','2026, 2023 P-I'),
('P2','Blood transfusion reactions','Reactions / complications of blood transfusion.','2','2023, 2022 P-I'),
('P2','Chemotaxis','Chemotaxis; definition and chemoattractants.','2','2025, 2024 P-I'),
]
paper2_saq = [
('P1','Osteoclastoma / giant cell tumour of bone','Morphology, microscopy and, where asked, clinical/radiological features.','4','2026, 2023, 2022, 2021 P-II'),
('P1','Emphysema','Types of emphysema and pathology.','4','2026, 2025, 2023, 2022 P-II'),
('P1','Cirrhosis','Cirrhosis and complications; alcoholic liver disease.','4','2026, 2025, 2023, 2021 P-II'),
('P1','Schwannoma microscopy','Microscopy of schwannoma.','3','2025, 2024, 2023 P-II'),
('P1','Peptic / gastric ulcer','Peptic ulcer and morphology of peptic ulcer.','3','2025, 2023, 2022 P-II'),
('P2','Basal cell carcinoma','Short note on basal cell carcinoma.','2','2025, 2022 P-II'),
('P2','Kidney changes in diabetes mellitus','Renal changes in diabetes mellitus.','2','2025, 2023 P-II'),
('P2','Hashimoto thyroiditis','Short note on Hashimoto thyroiditis.','2','2025, 2024 P-II'),
('P2','Barrett oesophagus','Pathogenesis / brief note on Barrett oesophagus.','2','2026, 2022 P-II'),
('P2','Cryptorchidism','Short note and causes of cryptorchidism.','2','2026, 2025 P-II'),
('P2','Gallstones','Gallstones and risk factors for gallstones.','2','2025, 2022 P-II'),
('P2','Atheroma / atherosclerosis','Morphology and complications of atheroma.','2','2022, 2021 P-II'),
('P2','CSF in meningitis','CSF findings in pyogenic and tubercular meningitis.','2','2022, 2021 P-II'),
('P3','Dysgerminoma','Pathology / brief note on dysgerminoma.','2','2026, 2023 P-II'),
('P3','Teratoma','Teratoma and dermoid cyst of ovary.','2 related questions','2025, 2022 P-II'),
]
story=[]
story += [Spacer(1,2.1*cm), p('KNRUHS Pathology', 'TitleX'), p('All Repeated LAQs and SAQs: Paper-wise Priority List', 'TitleX'), p('PYQs analysed: August 2021, September 2022, August 2023, February/July 2024, August 2025 and January 2026', 'SubX'), Spacer(1,15)]
story.append(p('<b>What this PDF includes</b>', 'H2X'))
story.append(p('Every LAQ and SAQ topic that appeared in at least <b>two different sessions</b> in the uploaded PDF. Similar wording has been grouped into one exam-ready topic. “SAQ” includes short notes, short answers and brief notes because the paper pattern changed across years.', 'BodyX'))
story.append(p('<b>Priority rule:</b> P1 = 3 or more appearances or a high-scoring recurrent LAQ; P2 = 2 appearances; P3 = repeated but mainly as a linked or lower-mark question. Counts refer to the supplied list only, not the full university archive.', 'BodyX'))
story.append(Spacer(1,8))
legend = Table([[p('<b>P1</b><br/>Do first', 'CellX'),p('<b>P2</b><br/>Do next', 'CellX'),p('<b>P3</b><br/>Do after P1/P2', 'CellX')]], colWidths=[5.8*cm]*3)
legend.setStyle(TableStyle([('BACKGROUND',(0,0),(0,0),LIGHT_GREEN),('BACKGROUND',(1,0),(1,0),LIGHT_GOLD),('BACKGROUND',(2,0),(2,0),LIGHT_BLUE),('BOX',(0,0),(-1,-1),0.4,LINE),('INNERGRID',(0,0),(-1,-1),0.4,LINE),('VALIGN',(0,0),(-1,-1),'MIDDLE'),('LEFTPADDING',(0,0),(-1,-1),8),('TOPPADDING',(0,0),(-1,-1),7),('BOTTOMPADDING',(0,0),(-1,-1),7)]))
story.append(legend); story.append(PageBreak())
story += [p('PAPER I', 'H1X'), p('General Pathology and Haematology', 'H2X'), p('Use this section for Paper I preparation. The tables below contain all repeated LAQ and SAQ themes found in the uploaded sessions.', 'BodyX')]
table(paper1_laq, [1.8*cm,4.1*cm,6.0*cm,2.0*cm,4.0*cm], 'Repeated LAQs and LAQ-linked topics: study in this order')
story.append(p('<b>Paper I LAQ revision order:</b> Haemolytic anaemia -> Megaloblastic anaemia -> Amyloidosis -> Neoplasia/metastasis -> Tuberculous granuloma -> Necrosis.', 'BodyX'))
story.append(PageBreak())
story += [p('PAPER I', 'H1X'), p('Repeated SAQs: study in this order', 'H2X')]
table(paper1_saq, [1.8*cm,4.1*cm,6.0*cm,2.0*cm,4.0*cm])
story.append(p('<b>Paper I quick checklist:</b> For every P1 answer, prepare definition, classification where applicable, pathogenesis, morphology/lab diagnosis, complications, and one suitable diagram or flowchart.', 'BodyX'))
story.append(PageBreak())
story += [p('PAPER II', 'H1X'), p('Systemic Pathology', 'H2X'), p('Use this section for Paper II preparation. The tables below contain all repeated LAQ and SAQ themes found in the uploaded sessions.', 'BodyX')]
table(paper2_laq, [1.8*cm,4.1*cm,6.0*cm,2.0*cm,4.0*cm], 'Repeated LAQs and LAQ-linked topics: study in this order')
story.append(p('<b>Paper II LAQ revision order:</b> Bone tumours/osteosarcoma -> Alcoholic cirrhosis -> Emphysema -> Peptic/gastric ulcer -> Osteoclastoma.', 'BodyX'))
story.append(PageBreak())
story += [p('PAPER II', 'H1X'), p('Repeated SAQs: study in this order', 'H2X')]
table(paper2_saq, [1.8*cm,4.1*cm,6.0*cm,2.0*cm,4.0*cm])
story.append(p('<b>Paper II quick checklist:</b> For morphology answers, separate gross and microscopy. For tumours, add age/site, clinical features, gross, microscopy, spread and key differential points where relevant.', 'BodyX'))
story.append(PageBreak())
story += [p('Final 2-Day Revision Order', 'H1X'), p('Day 1: Paper I', 'H2X')]
bullets(['LAQs: Haemolytic anaemia, megaloblastic anaemia, amyloidosis, neoplasia/metastasis.', 'SAQs P1: Amyloid stains, Down syndrome, thrombosis, wound healing, phagocytosis, chemical carcinogenesis, ITP and shock.', 'SAQs P2: B12 marrow, Barr body, apoptosis, transudate/exudate, transfusion reactions and chemotaxis.'])
story += [p('Day 2: Paper II', 'H2X')]
bullets(['LAQs: Osteosarcoma, alcoholic cirrhosis, emphysema and peptic/gastric ulcer.', 'SAQs P1: Osteoclastoma, emphysema, cirrhosis, schwannoma and peptic ulcer.', 'SAQs P2: Basal cell carcinoma, diabetic kidney, Hashimoto thyroiditis, Barrett oesophagus, cryptorchidism, gallstones, atheroma and CSF in meningitis.'])
story.append(Spacer(1,10))
story.append(p('Source note: This prioritisation is derived only from the supplied compilation of KNRUHS Pathology PYQs. The compilation itself advises verifying current university papers through official channels before relying on it for examination preparation.', 'SmallX'))
doc=SimpleDocTemplate(str(OUT),pagesize=A4,rightMargin=1.45*cm,leftMargin=1.45*cm,topMargin=1.45*cm,bottomMargin=1.7*cm,title='KNRUHS Pathology Repeated LAQ SAQ Paperwise')
doc.build(story,onFirstPage=footer,onLaterPages=footer)
print(OUT)
python "/tmp/workspace/knruhs-pathology-pyq-analysis/src/create_complete_repeated_pdf.py" && python - <<'PY' from pypdf import PdfReader from pathlib import Path p=Path('/tmp/workspace/knruhs-pathology-pyq-analysis/output/KNRUHS_Pathology_All_Repeated_LAQ_SAQ_Paperwise_2021_2026.pdf') r=PdfReader(str(p)) print('exists=',p.exists(),'size=',p.stat().st_size,'pages=',len(r.pages)) for i,page in enumerate(r.pages,1): t=page.extract_text() or '' print(f'PAGE {i}: chars={len(t)}, sample={t[:110].replace(chr(10)," | ")}') PY
KNRUHS Pathology All Repeated LAQ SAQ Paperwise 2021 2026
PDF Document · PDF
Make laq’s and saq’s in priority order and most frequently repeated topics first and arrange all questions in paper wise separation and also include atleast one repeated questions also and make a pdf according to paper wise
KNRUHS Pathology Paper I Paper II previous question papers 2021 2026
~/
pathology education assessment
~/knruhs-pathology-pyq-analysis/output
KNRUHS Pathology All Repeated LAQ SAQ Paperwise 2021 2026
PDF Document · PDF
make a microscopic diagram of all this questions
Create labelled diagrams for all high-yield histology topics
histopathology labelled diagram amyloidosis cirrhosis emphysema osteosarcoma examination
A medical pathology educational illustration showing a microscope field with representative hematoxylin and eosin histology patterns: glomeruli, hepatic nodules, lung alveoli, tumour osteoid, and a peripheral nerve fascicle. No text.
~/knruhs-pathology-pyq-analysis
.../src/create_high_yield_histology_diagrams.py
from pathlib import Path
import matplotlib.pyplot as plt
from matplotlib.patches import Circle, Ellipse, Polygon, Rectangle, FancyArrowPatch
import numpy as np
from reportlab.lib.pagesizes import A4
from reportlab.lib import colors
from reportlab.lib.colors import HexColor
from reportlab.lib.styles import getSampleStyleSheet, ParagraphStyle
from reportlab.lib.enums import TA_CENTER
from reportlab.lib.units import cm
from reportlab.platypus import SimpleDocTemplate, Paragraph, Spacer, Image, PageBreak, Table, TableStyle
ROOT = Path('/tmp/workspace/knruhs-pathology-pyq-analysis')
ASSETS = ROOT/'assets'/'histology_diagrams'
OUT = ROOT/'output'/'KNRUHS_High_Yield_Labelled_Histology_Diagrams_Paperwise.pdf'
ASSETS.mkdir(parents=True, exist_ok=True)
np.random.seed(8)
INK='#25313a'; PINK='#f4b6c2'; PALE='#fdebf0'; PURPLE='#713b73'; BLUE='#a9d8eb'; DARKBLUE='#276b93'; BEIGE='#f3d8a1'; GREEN='#b8d8b1'; ORANGE='#e18c5e'; GREY='#b2b6bc'
def axbase(title):
fig, ax = plt.subplots(figsize=(10.4,6.4), dpi=180)
ax.set_xlim(0,10); ax.set_ylim(0,7); ax.axis('off'); ax.set_facecolor('#fffdfc')
ax.text(.25,6.72,title,fontsize=18,fontweight='bold',color='#12304A',va='top')
ax.text(.25,6.35,'Schematic labelled diagram for university answer practice - not a photomicrograph',fontsize=7.8,color='#64717a',va='top')
return fig,ax
def label(ax, text, xy, xytext):
ax.annotate(text, xy=xy, xytext=xytext, fontsize=8.5, color=INK, ha='left', va='center',
arrowprops=dict(arrowstyle='->', color='#46555e', lw=1.1, shrinkA=2, shrinkB=2),
bbox=dict(boxstyle='round,pad=0.18',fc='white',ec='#ced8dd',alpha=.96))
def save(fig, key):
p=ASSETS/f'{key}.png'; fig.savefig(p,bbox_inches='tight',facecolor='white'); plt.close(fig); return p
def amyloid():
fig,ax=axbase('Amyloidosis - kidney (Congo-red positive deposits)')
for x,y,r in [(3.0,3.5,1.45),(5.0,3.1,1.2),(3.8,1.8,.9)]:
ax.add_patch(Circle((x,y),r,fc=PALE,ec=PURPLE,lw=2))
for a in np.linspace(0,2*np.pi,8,endpoint=False):
ax.add_patch(Circle((x+.64*r*np.cos(a),y+.64*r*np.sin(a)),.12,fc=PURPLE,ec='none'))
ax.add_patch(Circle((x,y),.55*r,fc=ORANGE,ec=PURPLE,lw=1.2,alpha=.8))
ax.add_patch(Rectangle((7.1,1.3),1.0,3.5,fc=PALE,ec=PURPLE,lw=2)); ax.add_patch(Rectangle((7.43,1.5),.34,3.1,fc='white',ec=PURPLE,lw=1))
label(ax,'Amorphous extracellular amyloid\nin mesangium/capillary walls',(3.0,3.5),(6.0,5.25))
label(ax,'Compressed glomerular capillary lumina',(5.0,3.1),(6.5,3.7))
label(ax,'Amyloid in vessel wall',(7.6,3.4),(8.25,2.1))
ax.text(.4,.35,'Key stain: Congo red shows apple-green birefringence under polarized light.',fontsize=9,color=PURPLE,fontweight='bold')
return save(fig,'01_amyloid')
def tb_granuloma():
fig,ax=axbase('Tuberculous granuloma (caseating granuloma)')
ax.add_patch(Ellipse((4.1,3.35),5.0,4.4,fc='#f7d8bd',ec=PURPLE,lw=2))
ax.add_patch(Ellipse((4.1,3.35),2.25,1.75,fc=BEIGE,ec=ORANGE,lw=2))
for a in np.linspace(0,2*np.pi,13,endpoint=False):
x,y=4.1+1.55*np.cos(a),3.35+1.35*np.sin(a)
ax.add_patch(Ellipse((x,y),.38,.18,angle=np.degrees(a)+90,fc=PINK,ec=PURPLE,lw=.7))
ax.add_patch(Ellipse((x,y),.08,.1,fc=PURPLE,ec='none'))
for a in np.linspace(.1,6.2,10):
ax.add_patch(Circle((4.1+2.15*np.cos(a),3.35+1.85*np.sin(a)),.13,fc=PURPLE,ec='none'))
ax.add_patch(Ellipse((2.85,3.35),.95,1.85,fc=PINK,ec=PURPLE,lw=1));
for y in np.linspace(2.75,3.95,6): ax.add_patch(Circle((2.85,y),.1,fc=PURPLE,ec='none'))
label(ax,'Central caseous necrosis',(4.1,3.35),(6.75,4.95)); label(ax,'Epithelioid histiocytes',(5.45,3.6),(7.1,3.6)); label(ax,'Langhans giant cell\nperipheral nuclei',(2.85,3.4),(.55,4.65)); label(ax,'Peripheral lymphocytes',(5.95,5.05),(7.05,1.85))
return save(fig,'02_tb_granuloma')
def megaloblastic():
fig,ax=axbase('Megaloblastic anaemia - bone marrow smear')
for i in range(23):
x,y=np.random.uniform(.8,6.8),np.random.uniform(1.0,5.8); r=np.random.uniform(.16,.33)
ax.add_patch(Circle((x,y),r,fc='#f8d0d8',ec=PURPLE,lw=.7)); ax.add_patch(Circle((x,y),r*.48,fc=PURPLE,ec='none'))
for x,y in [(7.8,4.8),(8.55,3.2),(7.55,1.75)]:
ax.add_patch(Circle((x,y),.75,fc='#f4bdca',ec=PURPLE,lw=1.6)); ax.add_patch(Circle((x,y),.38,fc=PURPLE,ec='none'))
ax.add_patch(Circle((x+.42,y+.43),.12,fc=PINK,ec=PURPLE,lw=.5))
ax.add_patch(Ellipse((5.1,4.65),1.55,.5,fc='#f9d6df',ec=PURPLE,lw=1))
for x in np.linspace(4.55,5.65,6): ax.add_patch(Circle((x,4.65),.09,fc=PURPLE,ec='none'))
label(ax,'Megaloblast: large erythroid precursor\nwith open, immature nucleus',(7.8,4.8),(7.05,6.0)); label(ax,'Nuclear-cytoplasmic asynchrony',(8.55,3.2),(7.15,2.7)); label(ax,'Hypersegmented neutrophil',(5.1,4.65),(2.0,5.9))
return save(fig,'03_megaloblastic_marrow')
def osteosarcoma():
fig,ax=axbase('Osteosarcoma - malignant osteoid formation')
for x,y,ang in [(2,2.0,20),(3.8,4.4,-25),(5.4,2.5,10),(7.0,4.5,40)]:
pts=np.array([[x-.9,y-.2],[x-.35,y+.35],[x+.65,y+.15],[x+.85,y-.35],[x-.2,y-.45]])
ax.add_patch(Polygon(pts,closed=True,fc=BEIGE,ec=ORANGE,lw=2,alpha=.95))
for i in range(38):
x,y=np.random.uniform(.7,8.2),np.random.uniform(1.0,5.7)
ax.add_patch(Ellipse((x,y),.28,.16,angle=np.random.uniform(0,180),fc=PINK,ec=PURPLE,lw=.7)); ax.add_patch(Circle((x,y),.06,fc=PURPLE,ec='none'))
label(ax,'Lace-like malignant osteoid',(5.4,2.5),(7.45,1.5)); label(ax,'Pleomorphic malignant osteoblasts',(3.8,4.4),(6.45,5.55)); label(ax,'Hyperchromatic nuclei / atypical mitosis',(2.0,2.0),(.55,1.1))
return save(fig,'04_osteosarcoma')
def osteoclastoma():
fig,ax=axbase('Osteoclastoma / giant cell tumour of bone')
ax.add_patch(Rectangle((.5,.7),8.2,5.1,fc='#fdf0ee',ec=PINK,lw=1))
for i in range(24):
x,y=np.random.uniform(.9,8.2),np.random.uniform(1.1,5.3)
ax.add_patch(Ellipse((x,y),.32,.19,angle=np.random.uniform(0,180),fc=PINK,ec=PURPLE,lw=.6))
ax.add_patch(Circle((x,y),.06,fc=PURPLE,ec='none'))
for x,y in [(2.2,4.1),(5.1,3.0),(7.3,4.3)]:
ax.add_patch(Ellipse((x,y),1.3,.75,fc='#eeb2c2',ec=PURPLE,lw=1.5))
for a in np.linspace(0,2*np.pi,10,endpoint=False): ax.add_patch(Circle((x+.39*np.cos(a),y+.22*np.sin(a)),.075,fc=PURPLE,ec='none'))
label(ax,'Osteoclast-type multinucleated\ngiant cells',(5.1,3.0),(6.4,1.45)); label(ax,'Uniform mononuclear stromal cells',(7.8,2.1),(6.6,5.5)); label(ax,'Haemorrhage / hemosiderin may be present',(2.2,4.1),(.55,5.7))
return save(fig,'05_osteoclastoma')
def cirrhosis():
fig,ax=axbase('Alcoholic cirrhosis - regenerative nodules and fibrosis')
ax.add_patch(Rectangle((.6,.75),7.6,5.0,fc='#f9e6cf',ec=ORANGE,lw=1))
centers=[(2,4.4,1.15),(4.6,4.45,1.1),(6.7,4.2,.95),(2.7,2.25,1.12),(5.35,2.05,1.28),(7.15,2.3,.72)]
for x,y,r in centers:
ax.add_patch(Circle((x,y),r,fc='#f5cbb4',ec=ORANGE,lw=1.6))
for a in np.linspace(0,2*np.pi,15,endpoint=False): ax.add_patch(Circle((x+.65*r*np.cos(a),y+.65*r*np.sin(a)),.05,fc=PURPLE,ec='none'))
for (a,b) in [((3.05,4.1),(3.7,3.4)),((5.6,4.0),(5.65,3.0)),((3.6,2.7),(4.25,2.5)),((6.4,3.5),(6.45,3.0))]: ax.plot([a[0],b[0]],[a[1],b[1]],color='#5f9475',lw=8,solid_capstyle='round')
label(ax,'Regenerative hepatocyte nodules',(2,4.4),(8.35,5.15)); label(ax,'Broad bridging fibrous septa',(5.6,3.5),(8.25,3.4)); label(ax,'Distorted lobular architecture',(4.7,2.0),(8.25,1.65))
return save(fig,'06_cirrhosis')
def emphysema():
fig,ax=axbase('Emphysema - enlarged air spaces with septal destruction')
# normal left
ax.text(2.35,5.75,'Normal alveoli',ha='center',fontsize=11,fontweight='bold',color=DARKBLUE)
for i in range(13):
th=2*np.pi*i/13; x=2.35+1.25*np.cos(th); y=3.35+1.45*np.sin(th)
ax.add_patch(Circle((x,y),.65,fc=BLUE,ec=DARKBLUE,lw=1.3,alpha=.65))
# emphysema right
ax.text(6.9,5.75,'Emphysema',ha='center',fontsize=11,fontweight='bold',color=ORANGE)
for x,y,w,h in [(6.2,4.0,2.15,1.35),(7.55,3.0,2.0,1.55),(5.9,2.25,1.65,1.2)]: ax.add_patch(Ellipse((x,y),w,h,fc=BLUE,ec=ORANGE,lw=2.2,alpha=.68))
ax.plot([4.6,4.6],[1,5.5],color='#86939a',lw=1,ls='--')
label(ax,'Thin intact interalveolar septa',(2.8,4.1),(.4,1.15)); label(ax,'Coalescent enlarged air spaces',(7.5,3.0),(7.7,1.3)); label(ax,'Loss of alveolar septa',(6.2,4.0),(7.7,4.95))
return save(fig,'07_emphysema')
def psgn():
fig,ax=axbase('Acute post-streptococcal glomerulonephritis')
ax.add_patch(Circle((4.1,3.4),2.2,fc='#f6d9df',ec=PURPLE,lw=2))
for a in np.linspace(0,2*np.pi,11,endpoint=False):
x,y=4.1+1.35*np.cos(a),3.4+1.35*np.sin(a)
ax.add_patch(Circle((x,y),.52,fc='#f3bdc8',ec=PURPLE,lw=1)); ax.add_patch(Circle((x,y),.12,fc=PURPLE,ec='none'))
for x,y in [(3.0,4.65),(4.9,4.45),(5.25,2.65),(3.35,2.0)]: ax.add_patch(Circle((x,y),.17,fc=ORANGE,ec='#a34e2c',lw=.6))
ax.add_patch(Rectangle((7.4,1.2),.82,4.3,fc='#f3bdc8',ec=PURPLE,lw=1.2)); ax.add_patch(Rectangle((7.68,1.4),.26,3.9,fc='white',ec=PURPLE,lw=.7))
label(ax,'Diffuse endocapillary hypercellularity',(4.1,3.4),(6.7,5.4)); label(ax,'Narrowed / occluded capillary lumina',(3.0,4.65),(.55,5.1)); label(ax,'Subepithelial immune-complex humps\n(EM feature)',(7.82,3.1),(8.25,2.35))
return save(fig,'08_psgn')
def diabetic_nephropathy():
fig,ax=axbase('Diabetic nephropathy - nodular glomerulosclerosis')
ax.add_patch(Circle((3.9,3.4),2.25,fc='#fde8ee',ec=PURPLE,lw=2))
for a in np.linspace(0,2*np.pi,12,endpoint=False):
x,y=3.9+1.35*np.cos(a),3.4+1.35*np.sin(a)
ax.add_patch(Ellipse((x,y),.8,.48,angle=np.degrees(a),fc=BLUE,ec=DARKBLUE,lw=1))
for x,y in [(3.45,3.9),(4.5,2.8),(3.3,2.55)]: ax.add_patch(Circle((x,y),.42,fc='#df86a1',ec=PURPLE,lw=1))
label(ax,'Kimmelstiel-Wilson mesangial nodule',(3.45,3.9),(6.6,5.25)); label(ax,'Diffuse mesangial expansion',(4.5,2.8),(6.6,2.75)); label(ax,'Thickened glomerular basement membrane',(2.65,4.55),(.6,4.95))
return save(fig,'09_diabetic_nephropathy')
def peptic_ulcer():
fig,ax=axbase('Peptic ulcer - microscopic zones')
zones=[('Surface necrotic debris',5.2,1.05,'#f2d3ad'),('Fibrinoid necrosis',4.25,.85,'#f3b7aa'),('Granulation tissue',3.15,1.1,'#eab0bd'),('Fibrous scar with chronic inflammation',1.5,1.65,'#d6e0c5')]
x=.75
for name,y,h,c in zones:
ax.add_patch(Rectangle((x,y),7.0,h,fc=c,ec='white',lw=1.5)); ax.text(1.0,y+h/2,name,fontsize=10,fontweight='bold',color=INK,va='center')
for xx in np.linspace(1,7,12): ax.add_patch(Circle((xx,3.65),.09,fc=PURPLE,ec='none'))
label(ax,'Ulcer crater surface',(3.6,6.15),(8.15,6.0)); label(ax,'Granulation tissue: capillaries + fibroblasts',(4.2,3.7),(8.15,3.7)); label(ax,'Deep fibrosis and chronic inflammatory cells',(4.0,2.25),(8.15,1.8))
return save(fig,'10_peptic_ulcer')
def asbestosis():
fig,ax=axbase('Asbestosis - ferruginous (asbestos) bodies')
for i in range(35):
x,y=np.random.uniform(.8,8.5),np.random.uniform(1,5.6); ax.add_patch(Circle((x,y),np.random.uniform(.05,.12),fc=PURPLE,ec='none',alpha=.75))
for x,y,ang in [(2.4,3.6,35),(4.7,4.1,-20),(6.6,2.5,60)]:
ax.add_patch(Ellipse((x,y),1.55,.24,angle=ang,fc='#b58145',ec='#70451c',lw=1.5))
ux,uy=np.cos(np.radians(ang)),np.sin(np.radians(ang));
for t in [-.55,-.28,0,.28,.55]: ax.add_patch(Circle((x+t*ux,y+t*uy),.14,fc='#7b4d20',ec='none'))
ax.plot([.8,8.5],[1.0,1.0],color=GREEN,lw=12,alpha=.55)
label(ax,'Ferruginous body: beaded\niron-protein coating',(4.7,4.1),(6.6,5.4)); label(ax,'Interstitial fibrosis',(6.5,1.05),(7.5,1.7)); label(ax,'Macrophages / inflammatory cells',(2.4,3.6),(.45,4.9))
return save(fig,'11_asbestosis')
def meningioma():
fig,ax=axbase('Meningioma - whorls and psammoma bodies')
for cx,cy in [(2.3,4.25),(4.55,3.3),(6.5,4.4),(3.0,1.95),(6.4,1.95)]:
th=np.linspace(0,4*np.pi,130); r=np.linspace(.05,.65,130); ax.plot(cx+r*np.cos(th),cy+r*np.sin(th),color=PURPLE,lw=2)
for x,y in [(7.9,3.0),(7.2,2.3),(5.5,1.4)]:
ax.add_patch(Circle((x,y),.28,fc=BEIGE,ec=ORANGE,lw=1.4));
for rr in [.1,.18]: ax.add_patch(Circle((x,y),rr,fill=False,ec=ORANGE,lw=.8))
label(ax,'Meningothelial cell whorls',(4.55,3.3),(6.8,5.4)); label(ax,'Psammoma bodies: laminated calcifications',(7.9,3.0),(7.1,1.1))
return save(fig,'12_meningioma')
def schwannoma():
fig,ax=axbase('Schwannoma - Antoni A, Antoni B and Verocay bodies')
ax.add_patch(Rectangle((.6,1.0),4.0,4.6,fc='#f5cbd5',ec=PURPLE,lw=1.5)); ax.add_patch(Rectangle((5.1,1.0),3.7,4.6,fc='#e7f3f4',ec=DARKBLUE,lw=1.5))
ax.text(2.6,5.85,'Antoni A: hypercellular',ha='center',fontsize=10,fontweight='bold'); ax.text(6.95,5.85,'Antoni B: hypocellular',ha='center',fontsize=10,fontweight='bold')
for x in np.linspace(1.0,4.1,7):
for y in np.linspace(1.5,5.0,8): ax.add_patch(Ellipse((x+(y%2)*.08,y),.11,.27,fc=PURPLE,ec='none'))
for y in [2.25,3.75]:
ax.add_patch(Rectangle((1.25,y-.12),2.5,.24,fc='#f7e5dc',ec='none'))
for i in range(20):
x,y=np.random.uniform(5.4,8.5),np.random.uniform(1.3,5.2); ax.add_patch(Ellipse((x,y),.1,.2,fc=PURPLE,ec='none',alpha=.6))
label(ax,'Nuclear palisading',(2.45,4.2),(.65,.75)); label(ax,'Verocay body: acellular zone\nbetween palisaded nuclei',(2.45,3.75),(4.8,2.55)); label(ax,'Loose myxoid Antoni B area',(7.1,3.3),(7.15,.72))
return save(fig,'13_schwannoma')
def hashimoto():
fig,ax=axbase('Hashimoto thyroiditis - lymphoid infiltrate and Hürthle cells')
for x,y,r in [(2.1,4.4,.78),(4.35,4.1,.75),(6.45,4.45,.8),(3.1,2.35,.75),(5.7,2.35,.82)]:
ax.add_patch(Circle((x,y),r,fc='#f9dddf',ec=PURPLE,lw=1.3)); ax.add_patch(Circle((x,y),r*.53,fc='#f9f5ef',ec=ORANGE,lw=1))
for a in np.linspace(0,2*np.pi,12,endpoint=False): ax.add_patch(Ellipse((x+.72*r*np.cos(a),y+.72*r*np.sin(a)),.14,.2,angle=np.degrees(a),fc='#da8e9d',ec=PURPLE,lw=.4))
for i in range(45):
x,y=np.random.uniform(.8,8.3),np.random.uniform(1.0,5.7); ax.add_patch(Circle((x,y),.07,fc=PURPLE,ec='none'))
ax.add_patch(Circle((7.6,2.1),.75,fc='#ead4eb',ec=PURPLE,lw=1));
for i in range(22):
a=np.random.rand()*2*np.pi; rr=np.sqrt(np.random.rand())*.6; ax.add_patch(Circle((7.6+rr*np.cos(a),2.1+rr*np.sin(a)),.055,fc=PURPLE,ec='none'))
label(ax,'Atrophic thyroid follicles with\nHürthle-cell metaplasia',(4.35,4.1),(6.4,5.6)); label(ax,'Diffuse lymphocytic infiltrate',(2.8,2.0),(.45,1.1)); label(ax,'Lymphoid follicle with germinal centre',(7.6,2.1),(7.2,.75))
return save(fig,'14_hashimoto')
def barrett():
fig,ax=axbase('Barrett oesophagus - intestinal metaplasia with goblet cells')
ax.add_patch(Rectangle((.7,.85),7.6,1.0,fc='#e6c3d2',ec=PURPLE,lw=1)); ax.text(1.0,1.25,'Lamina propria',fontsize=10)
for x in np.linspace(1.05,7.8,12):
ax.add_patch(Rectangle((x,1.85),.38,2.9,fc='#f8d9df',ec=PURPLE,lw=.7))
ax.add_patch(Ellipse((x+.19,4.2),.25,.4,fc=PURPLE,ec='none'))
for x,y in [(1.75,3.25),(3.0,2.7),(4.45,3.6),(5.85,2.85),(7.1,3.5)]:
ax.add_patch(Ellipse((x,y),.34,.58,fc=BLUE,ec=DARKBLUE,lw=1)); ax.add_patch(Circle((x,y-.25),.07,fc=PURPLE,ec='none'))
ax.plot([.7,8.3],[4.8,4.8],color=ORANGE,lw=3)
label(ax,'Columnar epithelium replacing\nsquamous epithelium',(4.4,4.45),(6.2,5.65)); label(ax,'Goblet cells with mucin vacuoles',(5.85,2.85),(6.7,2.15)); label(ax,'Basal nuclei',(3.0,2.15),(.7,5.25))
return save(fig,'15_barrett')
def bcc():
fig,ax=axbase('Basal cell carcinoma - peripheral palisading')
ax.add_patch(Rectangle((.5,5.05),8.4,.5,fc='#f3d5db',ec=PURPLE,lw=1)); ax.text(.75,5.22,'Epidermis',fontsize=10)
for cx,cy,rx,ry in [(3.0,3.8,1.3,1.2),(5.5,3.55,1.5,1.4),(7.1,3.9,.8,.85)]:
ax.add_patch(Ellipse((cx,cy),2*rx,2*ry,fc='#785486',ec=PURPLE,lw=1.5))
for a in np.linspace(0,2*np.pi,20,endpoint=False): ax.add_patch(Ellipse((cx+.78*rx*np.cos(a),cy+.78*ry*np.sin(a)),.09,.19,angle=np.degrees(a),fc='#21142a',ec='none'))
ax.add_patch(Rectangle((.5,.75),8.4,4.25,fc='none',ec='#d4a5b4',lw=1)); ax.text(.75,.95,'Dermis',fontsize=10)
label(ax,'Nests of basaloid cells',(5.5,3.55),(6.8,5.95)); label(ax,'Peripheral palisading of nuclei',(3.0,4.8),(.5,4.4)); label(ax,'Retraction cleft around tumour nests',(6.85,3.55),(7.5,2.05))
return save(fig,'16_bcc')
diagrams = [
('Paper I', 'Amyloidosis', 'Amyloid deposition in kidney', amyloid),
('Paper I', 'Tuberculous granuloma', 'Caseating granuloma', tb_granuloma),
('Paper I', 'Megaloblastic anaemia', 'Bone marrow smear', megaloblastic),
('Paper II', 'Osteosarcoma', 'Malignant osteoid', osteosarcoma),
('Paper II', 'Osteoclastoma', 'Giant cell tumour of bone', osteoclastoma),
('Paper II', 'Alcoholic cirrhosis', 'Regenerative nodules and bridging fibrosis', cirrhosis),
('Paper II', 'Emphysema', 'Alveolar septal destruction', emphysema),
('Paper II', 'Acute post-streptococcal GN', 'Diffuse proliferative glomerulonephritis', psgn),
('Paper II', 'Diabetic nephropathy', 'Nodular glomerulosclerosis', diabetic_nephropathy),
('Paper II', 'Peptic ulcer', 'Four microscopic zones', peptic_ulcer),
('Paper II', 'Asbestosis', 'Ferruginous bodies and fibrosis', asbestosis),
('Paper II', 'Meningioma', 'Whorls and psammoma bodies', meningioma),
('Paper II', 'Schwannoma', 'Antoni A/B areas and Verocay bodies', schwannoma),
('Paper II', 'Hashimoto thyroiditis', 'Hürthle cells and lymphoid infiltrate', hashimoto),
('Paper II', 'Barrett oesophagus', 'Intestinal metaplasia with goblet cells', barrett),
('Paper II', 'Basal cell carcinoma', 'Basaloid nests with palisading', bcc),
]
files=[]
for section,topic,subtitle,fn in diagrams:
files.append((section,topic,subtitle,fn()))
styles=getSampleStyleSheet()
styles.add(ParagraphStyle(name='TitleX',parent=styles['Title'],fontName='Helvetica-Bold',fontSize=22,leading=28,alignment=TA_CENTER,textColor=HexColor('#12304A'),spaceAfter=8))
styles.add(ParagraphStyle(name='SubX',parent=styles['Normal'],fontName='Helvetica',fontSize=10,leading=14,alignment=TA_CENTER,textColor=HexColor('#58666f')))
styles.add(ParagraphStyle(name='H1X',parent=styles['Heading1'],fontName='Helvetica-Bold',fontSize=17,leading=22,textColor=HexColor('#12304A'),spaceAfter=6))
styles.add(ParagraphStyle(name='H2X',parent=styles['Heading2'],fontName='Helvetica-Bold',fontSize=13,leading=16,textColor=HexColor('#007C83'),spaceBefore=8,spaceAfter=5))
styles.add(ParagraphStyle(name='BodyX',parent=styles['BodyText'],fontName='Helvetica',fontSize=9.2,leading=13,textColor=HexColor('#293740')))
styles.add(ParagraphStyle(name='CapX',parent=styles['BodyText'],fontName='Helvetica-Oblique',fontSize=8.2,leading=11,textColor=HexColor('#58666f')))
def footer(canvas,doc):
canvas.saveState(); canvas.setStrokeColor(HexColor('#D7E0E5')); canvas.line(1.5*cm,1.15*cm,19.5*cm,1.15*cm)
canvas.setFont('Helvetica',7.5); canvas.setFillColor(HexColor('#64717A'))
canvas.drawString(1.5*cm,.72*cm,'KNRUHS Pathology - High-yield labelled histology diagrams')
canvas.drawRightString(19.5*cm,.72*cm,f'Page {doc.page}')
canvas.restoreState()
doc=SimpleDocTemplate(str(OUT),pagesize=A4,rightMargin=1.35*cm,leftMargin=1.35*cm,topMargin=1.25*cm,bottomMargin=1.45*cm)
story=[Spacer(1,2.25*cm),Paragraph('KNRUHS Pathology',styles['TitleX']),Paragraph('High-Yield Labelled Histology Diagrams',styles['TitleX']),Paragraph('Paper-wise exam practice set based on recurrent 2021 to January 2026 PYQ topics',styles['SubX']),Spacer(1,16)]
story.append(Paragraph('How to use this set',styles['H2X']))
story.append(Paragraph('These are simplified, labelled, hand-drawing style schematic diagrams. They are designed to help you reproduce the diagnostic microscopic pattern in an exam. They are not substitutes for real H&E slides. Draw the outline first, add the labelled hallmark features, then write two to four microscopic points.',styles['BodyX']))
story.append(Spacer(1,8))
data=[[Paragraph('<b>Paper I</b>',styles['BodyX']),Paragraph('Amyloidosis, tuberculous granuloma, megaloblastic marrow',styles['BodyX'])],[Paragraph('<b>Paper II</b>',styles['BodyX']),Paragraph('Osteosarcoma, osteoclastoma, cirrhosis, emphysema, renal disease, peptic ulcer, asbestosis, meningioma, schwannoma, thyroid, Barrett oesophagus and basal cell carcinoma',styles['BodyX'])]]
t=Table(data,colWidths=[3.2*cm,14.2*cm]); t.setStyle(TableStyle([('BACKGROUND',(0,0),(0,-1),HexColor('#EAF4F7')),('GRID',(0,0),(-1,-1),.4,HexColor('#D7E0E5')),('VALIGN',(0,0),(-1,-1),'TOP'),('LEFTPADDING',(0,0),(-1,-1),8),('RIGHTPADDING',(0,0),(-1,-1),8),('TOPPADDING',(0,0),(-1,-1),7),('BOTTOMPADDING',(0,0),(-1,-1),7)])); story += [t,PageBreak()]
current=None
for section,topic,subtitle,path in files:
if section != current:
if current is not None: story.append(PageBreak())
story += [Paragraph(section,styles['H1X']),Paragraph('High-yield microscopic diagrams',styles['H2X'])]
current=section
story.append(Paragraph(topic,styles['H2X']))
story.append(Paragraph(subtitle,styles['CapX']))
im=Image(str(path),width=17.3*cm,height=10.55*cm)
story.append(im); story.append(Spacer(1,4))
doc.build(story,onFirstPage=footer,onLaterPages=footer)
print(OUT)
python "/tmp/workspace/knruhs-pathology-pyq-analysis/src/create_high_yield_histology_diagrams.py" && python - <<'PY' from pathlib import Path from pypdf import PdfReader p=Path('/tmp/workspace/knruhs-pathology-pyq-analysis/output/KNRUHS_High_Yield_Labelled_Histology_Diagrams_Paperwise.pdf') r=PdfReader(str(p)) print('exists', p.exists(), 'size', p.stat().st_size, 'pages', len(r.pages)) for i, page in enumerate(r.pages, 1): text=page.extract_text() or '' print(i, len(text), text[:100].replace('\n',' | ')) PY
python - <<'PY' from pathlib import Path from pypdf import PdfReader root=Path('/tmp/workspace/knruhs-pathology-pyq-analysis/assets/histology_diagrams') p=Path('/tmp/workspace/knruhs-pathology-pyq-analysis/output/KNRUHS_High_Yield_Labelled_Histology_Diagrams_Paperwise.pdf') print('diagram pngs:',len(list(root.glob('*.png')))) r=PdfReader(str(p)) for i,page in enumerate(r.pages,1): print('page',i,'images',len(list(page.images))) PY
KNRUHS High Yield Labelled Histology Diagrams Paperwise
PDF Document · PDF
prepare a hand made histology diagram of that