[{"data":1,"prerenderedAt":-1},["ShallowReactive",2],{"skill:01M75KGXVFAR92YQAH5TEVC3DD":3,"skill-same:01M75KGXVFAR92YQAH5TEVC3DD":46},{"skillNo":4,"name":5,"nameZh":6,"description":7,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":6,"sourceHtmlUrl":16,"categories":17,"keywords":18,"publishedAt":19,"linkOnly":20,"markdownContent":21,"markdownBody":22,"frontMatter":23,"refName":24,"commitSha":25,"skillDirectory":26,"forksCount":27,"repositoryHtmlUrl":28,"repositoryHomepageUrl":6,"ownerHtmlUrl":29,"ownerBlogUrl":6,"ownerDescription":30,"updatedAt":31,"install":32,"resources":45},"01M75KGXVFAR92YQAH5TEVC3DD","image-analysis-best-practices",null,"Apply best practices for microscopy image analysis: pixel-size calibration, channel bleed-through, exposure and dynamic range, controls, publication figures, color-blind safe palettes, and proper statistical handling of n=cells vs n=images vs n=animals.","pradyumnasagar\u002Fopen-research-skills","pradyumnasagar","https:\u002F\u002Favatars.githubusercontent.com\u002Fu\u002F10559871?v=4","01M75K78MYCCVKRTYGT8KKC380","Pradyumna Jayaram","01M75K78NTNE41F2PE1XBVFHAS",8,"MIT","https:\u002F\u002Fgithub.com\u002Fpradyumnasagar\u002Fopen-research-skills\u002Fblob\u002Fmain\u002Fskills\u002Fimage-analysis-microscopy\u002Fimage-analysis-best-practices\u002FSKILL.md",[],[],"2026-11-12 13:55:43",false,"---\n\nname: image-analysis-best-practices\ndescription: \"Apply best practices for microscopy image analysis: pixel-size calibration, channel bleed-through, exposure and dynamic range, controls, publication figures, color-blind safe palettes, and proper statistical handling of n=cells vs n=images vs n=animals.\"\nlicense: MIT\n---\n\u003C!-- metadata:\n  category: image-analysis-microscopy\n  oversight: low\n  version: 1.0.0\n  author: Pradyumna Jayaram\n  tags: [image-analysis-microscopy, research]\n  difficulty: intermediate\n-->\n\n# Image Analysis Best Practices: Acquisition, Controls, and Publication\n## Hard rules\n\n1. **No fabricated citations.** Every cited work must resolve to a verifiable\n2. **No claim without provenance.** Every quantitative or factual claim\n3. **No silent failure.** Every script invocation, API call, or tool use must declare its exit status and what to do on non-zero. A skill that silently swallows errors is a violation.\n\n## When to use\n\n- Designing a microscopy experiment whose quantitative results will\n  appear in a paper, preprint, or grant.\n- Reviewing a manuscript or thesis chapter that contains\n  microscopy-based quantitative claims.\n- Building a figure for a journal, with correct resolution, scale\n  bars, color-blind safe palettes, and minimal-necessary processing.\n- Deciding what counts as \"n\" in an image-derived dataset\n  (cells vs images vs animals vs fields-of-view).\n- Diagnosing a red flag in someone else's figure or your own\n  (saturation, mismatch in channel intensities, scaled-up\n  background, \"western-blot\" tweaks to gels).\n- Implementing positive\u002Fnegative\u002Fisotype controls for an\n  immunofluorescence experiment.\n\n## When NOT to use\n\n- Tool-specific \"how do I run CellProfiler \u002F QuPath \u002F Fiji\" — use\n  the corresponding tool skill in this category.\n- Pure flow-cytometry (no spatial information) — see the\n  `bio-flow-cytometry-*` skills.\n- Statistical testing per se (t-tests, GLMMs) — see the\n  statistical-analysis skills; this skill covers *which* test to\n  pick, not the mechanics.\n- Acquisition-side correction (illumination, chromatic\n  aberration) — the tool skills cover that; this skill covers\n  *experimental* best practices.\n\n## Prerequisites\n\n- Familiarity with the chosen microscope and acquisition software\n  (µManager, NIS-Elements, ZEN, LAS X, slide-scanner software).\n- A figure-creation tool (matplotlib, ggplot2, Illustrator,\n  Inkscape) with at least one that supports CMYK \u002F 300+ DPI export.\n- A small statistics toolset (R, Python statsmodels \u002F scipy) for\n  hierarchical models and effect-size calculations.\n- Awareness of the target journal's figure requirements (most\n  biomedical journals require 300 DPI for color, 600 DPI for\n  halftone, vector format for line art — verify with the journal's\n  *Instructions for Authors*).\n\n## Core workflow\n\nThe order below matters. Skipping step 1 cannot be patched in\nstep 5.\n\n1. **Plan the experiment *before* imaging.** Specify the biological\n   replicate (animal, donor, biological sample), the technical\n   replicate (fields-of-view, slides, sections), the *a priori*\n   power calculation, and which statistical test will be applied\n   later. The MIAME\u002FMIAPE-style checklists (e.g. the CellProfiler\n   example pipelines' \"metadata\") are useful templates.\n2. **Set the acquisition parameters once, write them down.**\n   - Exposure \u002F gain for every channel chosen to place the\n     dimmest expected signal *well above* the noise floor\n     (typically with peak pixel 500-3000 of a 12-bit \u002F 16-bit\n     dynamic range — see \"Dynamic range\" below).\n   - Pixel size at Nyquist or finer (≈ 2.3× oversampling of the\n     optical resolution; for a 1.4 NA objective at 488 nm\n     excitation, the Abbe limit is ≈ 200 nm, so 90-100 nm\u002Fpx\n     sampling is good practice).\n   - Laser power, integration time, and detector gain recorded in\n     a per-channel table.\n   - No contrast \u002F brightness \u002F gamma applied at acquisition\n     (linear data, no LUT stretching).\n3. **Capture the controls.** For fluorescence:\n   - **Negative control (no primary \u002F isotype).** Establishes\n     autofluorescence and non-specific binding baseline.\n   - **Positive control (known-positive sample).** Confirms the\n     antibody \u002F probe works and the acquisition range is right.\n   - **Single-stain controls (one per channel).** Required for\n     unmixing, channel bleed-through correction, and spectral\n     unmixing.\n   - **DAPI \u002F nuclear channel on its own.** Confirms the nuclear\n     segmentation.\n4. **Process and quantify on raw data.** Always keep a copy of the\n   original `.czi`, `.lif`, `.nd2`, or 16-bit `.tif` in a\n   write-once archive. Apply the same processing chain to every\n   image in the batch. The image is the data; the figure is the\n   visualization.\n5. **Document the processing chain.** A short methods paragraph\n   listing: software, version, exact modules \u002F commands, any\n   thresholds, any color balance changes. Best practice: deposit\n   the full pipeline \u002F script (e.g. `.cppipe`, `.qpproj`, `.ijm`,\n   Python notebook) in a public or supplementary archive\n   (Zenodo, GitHub tag).\n6. **Build the figure to journal specs.** Resolution, color space,\n   file format, scale bar, channel colors, and any linear\n   contrast adjustment must be applied *identically* to all\n   panels in a comparison (no \"normalized\" or \"this one is\n   brighter to see the structure\").\n7. **Run the statistics on the right unit of analysis.** See the\n   \"Common pitfalls — n = cells vs n = images vs n = animals\"\n   below. Report effect sizes and CIs, not only p-values.\n8. **Self-audit before submission.** Run the figure through the\n   \"Common pitfalls — Image manipulation\" checklist. Use the\n   CellProfiler example data or test images as a sanity check\n   for the whole pipeline.\n\n## Code patterns\n\n### Pixel-size \u002F scale bar verification\n\n```python\nimport tifffile\nimport json\n\n# Load a multi-resolution slide and check the embedded XML\n# metadata (OME \u002F vendor-specific). Verify the exact metadata\n# keys for your file format in the Bio-Formats or vendor docs.\nimg = tifffile.TiffFile(\"slide.tif\")\n# The physical-pixel-size key is format-dependent; the exact\n# name and units must be confirmed in the metadata specification.\n# print(img.pages[0].tags.get(\"XResolution\"))\n```\n\nIn the figure, set the scale bar in absolute units — e.g. \"10 µm\"\nin white on a 10-pixel wide line — and never in pixel count\n(\"250 pixels = ? µm, depends on the figure size\").\n\n### Check for channel bleed-through\n\n```python\nimport numpy as np\nimport tifffile\nimport matplotlib.pyplot as plt\n\n# Single-stain control: image of only the donor (no acceptor).\ndonor_only = tifffile.imread(\"control_donor_only.tif\")\n# Acceptor-detection channel from that same field:\nacceptor_leak = tifffile.imread(\"control_donor_only_acceptor_ch.tif\")\n\n# Plot a 2-D intensity histogram to look for cross-talk\nH, xedges, yedges = np.histogram2d(\n    donor_only.ravel(), acceptor_leak.ravel(), bins=128\n)\nplt.imshow(np.log1p(H.T), origin=\"lower\", aspect=\"auto\",\n           extent=[xedges[0], xedges[-1], yedges[0], yedges[-1]])\nplt.xlabel(\"Donor intensity\")\nplt.ylabel(\"Acceptor-leak intensity\")\nplt.title(\"Single-stain control — check for cross-talk\")\nplt.colorbar(label=\"log(1 + count)\")\nplt.show()\n```\n\nA non-zero slope in the high-intensity donor tail means\nbleed-through; correct by unmixing (linear spectral unmixing,\nlinear subtraction with a measured coefficient) or by selecting\nnarrower emission filters.\n\n### Saturation \u002F dynamic-range audit\n\n```python\nimport numpy as np\nimport tifffile\n\nimg = tifffile.imread(\"dapi.tif\")\nbit_depth = img.dtype  # e.g. uint16\n\n# Percentage of pixels at the max value\nsat = np.mean(img == np.iinfo(bit_depth).max) * 100\nprint(f\"Saturated pixels: {sat:.3f}%\")\n\n# Median intensity — should be well above the camera's\n# dark \u002F readout floor\nprint(f\"Median intensity: {np.median(img):.1f}\")\n```\n\nBoth CellProfiler's `MeasureImageSaturation` and a custom Python\ncheck like this are reasonable. Re-image at lower exposure if\nsaturation > ~0.5%; re-image at higher exposure if median ≪\n0.1% of dynamic range.\n\n### Color-blind safe palette (Wong \u002F Okabe-Ito)\n\n```python\nimport matplotlib.pyplot as plt\nimport numpy as np\n\n# Okabe-Ito 8-color palette — distinguishable by all common\n# forms of color-vision deficiency. Originally published\n# by Okabe & Ito and popularized in Wong 2011 (Nature\n# Methods). Always cite the palette you use.\nokabe_ito = {\n    \"black\": \"#000000\",\n    \"orange\": \"#E69F00\",\n    \"sky_blue\": \"#56B4E9\",\n    \"bluish_green\": \"#009E73\",\n    \"yellow\": \"#F0E442\",\n    \"blue\": \"#0072B2\",\n    \"vermillion\": \"#D55E00\",\n    \"purple\": \"#CC79A7\",\n}\n\nfig, ax = plt.subplots()\nfor (name, color) in okabe_ito.items():\n    ax.plot(np.arange(10), np.random.rand(10), color=color, label=name)\nax.legend()\nplt.show()\n```\n\n### Hierarchical \u002F mixed-effects model (n = cells, n = images, n = animals)\n\n```python\n# Pseudo-code: a hierarchical model where per-cell measurements\n# are subsamples of per-image measurements, which are subsamples\n# of per-animal measurements. Use a linear mixed-effects model\n# in statsmodels or R's lme4 — the exact test and link function\n# depend on the data type. Verify the model in the statsmodels\n# \u002F lme4 documentation.\n#\n# import statsmodels.formula.api as smf\n# model = smf.mixedlm(\n#     \"intensity ~ treatment\",\n#     data=per_cell_df,\n#     groups=per_cell_df[\"animal_id\"],\n#     vc_formula={\"image_id\": \"0 + C(image_id)\"}\n# )\n# result = model.fit()\n# print(result.summary())\n```\n\nA simpler but *acceptable* alternative when the experimental\ndesign permits is to **average within animal first**, then run\nthe test on the per-animal table (one number per animal). This\ndiscards the per-cell information but produces a defensible\nn = number-of-animals statistical test.\n\n## Common pitfalls\n\n### Image manipulation (Rossner & Yamada 2004, *Journal of Cell Biology*)\n\n- **Adjusting brightness\u002Fcontrast differently across panels** —\n  a frequent reason for editorial rejection. Apply the *same*\n  linear adjustment to every image in a comparison.\n- **Erasing background speckle \u002F dust \u002F saturated pixels** —\n  must be done in a way that is also applied to controls and\n  documented. ImageJ's *Cloning* tool used to \"clean up\" a panel\n  is a hard no for a publication figure.\n- **Splicing lanes \u002F regions from different gels or fields** —\n  must be visibly indicated with a separator line and explained\n  in the legend. A \"representative\" image must be representative\n  of the quantified data, not a cherry-picked field.\n- **Re-scaling a Western blot's contrast** to hide or enhance a\n  band. Always provide the full original.\n- **Publication of an image with no scale bar \u002F wrong scale\n  bar** — the original Rossner & Yamada editorial gives many\n  examples.\n\n### Exposure and dynamic range\n\n- **Pixel intensities pinned at 65535 (or 4095).** Saturated\n  pixels cannot be quantified; the relative amount of\n  signal across samples is destroyed. Lower the exposure.\n- **Median intensity \u003C\u003C 1% of the dynamic range.** The signal is\n  being thrown away; raise the exposure or use a brighter probe.\n- **16-bit data saved as 8-bit JPEG.** All quantitative\n  information is lost; the dynamic range is permanently\n  compressed.\n\n### Channel bleed-through\n\n- **Using the \"yellow\" look (green + red colocalization) on\n  un-corrected channels.** Strong cross-talk can mimic\n  colocalization. Run single-stain controls; compute\n  bleed-through coefficients; consider spectral unmixing.\n- **Photobleaching during acquisition.** The donor bleaches\n  faster than the acceptor, biasing ratiometric measurements\n  (FRET) over time. Reduce laser power; minimize exposure\n  time; do the FRET calculation on the same frame order.\n\n### Controls\n\n- **No negative control \u002F no isotype.** Every fluorescence\n  experiment must have one. For a multi-color panel, include\n  single-color controls and a \"no primary\" or \"isotype\"\n  control per primary.\n- **No positive control.** A failed experiment looks identical\n  to a successful one with no positive control. Always include\n  a known-positive sample.\n- **Wrong \"isotype\" concentration.** Isotype control should be\n  at the same concentration (mass, fluorophore-to-protein\n  ratio) as the test antibody, not at a generic \"matching\"\n  concentration.\n\n### Publication figures\n\n- **Insufficient resolution.** Most journals require ≥ 300 DPI\n  for color, ≥ 600 DPI for halftone, vector format (PDF, SVG,\n  EPS) for line art. A \"pretty\" 72-DPI figure is not\n  publication-quality.\n- **Using red\u002Fgreen to encode information.** Deuteranopia\n  (red-green color-blindness) affects ~6% of male readers;\n  use a color-blind safe palette (Wong \u002F Okabe-Ito) and pair\n  with shape\u002Flabel redundancy.\n- **No scale bar.** Reviewers will (rightly) reject the\n  figure.\n- **Inconsistent figure styles within a paper.** Define a\n  style once (font, line widths, color, marker sizes,\n  annotations) and apply it everywhere.\n- **Log-scale axes without a warning.** Log scales hide\n  small-magnitude differences; use them with care, and\n  label them clearly.\n\n### n = cells vs n = images vs n = animals\n\nThis is the single most common statistical error in image\nanalysis papers (and reviewers are increasingly trained to\ncatch it). Three scenarios:\n\n- **n = cells, treatment-vs-control.** If 50 cells from one\n  animal per condition are measured, the unit of analysis\n  is the cell, but the *biological replicate* is still the\n  animal. The cell-level test is wrong if it ignores the\n  animal-level clustering.\n- **n = images (fields-of-view).** Often 5-10 fields per\n  condition per animal. The FOV is a *technical* replicate\n  nested in animal; analyze as a hierarchical model or\n  average within animal first.\n- **n = animals.** If you have 6 animals per condition, the\n  per-animal mean is the right unit. Doing a t-test on\n  per-cell values with n = 1000 is statistically invalid\n  because the cells are not independent.\n\nUse a **linear mixed-effects model** (R `lme4`, Python\n`statsmodels` mixedlm) with the appropriate random-effect\nstructure: cells nested in FOVs nested in animals. Or, when\nthe design is simple, average within animal, plot per-animal\npoints, and run a t-test on the per-animal means. *Always\nreport both n = animals and a total cell count in the\nlegend.*\n\n### Other gotchas\n\n- **Comparing images acquired with different objectives \u002F\n  cameras \u002F bit depths.** Calibrate the pixel size and the\n  intensity units first; otherwise the comparison is\n  meaningless.\n- **Comparing control and treated without checking the\n  baseline imaging conditions.** Day-to-day, instrument-to-\n  instrument variation in lamp output and detector gain can\n  exceed biological effects. Block by day, run a control in\n  the *same* session, or use a ratiometric measurement.\n- **Ignoring 3D context.** A 2-D maximum projection of a Z\n  stack is *not* the same data as a single 2-D plane; the\n  projection can introduce apparent co-localization\n  artifacts.\n\n## Validation\n\n- **Pipeline test on synthetic data:** generate an artificial\n  image stack (e.g. 100 circles of known diameter and\n  intensity) and verify the pipeline recovers the ground truth\n  within tolerance.\n- **Spike-and-recovery \u002F dilution series:** where possible,\n  spike in a known amount of fluorescent standard and verify\n  the measurement is linear in the expected range.\n- **Inter-rater agreement:** when annotations are involved\n  (pathology, ROIs), compute Cohen's κ or ICC between two\n  annotators; report it.\n- **Re-analysis by an independent analyst:** if results are\n  central to a paper claim, have a second person re-run the\n  analysis from raw data using only the methods paragraph.\n- **Journals' figure QC:** Cell, Nature, JCB, eLife, and PLOS\n  all run published figures through image-manipulation\n  screening tools (e.g. the Office of Research Integrity's\n  forensic kit). Run your own audit with the\n  `bioimage-forensics` or similar tool before submission.\n\n## Open alternatives\n\n- **Forensic image-audit tools:** the *Bioimage Forensics*\n  community maintains open tools for detecting cloning and\n  splicing. Commercial equivalents exist (e.g. ImageJ-based\n  \"Analyze → Tools → ...) but are not standard.\n- **Acquisition standards:** the *Quality Assessment and\n  Reproducibility for Instruments in Optical Microscopy*\n  (QUAREP-LiMi) initiative publishes per-modality\n  checklists.\n- **Reporting standards:** ARRIVE 2.0 (animal research),\n  MIAME (microarray — analogously applied to imaging),\n  REMARK (tumor marker), and the *CellProfiler* and\n  *QuPath* project templates all have methods-section\n  templates you can copy.\n\n## References\n\n- Rossner, M. & Yamada, K. M. 2004, \"What's in a picture?\n  The temptation of image manipulation,\" *Journal of Cell\n  Biology* 166(1):11-15. The foundational editorial on\n  image-manipulation ethics.\n- Cromey, D. W. 2010, \"Avoiding twisted pixels: ethical\n  guidelines for the appropriate use and manipulation of\n  scientific digital images,\" *Science and Engineering\n  Ethics* 16(4):639-667. Comprehensive practical guide.\n- Okabe, M. & Ito, K. 2008, \"Color universal design\" — the\n  origin of the Okabe-Ito palette.\n- Wong, B. 2011, \"Points of view: Color blindness,\" *Nature\n  Methods* 8:441. Popularized Okabe-Ito for biology.\n- QUAREP-LiMi: \u003Chttps:\u002F\u002Fquarep.org\u002F> — community\n  microscopy-quality standards.\n- ARRIVE 2.0: \u003Chttps:\u002F\u002Farriveguidelines.org\u002F>\n- NIH figure guidelines and the *ImageJ for\n  Scientists* book (Miura & Nørrelykke, 2021) for\n  further practical reading.\n\n## Changelog\n\n- 1.0.0 (2026-06-10): Initial adaptation by Pradyumna Jayaram\n  from the Rossner & Yamada 2004 JCB editorial and the\n  QUAREP-LiMi reporting standards; consolidated the\n  n = cells vs n = images vs n = animals guidance and the\n  color-blind palette reference.\n\n## Cross-references\n\nOther skills in this category:\n\n- cellprofiler-pipelines\n- imagej-fiji-macro\n- qupath-pathology\n","\u003C!-- metadata:\n  category: image-analysis-microscopy\n  oversight: low\n  version: 1.0.0\n  author: Pradyumna Jayaram\n  tags: [image-analysis-microscopy, research]\n  difficulty: intermediate\n-->\n\n# Image Analysis Best Practices: Acquisition, Controls, and Publication\n## Hard rules\n\n1. **No fabricated citations.** Every cited work must resolve to a verifiable\n2. **No claim without provenance.** Every quantitative or factual claim\n3. **No silent failure.** Every script invocation, API call, or tool use must declare its exit status and what to do on non-zero. A skill that silently swallows errors is a violation.\n\n## When to use\n\n- Designing a microscopy experiment whose quantitative results will\n  appear in a paper, preprint, or grant.\n- Reviewing a manuscript or thesis chapter that contains\n  microscopy-based quantitative claims.\n- Building a figure for a journal, with correct resolution, scale\n  bars, color-blind safe palettes, and minimal-necessary processing.\n- Deciding what counts as \"n\" in an image-derived dataset\n  (cells vs images vs animals vs fields-of-view).\n- Diagnosing a red flag in someone else's figure or your own\n  (saturation, mismatch in channel intensities, scaled-up\n  background, \"western-blot\" tweaks to gels).\n- Implementing positive\u002Fnegative\u002Fisotype controls for an\n  immunofluorescence experiment.\n\n## When NOT to use\n\n- Tool-specific \"how do I run CellProfiler \u002F QuPath \u002F Fiji\" — use\n  the corresponding tool skill in this category.\n- Pure flow-cytometry (no spatial information) — see the\n  `bio-flow-cytometry-*` skills.\n- Statistical testing per se (t-tests, GLMMs) — see the\n  statistical-analysis skills; this skill covers *which* test to\n  pick, not the mechanics.\n- Acquisition-side correction (illumination, chromatic\n  aberration) — the tool skills cover that; this skill covers\n  *experimental* best practices.\n\n## Prerequisites\n\n- Familiarity with the chosen microscope and acquisition software\n  (µManager, NIS-Elements, ZEN, LAS X, slide-scanner software).\n- A figure-creation tool (matplotlib, ggplot2, Illustrator,\n  Inkscape) with at least one that supports CMYK \u002F 300+ DPI export.\n- A small statistics toolset (R, Python statsmodels \u002F scipy) for\n  hierarchical models and effect-size calculations.\n- Awareness of the target journal's figure requirements (most\n  biomedical journals require 300 DPI for color, 600 DPI for\n  halftone, vector format for line art — verify with the journal's\n  *Instructions for Authors*).\n\n## Core workflow\n\nThe order below matters. Skipping step 1 cannot be patched in\nstep 5.\n\n1. **Plan the experiment *before* imaging.** Specify the biological\n   replicate (animal, donor, biological sample), the technical\n   replicate (fields-of-view, slides, sections), the *a priori*\n   power calculation, and which statistical test will be applied\n   later. The MIAME\u002FMIAPE-style checklists (e.g. the CellProfiler\n   example pipelines' \"metadata\") are useful templates.\n2. **Set the acquisition parameters once, write them down.**\n   - Exposure \u002F gain for every channel chosen to place the\n     dimmest expected signal *well above* the noise floor\n     (typically with peak pixel 500-3000 of a 12-bit \u002F 16-bit\n     dynamic range — see \"Dynamic range\" below).\n   - Pixel size at Nyquist or finer (≈ 2.3× oversampling of the\n     optical resolution; for a 1.4 NA objective at 488 nm\n     excitation, the Abbe limit is ≈ 200 nm, so 90-100 nm\u002Fpx\n     sampling is good practice).\n   - Laser power, integration time, and detector gain recorded in\n     a per-channel table.\n   - No contrast \u002F brightness \u002F gamma applied at acquisition\n     (linear data, no LUT stretching).\n3. **Capture the controls.** For fluorescence:\n   - **Negative control (no primary \u002F isotype).** Establishes\n     autofluorescence and non-specific binding baseline.\n   - **Positive control (known-positive sample).** Confirms the\n     antibody \u002F probe works and the acquisition range is right.\n   - **Single-stain controls (one per channel).** Required for\n     unmixing, channel bleed-through correction, and spectral\n     unmixing.\n   - **DAPI \u002F nuclear channel on its own.** Confirms the nuclear\n     segmentation.\n4. **Process and quantify on raw data.** Always keep a copy of the\n   original `.czi`, `.lif`, `.nd2`, or 16-bit `.tif` in a\n   write-once archive. Apply the same processing chain to every\n   image in the batch. The image is the data; the figure is the\n   visualization.\n5. **Document the processing chain.** A short methods paragraph\n   listing: software, version, exact modules \u002F commands, any\n   thresholds, any color balance changes. Best practice: deposit\n   the full pipeline \u002F script (e.g. `.cppipe`, `.qpproj`, `.ijm`,\n   Python notebook) in a public or supplementary archive\n   (Zenodo, GitHub tag).\n6. **Build the figure to journal specs.** Resolution, color space,\n   file format, scale bar, channel colors, and any linear\n   contrast adjustment must be applied *identically* to all\n   panels in a comparison (no \"normalized\" or \"this one is\n   brighter to see the structure\").\n7. **Run the statistics on the right unit of analysis.** See the\n   \"Common pitfalls — n = cells vs n = images vs n = animals\"\n   below. Report effect sizes and CIs, not only p-values.\n8. **Self-audit before submission.** Run the figure through the\n   \"Common pitfalls — Image manipulation\" checklist. Use the\n   CellProfiler example data or test images as a sanity check\n   for the whole pipeline.\n\n## Code patterns\n\n### Pixel-size \u002F scale bar verification\n\n```python\nimport tifffile\nimport json\n\n# Load a multi-resolution slide and check the embedded XML\n# metadata (OME \u002F vendor-specific). Verify the exact metadata\n# keys for your file format in the Bio-Formats or vendor docs.\nimg = tifffile.TiffFile(\"slide.tif\")\n# The physical-pixel-size key is format-dependent; the exact\n# name and units must be confirmed in the metadata specification.\n# print(img.pages[0].tags.get(\"XResolution\"))\n```\n\nIn the figure, set the scale bar in absolute units — e.g. \"10 µm\"\nin white on a 10-pixel wide line — and never in pixel count\n(\"250 pixels = ? µm, depends on the figure size\").\n\n### Check for channel bleed-through\n\n```python\nimport numpy as np\nimport tifffile\nimport matplotlib.pyplot as plt\n\n# Single-stain control: image of only the donor (no acceptor).\ndonor_only = tifffile.imread(\"control_donor_only.tif\")\n# Acceptor-detection channel from that same field:\nacceptor_leak = tifffile.imread(\"control_donor_only_acceptor_ch.tif\")\n\n# Plot a 2-D intensity histogram to look for cross-talk\nH, xedges, yedges = np.histogram2d(\n    donor_only.ravel(), acceptor_leak.ravel(), bins=128\n)\nplt.imshow(np.log1p(H.T), origin=\"lower\", aspect=\"auto\",\n           extent=[xedges[0], xedges[-1], yedges[0], yedges[-1]])\nplt.xlabel(\"Donor intensity\")\nplt.ylabel(\"Acceptor-leak intensity\")\nplt.title(\"Single-stain control — check for cross-talk\")\nplt.colorbar(label=\"log(1 + count)\")\nplt.show()\n```\n\nA non-zero slope in the high-intensity donor tail means\nbleed-through; correct by unmixing (linear spectral unmixing,\nlinear subtraction with a measured coefficient) or by selecting\nnarrower emission filters.\n\n### Saturation \u002F dynamic-range audit\n\n```python\nimport numpy as np\nimport tifffile\n\nimg = tifffile.imread(\"dapi.tif\")\nbit_depth = img.dtype  # e.g. uint16\n\n# Percentage of pixels at the max value\nsat = np.mean(img == np.iinfo(bit_depth).max) * 100\nprint(f\"Saturated pixels: {sat:.3f}%\")\n\n# Median intensity — should be well above the camera's\n# dark \u002F readout floor\nprint(f\"Median intensity: {np.median(img):.1f}\")\n```\n\nBoth CellProfiler's `MeasureImageSaturation` and a custom Python\ncheck like this are reasonable. Re-image at lower exposure if\nsaturation > ~0.5%; re-image at higher exposure if median ≪\n0.1% of dynamic range.\n\n### Color-blind safe palette (Wong \u002F Okabe-Ito)\n\n```python\nimport matplotlib.pyplot as plt\nimport numpy as np\n\n# Okabe-Ito 8-color palette — distinguishable by all common\n# forms of color-vision deficiency. Originally published\n# by Okabe & Ito and popularized in Wong 2011 (Nature\n# Methods). Always cite the palette you use.\nokabe_ito = {\n    \"black\": \"#000000\",\n    \"orange\": \"#E69F00\",\n    \"sky_blue\": \"#56B4E9\",\n    \"bluish_green\": \"#009E73\",\n    \"yellow\": \"#F0E442\",\n    \"blue\": \"#0072B2\",\n    \"vermillion\": \"#D55E00\",\n    \"purple\": \"#CC79A7\",\n}\n\nfig, ax = plt.subplots()\nfor (name, color) in okabe_ito.items():\n    ax.plot(np.arange(10), np.random.rand(10), color=color, label=name)\nax.legend()\nplt.show()\n```\n\n### Hierarchical \u002F mixed-effects model (n = cells, n = images, n = animals)\n\n```python\n# Pseudo-code: a hierarchical model where per-cell measurements\n# are subsamples of per-image measurements, which are subsamples\n# of per-animal measurements. Use a linear mixed-effects model\n# in statsmodels or R's lme4 — the exact test and link function\n# depend on the data type. Verify the model in the statsmodels\n# \u002F lme4 documentation.\n#\n# import statsmodels.formula.api as smf\n# model = smf.mixedlm(\n#     \"intensity ~ treatment\",\n#     data=per_cell_df,\n#     groups=per_cell_df[\"animal_id\"],\n#     vc_formula={\"image_id\": \"0 + C(image_id)\"}\n# )\n# result = model.fit()\n# print(result.summary())\n```\n\nA simpler but *acceptable* alternative when the experimental\ndesign permits is to **average within animal first**, then run\nthe test on the per-animal table (one number per animal). This\ndiscards the per-cell information but produces a defensible\nn = number-of-animals statistical test.\n\n## Common pitfalls\n\n### Image manipulation (Rossner & Yamada 2004, *Journal of Cell Biology*)\n\n- **Adjusting brightness\u002Fcontrast differently across panels** —\n  a frequent reason for editorial rejection. Apply the *same*\n  linear adjustment to every image in a comparison.\n- **Erasing background speckle \u002F dust \u002F saturated pixels** —\n  must be done in a way that is also applied to controls and\n  documented. ImageJ's *Cloning* tool used to \"clean up\" a panel\n  is a hard no for a publication figure.\n- **Splicing lanes \u002F regions from different gels or fields** —\n  must be visibly indicated with a separator line and explained\n  in the legend. A \"representative\" image must be representative\n  of the quantified data, not a cherry-picked field.\n- **Re-scaling a Western blot's contrast** to hide or enhance a\n  band. Always provide the full original.\n- **Publication of an image with no scale bar \u002F wrong scale\n  bar** — the original Rossner & Yamada editorial gives many\n  examples.\n\n### Exposure and dynamic range\n\n- **Pixel intensities pinned at 65535 (or 4095).** Saturated\n  pixels cannot be quantified; the relative amount of\n  signal across samples is destroyed. Lower the exposure.\n- **Median intensity \u003C\u003C 1% of the dynamic range.** The signal is\n  being thrown away; raise the exposure or use a brighter probe.\n- **16-bit data saved as 8-bit JPEG.** All quantitative\n  information is lost; the dynamic range is permanently\n  compressed.\n\n### Channel bleed-through\n\n- **Using the \"yellow\" look (green + red colocalization) on\n  un-corrected channels.** Strong cross-talk can mimic\n  colocalization. Run single-stain controls; compute\n  bleed-through coefficients; consider spectral unmixing.\n- **Photobleaching during acquisition.** The donor bleaches\n  faster than the acceptor, biasing ratiometric measurements\n  (FRET) over time. Reduce laser power; minimize exposure\n  time; do the FRET calculation on the same frame order.\n\n### Controls\n\n- **No negative control \u002F no isotype.** Every fluorescence\n  experiment must have one. For a multi-color panel, include\n  single-color controls and a \"no primary\" or \"isotype\"\n  control per primary.\n- **No positive control.** A failed experiment looks identical\n  to a successful one with no positive control. Always include\n  a known-positive sample.\n- **Wrong \"isotype\" concentration.** Isotype control should be\n  at the same concentration (mass, fluorophore-to-protein\n  ratio) as the test antibody, not at a generic \"matching\"\n  concentration.\n\n### Publication figures\n\n- **Insufficient resolution.** Most journals require ≥ 300 DPI\n  for color, ≥ 600 DPI for halftone, vector format (PDF, SVG,\n  EPS) for line art. A \"pretty\" 72-DPI figure is not\n  publication-quality.\n- **Using red\u002Fgreen to encode information.** Deuteranopia\n  (red-green color-blindness) affects ~6% of male readers;\n  use a color-blind safe palette (Wong \u002F Okabe-Ito) and pair\n  with shape\u002Flabel redundancy.\n- **No scale bar.** Reviewers will (rightly) reject the\n  figure.\n- **Inconsistent figure styles within a paper.** Define a\n  style once (font, line widths, color, marker sizes,\n  annotations) and apply it everywhere.\n- **Log-scale axes without a warning.** Log scales hide\n  small-magnitude differences; use them with care, and\n  label them clearly.\n\n### n = cells vs n = images vs n = animals\n\nThis is the single most common statistical error in image\nanalysis papers (and reviewers are increasingly trained to\ncatch it). Three scenarios:\n\n- **n = cells, treatment-vs-control.** If 50 cells from one\n  animal per condition are measured, the unit of analysis\n  is the cell, but the *biological replicate* is still the\n  animal. The cell-level test is wrong if it ignores the\n  animal-level clustering.\n- **n = images (fields-of-view).** Often 5-10 fields per\n  condition per animal. The FOV is a *technical* replicate\n  nested in animal; analyze as a hierarchical model or\n  average within animal first.\n- **n = animals.** If you have 6 animals per condition, the\n  per-animal mean is the right unit. Doing a t-test on\n  per-cell values with n = 1000 is statistically invalid\n  because the cells are not independent.\n\nUse a **linear mixed-effects model** (R `lme4`, Python\n`statsmodels` mixedlm) with the appropriate random-effect\nstructure: cells nested in FOVs nested in animals. Or, when\nthe design is simple, average within animal, plot per-animal\npoints, and run a t-test on the per-animal means. *Always\nreport both n = animals and a total cell count in the\nlegend.*\n\n### Other gotchas\n\n- **Comparing images acquired with different objectives \u002F\n  cameras \u002F bit depths.** Calibrate the pixel size and the\n  intensity units first; otherwise the comparison is\n  meaningless.\n- **Comparing control and treated without checking the\n  baseline imaging conditions.** Day-to-day, instrument-to-\n  instrument variation in lamp output and detector gain can\n  exceed biological effects. Block by day, run a control in\n  the *same* session, or use a ratiometric measurement.\n- **Ignoring 3D context.** A 2-D maximum projection of a Z\n  stack is *not* the same data as a single 2-D plane; the\n  projection can introduce apparent co-localization\n  artifacts.\n\n## Validation\n\n- **Pipeline test on synthetic data:** generate an artificial\n  image stack (e.g. 100 circles of known diameter and\n  intensity) and verify the pipeline recovers the ground truth\n  within tolerance.\n- **Spike-and-recovery \u002F dilution series:** where possible,\n  spike in a known amount of fluorescent standard and verify\n  the measurement is linear in the expected range.\n- **Inter-rater agreement:** when annotations are involved\n  (pathology, ROIs), compute Cohen's κ or ICC between two\n  annotators; report it.\n- **Re-analysis by an independent analyst:** if results are\n  central to a paper claim, have a second person re-run the\n  analysis from raw data using only the methods paragraph.\n- **Journals' figure QC:** Cell, Nature, JCB, eLife, and PLOS\n  all run published figures through image-manipulation\n  screening tools (e.g. the Office of Research Integrity's\n  forensic kit). Run your own audit with the\n  `bioimage-forensics` or similar tool before submission.\n\n## Open alternatives\n\n- **Forensic image-audit tools:** the *Bioimage Forensics*\n  community maintains open tools for detecting cloning and\n  splicing. Commercial equivalents exist (e.g. ImageJ-based\n  \"Analyze → Tools → ...) but are not standard.\n- **Acquisition standards:** the *Quality Assessment and\n  Reproducibility for Instruments in Optical Microscopy*\n  (QUAREP-LiMi) initiative publishes per-modality\n  checklists.\n- **Reporting standards:** ARRIVE 2.0 (animal research),\n  MIAME (microarray — analogously applied to imaging),\n  REMARK (tumor marker), and the *CellProfiler* and\n  *QuPath* project templates all have methods-section\n  templates you can copy.\n\n## References\n\n- Rossner, M. & Yamada, K. M. 2004, \"What's in a picture?\n  The temptation of image manipulation,\" *Journal of Cell\n  Biology* 166(1):11-15. The foundational editorial on\n  image-manipulation ethics.\n- Cromey, D. W. 2010, \"Avoiding twisted pixels: ethical\n  guidelines for the appropriate use and manipulation of\n  scientific digital images,\" *Science and Engineering\n  Ethics* 16(4):639-667. Comprehensive practical guide.\n- Okabe, M. & Ito, K. 2008, \"Color universal design\" — the\n  origin of the Okabe-Ito palette.\n- Wong, B. 2011, \"Points of view: Color blindness,\" *Nature\n  Methods* 8:441. Popularized Okabe-Ito for biology.\n- QUAREP-LiMi: \u003Chttps:\u002F\u002Fquarep.org\u002F> — community\n  microscopy-quality standards.\n- ARRIVE 2.0: \u003Chttps:\u002F\u002Farriveguidelines.org\u002F>\n- NIH figure guidelines and the *ImageJ for\n  Scientists* book (Miura & Nørrelykke, 2021) for\n  further practical reading.\n\n## Changelog\n\n- 1.0.0 (2026-06-10): Initial adaptation by Pradyumna Jayaram\n  from the Rossner & Yamada 2004 JCB editorial and the\n  QUAREP-LiMi reporting standards; consolidated the\n  n = cells vs n = images vs n = animals guidance and the\n  color-blind palette reference.\n\n## Cross-references\n\nOther skills in this category:\n\n- cellprofiler-pipelines\n- imagej-fiji-macro\n- qupath-pathology\n",{"name":5,"license":15,"description":7},"main","9c0b41e2036cc5588c699f06e658ea6dc3b9685d","skills\u002Fimage-analysis-microscopy\u002Fimage-analysis-best-practices",2,"https:\u002F\u002Fgithub.com\u002Fpradyumnasagar\u002Fopen-research-skills","https:\u002F\u002Fgithub.com\u002Fpradyumnasagar","PhD Scholar,\r\nManipal School Of Life Sciences, Manipal\r\n #OpenSourceDeveloper #LifeSciences #ComputationalBiology","2026-10-30 01:30:52",{"source":8,"skillName":5,"commands":33,"prompt":43,"zipAvailable":44},[34,37,40],{"tool":35,"command":36},"npx","npx skills add pradyumnasagar\u002Fopen-research-skills --skill image-analysis-best-practices",{"tool":38,"command":39},"bunx","bunx skills add pradyumnasagar\u002Fopen-research-skills --skill image-analysis-best-practices",{"tool":41,"command":42},"pnpm","pnpm dlx skills add pradyumnasagar\u002Fopen-research-skills --skill image-analysis-best-practices","安装技能，技能地址：https:\u002F\u002Fgithub.com\u002Fpradyumnasagar\u002Fopen-research-skills\u002Fblob\u002Fmain\u002Fskills\u002Fimage-analysis-microscopy\u002Fimage-analysis-best-practices\u002FSKILL.md",true,[],[47,54,60,67,74,81],{"skillNo":48,"name":49,"nameZh":6,"description":50,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":6,"sourceHtmlUrl":51,"categories":52,"keywords":53,"publishedAt":19},"01M75KTS5K9QNX8FQBTJW2GQSH","good-skill","A well-formed test fixture for the validation script.","https:\u002F\u002Fgithub.com\u002Fpradyumnasagar\u002Fopen-research-skills\u002Fblob\u002Fmain\u002Ftests\u002Ffixtures\u002Fgood-skill\u002FSKILL.md",[],[],{"skillNo":55,"name":56,"nameZh":6,"description":6,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":6,"sourceHtmlUrl":57,"categories":58,"keywords":59,"publishedAt":19},"01M75KTR7FAT0MMMED2EGC9WZZ","BadSkill","https:\u002F\u002Fgithub.com\u002Fpradyumnasagar\u002Fopen-research-skills\u002Fblob\u002Fmain\u002Ftests\u002Ffixtures\u002Fbad-skill\u002FSKILL.md",[],[],{"skillNo":61,"name":62,"nameZh":6,"description":63,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":6,"sourceHtmlUrl":64,"categories":65,"keywords":66,"publishedAt":19},"01M75KTN949EDF77GJDS8H6VR8","my-new-skill","One sentence (max 200 chars) — what the skill does and when to use it.","https:\u002F\u002Fgithub.com\u002Fpradyumnasagar\u002Fopen-research-skills\u002Fblob\u002Fmain\u002Ftemplate\u002FSKILL.md",[],[],{"skillNo":68,"name":69,"nameZh":6,"description":70,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":6,"sourceHtmlUrl":71,"categories":72,"keywords":73,"publishedAt":19},"01M75KTHTFS121SSF1Q5X2FXDA","thesis-structure","Use when planning or checking the architecture of a PhD \u002F MPhil thesis in the life sciences or bioinformatics — monograph vs article-based, chapter sequence, IMRaD-based chapters, abstract-to-conclusion flow, and the examiner expectations that the structure must meet.","https:\u002F\u002Fgithub.com\u002Fpradyumnasagar\u002Fopen-research-skills\u002Fblob\u002Fmain\u002Fskills\u002Fthesis-writing\u002Fthesis-structure\u002FSKILL.md",[],[],{"skillNo":75,"name":76,"nameZh":6,"description":77,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":6,"sourceHtmlUrl":78,"categories":79,"keywords":80,"publishedAt":19},"01M75KTE3WKW46FXFHQ579H8YP","thesis-methods-reproducibility","Use when writing or checking the Methods, figures, data, and code of a bioinformatics \u002F microbiology \u002F life-science PhD thesis — the FAIR data, versioned code, report-generation, figure-and-table discipline, and the reproducibility expectations that examiners probe at viva.","https:\u002F\u002Fgithub.com\u002Fpradyumnasagar\u002Fopen-research-skills\u002Fblob\u002Fmain\u002Fskills\u002Fthesis-writing\u002Fthesis-methods-reproducibility\u002FSKILL.md",[],[],{"skillNo":82,"name":83,"nameZh":6,"description":84,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":6,"sourceHtmlUrl":85,"categories":86,"keywords":87,"publishedAt":19},"01M75KTA033ZQCJY3DC8P5VQET","thesis-defense-viva","Use when preparing for the viva voce \u002F oral thesis defense — building the examiner's question set, rehearsing the presentation, and the pre-defense polish (slides, summary, the 'what if I'm stuck' responses) for a life-science or bioinformatics PhD.","https:\u002F\u002Fgithub.com\u002Fpradyumnasagar\u002Fopen-research-skills\u002Fblob\u002Fmain\u002Fskills\u002Fthesis-writing\u002Fthesis-defense-viva\u002FSKILL.md",[],[]]