mujhe Pap staining ki procedure btao details me or har step k baare me kyu ki jati hai or cells kesi dikhegi

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

Papanicolaou Pap staining procedure steps fixation hematoxylin OG EA stain cytology

Reading File
Reading Web Page

https://pmc.ncbi.nlm.nih.gov/articles/PMC9345133

Loading Image
Ab main aapko Pap staining ki poori detailed procedure, har step ka reason, aur cells ki appearance bata raha hoon:

πŸ”¬ Papanicolaou (Pap) Staining - Poori Procedure

Pap Stain Kya Hai?

Pap stain ek polychromatic cytological staining technique hai jisme 3 dyes ka combination use hota hai:
  1. Hematoxylin - nucleus stain karta hai
  2. Orange G (OG-6) - keratin/mature cells stain karta hai
  3. Eosin Azure (EA-50/EA-65) - cytoplasm ko differentiate karta hai
Ye stain mainly cervical smears, sputum, urine, FNA samples mein use hoti hai.

πŸ“‹ STEP-BY-STEP PROCEDURE

πŸ”· STEP 1: FIXATION

Kya karte hain: Smear banate hi TURANT (wet fixation) 95% Ethyl Alcohol mein 15-20 minutes tak rakhte hain.
Kyun karte hain:
  • Cells ko preserve karta hai - proteins denature hoke cellular structure lock ho jati hai
  • Autolysis (self-digestion) rokta hai
  • Cells ki morphology maintain rehti hai
  • Wet fixation zaroori hai - agar slide sookh gayi to artifacts aa jaate hain
⚠️ Yahi Pap stain ki sabse critical step hai. Agar fixation galat ho to baaki sab bekar.

πŸ”· STEP 2: HYDRATION (Rehydration)

Kya karte hain: Graded alcohol series se pass karte hain:
  • 80% alcohol - 10 dips
  • 70% alcohol - 10 dips
  • 50% alcohol - 10 dips
  • Distilled water - 10 dips
Kyun karte hain:
  • Alcohol-fixed slide ko water-based hematoxylin stain receive karne ke liye prepare karta hai
  • Gradual hydration se cells distort nahi hoti
  • Direct alcohol se water mein jaane se cells shrink ho sakti hain

πŸ”· STEP 3: NUCLEAR STAIN - HEMATOXYLIN

Kya karte hain: Gill's Hematoxylin mein 10-15 minutes rakhte hain.
Kyun karte hain:
  • Hematoxylin ek basic dye hai jo nucleus ke acidic components (DNA, RNA, chromatin) se bind karta hai
  • Nucleus ko blue-purple (basophilic) color deta hai
  • Chromatin pattern clearly dikhai deta hai - normal vs. malignant cells distinguish karne mein madad karta hai
2 techniques:
  • Regressive method (Harris Hematoxylin): Overstain karo, phir acid-alcohol se differentiate karo - better nuclear detail
  • Progressive method (Gill's Hematoxylin): Exact time tak stain karo - easier, commonly used

πŸ”· STEP 4: WASHING

Kya karte hain: Running tap water se 2-3 minutes wash.
Kyun karte hain: Excess hematoxylin remove karta hai, background saaf karta hai.

πŸ”· STEP 5: ACID ALCOHOL DIFFERENTIATION (Regressive method mein)

Kya karte hain: 0.5% Acid Alcohol mein sirf 1 DIP (1-2 seconds).
Kyun karte hain:
  • Non-specific staining remove karta hai
  • Cytoplasm se extra hematoxylin nikalta hai
  • Sirf nucleus ka stain retain hota hai
  • Extremely critical step - zyada time = nucleus ka stain bhi nikal jaata hai

πŸ”· STEP 6: BLUING

Kya karte hain: Running tap water mein 3-10 minutes, ya Scott's tap water substitute mein.
Kyun karte hain:
  • Acid treatment ke baad hematoxylin red/brown ho jaata hai
  • Alkaline environment (tap water pH ~7-8) mein blue-purple ho jaata hai
  • Ye chemical reaction: Red soluble salt β†’ Blue insoluble lake (aluminum-hematein complex)

πŸ”· STEP 7: DEHYDRATION (Pre-counterstain)

Kya karte hain:
  • 50% alcohol - 10 dips
  • 70% alcohol - 10 dips
  • 95% alcohol - 10 dips
Kyun karte hain:
  • Counterstains alcohol-based hain, isliye water remove karna padega
  • Agar paani raha to OG aur EA properly bind nahi karenge

πŸ”· STEP 8: ORANGE G (OG-6) STAINING

Kya karte hain: OG-6 solution mein 2-3 dips (1-2 minutes).
Kyun karte hain:
  • OG ek acid dye hai jo cytoplasmic basic proteins (keratin) se bind karta hai
  • Mature squamous cells aur keratinized cells ko orange-red color deta hai
  • RBCs aur superficial cells strongly stain hoti hain
  • OG-6 mein phosphotungstic acid hota hai jo non-specific staining rokta hai
Baad mein: 95% alcohol mein 2-3 dips - differentiation ke liye.

πŸ”· STEP 9: EA STAINING (Eosin Azure - EA-50 ya EA-65)

Kya karte hain: EA mein 3-5 minutes rakhte hain.
Kyun karte hain:
  • EA ek polychromatic mixture hai jisme hota hai:
    • Eosin Y (acid dye) - cytoplasmic proteins, nucleoli, cilia ko pink-red stain karta hai
    • Light Green - immature/active cells ke cytoplasm ko green-blue stain karta hai
    • Bismarck Brown (EA-50 mein) - minimal role
  • Cytoplasmic differentiation possible hoti hai - mature vs immature cells alag dikhte hain
FeatureEA-50EA-65
UseGynecological (cervical) samplesNon-gynecological (sputum, urine, FNA)
Eosin concentrationKamZyada

πŸ”· STEP 10: FINAL DEHYDRATION

Kya karte hain:
  • 95% alcohol (x2) - 10 dips each
  • Absolute alcohol (100%) - 10 dips
Kyun karte hain:
  • Mounting medium (DPX/Canada balsam) water-based nahi hota
  • Pura paani remove karna padta hai warna slide cloudy ho jaati hai

πŸ”· STEP 11: CLEARING

Kya karte hain: Xylene mein 3-5 minutes (3 changes).
Kyun karte hain:
  • Alcohol ko replace karta hai
  • Xylene ka refractive index glass aur mounting medium ke barabar hai
  • Slide transparent (clear) ho jaati hai
  • Mounting medium ke saath compatible hai

πŸ”· STEP 12: MOUNTING

Kya karte hain: DPX (Dibutylphthalate Polystyrene Xylene) ya Canada balsam se coverslip lagaate hain.
Kyun karte hain:
  • Cells preserve rehti hain permanently
  • Refraction improve hoti hai - microscopy better hoti hai
  • Physical damage se bachata hai

🎨 CELLS KESI DIKHEGI? (Microscopic Appearance)

StructureColorReason
NucleusBlue-Purple (Basophilic)Hematoxylin + acidic DNA/chromatin
ChromatinDark blue, well-definedHematoxylin nuclear staining
Mature squamous cells cytoplasmOrange / Pink-orangeOrange G binds keratin
Intermediate cells cytoplasmLight green / Blue-greenLight green in EA stain
Parabasal cells cytoplasmDark green / BlueImmature cells, more RNA
NucleoliPink-redEosin in EA stain
CiliaPinkEosin Y
RBCsOrange-redOG strongly stains them
NeutrophilsSmall blue nucleiHematoxylin
MucusPale pink/greyNon-specific eosin

πŸ” NORMAL vs. ABNORMAL CELLS

Upar image mein clearly dekh sakte hain:
Pap stain - Normal (a) vs Abnormal (b) cervical cytology
Normal cells (Image a):
  • Large, flat squamous cells with abundant pink-orange cytoplasm
  • Small, dark (pyknotic) nuclei - condensed, inactive
  • Cells ek dusre se alag, flat dikhti hain
Abnormal/Malignant cells (Image b) (arrows):
  • Large, irregular nuclei - koi pyknosis nahi
  • High N:C ratio (nucleus bada, cytoplasm kam)
  • Nuclei deeply stained, irregular chromatin
  • Cells cluster mein hongi
  • Kuch cells orange (keratinizing) dikhte hain
(Histology: A Text and Atlas with Correlated Cell and Molecular Biology)

πŸ“Š Summary Table - Quick Reference

StepTimePurpose
95% Alcohol fixation15-20 minCell preservation
Hydration (graded alcohol)10 dips eachWater-based stain ke liye prepare
Gill's Hematoxylin10-15 minNucleus blue-purple
Wash + Acid alcohol1 dipDifferentiation
Bluing (tap water)3-10 minRed β†’ Blue conversion
Dehydration10 dips eachCounterstain ke liye
Orange G (OG-6)1-2 minKeratin orange
EA-50/653-5 minCytoplasm pink/green
Absolute alcohol10 dipsComplete dehydration
Xylene3-5 minClearing
DPX mounting-Permanent preservation
Total time: ~20-30 minutes (manual method)

Pap stain ki yeh NIH review mein aur detailed nuances milenge. Koi specific step ya component ke baare mein aur samajhna ho to poochh sakte hain!

isi tarah H&E staining Gimsa staining or AFB staining leisman staining k baare me bhi btao

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

Leishman stain blood smear procedure steps methanol fixation malaria cells appearance

Loading Image
Loading Image
Finding Sources
Searching the Web

Giemsa staining procedure steps dilution buffer blood film malaria parasite appearance WBC colors

Finding Sources
Finding Sources
Finding Sources
Yahan sabhi 4 stains ki poori details hain:

πŸ”¬ FOUR IMPORTANT STAINS - Complete Guide


═══════════════════════════════════

1️⃣ H&E STAINING (Hematoxylin & Eosin)

═══════════════════════════════════

Kya hai?

Histopathology ki "gold standard" stain - duniya mein sabse zyada use hone wali stain. Tissue sections (biopsy) examine karne ke liye use hoti hai.
Dyes: Hematoxylin (basic dye) + Eosin (acid dye)

πŸ“‹ H&E Procedure - Step by Step

STEP 1: FIXATION

Kya: Tissue ko 10% Neutral Buffered Formalin (NBF) mein 24-48 hours tak rakhte hain.
Kyun:
  • Cell metabolism band karta hai
  • Autolysis (self-digestion) rokta hai
  • Proteins cross-link hoke structure preserve hoti hai
  • Formaldehyde amino groups ke saath react karta hai (mainly lysine residues)
  • Pathogenic organisms kill hote hain
⚠️ Formalin lipids ke saath react nahi karta - isliye lipid membranes ke liye poor fixative hai.

STEP 2: PROCESSING (Tissue Processing)

Kya: Ek automatic tissue processor mein steps:
  1. Washing - formalin hata
  2. Dehydration - graded alcohol (70% β†’ 80% β†’ 95% β†’ 100%) - paani nikalo
  3. Clearing - Xylene/Xylol se alcohol replace karo
  4. Infiltration - Molten paraffin tissue mein ghusta hai
Kyun: Tissue ko slice karne layak banana padta hai. Paraffin ek solid support deta hai.

STEP 3: EMBEDDING & SECTIONING

Kya: Tissue ko paraffin block mein set karo, phir microtome se 5-7 Β΅m thin sections kato.
Kyun: Light microscope mein single cell layer dekhni hoti hai - itni thin slice zaroori hai.

STEP 4: DEPARAFFINIZATION

Kya: Section ko xylene mein rakhte hain - 2 changes, 5 min each.
Kyun: Paraffin wax hata - warna stain tissue mein penetrate nahi karega.

STEP 5: REHYDRATION

Kya: Descending alcohol series:
  • 100% β†’ 95% β†’ 80% β†’ 70% β†’ Distilled water
Kyun: Hematoxylin water-based hai, isliye tissue ko rehydrate karna padega.

STEP 6: HEMATOXYLIN STAINING

Kya: Mayer's ya Harris Hematoxylin mein 3-10 minutes.
Kyun:
  • Hematoxylin ek cationic (positive charge) dye hai
  • Nucleus mein DNA/RNA aur chromatin negatively charged hain (anionic)
  • Electrostatic attraction se bind karta hai
  • Mordant (Alum/Aluminum salt) zaroori hai - dye ko tissue se permanently bind karta hai
  • Nuclear detail: chromatin pattern, nucleoli, mitoses clearly dikhte hain

STEP 7: WASHING & BLUEING

Kya: Running tap water ya Scott's solution mein 5-10 min.
Kyun: Hematoxylin acidic environment mein red-brown hota hai - alkaline water mein "blueing" reaction hoti hai aur blue-purple color aata hai.

STEP 8: DEHYDRATION (Partial)

Kya: 70% β†’ 95% alcohol mein rakhte hain.
Kyun: Eosin alcohol-soluble hai aur alcohol mein better stain karta hai.

STEP 9: EOSIN STAINING

Kya: Eosin Y (1% in 95% alcohol) mein 1-3 minutes.
Kyun:
  • Eosin anionic (negative charge) dye hai
  • Cytoplasmic proteins positively charged hain
  • Eosin bind hota hai aur pink/red color deta hai
  • Collagen, muscle, RBCs bhi pink ho jaate hain

STEP 10: DEHYDRATION β†’ CLEARING β†’ MOUNTING

Kya:
  • 95% β†’ 100% alcohol (dehydration)
  • Xylene Γ— 2-3 (clearing)
  • DPX/Canada balsam se coverslip
Kyun: Permanent slide banana - preservation aur better optics ke liye.

🎨 H&E mein Cells Kaisi Dikhti Hain?

Yahan H&E ki classic appearance dekho (pancreatic tissue):
H&E staining - a) Hematoxylin only (blue), b) Eosin only (pink), c) H&E combined
  • Image (a) - Sirf hematoxylin: sab kuch blue
  • Image (b) - Sirf eosin: sab kuch pink
  • Image (c) - H&E combined: nuclei blue-purple, cytoplasm pink - perfect contrast!
StructureH&E ColorReason
Nucleus / ChromatinBlue-Purple (Basophilic)Hematoxylin + DNA/RNA
NucleolusDark blue/purpleRNA-rich
Cytoplasm (most cells)Pink (Eosinophilic)Eosin + cytoplasmic proteins
RBCsBright pink/orange-redHemoglobin eosinophilic
Collagen fibersPale pinkEosin
MuscleDeep pink/redMyosin eosinophilic
Cartilage matrixBlue-purpleProteoglycans basophilic
Fat cells (adipocytes)Empty white vacuolesLipid dissolved by processing
CalcificationDark blue/purpleCalcium basophilic
Mitotic figuresDark purpleCondensed chromosomes
(Histology: A Text and Atlas with Correlated Cell and Molecular Biology)


═══════════════════════════════════

2️⃣ GIEMSA STAINING

═══════════════════════════════════

Kya hai?

Romanowsky stain family ka member - mainly blood smears, bone marrow, aur parasitology mein use hoti hai. Malaria diagnosis ke liye WHO recommended stain hai.
Dyes: Giemsa powder = Azure B (polychromed methylene blue) + Eosin Y, dissolved in methanol + glycerin.

πŸ“‹ Giemsa Procedure - Step by Step

STEP 1: SMEAR PREPARATION

Kya: Clean glass slide par blood ki thin ya thick film banao, air dry karo.
Kyun:
  • Thin film - individual cell morphology detail ke liye, species identification
  • Thick film - parasite detection sensitivity ke liye (zyada blood, WBCs lyse ho jaati hain)

STEP 2: FIXATION (Thin film only!)

Kya: Absolute methanol mein 2-3 dips (30 seconds).
Kyun:
  • Cells morphology preserve karta hai
  • Slide se cells ko adhere karta hai
  • THICK FILM FIX NAHI KARTE - kyunki RBCs ko lyse hona hai taaki parasites dikh sakein

STEP 3: GIEMSA WORKING SOLUTION BANANA

Kya:
  • Stock solution (3.8g Giemsa powder + 250ml methanol + 250ml glycerin)
  • Working solution: 1:20 (thin film) ya 1:50 (thick film) dilution phosphate buffer (pH 7.2) mein
Kyun: pH 7.2 critical hai:
  • Alkaline pH (>7.4) = blue dominant, parasite detail kho jaata hai
  • Acidic pH (<7.0) = eosin dominant, RBCs too pink, Schuffner's dots nahi dikhte

STEP 4: STAINING

Kya:
  • Thin film: Giemsa (1:20) se 20-30 minutes
  • Thick film: Giemsa (1:50) se 45-60 minutes (ya 10% solution for 8-10 min)
Kyun:
  • Azure dyes negatively charged chromatin se bind karte hain (blue-purple)
  • Eosin positively charged cytoplasm se bind karta hai (pink-red)
  • Longer time = better penetration

STEP 5: WASHING

Kya: Buffered water (pH 7.2) se gentle wash, 3-5 dips.
Kyun:
  • Excess stain remove karo
  • Iridescent "scum" float off karo
  • Zyada wash mat karo - decolorization hogi

STEP 6: AIR DRY & EXAMINE

Kya: Vertical position mein dry karo. Oil immersion lens (100x) se dekho.

🎨 Giemsa mein Cells Kaisi Dikhti Hain?

StructureGiemsa ColorReason
Leukocyte nucleusPurple/Dark blueAzure dyes + DNA
Neutrophil granulesNeutral pink-purpleBoth acidic + basic dyes
Eosinophil granulesBright red-orangeEosin strongly binds
Basophil granulesDeep purple/blackAzure strongly binds
Monocyte cytoplasmGrey-blueAzure dyes
Lymphocyte cytoplasmSky blueScant, azure-stained
RBCs (normal)Pale pinkHemoglobin, eosinophilic
PlateletsPurple granulesAzure
Malaria parasite nucleusRed/Magenta dotEosin + DNA
Malaria cytoplasmBlueAzure
Schuffner's dots (P. vivax)Pink stipplingIn infected RBC cytoplasm


═══════════════════════════════════

3️⃣ AFB STAINING (Ziehl-Neelsen / Acid Fast Bacilli)

═══════════════════════════════════

Kya hai?

Mycobacterium tuberculosis aur dusre acid-fast organisms (leprosy, Nocardia) detect karne ke liye use hoti hai.
Dyes: Carbol Fuchsin (primary) + Acid Alcohol (decolorizer) + Methylene Blue (counterstain)

🧬 Principle (Kyun Kaam Karta Hai?)

Mycobacteria ki cell wall mein mycolic acids (long-chain fatty acids, C60-C90) hoti hain jo ek waxy, lipid-rich layer banati hain. Yeh layer:
  • Normal dyes ko block karti hai
  • Lekin Carbol Fuchsin (phenol + fuchsin) heat ke saath penetrate kar leta hai
  • Ek baar andar gaya to acid-alcohol se nahi nikalta = "Acid Fast"
  • Isliye inhe Acid-Fast Bacilli (AFB) kehte hain
(Jawetz Medical Microbiology; Medical Microbiology 9e)

πŸ“‹ ZN Staining Procedure

STEP 1: SMEAR PREPARATION & FIXATION

Kya: Sputum/specimen se slide banao, air dry karo, phir heat fix karo (slide ko flame par 3 times pass karo).
Kyun: Cells slide se adhere ho jayen, aur pathogenic organisms inactivate ho jayein (safety).

STEP 2: CARBOL FUCHSIN (Primary Stain)

Kya: Slide ko carbol fuchsin se flood karo. Gentle heat do (steam aane tak) aur 5 minutes raho. Heat band karo, thanda karne do.
Kyun:
  • Carbol Fuchsin = Basic fuchsin + 5% phenol in water/alcohol
  • Phenol cell wall lipid layer ko dissolve karta hai, dye andar ghusta hai
  • Heat penetration further increase karta hai
  • Phenol + heat ke bina dye mycolic acid layer cross nahi kar sakta
⚠️ Kinyoun cold stain mein heat step nahi hoti - kyunki phenol concentration zyada hoti hai (8%).

STEP 3: WASHING

Kya: Running water se wash.
Kyun: Excess dye hata.

STEP 4: DECOLORIZATION - ACID ALCOHOL

Kya: 3% HCl in 95% alcohol se 1-3 minutes decolorize karo.
Kyun:
  • Non-AFB organisms se fuchsin nikaal deta hai (wo acid-alcohol resistant nahi hain)
  • AFB ki mycolic acid wall dye ko tightly hold karti hai - nahi nikalti
  • Yahi stain ka "diagnostic key" hai
  • Modified AFB (Nocardia ke liye): 0.5-1% H2SO4 (weaker acid) use karte hain

STEP 5: WASHING

Kya: Water se wash.

STEP 6: COUNTERSTAIN - METHYLENE BLUE

Kya: 1% Methylene Blue se 1-2 minutes.
Kyun:
  • Background aur non-AFB organisms ko blue color deta hai
  • AFB aur background mein contrast banata hai - AFB clearly red dikhte hain blue background par

STEP 7: WASH, DRY, EXAMINE

Kya: Wash, air dry, oil immersion (1000x) mein examine karo.

🎨 AFB Stain Mein Kya Dikhta Hai?

Yahan AFB stain (Kinyoun) ki image dekho - red bacilli blue background par:
AFB stain - Red acid-fast bacilli (TB) against blue background (Kinyoun, 400x)
StructureZN ColorReason
AFB (M. tuberculosis)Bright red/magenta rodsCarbol fuchsin retained (acid-fast)
Non-AFB bacteriaBlueCounterstained with methylene blue
Neutrophils / Host cellsBlueNon-acid-fast, counterstained
BackgroundPale blueMethylene blue
M. kansasiiRed, cross-barred "shepherd's crook"Distinctive morphology
NocardiaWeakly red (partially acid-fast)Less mycolic acid, needs modified AFB
AFB Report (WHO grading):
Bacilli per fieldReport
0No AFB seen
1-9 per 100 fields1+
1-9 per 10 fields2+
1-9 per field3+
>9 per field4+
(Henry's Clinical Diagnosis; Tietz Textbook; Robbins Pathology)


═══════════════════════════════════

4️⃣ LEISHMAN STAINING

═══════════════════════════════════

Kya hai?

Haematology mein blood smear examine karne ke liye use hoti hai - WBC differential count, malaria diagnosis, trypanosomiasis. Yeh bhi Romanowsky family ka member hai (Giemsa jaisi).
Naam: Scottish pathologist William Boog Leishman ke naam par.
Composition: Polychromed Methylene Blue (azure mixture) + Eosin - methanol mein dissolved.

πŸ“‹ Leishman Staining Procedure

STEP 1: BLOOD SMEAR BANAO

Kya: Finger prick ya EDTA blood se thin smear banao, air dry karo completely.
Kyun: Thin smear mein individual cell morphology clearly dikhti hai.

STEP 2: FIXATION + PRIMARY STAINING (Combined!)

Kya: Slide ko staining rack par rakho. Leishman stain (undiluted) se flood karo - 1-2 minutes.
Kyun:
  • Leishman stain methanol mein dissolved hai
  • Methanol hi fixative ka kaam karta hai + stain bhi deta hai - ek step mein dono!
  • Pap stain se fark: Pap mein alag fixation step hoti hai, Leishman mein combined hai
  • Methanol cells ko adhere karta hai, morphology preserve karta hai
⚠️ Bottle shake mat karo - precipitate suspend ho jaata hai aur slide par deposit hoke artifact banata hai.

STEP 3: BUFFER DILUTION

Kya: Bina wash kiye, double volume phosphate buffer (pH 6.8-7.0) add karo. Mix gently (rocking). 3 minutes raho. Greenish metallic sheen surface par dikhni chahiye.
Kyun:
  • Buffer paani provide karta hai - ionic dissociation se actual staining shuru hoti hai
  • Romanowsky effect produce hota hai: methylene blue + eosin react karke purple color banate hain (yeh azure-eosin complex hai)
  • pH 6.8 recommended - acidic pH eosinophilic structures (eosinophil granules, malaria parasites) better stain karta hai
  • Metallic sheen confirm karta hai ki staining ho rahi hai

STEP 4: WASHING

Kya: Slide ko deionized water/tap water se rinse karo, 10-15 seconds.
Kyun:
  • Excess stain hata
  • Buffer remove karo
  • Zyada wash = decolorization - colors fadenge

STEP 5: AIR DRY & EXAMINE

Kya: Vertically dry karo (dhool se bachao). Oil immersion lens (100x) mein examine karo.
Total time: ~5-8 minutes (Giemsa se faster!)

🎨 Leishman Stain Mein Cells Kaisi Dikhti Hain?

Cell TypeLeishman ColorWhy
RBCsPale pink/salmonHemoglobin eosinophilic
Neutrophil nucleusPurple (multilobed)Azure + DNA
Neutrophil granulesNeutral pink-lilacMixed charge, both dyes
Eosinophil nucleusPurple (bilobed)Azure
Eosinophil granulesBright orange-redEosin strongly binds specific proteins
Basophil granulesDark purple/violetAzure strongly binds
Monocyte nucleusPurple, kidney-shapedAzure
Monocyte cytoplasmGrey-blue, vacuolatedAzure
Lymphocyte nucleusDeep purpleAzure, dense chromatin
Lymphocyte cytoplasmScant, sky blueAzure
PlateletsPurple granulesAzurophilic
Malaria parasite (ring stage)Blue cytoplasm + red nucleus dotAzure + eosin
Malarial pigment (hemozoin)Brown-black granulesHematin byproduct

πŸ”„ Leishman vs Giemsa - Comparison

FeatureLeishmanGiemsa
FixationCombined (methanol in stain)Separate methanol step
Time5-8 min20-60 min
pH6.8-7.07.2
StabilityLess stable (diluted = 3 hours)More stable (glycerin present)
MalariaGood for thin smearsWHO recommended, thick + thin
Main useWBC differential (India/UK common)Malaria, parasitology
Artifact riskHigher (precipitation)Lower

πŸ“Š ALL FOUR STAINS - Master Comparison Table

FeatureH&EGiemsaAFB (ZN)Leishman
Main useHistopathology (tissue biopsy)Blood parasites, bone marrowMycobacteria (TB)WBC differential, malaria
Specimen typeParaffin tissue sectionsBlood/bone marrow smearSputum, tissueBlood smear
Fixative10% FormalinMethanolHeat fixMethanol (in stain)
Primary stainHematoxylin (blue)Azure B (blue-purple)Carbol Fuchsin (red)Leishman (methylene blue+eosin)
CounterstainEosin (pink)Eosin (pink-red)Methylene Blue (blue)Buffer activates
Nucleus colorBlue-purplePurpleBluePurple
Cytoplasm colorPinkPink-grey-blueBluePink-grey
Unique featureUniversal tissue stainSchuffner's dots in malariaAFB = bright RED rodsCombined fix+stain
Total time~2 hours30-60 min20-30 min5-8 min

Koi bhi stain ke kisi specific step ya application ke baare mein aur detail chahiye ho to zaroor poochho!

sabhi staining ki compete details ki pdf bnao

Reading File
Running Command

ls /home/daytona/workspace/ 2>/dev/null || echo "workspace not found"

Running Command

mkdir -p /home/daytona/workspace/staining-guide && python3 -c "from reportlab.li…

Writing File

~/staining-guide/generate_pdf.py


from reportlab.lib.pagesizes import A4
from reportlab.lib import colors
from reportlab.lib.styles import getSampleStyleSheet, ParagraphStyle
from reportlab.lib.units import cm, mm
from reportlab.lib.enums import TA_LEFT, TA_CENTER, TA_JUSTIFY
from reportlab.platypus import (
    SimpleDocTemplate, Paragraph, Spacer, Table, TableStyle,
    PageBreak, HRFlowable, KeepTogether
)
from reportlab.pdfbase import pdfmetrics
from reportlab.pdfbase.ttfonts import TTFont
import os

OUTPUT_PATH = "/home/daytona/workspace/staining-guide/Histology_Staining_Complete_Guide.pdf"

# ── Color palette ──────────────────────────────────────────────
C_BLUE       = colors.HexColor("#1a3a5c")   # dark navy – headings
C_LIGHT_BLUE = colors.HexColor("#dce9f5")   # light blue – header bg
C_ACCENT     = colors.HexColor("#2e86de")   # medium blue – sub-heads
C_PURPLE     = colors.HexColor("#6c3483")   # purple – H&E section
C_GREEN      = colors.HexColor("#1e8449")   # green – Giemsa section
C_RED        = colors.HexColor("#c0392b")   # red – AFB section
C_ORANGE     = colors.HexColor("#d35400")   # orange – Leishman section
C_PAP        = colors.HexColor("#0e6655")   # teal – Pap section
C_GRAY_LIGHT = colors.HexColor("#f4f6f7")
C_GRAY_MID   = colors.HexColor("#aab7b8")
C_WHITE      = colors.white
C_BLACK      = colors.black

W, H = A4
MARGIN = 2*cm

doc = SimpleDocTemplate(
    OUTPUT_PATH,
    pagesize=A4,
    rightMargin=MARGIN, leftMargin=MARGIN,
    topMargin=2.5*cm, bottomMargin=2.5*cm,
    title="Histology Staining – Complete Guide",
    author="Orris Medical"
)

styles = getSampleStyleSheet()

# ── Custom paragraph styles ────────────────────────────────────
def make_style(name, parent="Normal", **kw):
    s = ParagraphStyle(name, parent=styles[parent], **kw)
    styles.add(s)
    return s

title_style = make_style("MyTitle",
    fontSize=26, leading=32, textColor=C_BLUE,
    alignment=TA_CENTER, spaceAfter=6, fontName="Helvetica-Bold")

subtitle_style = make_style("MySubtitle",
    fontSize=13, leading=18, textColor=C_ACCENT,
    alignment=TA_CENTER, spaceAfter=4, fontName="Helvetica")

toc_head = make_style("TocHead",
    fontSize=14, leading=18, textColor=C_BLUE,
    fontName="Helvetica-Bold", spaceAfter=8)

toc_entry = make_style("TocEntry",
    fontSize=11, leading=16, textColor=C_BLACK,
    fontName="Helvetica", leftIndent=12)

sec_head = make_style("SecHead",
    fontSize=16, leading=20, textColor=C_WHITE,
    fontName="Helvetica-Bold", spaceAfter=2, spaceBefore=4,
    backColor=C_BLUE, leftIndent=-5, borderPadding=(4,8,4,8))

sub_head = make_style("SubHead",
    fontSize=13, leading=17, textColor=C_BLUE,
    fontName="Helvetica-Bold", spaceBefore=10, spaceAfter=4)

step_head = make_style("StepHead",
    fontSize=11, leading=15, textColor=C_WHITE,
    fontName="Helvetica-Bold", spaceBefore=4, spaceAfter=2)

body = make_style("Body",
    fontSize=10, leading=15, textColor=C_BLACK,
    fontName="Helvetica", spaceAfter=4, alignment=TA_JUSTIFY)

bullet_style = make_style("Bullet",
    fontSize=10, leading=15, textColor=C_BLACK,
    fontName="Helvetica", spaceAfter=2,
    leftIndent=18, bulletIndent=6)

note_style = make_style("Note",
    fontSize=9.5, leading=14, textColor=colors.HexColor("#555555"),
    fontName="Helvetica-Oblique", spaceAfter=4,
    leftIndent=12, rightIndent=12,
    backColor=colors.HexColor("#fdf6e3"),
    borderPadding=(4,6,4,6))

caption_style = make_style("Caption",
    fontSize=9, leading=12, textColor=colors.HexColor("#555555"),
    fontName="Helvetica-Oblique", alignment=TA_CENTER, spaceAfter=6)

# ── Helper functions ───────────────────────────────────────────
def sp(h=0.3):
    return Spacer(1, h*cm)

def hr(color=C_GRAY_MID, thickness=0.5):
    return HRFlowable(width="100%", thickness=thickness, color=color,
                      spaceAfter=4, spaceBefore=4)

def colored_box_para(text, bg_color, text_color=C_WHITE, font_size=11, bold=True):
    fn = "Helvetica-Bold" if bold else "Helvetica"
    st = ParagraphStyle("_cb", fontSize=font_size, leading=font_size+5,
                        textColor=text_color, fontName=fn,
                        backColor=bg_color, borderPadding=(5,10,5,10),
                        spaceBefore=8, spaceAfter=4)
    return Paragraph(text, st)

def step_box(num, title, color=C_ACCENT):
    st = ParagraphStyle("_step", fontSize=11, leading=15,
                        textColor=C_WHITE, fontName="Helvetica-Bold",
                        backColor=color, borderPadding=(4,8,4,8),
                        spaceBefore=8, spaceAfter=2)
    return Paragraph(f"● STEP {num}: {title}", st)

def bullet(text):
    return Paragraph(f"β€’ {text}", bullet_style)

def note(text):
    return Paragraph(f"⚠ {text}", note_style)

def body_para(text):
    return Paragraph(text, body)

def make_table(data, col_widths, header_bg=C_BLUE, header_fg=C_WHITE,
               alt_bg=C_GRAY_LIGHT, font_size=9):
    ts = TableStyle([
        ("BACKGROUND", (0,0), (-1,0), header_bg),
        ("TEXTCOLOR",  (0,0), (-1,0), header_fg),
        ("FONTNAME",   (0,0), (-1,0), "Helvetica-Bold"),
        ("FONTSIZE",   (0,0), (-1,-1), font_size),
        ("LEADING",    (0,0), (-1,-1), font_size+4),
        ("ROWBACKGROUNDS", (0,1), (-1,-1), [C_WHITE, alt_bg]),
        ("GRID",       (0,0), (-1,-1), 0.4, C_GRAY_MID),
        ("VALIGN",     (0,0), (-1,-1), "MIDDLE"),
        ("TOPPADDING", (0,0), (-1,-1), 5),
        ("BOTTOMPADDING", (0,0), (-1,-1), 5),
        ("LEFTPADDING",  (0,0), (-1,-1), 7),
        ("RIGHTPADDING", (0,0), (-1,-1), 7),
        ("WORDWRAP",   (0,0), (-1,-1), True),
        ("ALIGN",      (0,0), (-1,-1), "LEFT"),
    ])
    t = Table(data, colWidths=col_widths, repeatRows=1)
    t.setStyle(ts)
    return t

# ── Header/Footer ──────────────────────────────────────────────
def header_footer(canvas, doc):
    canvas.saveState()
    W_p, H_p = A4
    # Header bar
    canvas.setFillColor(C_BLUE)
    canvas.rect(0, H_p - 1.5*cm, W_p, 1.5*cm, fill=1, stroke=0)
    canvas.setFillColor(C_WHITE)
    canvas.setFont("Helvetica-Bold", 11)
    canvas.drawString(MARGIN, H_p - 1.0*cm, "Histology Staining – Complete Guide")
    canvas.setFont("Helvetica", 9)
    canvas.drawRightString(W_p - MARGIN, H_p - 1.0*cm, "Orris Medical Reference")
    # Footer
    canvas.setFillColor(C_BLUE)
    canvas.rect(0, 0, W_p, 1.2*cm, fill=1, stroke=0)
    canvas.setFillColor(C_WHITE)
    canvas.setFont("Helvetica", 9)
    canvas.drawString(MARGIN, 0.4*cm, "For educational purposes only")
    canvas.drawRightString(W_p - MARGIN, 0.4*cm, f"Page {doc.page}")
    canvas.restoreState()

# ══════════════════════════════════════════════════════════════════
# BUILD CONTENT
# ══════════════════════════════════════════════════════════════════
story = []

# ─── COVER PAGE ───────────────────────────────────────────────
story.append(sp(3))
# Big colored banner
banner_data = [["HISTOLOGY STAINING"]]
banner_t = Table(banner_data, colWidths=[W - 2*MARGIN])
banner_t.setStyle(TableStyle([
    ("BACKGROUND", (0,0), (-1,-1), C_BLUE),
    ("TEXTCOLOR",  (0,0), (-1,-1), C_WHITE),
    ("FONTNAME",   (0,0), (-1,-1), "Helvetica-Bold"),
    ("FONTSIZE",   (0,0), (-1,-1), 32),
    ("ALIGN",      (0,0), (-1,-1), "CENTER"),
    ("VALIGN",     (0,0), (-1,-1), "MIDDLE"),
    ("TOPPADDING", (0,0), (-1,-1), 22),
    ("BOTTOMPADDING", (0,0), (-1,-1), 22),
]))
story.append(banner_t)
story.append(sp(0.5))

sub_banner_data = [["Complete Procedure Guide"]]
sub_t = Table(sub_banner_data, colWidths=[W - 2*MARGIN])
sub_t.setStyle(TableStyle([
    ("BACKGROUND", (0,0), (-1,-1), C_ACCENT),
    ("TEXTCOLOR",  (0,0), (-1,-1), C_WHITE),
    ("FONTNAME",   (0,0), (-1,-1), "Helvetica"),
    ("FONTSIZE",   (0,0), (-1,-1), 16),
    ("ALIGN",      (0,0), (-1,-1), "CENTER"),
    ("VALIGN",     (0,0), (-1,-1), "MIDDLE"),
    ("TOPPADDING", (0,0), (-1,-1), 10),
    ("BOTTOMPADDING", (0,0), (-1,-1), 10),
]))
story.append(sub_t)
story.append(sp(1.5))

# 5 stain boxes on cover
stains = [
    ("PAP STAIN",     "Cervical Cytology β€’ FNA β€’ Sputum",             C_PAP),
    ("H&E STAIN",     "Histopathology Tissue Sections",               C_PURPLE),
    ("GIEMSA STAIN",  "Blood Parasites β€’ Malaria β€’ Bone Marrow",      C_GREEN),
    ("AFB STAIN (ZN)","Mycobacteria β€’ Tuberculosis β€’ Leprosy",        C_RED),
    ("LEISHMAN STAIN","WBC Differential β€’ Malaria β€’ Blood Smear",     C_ORANGE),
]
cover_data = []
for name, desc, clr in stains:
    cover_data.append([
        Paragraph(f"<b>{name}</b>", ParagraphStyle("_ct", fontSize=13, textColor=C_WHITE,
            fontName="Helvetica-Bold", alignment=TA_CENTER, leading=17)),
        Paragraph(desc, ParagraphStyle("_cd", fontSize=10, textColor=C_WHITE,
            fontName="Helvetica", alignment=TA_LEFT, leading=14)),
    ])

ct = Table(cover_data, colWidths=[5.5*cm, W - 2*MARGIN - 5.5*cm])
row_styles = []
for i, (_, _, clr) in enumerate(stains):
    row_styles += [
        ("BACKGROUND", (0,i), (-1,i), clr),
        ("ROWHEIGHT",  (0,i), (-1,i), 1.1*cm),
    ]
ct.setStyle(TableStyle([
    ("VALIGN",      (0,0), (-1,-1), "MIDDLE"),
    ("TOPPADDING",  (0,0), (-1,-1), 8),
    ("BOTTOMPADDING",(0,0),(-1,-1), 8),
    ("LEFTPADDING", (0,0), (-1,-1), 12),
    ("RIGHTPADDING",(0,0), (-1,-1), 12),
    ("LINEABOVE",   (0,0), (-1,0), 0, C_WHITE),
    ("LINEBELOW",   (0,-1),(-1,-1), 0, C_WHITE),
    ("INNERGRID",   (0,0), (-1,-1), 0.5, C_WHITE),
] + row_styles))
story.append(ct)
story.append(sp(1.5))

story.append(Paragraph("Complete Step-by-Step Procedures, Principles & Cell Appearances",
    ParagraphStyle("_cov", fontSize=11, textColor=colors.HexColor("#555555"),
    fontName="Helvetica-Oblique", alignment=TA_CENTER)))
story.append(Paragraph("Orris Medical Reference   |   July 2026",
    ParagraphStyle("_cov2", fontSize=10, textColor=C_GRAY_MID,
    fontName="Helvetica", alignment=TA_CENTER, spaceBefore=4)))

story.append(PageBreak())

# ─── TABLE OF CONTENTS ────────────────────────────────────────
story.append(colored_box_para("TABLE OF CONTENTS", C_BLUE, font_size=16))
story.append(sp(0.5))
toc_items = [
    ("1.", "PAP STAINING (Papanicolaou Stain)", "3"),
    ("2.", "H&E STAINING (Hematoxylin & Eosin)", "7"),
    ("3.", "GIEMSA STAINING", "11"),
    ("4.", "AFB STAINING (Ziehl-Neelsen)", "14"),
    ("5.", "LEISHMAN STAINING", "17"),
    ("6.", "Comparison Table – All 5 Stains", "20"),
]
toc_data = [[Paragraph(n, toc_entry), Paragraph(t, toc_entry),
             Paragraph(p, ParagraphStyle("_pg", fontSize=11, fontName="Helvetica-Bold",
             alignment=TA_CENTER, textColor=C_ACCENT))]
            for n, t, p in toc_items]
toc_t = Table(toc_data, colWidths=[1*cm, 13*cm, 2*cm])
toc_t.setStyle(TableStyle([
    ("FONTSIZE", (0,0), (-1,-1), 11),
    ("LEADING",  (0,0), (-1,-1), 18),
    ("LINEBELOW",(0,0), (-1,-1), 0.3, C_GRAY_MID),
    ("TOPPADDING",(0,0),(-1,-1), 6),
    ("BOTTOMPADDING",(0,0),(-1,-1), 6),
    ("ROWBACKGROUNDS",(0,0),(-1,-1),[C_WHITE, C_GRAY_LIGHT]),
]))
story.append(toc_t)
story.append(PageBreak())

# ══════════════════════════════════════════════════════════════════
# SECTION TEMPLATE HELPER
# ══════════════════════════════════════════════════════════════════
def section_header(num, title, subtitle, color):
    data = [[
        Paragraph(f"{num}", ParagraphStyle("_n", fontSize=28, fontName="Helvetica-Bold",
            textColor=C_WHITE, alignment=TA_CENTER, leading=34)),
        Paragraph(f"<b>{title}</b><br/><font size='11'>{subtitle}</font>",
            ParagraphStyle("_t", fontSize=18, fontName="Helvetica-Bold",
            textColor=C_WHITE, leading=24)),
    ]]
    t = Table(data, colWidths=[1.8*cm, W - 2*MARGIN - 1.8*cm])
    t.setStyle(TableStyle([
        ("BACKGROUND", (0,0), (-1,-1), color),
        ("VALIGN",     (0,0), (-1,-1), "MIDDLE"),
        ("TOPPADDING", (0,0), (-1,-1), 12),
        ("BOTTOMPADDING",(0,0),(-1,-1), 12),
        ("LEFTPADDING",(0,0),(-1,-1), 10),
    ]))
    return t

def step_row(num, title, step_color, content_paras):
    """Returns a KeepTogether block for a single step."""
    elems = []
    elems.append(sp(0.2))
    data = [[
        Paragraph(str(num), ParagraphStyle("_sn", fontSize=14, fontName="Helvetica-Bold",
            textColor=C_WHITE, alignment=TA_CENTER, leading=18)),
        Paragraph(f"<b>{title}</b>", ParagraphStyle("_st", fontSize=11,
            fontName="Helvetica-Bold", textColor=C_WHITE, leading=15)),
    ]]
    st = Table(data, colWidths=[1.0*cm, W - 2*MARGIN - 1.0*cm])
    st.setStyle(TableStyle([
        ("BACKGROUND", (0,0), (-1,-1), step_color),
        ("VALIGN",     (0,0), (-1,-1), "MIDDLE"),
        ("TOPPADDING", (0,0), (-1,-1), 5),
        ("BOTTOMPADDING",(0,0),(-1,-1), 5),
        ("LEFTPADDING",(0,0),(-1,-1), 8),
    ]))
    elems.append(st)
    for p in content_paras:
        elems.append(p)
    return KeepTogether(elems)

def app_color(sec_color):
    """Returns a lighter version for step backgrounds."""
    return sec_color

# ══════════════════════════════════════════════════════════════════
# 1. PAP STAINING
# ══════════════════════════════════════════════════════════════════
story.append(section_header("1", "PAP STAINING", "Papanicolaou Stain – Cytology", C_PAP))
story.append(sp(0.4))

story.append(colored_box_para("Overview & Principle", C_PAP, font_size=12))
story.append(body_para(
    "The Papanicolaou (Pap) stain is a <b>polychromatic cytological staining technique</b> used to examine "
    "cells in cervical smears, sputum, urine, FNA, and other body fluids. It uses three dyes: "
    "<b>Hematoxylin</b> (nuclear stain), <b>Orange G / OG-6</b> (keratin stain), and "
    "<b>Eosin Azure / EA-50/65</b> (cytoplasmic counterstain). The combination produces excellent "
    "nuclear detail and differential cytoplasmic staining."))
story.append(sp(0.2))

story.append(colored_box_para("Dyes Used", C_PAP, font_size=11))
dye_data = [
    ["Dye", "Type", "Target", "Color Produced"],
    ["Hematoxylin (Harris/Gill's)", "Basic (cationic)", "DNA, RNA, chromatin (acidic)", "Blue-Purple"],
    ["Orange G (OG-6)", "Acid (anionic)", "Keratin, basic proteins", "Orange"],
    ["Eosin Y (in EA)", "Acid (anionic)", "Cytoplasmic proteins, nucleoli", "Pink-Red"],
    ["Light Green (in EA)", "Acid (anionic)", "Immature cell cytoplasm", "Blue-Green"],
]
story.append(make_table(dye_data, [5*cm, 3*cm, 4.5*cm, 3*cm], header_bg=C_PAP))
story.append(sp(0.3))

story.append(colored_box_para("Step-by-Step Procedure", C_PAP, font_size=12))

pap_steps = [
    ("FIXATION", [
        body_para("Immerse wet smear <b>immediately</b> in <b>95% Ethyl Alcohol for 15–20 minutes</b>."),
        bullet("Preserves cell morphology by denaturing proteins"),
        bullet("Prevents autolysis and drying artifacts"),
        bullet("Wet fixation is critical β€” air drying causes cell shrinkage and distortion"),
        note("Most critical step. If slide dries before fixation, results are unreliable."),
    ]),
    ("HYDRATION (Graded Alcohol)", [
        body_para("Pass slide through descending alcohols: <b>80% β†’ 70% β†’ 50% β†’ Distilled water</b> (10 dips each)."),
        bullet("Removes alcohol to allow water-based hematoxylin to penetrate"),
        bullet("Gradual hydration prevents cell distortion"),
    ]),
    ("HEMATOXYLIN (Nuclear Stain)", [
        body_para("Stain in <b>Gill's or Harris Hematoxylin for 10–15 minutes</b>."),
        bullet("Basic dye binds acidic nuclear components (DNA/RNA) via electrostatic attraction"),
        bullet("Aluminium mordant forms lake complex with hematoxylin β€” permanent staining"),
        bullet("Regressive method: overstain then differentiate | Progressive: exact timed staining"),
    ]),
    ("WASHING", [
        body_para("Running tap water for <b>2–3 minutes</b>. Removes excess hematoxylin."),
    ]),
    ("ACID ALCOHOL DIFFERENTIATION", [
        body_para("<b>0.5% acid alcohol β€” only 1 dip!</b> (Regressive method only)"),
        bullet("Removes non-specific cytoplasmic hematoxylin staining"),
        bullet("Nuclear stain is retained due to mordant binding"),
        note("Over-differentiation removes nuclear stain. Exactly 1 dip β€” no more."),
    ]),
    ("BLUING", [
        body_para("Running tap water or Scott's tap water substitute for <b>3–10 minutes</b>."),
        bullet("Acid treatment turns hematoxylin brown-red β†’ alkaline environment converts to blue-purple"),
        bullet("Chemical shift: Red soluble salt β†’ Blue insoluble aluminum-hematein lake"),
    ]),
    ("DEHYDRATION (Pre-counterstain)", [
        body_para("Pass through <b>50% β†’ 70% β†’ 95% alcohol</b> (10 dips each)."),
        bullet("Removes water β€” counterstains (OG, EA) are alcohol-based"),
        bullet("Water presence prevents proper counterstain binding"),
    ]),
    ("ORANGE G (OG-6) STAINING", [
        body_para("Dip in OG-6 solution for <b>1–2 minutes</b>. Then 95% alcohol 2–3 dips."),
        bullet("Acid dye binds basic cytoplasmic proteins, especially keratin"),
        bullet("Superficial squamous cells and RBCs stain bright orange"),
        bullet("Phosphotungstic acid in OG-6 prevents non-specific staining"),
    ]),
    ("EA STAINING (Eosin Azure)", [
        body_para("Stain in <b>EA-50 (gynecological) or EA-65 (non-GYN) for 3–5 minutes</b>."),
        bullet("EA is polychromatic: Eosin Y stains nucleoli, cilia pink-red"),
        bullet("Light Green stains immature/metabolically active cell cytoplasm blue-green"),
        bullet("Differential cytoplasmic staining allows maturation assessment"),
    ]),
    ("FINAL DEHYDRATION β†’ CLEARING β†’ MOUNTING", [
        body_para("95% alcohol Γ— 2 β†’ Absolute alcohol β†’ Xylene Γ— 3 β†’ <b>DPX coverslip</b>."),
        bullet("Complete water removal required for resinous mounting medium"),
        bullet("Xylene clears tissue (same refractive index as glass/mountant)"),
        bullet("DPX provides permanent preservation for archival storage"),
    ]),
]

for i, (title, content) in enumerate(pap_steps):
    story.append(step_row(i+1, title, C_PAP, content))

story.append(sp(0.4))
story.append(colored_box_para("Cell Appearance in Pap Stain", C_PAP, font_size=12))
pap_result = [
    ["Structure", "Color", "Reason"],
    ["Nucleus / Chromatin", "Blue-Purple", "Hematoxylin + DNA/chromatin"],
    ["Nucleolus", "Dark blue-purple", "RNA-rich"],
    ["Superficial squamous cells", "Orange / Pink-orange", "Orange G binds keratin"],
    ["Intermediate cells", "Light green / Blue-green", "Light Green in EA"],
    ["Parabasal cells", "Dark green / Blue", "Immature, RNA-rich cytoplasm"],
    ["Cilia", "Pink-red", "Eosin Y"],
    ["Nucleoli", "Pink-red", "Eosin Y"],
    ["RBCs", "Orange-red", "OG strongly binds hemoglobin"],
    ["Neutrophils", "Small blue nuclei, pink cytoplasm", "Hematoxylin + Eosin"],
    ["Malignant cells", "Large dark nuclei, high N:C ratio", "Increased chromatin density"],
]
story.append(make_table(pap_result, [5.5*cm, 4*cm, 6*cm], header_bg=C_PAP))
story.append(sp(0.3))
story.append(note("Normal: Large cytoplasm, small pyknotic nucleus. Malignant: Large nucleus, scant cytoplasm, irregular chromatin. Bethesda system used for reporting."))
story.append(PageBreak())

# ══════════════════════════════════════════════════════════════════
# 2. H&E STAINING
# ══════════════════════════════════════════════════════════════════
story.append(section_header("2", "H&E STAINING", "Hematoxylin & Eosin – Histopathology Gold Standard", C_PURPLE))
story.append(sp(0.4))

story.append(colored_box_para("Overview & Principle", C_PURPLE, font_size=12))
story.append(body_para(
    "Hematoxylin & Eosin (H&E) is the <b>most widely used stain in histopathology</b>. It is applied to "
    "formalin-fixed, paraffin-embedded tissue sections. Hematoxylin (basic dye) stains nuclei blue-purple; "
    "Eosin (acidic dye) stains cytoplasm and extracellular matrix pink. This combination gives superb "
    "cellular detail for pathological diagnosis."))

story.append(colored_box_para("Dyes Used", C_PURPLE, font_size=11))
he_dye = [
    ["Dye", "Type", "Target", "Color Produced"],
    ["Hematoxylin + Al mordant", "Basic (cationic)", "DNA, RNA, chromatin", "Blue-Purple (Basophilic)"],
    ["Eosin Y (alcohol-based)", "Acid (anionic)", "Cytoplasmic proteins, collagen, muscle", "Pink-Red (Eosinophilic)"],
]
story.append(make_table(he_dye, [5*cm, 3*cm, 4.5*cm, 3*cm], header_bg=C_PURPLE))
story.append(sp(0.3))

story.append(colored_box_para("Step-by-Step Procedure", C_PURPLE, font_size=12))

he_steps = [
    ("FIXATION", [
        body_para("Immerse tissue <b>immediately</b> in <b>10% Neutral Buffered Formalin (NBF) for 24–48 hours</b>."),
        bullet("Terminates cell metabolism and enzyme activity"),
        bullet("Prevents autolysis (self-digestion by intracellular enzymes)"),
        bullet("Formaldehyde cross-links amino groups (mainly lysine) of proteins"),
        bullet("Kills pathogens β€” biosafety for lab handling"),
        note("Formalin does NOT fix lipids β€” fat cells appear as empty vacuoles after processing."),
    ]),
    ("TISSUE PROCESSING (Automated Processor)", [
        body_para("Sequential steps in tissue processor: Washing β†’ Dehydration β†’ Clearing β†’ Infiltration."),
        bullet("Dehydration: Graded alcohol (70% β†’ 80% β†’ 95% β†’ 100%) removes water"),
        bullet("Clearing: Xylene/Xylol replaces alcohol (miscible with both alcohol & paraffin)"),
        bullet("Paraffin infiltration: Molten paraffin (60Β°C) fills tissue spaces"),
        bullet("Paraffin provides solid support for thin sectioning"),
    ]),
    ("EMBEDDING & SECTIONING", [
        body_para("Tissue embedded in paraffin block. <b>Microtome</b> cuts <b>5–7 Β΅m sections</b> mounted on glass slides."),
        bullet("5–7 Β΅m thickness = single cell layer β€” essential for light microscopy"),
        bullet("Sections floated on warm water bath to flatten, then mounted on charged slides"),
    ]),
    ("DEPARAFFINIZATION", [
        body_para("<b>Xylene Γ— 2 changes, 5 minutes each</b>."),
        bullet("Dissolves paraffin wax completely"),
        bullet("Stains cannot penetrate wax β€” must be removed first"),
    ]),
    ("REHYDRATION", [
        body_para("Descending alcohol series: <b>100% β†’ 95% β†’ 80% β†’ 70% β†’ Distilled water</b>."),
        bullet("Hematoxylin is water-based β€” tissue must be rehydrated"),
        bullet("Graded steps prevent osmotic shock to tissue"),
    ]),
    ("HEMATOXYLIN STAINING", [
        body_para("Immerse in <b>Mayer's or Harris Hematoxylin for 3–10 minutes</b>."),
        bullet("Hematoxylin oxidized to hematein (active form) binds aluminium mordant"),
        bullet("Al-hematein complex (positively charged) binds negatively charged DNA/RNA"),
        bullet("Nuclear chromatin, nucleoli, and mitotic figures stained blue-purple"),
    ]),
    ("WASHING & BLUEING", [
        body_para("Running tap water or Scott's solution for <b>5–10 minutes</b>."),
        bullet("Acid residues removed; alkaline water (pH 7-8) causes 'blueing' reaction"),
        bullet("Hematoxylin shifts from brown-red to characteristic blue-purple (bathochromic shift)"),
    ]),
    ("EOSIN STAINING", [
        body_para("Stain in <b>1% Eosin Y in 95% alcohol for 1–3 minutes</b>."),
        bullet("Eosin (anionic dye) binds positively charged cytoplasmic proteins"),
        bullet("Collagen, muscle fibers, RBCs all stain pink-red"),
        bullet("Alcohol-based eosin gives crisper results than aqueous eosin"),
    ]),
    ("DEHYDRATION β†’ CLEARING β†’ MOUNTING", [
        body_para("95% alcohol β†’ 100% alcohol β†’ <b>Xylene Γ— 3 β†’ DPX/Canada Balsam coverslip</b>."),
        bullet("Complete dehydration required β€” water causes cloudiness in permanent mount"),
        bullet("Xylene is transparent and miscible with mounting resin"),
        bullet("DPX mount is permanent β€” slides usable for decades"),
    ]),
]
for i, (title, content) in enumerate(he_steps):
    story.append(step_row(i+1, title, C_PURPLE, content))

story.append(sp(0.4))
story.append(colored_box_para("Cell Appearance in H&E", C_PURPLE, font_size=12))
he_result = [
    ["Structure", "Color", "Term"],
    ["Nucleus / Chromatin", "Blue-Purple", "Basophilic"],
    ["Nucleolus", "Dark blue/purple", "Basophilic (RNA)"],
    ["Cytoplasm (most cells)", "Pink", "Eosinophilic"],
    ["RBCs", "Bright pink/orange-red", "Eosinophilic (Hemoglobin)"],
    ["Collagen fibers", "Pale pink", "Eosinophilic"],
    ["Skeletal/cardiac muscle", "Deep pink-red", "Eosinophilic (Myosin)"],
    ["Cartilage matrix", "Blue-purple", "Basophilic (Proteoglycans)"],
    ["Fat cells (adipocytes)", "Empty white vacuoles", "Lipid dissolved in processing"],
    ["Calcification (calcium)", "Dark blue-purple", "Basophilic"],
    ["Mitotic figures", "Dark purple", "Condensed chromosomes"],
    ["Plasma cells", "Clockface purple nucleus, pink cytoplasm", "Eccentric nucleus, RER-rich"],
    ["Mast cell granules", "Purple/metachromatic", "Heparin/histamine granules"],
]
story.append(make_table(he_result, [5.5*cm, 4.5*cm, 5.5*cm], header_bg=C_PURPLE))
story.append(sp(0.3))
story.append(note("Basophilic = Blue-purple (DNA, RNA, GAGs, calcium). Eosinophilic = Pink-red (proteins, collagen, RBCs). These terms describe affinity for the respective dyes."))
story.append(PageBreak())

# ══════════════════════════════════════════════════════════════════
# 3. GIEMSA STAINING
# ══════════════════════════════════════════════════════════════════
story.append(section_header("3", "GIEMSA STAINING", "Romanowsky Stain – Blood Parasites & Haematology", C_GREEN))
story.append(sp(0.4))

story.append(colored_box_para("Overview & Principle", C_GREEN, font_size=12))
story.append(body_para(
    "Giemsa stain is a <b>Romanowsky-type stain</b> used for blood smears, bone marrow, and parasite detection. "
    "It is the <b>WHO-recommended stain for malaria diagnosis</b>. Composed of Azure B (polychromed methylene blue) "
    "and Eosin Y dissolved in methanol and glycerol. The Romanowsky effect (azure-eosin complex) produces the "
    "characteristic purple color of nuclei distinct from pink cytoplasm. pH 7.2 is critical for optimal results."))

story.append(colored_box_para("Composition", C_GREEN, font_size=11))
gi_comp = [
    ["Component", "Amount", "Role"],
    ["Giemsa powder (Azure B + Eosin Y)", "3.8 g", "Primary staining dyes"],
    ["Methanol (anhydrous)", "250 mL", "Solvent + fixative action"],
    ["Glycerol", "250 mL", "Stabilizer, extends shelf life"],
    ["Phosphate buffer pH 7.2", "As working diluent", "Critical for Romanowsky effect"],
]
story.append(make_table(gi_comp, [6*cm, 3*cm, 6.5*cm], header_bg=C_GREEN))
story.append(sp(0.3))

story.append(colored_box_para("Step-by-Step Procedure", C_GREEN, font_size=12))
gi_steps = [
    ("SMEAR PREPARATION", [
        body_para("Make <b>thin film</b> (individual cell morphology) or <b>thick film</b> (parasite sensitivity) on clean glass slide. Air dry completely."),
        bullet("Thin film: 1 drop of blood, spread at 45Β° angle β€” single cell layer"),
        bullet("Thick film: 2-3 drops, spread in circular motion β€” 3x more sensitive for parasites"),
    ]),
    ("FIXATION (THIN FILM ONLY!)", [
        body_para("<b>Absolute methanol β€” 2-3 dips (30 seconds)</b> in Coplin jar."),
        bullet("Methanol denatures proteins and fixes cellular morphology"),
        bullet("Adheres cells firmly to glass slide"),
        note("THICK FILM IS NOT FIXED. RBCs must lyse during staining to expose parasites. Methanol prevents lysis."),
    ]),
    ("PREPARE GIEMSA WORKING SOLUTION", [
        body_para("Dilute stock Giemsa in <b>phosphate buffer pH 7.2</b>:"),
        bullet("Thin film: 1:20 dilution β†’ 20-30 minutes staining"),
        bullet("Thick film: 1:50 dilution β†’ 45-60 minutes (or 10% solution for 8-10 min rapid)"),
        note("pH 7.2 is critical. Alkaline pH (>7.4) = over-blue, obscures detail. Acidic pH (<7.0) = Schuffner's dots lost."),
    ]),
    ("STAINING", [
        body_para("Immerse slides in working Giemsa solution for specified time (see above)."),
        bullet("Azure dyes (negatively charged) bind positively charged nuclear components β†’ purple"),
        bullet("Eosin (negatively charged) binds positively charged cytoplasmic proteins β†’ pink"),
        bullet("Parasite nucleus stains red/magenta (Romanowsky effect = azure-eosin complex)"),
    ]),
    ("WASHING", [
        body_para("Dip gently in <b>buffered water pH 7.2 (3-5 dips)</b>. Float off iridescent scum."),
        note("Excessive washing decolorizes the film. 3-5 gentle dips only."),
    ]),
    ("AIR DRY & EXAMINE", [
        body_para("Stand vertically to dry. Examine under oil immersion (100x)."),
        bullet("Thin film: Examine first at 40x for overview, then 100x oil for detail"),
        bullet("Thick film: Used for screening β€” quantify parasites per 1000 RBCs"),
    ]),
]
for i, (title, content) in enumerate(gi_steps):
    story.append(step_row(i+1, title, C_GREEN, content))

story.append(sp(0.4))
story.append(colored_box_para("Cell Appearance in Giemsa", C_GREEN, font_size=12))
gi_result = [
    ["Cell / Structure", "Color", "Notes"],
    ["Leukocyte nucleus", "Purple/Dark blue", "All WBCs β€” Azure dyes + DNA"],
    ["Neutrophil granules", "Neutral pink-purple", "Mixed charge β€” both dyes bind"],
    ["Eosinophil granules", "Bright red-orange", "Eosin strongly binds specific proteins"],
    ["Basophil granules", "Deep purple/violet-black", "Azure strongly binds heparin"],
    ["Monocyte cytoplasm", "Grey-blue, vacuolated", "Azure dyes, phagocytic vacuoles"],
    ["Lymphocyte cytoplasm", "Scant, sky blue", "Azure, minimal cytoplasm"],
    ["RBCs (normal)", "Pale pink/salmon", "Hemoglobin, eosinophilic"],
    ["Platelets", "Purple granules", "Azurophilic granules"],
    ["Malaria parasite nucleus", "Red/Magenta dot", "Romanowsky effect, eosin-azure"],
    ["Malaria cytoplasm", "Blue ring", "Azure dyes bind RNA"],
    ["SchΓΌffner's dots (P. vivax)", "Pink stippling in RBC", "Characteristic of P. vivax/ovale"],
    ["Malarial pigment (hemozoin)", "Brown-black granules", "Hematin byproduct in parasites"],
    ["Histoplasma in macrophages", "Blue intracellular yeasts", "Fungal organisms"],
]
story.append(make_table(gi_result, [5*cm, 4*cm, 6.5*cm], header_bg=C_GREEN))
story.append(PageBreak())

# ══════════════════════════════════════════════════════════════════
# 4. AFB STAINING (ZIEHL-NEELSEN)
# ══════════════════════════════════════════════════════════════════
story.append(section_header("4", "AFB STAINING", "Ziehl-Neelsen Stain – Mycobacteria / Tuberculosis", C_RED))
story.append(sp(0.4))

story.append(colored_box_para("Overview & Principle", C_RED, font_size=12))
story.append(body_para(
    "The Ziehl-Neelsen (ZN) stain detects <b>Acid-Fast Bacilli (AFB)</b> such as <i>Mycobacterium tuberculosis</i>, "
    "M. leprae, and other mycobacteria. The key principle: mycobacterial cell walls contain "
    "<b>mycolic acids</b> (long-chain C60-C90 fatty acids), forming a waxy lipid layer. "
    "Carbol fuchsin + heat penetrates this layer. Once inside, the dye CANNOT be removed "
    "by acid-alcohol β€” hence 'acid-fast'. Non-AFB organisms are decolorized and "
    "counterstained blue."))

story.append(colored_box_para("Reagents", C_RED, font_size=11))
afb_reagents = [
    ["Reagent", "Composition", "Role"],
    ["Carbol Fuchsin", "Basic fuchsin + 5% phenol in ethanol/water", "Primary dye β€” penetrates mycolic acid wall"],
    ["Acid Alcohol", "3% HCl in 95% ethanol", "Decolorizer β€” removes dye from non-AFB"],
    ["Methylene Blue (1%)", "Aqueous solution", "Counterstain β€” stains non-AFB blue"],
]
story.append(make_table(afb_reagents, [4*cm, 6*cm, 5.5*cm], header_bg=C_RED))
story.append(sp(0.3))

story.append(colored_box_para("Step-by-Step Procedure (Ziehl-Neelsen)", C_RED, font_size=12))
afb_steps = [
    ("SMEAR PREPARATION & FIXATION", [
        body_para("Spread sputum/specimen on slide, air dry, then <b>heat fix</b> (pass over flame 3 times)."),
        bullet("Heat fixation adheres cells to slide"),
        bullet("Inactivates pathogenic organisms β€” biosafety for TB specimens"),
        bullet("Specimen can also be fixed at 80Β°C for 15 minutes (safer method)"),
    ]),
    ("CARBOL FUCHSIN (Primary Stain)", [
        body_para("Flood slide with <b>Carbol Fuchsin</b>. Apply <b>gentle heat until steaming</b>. Leave <b>5 minutes</b>. Cool."),
        bullet("Phenol (5%) disrupts the lipid-rich mycolic acid cell wall"),
        bullet("Heat further increases dye penetration into waxy wall"),
        bullet("Basic fuchsin (positively charged) binds nucleic acids inside organism"),
        note("Kinyoun modification: No heating β€” higher phenol (8%) compensates. Safer but slightly less sensitive."),
    ]),
    ("WASHING", [
        body_para("Running water wash. Removes unbound surface carbol fuchsin."),
    ]),
    ("ACID ALCOHOL DECOLORIZATION", [
        body_para("<b>3% HCl in 95% alcohol for 1–3 minutes</b> until no more red color runs off."),
        bullet("Removes carbol fuchsin from NON-acid-fast organisms (their walls lack mycolic acids)"),
        bullet("AFB RETAIN the dye β€” mycolic acids form insoluble dye-lipid complex"),
        bullet("This is the diagnostic key: retained red = acid-fast = mycobacterium"),
        note("Modified AFB (Nocardia, weakly acid-fast): Use 0.5% Hβ‚‚SOβ‚„ instead of acid-alcohol."),
    ]),
    ("WASHING", [
        body_para("Running water wash. Prepares slide for counterstain."),
    ]),
    ("METHYLENE BLUE COUNTERSTAIN", [
        body_para("<b>1% Methylene Blue for 1–2 minutes</b>."),
        bullet("Stains decolorized background cells, neutrophils, and non-AFB bacteria blue"),
        bullet("Creates color contrast: red AFB against blue background"),
        bullet("Without counterstain, AFB would be invisible against colorless background"),
    ]),
    ("WASH, DRY & EXAMINE", [
        body_para("Wash, air dry, examine under <b>oil immersion (1000x)</b>. Scan 100 fields minimum."),
        bullet("Report as: No AFB / 1+ / 2+ / 3+ / 4+ per WHO grading"),
        bullet("At least 300 fields should be examined before reporting negative"),
    ]),
]
for i, (title, content) in enumerate(afb_steps):
    story.append(step_row(i+1, title, C_RED, content))

story.append(sp(0.4))
story.append(colored_box_para("Cell Appearance in AFB (ZN) Stain", C_RED, font_size=12))
afb_result = [
    ["Structure", "Color", "Notes"],
    ["Acid-Fast Bacilli (M. tuberculosis)", "Bright red/magenta rods", "Retained carbol fuchsin"],
    ["Non-AFB bacteria", "Blue", "Methylene blue counterstain"],
    ["Neutrophils / Host cells", "Blue background", "Non-acid-fast"],
    ["Background", "Pale blue", "Methylene blue"],
    ["M. kansasii", "Red, cross-barred 'shepherd's crook'", "Distinctive banded morphology"],
    ["Nocardia", "Weakly pink/red (partial)", "Weakly acid-fast β€” needs modified AFB"],
    ["M. leprae", "Red, globi in macrophages", "Modified Fite-Faraco stain preferred"],
]
story.append(make_table(afb_result, [5*cm, 4*cm, 6.5*cm], header_bg=C_RED))
story.append(sp(0.3))
afb_grade = [
    ["Grading (Carbol Fuchsin, 1000x)", "Report"],
    ["0 AFB in 300 fields", "No AFB seen"],
    ["1-2 per 300 fields", "Doubtful β€” repeat"],
    ["1-9 per 100 fields", "1+"],
    ["1-9 per 10 fields", "2+"],
    ["1-9 per field", "3+"],
    [">9 per field", "4+"],
]
story.append(colored_box_para("AFB Grading (WHO/IUATLD)", C_RED, font_size=11))
story.append(make_table(afb_grade, [8*cm, 7.5*cm], header_bg=C_RED))
story.append(PageBreak())

# ══════════════════════════════════════════════════════════════════
# 5. LEISHMAN STAINING
# ══════════════════════════════════════════════════════════════════
story.append(section_header("5", "LEISHMAN STAINING", "Romanowsky Stain – WBC Differential & Malaria", C_ORANGE))
story.append(sp(0.4))

story.append(colored_box_para("Overview & Principle", C_ORANGE, font_size=12))
story.append(body_para(
    "Leishman stain is a <b>Romanowsky-type stain</b> named after Scottish pathologist William Boog Leishman. "
    "It is widely used for <b>WBC differential counts, malaria diagnosis, and trypanosomiasis</b>. "
    "Composed of polychromed methylene blue (azure mixture) + Eosin Y dissolved in methanol. "
    "Key advantage: <b>methanol in the stain acts as both fixative and solvent</b>, combining the "
    "fixation and primary staining into one step. Similar to Giemsa but faster."))

story.append(colored_box_para("Composition", C_ORANGE, font_size=11))
lei_comp = [
    ["Component", "Role"],
    ["Polychromed Methylene Blue (Azure mixture)", "Nuclear stain β€” blue-purple; Romanowsky effect"],
    ["Eosin Y", "Cytoplasmic stain β€” pink-red; granule staining"],
    ["Methanol (anhydrous)", "Solvent + FIXATIVE β€” combined in one step"],
    ["Phosphate Buffer pH 6.8-7.0", "Dilutant β€” activates ionic dissociation for staining"],
]
story.append(make_table(lei_comp, [8*cm, 7.5*cm], header_bg=C_ORANGE))
story.append(sp(0.3))

story.append(colored_box_para("Step-by-Step Procedure", C_ORANGE, font_size=12))
lei_steps = [
    ("BLOOD SMEAR PREPARATION", [
        body_para("Prepare <b>thin blood smear</b> from EDTA blood or finger prick. Spread evenly, <b>air dry completely</b>."),
        bullet("Thin film: single cell layer for individual morphology assessment"),
        bullet("Must be completely dry before staining β€” trace moisture causes artifacts"),
        note("Do NOT shake stain bottle before use β€” precipitates cause artifacts mimicking platelets."),
    ]),
    ("FIXATION + PRIMARY STAINING (Combined Step!)", [
        body_para("Flood slide with <b>undiluted Leishman stain for 1–2 minutes</b>. Do NOT rinse."),
        bullet("Methanol in stain = FIXATIVE: preserves morphology, adheres cells to slide"),
        bullet("Methanol also serves as solvent carrying the dye"),
        bullet("This combined fixation-staining step distinguishes Leishman from Giemsa"),
        note("This is Leishman's major advantage β€” no separate fixation step needed."),
    ]),
    ("BUFFER DILUTION (Critical Step)", [
        body_para("WITHOUT washing, add <b>double volume of phosphate buffer pH 6.8</b>. Mix gently by rocking. Leave <b>3 minutes</b>. A greenish metallic sheen should appear on surface."),
        bullet("Buffer provides water β€” essential for ionic dissociation of dyes"),
        bullet("Romanowsky effect activated: azure-eosin complex forms β†’ purple color for nuclei"),
        bullet("pH 6.8: slightly acidic β†’ better eosinophilic structures (eosinophil granules, malaria)"),
        bullet("Metallic sheen on surface = positive quality control indicator"),
    ]),
    ("WASHING", [
        body_para("Rinse slide with <b>deionized water for 10–15 seconds</b>. Drain."),
        bullet("Removes excess stain and buffer"),
        note("Excessive washing removes stain. 10-15 seconds only. If over-washed, restain."),
    ]),
    ("AIR DRY & EXAMINE", [
        body_para("Stand slides upright to drain and <b>air dry away from dust</b>. Examine under oil immersion (100x)."),
        bullet("Do not blot β€” causes artifacts"),
        bullet("Total staining time: 5–8 minutes (much faster than Giemsa)"),
    ]),
]
for i, (title, content) in enumerate(lei_steps):
    story.append(step_row(i+1, title, C_ORANGE, content))

story.append(sp(0.4))
story.append(colored_box_para("Cell Appearance in Leishman Stain", C_ORANGE, font_size=12))
lei_result = [
    ["Cell / Structure", "Color", "Notes"],
    ["RBCs", "Pale pink/salmon", "Hemoglobin eosinophilic"],
    ["Neutrophil nucleus", "Purple (multilobed)", "Azure + DNA"],
    ["Neutrophil granules", "Neutral pink-lilac", "Mixed charge, both dyes"],
    ["Eosinophil nucleus", "Purple (bilobed)", "Azure"],
    ["Eosinophil granules", "Bright orange-red", "Eosin strongly binds MBP"],
    ["Basophil granules", "Deep purple/violet-black", "Azure + heparin"],
    ["Monocyte nucleus", "Purple, kidney/horseshoe-shaped", "Azure"],
    ["Monocyte cytoplasm", "Grey-blue, vacuolated", "Azure, phagocytic vacuoles"],
    ["Lymphocyte nucleus", "Deep purple, dense", "Azure, condensed chromatin"],
    ["Lymphocyte cytoplasm", "Scant, sky blue", "Azure dyes"],
    ["Platelets", "Purple granules, pale blue area", "Azurophilic granules"],
    ["Malaria ring stage", "Blue cytoplasm + red nucleus dot", "Azure + eosin (Romanowsky)"],
    ["Malarial pigment (hemozoin)", "Brown-black coarse granules", "Hematin byproduct"],
    ["Trypanosoma", "Purple nucleus/kinetoplast, blue cytoplasm", "Blood parasites"],
    ["Leishman-Donovan bodies", "Blue oval amastigotes in macrophages", "Kala-azar diagnosis"],
]
story.append(make_table(lei_result, [5*cm, 4*cm, 6.5*cm], header_bg=C_ORANGE))
story.append(PageBreak())

# ══════════════════════════════════════════════════════════════════
# 6. MASTER COMPARISON TABLE
# ══════════════════════════════════════════════════════════════════
story.append(colored_box_para("MASTER COMPARISON – ALL 5 STAINS", C_BLUE, font_size=14))
story.append(sp(0.3))

comp_data = [
    ["Feature", "PAP", "H&E", "Giemsa", "AFB (ZN)", "Leishman"],
    ["Primary Use", "Cytology\n(cervical,\nFNA, sputum)", "Histopathology\ntissue biopsy", "Blood parasites\nmalaria\nbone marrow", "Mycobacteria\nTB, Leprosy\nNocardia", "WBC differential\nmalaria\nblood smear"],
    ["Specimen", "Cytology smear\n(wet)", "Paraffin tissue\nsections", "Blood/BM smear", "Sputum, tissue,\nBAL", "Blood smear"],
    ["Fixative", "95% Ethyl\nAlcohol (wet)", "10% NBF\n(formalin)", "Methanol\n(separate)", "Heat fixation", "Methanol\n(in stain!)"],
    ["Primary Stain", "Hematoxylin\n+ OG + EA", "Hematoxylin\n+ Eosin", "Azure B\n+ Eosin Y", "Carbol\nFuchsin (red)", "Polychromed\nMethylene Blue\n+ Eosin"],
    ["Counterstain", "None\n(EA acts as\ncounterstain)", "Eosin\ncounterstains\nhematoxylin", "None needed", "Methylene\nBlue (blue)", "Buffer activates\nRomanowsky\neffect"],
    ["Nucleus Color", "Blue-Purple", "Blue-Purple", "Purple", "Blue\n(methylene blue)", "Purple"],
    ["Cytoplasm", "Pink/Green\n(differential)", "Pink", "Pink-grey-blue", "Blue\n(background)", "Pink-grey"],
    ["Special Feature", "Diff cytoplasmic\nstaining by\nmaturation", "Universal tissue\nstain, gold\nstandard", "SchΓΌffner's dots\nin P.vivax", "AFB = bright\nRED rods on\nblue background", "Combined\nfix+stain\nstep"],
    ["Total Time", "20–30 min", "~2 hours\n(with processing)", "30–60 min", "20–30 min", "5–8 min"],
    ["Reporting", "Bethesda\nsystem", "Histopathology\nreport", "Parasite count\nper 1000 RBCs", "WHO AFB\ngrading 1+–4+", "WBC\ndifferential %"],
]

col_w = [(W - 2*MARGIN) / 6] * 6
col_w[0] = 3*cm
remaining = W - 2*MARGIN - 3*cm
for i in range(1, 6):
    col_w[i] = remaining / 5

comp_t = Table(comp_data, colWidths=col_w, repeatRows=1)
row_colors = [C_WHITE] * len(comp_data)
section_colors_map = [C_BLUE, C_PAP, C_PURPLE, C_GREEN, C_RED, C_ORANGE]

row_ts = [
    ("BACKGROUND", (0,0), (-1,0), C_BLUE),
    ("TEXTCOLOR", (0,0), (-1,0), C_WHITE),
    ("FONTNAME", (0,0), (-1,0), "Helvetica-Bold"),
    ("FONTSIZE", (0,0), (-1,-1), 8),
    ("LEADING", (0,0), (-1,-1), 11),
    ("GRID", (0,0), (-1,-1), 0.4, C_GRAY_MID),
    ("VALIGN", (0,0), (-1,-1), "MIDDLE"),
    ("TOPPADDING", (0,0), (-1,-1), 4),
    ("BOTTOMPADDING", (0,0), (-1,-1), 4),
    ("LEFTPADDING", (0,0), (-1,-1), 5),
    ("ROWBACKGROUNDS", (0,1), (-1,-1), [C_WHITE, C_GRAY_LIGHT]),
    ("FONTNAME", (0,1), (0,-1), "Helvetica-Bold"),
    ("TEXTCOLOR", (0,1), (0,-1), C_BLUE),
]
comp_t.setStyle(TableStyle(row_ts))
story.append(comp_t)
story.append(sp(0.5))

# Leishman vs Giemsa mini table
story.append(colored_box_para("Leishman vs Giemsa – Quick Comparison", C_GREEN, font_size=11))
lg_data = [
    ["Feature", "Leishman", "Giemsa"],
    ["Fixation", "Combined in stain (methanol)", "Separate methanol step"],
    ["Total time", "5–8 minutes", "30–60 minutes"],
    ["Buffer pH", "6.8–7.0", "7.2"],
    ["Stability (diluted)", "Unstable β€” use within 3 hours", "Stable β€” glycerol present"],
    ["Malaria diagnosis", "Good for thin smears", "WHO recommended (thin + thick)"],
    ["Common in", "India, UK haematology labs", "Parasitology, reference labs"],
    ["Artifact risk", "Higher (precipitation)", "Lower"],
]
story.append(make_table(lg_data, [4.5*cm, 7*cm, 4*cm], header_bg=C_GREEN))
story.append(sp(0.4))

story.append(colored_box_para("Romanowsky Effect – Explanation", C_BLUE, font_size=11))
story.append(body_para(
    "The <b>Romanowsky effect</b> is seen in Giemsa, Leishman, Wright, and other polychromatic blood stains. "
    "It produces a <b>purple color distinct from either blue or red alone</b>. The mechanism: "
    "polychromed methylene blue (oxidized to Azure B, Azure A etc.) combines with eosin to form "
    "an <b>azure-eosin complex</b>. This complex selectively stains certain structures (malaria parasite nucleus, "
    "SchΓΌffner's dots) a distinct purple-red (magenta) that neither dye alone can produce. "
    "This is the basis for differentiating malaria parasite chromatin (red-magenta dot) from the blue cytoplasm."))
story.append(sp(0.3))

# References
story.append(hr(C_BLUE, 1))
story.append(colored_box_para("Sources & References", C_BLUE, font_size=11))
refs = [
    "Histology: A Text and Atlas with Correlated Cell and Molecular Biology (Wolters Kluwer)",
    "Junqueira's Basic Histology – Text and Atlas, 17th Edition",
    "Henry's Clinical Diagnosis and Management by Laboratory Methods (Elsevier)",
    "Tietz Textbook of Laboratory Medicine, 7th Edition",
    "Robbins & Kumar Basic Pathology (Elsevier)",
    "Jawetz, Melnick & Adelberg's Medical Microbiology, 28th Edition",
    "Nuances of the Papanicolaou Stain – PMC/NIH (PMID: PMC9345133)",
    "WHO Guidelines – Giemsa Staining of Malaria Blood Films (WHO WPRO SOP-07A)",
    "Newcomer Supply – Papanicolaou Stain Procedure (Technical Reference)",
]
for r in refs:
    story.append(bullet(r))

story.append(sp(0.3))
story.append(Paragraph(
    "This document is for educational/reference purposes only. Always follow your institution's SOPs for diagnostic staining.",
    ParagraphStyle("_disc", fontSize=8.5, textColor=colors.HexColor("#888888"),
    fontName="Helvetica-Oblique", alignment=TA_CENTER)))

# ── BUILD PDF ──────────────────────────────────────────────────
doc.build(story, onFirstPage=header_footer, onLaterPages=header_footer)
print(f"PDF saved to: {OUTPUT_PATH}")
Running Command

cd /home/daytona/workspace/staining-guide && python3 generate_pdf.py 2>&1

Editing File

~/staining-guide/generate_pdf.py

Successfully replaced 1 instance(s) of the string in '/home/daytona/workspace/staining-guide/generate_pdf.py'
Running Command

cd /home/daytona/workspace/staining-guide && python3 generate_pdf.py 2>&1

Running Command

ls -lh /home/daytona/workspace/staining-guide/Histology_Staining_Complete_Guide.…

PDF successfully ban gayi! Yahan download link hai:

Histology Staining Complete Guide

PDF Document Β· PDF


PDF mein kya kya hai:

πŸ“„ Cover Page - Sabhi 5 stains ke colored boxes ke saath
πŸ“‹ Table of Contents - Page numbers ke saath
Phir har stain ke liye complete section:
SectionColor ThemeContent
1. PAP StainTeal10 steps + dye table + cell appearance
2. H&E StainPurple9 steps + what basophilic/eosinophilic means
3. Giemsa StainGreen6 steps + malaria cell appearance
4. AFB (ZN) StainRed7 steps + WHO grading table
5. Leishman StainOrange5 steps + WBC differential colors
πŸ“Š Master Comparison Table - Sabhi 5 stains ek saath compare kiye
πŸ”¬ Leishman vs Giemsa - Special mini comparison table
πŸ“– Romanowsky Effect - Explanation of purple color mechanism
πŸ“š References - Textbooks aur WHO sources
Har page par header aur footer hai with page numbers. Professional medical reference document ki tarah design ki gayi hai.
This is a shared conversation. Sign in to Orris to start your own chat.