Processes medical images with MATLAB Image Processing Toolbox: denoising, enhancement, segmentation, morphological operations, cell counting for MRI, CT, microscopy, histology.
npx claudepluginhub rrmaram2000/matlab-toolbox-skills --plugin matlab-toolbox-skillsThis skill uses the workspace's default tool permissions.
Expert skill for medical image analysis using MATLAB's Image Processing Toolbox (IPT R2025a+). Focuses on medical imaging patterns, domain-specific pipelines, and non-obvious gotchas that go beyond standard IPT knowledge.
knowledge/INDEX.mdknowledge/cards/data-types.mdknowledge/cards/deep-learning-segmentation.mdknowledge/cards/feature-regions.mdknowledge/cards/filtering-denoising.mdknowledge/cards/medical-microscopy.mdknowledge/cards/medical-mri.mdknowledge/cards/morphology-binary.mdknowledge/cards/segmentation-thresholding.mdscripts/template_adaptive_thresholding.mscripts/template_cell_counting.mscripts/template_ct_windowing.mscripts/template_edge_detection_pipeline.mscripts/template_fluorescence_quantification.mscripts/template_histology_stain_normalization.mscripts/template_large_image_blockproc.mscripts/template_morphological_cleanup.mscripts/template_mri_preprocessing.mscripts/template_watershed_segmentation.mProcesses microscopy and bioimage images with scikit-image: read/write, filter (Gaussian, median, LoG), segment (thresholding, watershed, active contours), measure regions, detect features. NumPy/SciPy integration.
Loads and processes 3D medical images in MATLAB Medical Imaging Toolbox: DICOM/NIfTI/NRRD I/O, volume visualization, registration, radiomics features, MedSAM segmentation, PACS queries.
Cell segmentation in fluorescence microscopy images. Supports Cellpose/cpsam (Cellpose 4.0) with additional backends planned. Produces segmentation masks, per-cell morphology metrics (area, diameter, centroid, eccentricity), overlay figures, and a report.md.
Share bugs, ideas, or general feedback.
Expert skill for medical image analysis using MATLAB's Image Processing Toolbox (IPT R2025a+). Focuses on medical imaging patterns, domain-specific pipelines, and non-obvious gotchas that go beyond standard IPT knowledge.
| Task | Read This | Template Script |
|---|---|---|
| MRI preprocessing | knowledge/cards/medical-mri.md | scripts/template_mri_preprocessing.m |
| Cell counting | knowledge/cards/medical-microscopy.md | scripts/template_cell_counting.m |
| CT windowing | knowledge/cards/medical-mri.md | scripts/template_ct_windowing.m |
| Fluorescence quantification | knowledge/cards/medical-microscopy.md | scripts/template_fluorescence_quantification.m |
| Histology stain normalization | knowledge/cards/medical-microscopy.md | scripts/template_histology_stain_normalization.m |
| Tissue thresholding | knowledge/cards/segmentation-thresholding.md | scripts/template_adaptive_thresholding.m |
| Watershed for touching cells | knowledge/cards/medical-microscopy.md | scripts/template_watershed_segmentation.m |
| Morphological mask cleanup | knowledge/cards/morphology-binary.md | scripts/template_morphological_cleanup.m |
| DL segmentation + IPT | knowledge/cards/deep-learning-segmentation.md | — |
| Data type gotchas | knowledge/cards/data-types.md | — |
| Modality-specific denoising | knowledge/cards/filtering-denoising.md | — |
| Advanced regionprops | knowledge/cards/feature-regions.md | — |
| Large image processing | — | scripts/template_large_image_blockproc.m |
| Edge detection pipeline | — | scripts/template_edge_detection_pipeline.m |
imfilter Zero-Pads by Default (Creates Dark Borders)% imfilter defaults to zero-padding — dark border artifacts!
bad = imfilter(I, h); % Dark borders
good = imfilter(I, h, 'replicate'); % Fix
% imgaussfilt defaults to 'replicate' — safe as-is
filtered = imgaussfilt(I, 2); % Already correct
graythresh Returns [0,1], Not Pixel Valueslevel = graythresh(img_uint8); % Returns 0.45, NOT 115
% Use imbinarize instead (handles automatically)
bw = imbinarize(img_uint8);
double() vs im2double() — Silent Disasterbad = double(img_uint8); % Still [0,255], NOT [0,1]!
good = im2double(img_uint8); % Correctly scales to [0,1]
% SE radius ≈ half the feature size you want to AFFECT
se = strel('disk', 5); % Removes features ~10px diameter
cleaned = imopen(bw, se);
% If SE radius > feature radius, features disappear!
blockproc BorderSize Must Match Filter Radiusfun = @(block) imgaussfilt(block.data, 2);
result = blockproc(huge_image, [512 512], fun, ...
'BorderSize', [6 6], ... % 3*sigma for Gaussian
'TrimBorder', true, ...
'UseParallel', true);
mat2gray, Not im2double% im2double assumes standard uint16 range; DICOM data may differ
img_norm = mat2gray(double(dicomread('scan.dcm')));
Ready-to-use medical imaging pipelines in scripts/:
| Script | Purpose |
|---|---|
template_mri_preprocessing.m | MRI bias correction, denoising, brain extraction |
template_ct_windowing.m | CT Hounsfield unit windowing for different tissues |
template_cell_counting.m | Automated cell detection and counting pipeline |
template_fluorescence_quantification.m | Multi-channel fluorescence analysis |
template_histology_stain_normalization.m | H&E color deconvolution and normalization |
template_adaptive_thresholding.m | Adaptive thresholding with sensitivity tuning |
template_watershed_segmentation.m | Marker-controlled watershed for touching objects |
template_morphological_cleanup.m | Standard binary mask cleanup pipeline |
template_large_image_blockproc.m | Block processing for large images |
template_edge_detection_pipeline.m | Multi-method edge detection comparison |
Medical Imaging (primary value):
knowledge/cards/medical-mri.md — MRI preprocessing, tissue segmentation, volumetryknowledge/cards/medical-microscopy.md — Cell counting, fluorescence, H&E histologyMedical-Specific Patterns:
knowledge/cards/filtering-denoising.md — Modality-specific denoising gotchasknowledge/cards/segmentation-thresholding.md — Tissue segmentation thresholdingknowledge/cards/morphology-binary.md — Medical cleanup recipesknowledge/cards/feature-regions.md — Advanced regionprops for medical measurementIntegration:
knowledge/cards/deep-learning-segmentation.md — DL + IPT post-processing patternsknowledge/cards/data-types.md — Type conversion gotchas for medical formatsFor wavelet-based image processing (multiresolution denoising, fusion), use Wavelet Toolbox functions (wavedec2, wdenoise2) for multiresolution denoising and image fusion.
% Example: Wavelet + IPT fusion for MRI denoising
denoised = wdenoise2(mri, 'DenoisingMethod', 'Bayes'); % Wavelet
cleaned = imopen(denoised, strel('disk', 2)); % IPT morphology
enhanced = adapthisteq(cleaned); % IPT contrast
Verified against MATLAB R2025b