# bnsreenu/python_for_microscopists

**Attribution required: if you use, quote, or summarise this content, you must credit and link back to [awesome-repositories.com](https://awesome-repositories.com/repository/bnsreenu-python-for-microscopists).**

4,402 stars · 2,498 forks · Jupyter Notebook · MIT

## Links

- GitHub: https://github.com/bnsreenu/python_for_microscopists
- awesome-repositories: https://awesome-repositories.com/repository/bnsreenu-python-for-microscopists.md

## Description

This project is a Python bio-imaging toolkit and analysis suite designed for processing and analyzing microscopy and medical images. It provides a collection of tools for image quantification, medical image segmentation, and general bio-imaging workflows.

The suite includes specialized capabilities for quantifying biological data, such as measuring neuron branching complexity via Sholl analysis, calculating particle size distributions, and tracking wound area in scratch assays. It also features a medical image segmentation library that implements U-Net architectures for isolating anatomical structures in 3D data and uses generative adversarial networks to create synthetic scientific imagery for dataset augmentation.

Broadly, the project covers image processing primitives including denoising, contrast enhancement, and morphological transformations. It provides dataset management utilities for converting annotations between COCO, YOLO, and binary mask formats, as well as machine learning tools for training neural networks and implementing autoencoder-based weight transfer.

The analysis workflows are provided as a series of interactive Jupyter Notebooks.

## Tags

### Artificial Intelligence & ML

- [Medical Image Segmentations](https://awesome-repositories.com/f/artificial-intelligence-ml/medical-image-segmentations.md) — Implements U-Net architectures and semantic segmentation to isolate anatomical structures in 3D medical data. ([source](https://github.com/bnsreenu/python_for_microscopists#readme))
- [Instance Segmentation Engines](https://awesome-repositories.com/f/artificial-intelligence-ml/computer-vision-libraries/instance-segmentation-engines.md) — Identifies and outlines individual objects within 3D electron microscopy images to isolate biological structures. ([source](https://github.com/bnsreenu/python_for_microscopists/blob/master/330_Detectron2_Instance_3D_EM_Platelet.ipynb))
- [Dataset Preprocessing Tools](https://awesome-repositories.com/f/artificial-intelligence-ml/dataset-preprocessing-tools.md) — Converts annotations between COCO and YOLO formats and standardizes imagery for machine learning models.
- [Vision Model Training](https://awesome-repositories.com/f/artificial-intelligence-ml/machine-learning/infrastructure/model-training-and-tuning/training-frameworks/model-training-frameworks/vision-model-training.md) — Provides frameworks for training U-Net models for semantic segmentation from scratch or with pretrained backbones. ([source](https://github.com/bnsreenu/python_for_microscopists/tree/master/265_feature_engineering_or_deep_learning))
- [U-Net Architectures](https://awesome-repositories.com/f/artificial-intelligence-ml/neural-network-architectures/u-net-architectures.md) — Implements U-Net architectures to isolate anatomical structures within 3D medical imaging data.
- [Autoencoder Weight Transfer](https://awesome-repositories.com/f/artificial-intelligence-ml/neural-network-implementations/autoencoders/autoencoder-weight-transfer.md) — Transfers learned features from a pretrained autoencoder to initialize a segmentation network.
- [Training Execution Loops](https://awesome-repositories.com/f/artificial-intelligence-ml/neural-training-pipelines/training-execution-loops.md) — Executes a granular model training loop iterating through epochs and batches. ([source](https://github.com/bnsreenu/python_for_microscopists/tree/master/246%20-%20Training%20a%20keras%20model%20by%20enumerating%20epochs%20and%20batches))
- [U-Net Pretrainings](https://awesome-repositories.com/f/artificial-intelligence-ml/weight-initialization/pretrained-weight-initializers/autoencoder-weight-transfers/u-net-pretrainings.md) — Trains an autoencoder to learn image features for weight transfer into a U-Net segmentation model. ([source](https://github.com/bnsreenu/python_for_microscopists/tree/master/235-236_pre-training_unet_using_autoencoders))
- [Classification Feature Engineering](https://awesome-repositories.com/f/artificial-intelligence-ml/computer-vision-features/classification-feature-engineering.md) — Creates image features optimized for predictive modeling and classification using gradient boosting machines. ([source](https://github.com/bnsreenu/python_for_microscopists/tree/master/265_feature_engineering_or_deep_learning))
- [Edge Detection](https://awesome-repositories.com/f/artificial-intelligence-ml/computer-vision-systems/computer-vision/image-processing/edge-detection.md) — Identifies object boundaries in microscopy images using deep learning edge detection to isolate structures. ([source](https://github.com/bnsreenu/python_for_microscopists/tree/master/291-Object%20segmentation%20using%20Deep%20Learning%20based%20edge%20detection%20(HED)%E2%80%8B))
- [Mask Refinements](https://awesome-repositories.com/f/artificial-intelligence-ml/computer-vision-systems/image-segmentation/object-mask-generators/point-based-mask-generators/binary-mask-generators/mask-refinements.md) — Refines segmented binary masks using morphological closing operations to fill holes and connect fragments. ([source](https://github.com/bnsreenu/python_for_microscopists/blob/master/023-histogram_segmentation_using_scikit_image.py))
- [Feature Extraction](https://awesome-repositories.com/f/artificial-intelligence-ml/feature-extraction.md) — Computes structural characteristics using Gabor filters and deep learning to represent visual data numerically. ([source](https://github.com/bnsreenu/python_for_microscopists/tree/master/tips_tricks_46-Feature%20engineering%20vs%20feature%20learning))
- [Image Anomaly Detection Pipelines](https://awesome-repositories.com/f/artificial-intelligence-ml/machine-learning/infrastructure/model-training-and-tuning/training-frameworks/model-training-frameworks/vision-model-training/anomaly-detection-training-workflows/image-anomaly-detection-pipelines.md) — Detects outliers and localizes anomalies within images using autoencoders and specialized detection layers. ([source](https://github.com/bnsreenu/python_for_microscopists#readme))
- [Microscopy Dataset Structuring](https://awesome-repositories.com/f/artificial-intelligence-ml/machine-learning/machine-learning-datasets/image-classification-datasets/microscopy-dataset-structuring.md) — Formats raw microscopy or satellite imagery into structured datasets suitable for machine learning training. ([source](https://github.com/bnsreenu/python_for_microscopists/tree/master/230_landcover_dataset_segmentation))
- [Scientific Image Synthesis](https://awesome-repositories.com/f/artificial-intelligence-ml/synthetic-data-generators/computer-vision/scientific-image-synthesis.md) — Creates realistic scientific imagery using generative adversarial networks to augment datasets or simulate biological conditions. ([source](https://github.com/bnsreenu/python_for_microscopists#readme))

### Graphics & Multimedia

- [Biomedical Image Processing Toolkits](https://awesome-repositories.com/f/graphics-multimedia/biomedical-image-processing-toolkits.md) — Provides a comprehensive toolkit for processing and analyzing microscopy and medical images using Python.
- [Image Preprocessing](https://awesome-repositories.com/f/graphics-multimedia/image-preprocessing.md) — Provides a pipeline for channel splitting, scaling, resizing, and denoising to prepare images for analysis. ([source](https://github.com/bnsreenu/python_for_microscopists/blob/master/025-image_processing_in_openCV_intro1-preprocessing.py))
- [Medical Image Segmentations](https://awesome-repositories.com/f/graphics-multimedia/medical-image-segmentations.md) — Segments 3D medical images using a U-Net architecture to isolate specific anatomical structures. ([source](https://github.com/bnsreenu/python_for_microscopists/tree/master/230_landcover_dataset_segmentation))
- [Microscopy Data Quantifiers](https://awesome-repositories.com/f/graphics-multimedia/microscopy-data-quantifiers.md) — Calculates numerical biological data such as neuron branching complexity and particle size distributions.
- [Entropy-Based Segmentations](https://awesome-repositories.com/f/graphics-multimedia/entropy-based-segmentations.md) — Separates distinct areas of an image using entropy filtering to identify specific features. ([source](https://github.com/bnsreenu/python_for_microscopists/blob/master/020-image_processing_in_scikit-image.py))
- [Image Denoising](https://awesome-repositories.com/f/graphics-multimedia/image-denoising.md) — Provides algorithms for removing noise and artifacts from microscopy and medical images. ([source](https://github.com/bnsreenu/python_for_microscopists/blob/master/023-histogram_segmentation_using_scikit_image.py))
- [Non-Local Means Filtering](https://awesome-repositories.com/f/graphics-multimedia/image-denoising/non-local-means-filtering.md) — Implements non-local means filtering to remove image noise and improve segmentation quality. ([source](https://github.com/bnsreenu/python_for_microscopists/blob/master/024-random_walker_segmentation_scikit-image.py))
- [Threshold-Based Segmentation](https://awesome-repositories.com/f/graphics-multimedia/image-editing-processing/image-analysis-tools/histogram-analysis/threshold-based-segmentation.md) — Partitions images into distinct regions by defining intensity thresholds based on the image histogram. ([source](https://github.com/bnsreenu/python_for_microscopists/blob/master/023-histogram_segmentation_using_scikit_image.py))
- [Dimension Resizing](https://awesome-repositories.com/f/graphics-multimedia/image-editing-processing/image-processing/dimension-resizing.md) — Adjusts image scale using cubic, linear, and area-based interpolation for zooming and shrinking. ([source](https://github.com/bnsreenu/python_for_microscopists/blob/master/025-image_processing_in_openCV_intro1-preprocessing.py))
- [Morphological Operations](https://awesome-repositories.com/f/graphics-multimedia/image-editing-processing/image-processing/morphological-operations.md) — Applies erosion, dilation, and top-hat transforms to binary images for noise removal and structure isolation. ([source](https://github.com/bnsreenu/python_for_microscopists/blob/master/028-image_processing_in_openCV_intro2-Thresholding.py))
- [Image Noise Reduction](https://awesome-repositories.com/f/graphics-multimedia/image-noise-reduction.md) — Removes artifacts and sensor noise using Gaussian, Median, and Non-Local Means filters. ([source](https://github.com/bnsreenu/python_for_microscopists/blob/master/022-denoising.py))
- [Image Restoration](https://awesome-repositories.com/f/graphics-multimedia/image-restoration.md) — Restores image clarity by removing blur using deconvolution techniques and point spread functions. ([source](https://github.com/bnsreenu/python_for_microscopists/blob/master/020-image_processing_in_scikit-image.py))
- [Image Smoothing Filters](https://awesome-repositories.com/f/graphics-multimedia/image-smoothing-filters.md) — Reduces image grain and artifacts using averaging, Gaussian, median, and bilateral filters. ([source](https://github.com/bnsreenu/python_for_microscopists/blob/master/026-image_processing_in_openCV_intro1-preprocessing.py))
- [Large Scale Processing](https://awesome-repositories.com/f/graphics-multimedia/media-processing-analysis/media-manipulation/image-processing/large-scale-processing.md) — Handles high-resolution images and large datasets exceeding system memory through patching and blending. ([source](https://github.com/bnsreenu/python_for_microscopists#readme))
- [Image Transformation Utilities](https://awesome-repositories.com/f/graphics-multimedia/media-processing-analysis/media-manipulation/media-processing-workflows/image-processing-pipelines/image-preprocessing-utilities/color-adjustment-utilities/image-transformation-utilities.md) — Provides utilities for rescaling, resizing, and downsampling images to adjust scale and resolution. ([source](https://github.com/bnsreenu/python_for_microscopists/blob/master/020-image_processing_in_scikit-image.py))

### Scientific & Mathematical Computing

- [Biological Assay Quantification](https://awesome-repositories.com/f/scientific-mathematical-computing/biological-assay-quantification.md) — Calculates wound area across time-series images using entropy filtering and thresholding to track healing. ([source](https://github.com/bnsreenu/python_for_microscopists/blob/master/021-scratch_assay_using_scikit_image.py))
- [Neuron Morphology Analysis](https://awesome-repositories.com/f/scientific-mathematical-computing/neuron-morphology-analysis.md) — Measures neuronal branching complexity by counting intersections with concentric circles of increasing radii. ([source](https://github.com/bnsreenu/python_for_microscopists/tree/master/341-342%20-%20Sholl%20Analysis))
- [Particle Size Analysis](https://awesome-repositories.com/f/scientific-mathematical-computing/particle-size-analysis.md) — Calculates particle sizes using watershed segmentation and exports the resulting distribution data. ([source](https://github.com/bnsreenu/python_for_microscopists/blob/master/032-grain_analysis_saving_to_csv.py))
- [Scientific Image Analysis Toolkits](https://awesome-repositories.com/f/scientific-mathematical-computing/scientific-image-analysis-toolkits.md) — Extracts numerical data from scientific images to enable objective measurement of biological samples. ([source](https://github.com/bnsreenu/python_for_microscopists#readme))

### Data & Databases

- [Annotation Conversion Tools](https://awesome-repositories.com/f/data-databases/annotation-conversion-tools.md) — Transforms JSON object annotations into labeled mask images for use in semantic segmentation tasks. ([source](https://github.com/bnsreenu/python_for_microscopists/tree/master/335%20-%20Converting%20COCO%20JSON%20annotations%20to%20labeled%20mask%20images))
- [COCO Dataset Management](https://awesome-repositories.com/f/data-databases/coco-dataset-parsers/coco-dataset-management.md) — Transforms binary image masks into COCO JSON format to standardize annotations for segmentation tasks. ([source](https://github.com/bnsreenu/python_for_microscopists/tree/master/332%20-%20All%20about%20image%20annotations%E2%80%8B))
- [COCO Dataset Processing](https://awesome-repositories.com/f/data-databases/coco-dataset-parsers/coco-dataset-processing.md) — Translates COCO annotations into YOLOv8 polygon format to prepare datasets for object detection models. ([source](https://github.com/bnsreenu/python_for_microscopists/tree/master/332%20-%20All%20about%20image%20annotations%E2%80%8B))
- [Vision Dataset Loading](https://awesome-repositories.com/f/data-databases/vision-dataset-loading.md) — Loads and processes image data exceeding system memory capacity for use in segmentation models. ([source](https://github.com/bnsreenu/python_for_microscopists/tree/master/222_working_with_large_data_that_does_not_fit_memory_semantic_segm))

### Development Tools & Productivity

- [Analysis Notebook Suites](https://awesome-repositories.com/f/development-tools-productivity/analysis-notebook-suites.md) — Offers a series of interactive notebooks providing workflows for denoising, contrast enhancement, and morphological transformations.
