Generic selectors
Exact matches only
Search in title
Search in content
Post Type Selectors

What is image preprocessing

Image preprocessing is the prep that turns a raw photo or a raw CT/MRI volume into a consistent input: same size, same intensity language, less noise. It is not the analysis (segmentation, registration, diagnosis). That field is medical image processing.

If you meant tabular rows (impute / IQR / one-hot), that is data preprocessing for machine learning. If you meant MONAI 3D compose for tumor segmentation, that is preprocessing 3D volumes in MONAI. If you meant HU as a unit, that is Hounsfield units. If you meant CT window presets, that is CT scan window settings.

What the job is

A camera frame and a DICOM slice are both arrays. Neither arrives ready. Sizes differ. Lighting differs. A volume has spacing and a vendor intensity curve. Preprocessing is the kitchen work: wash, trim, cut to one size — so the model (or the next algorithm) is not learning the mess.

Three goals, every time: standardize (size, colour, spacing), reduce noise (grain that hides an edge), enhance the feature you care about (an edge, a windowed organ) without inventing one.

Geometric

Real images do not share a shape. Nets do.

  • Resize to the input the model was built for (224×224, 512×512, a fixed volume shape).
  • Rotate / flip to correct orientation, or as augmentation so the net sees the object more than once.
  • Crop to the region that matters and drop the empty field of view.

On a medical volume, “resize” without touching spacing is how you invent a fake millimetre. Spacing is the resample page, not a JPEG scale.

Photometric

Colour and lighting, not geometry. Contrast and brightness so a faint edge is a number the next step can use. Histogram equalization spreads the common intensities — useful on a washed-out film, noisy if you train on it blindly. Grayscale drops RGB when colour is not the signal (documents, many X-rays).

Intensity scale as its own job — min-max, z-score, White-Stripe — is image normalization in medical imaging.

Technique Goal Typical use
Resize One input shape Every photo into 224×224 for a net
Rotate / flip Orientation, or more samples A tilted scan; left-right flip as augment
Crop Keep the region of interest Plate from a car; organ from a volume
Histogram equalization Open contrast A faint film you need to see
Grayscale Drop unused colour OCR, many radiographs
Denoise Remove grain without killing the edge Low-dose CT, low-light camera

Denoise and augment

Digital noise is random specs. A Gaussian filter averages neighbours (bell-curve weights) and blurs mild grain. A median filter replaces a pixel with the neighbourhood median and is the usual fix for salt-and-pepper without wrecking a hard edge.

Edge detection (Sobel, Canny) is a later optional: it turns the image into a line drawing so a model can lock onto shape. It is a feature, not a cleanup.

Augmentation is not cleanup. It grows the train set: rotate, flip, zoom, shift, brightness. The model sees the same anatomy under more conditions. Do this on train only.

Medical steps this page actually names

A CT or MRI is not a cat photo. Four steps show up on every serious medical pipeline. This page names them. It does not steal the how-to pages.

  • Windowing / HU clip. A CT stores Hounsfield units far outside what a screen or a net wants. You clip to a window (lung, bone, soft tissue) so air and metal do not own the scale. Presets: CT scan window settings. The unit: Hounsfield units.
  • Intensity. After the window, put volumes on one scale (min-max, z-score, White-Stripe). That is image normalization.
  • Resample / spacing. Change voxel size and recompute volume size from old spacing. Linear on intensities, nearest on masks. That is resampling in medical imaging.
  • Bias-field / N4. MRI brightness that drifts slowly across the FOV. N4 (and earlier N3) estimates that field and divides it out so white matter is not dark on one side of the coil. Name it, run it, do not turn this page into an N4 tutorial.

Skull-stripping (drop scalp so the brain is the only mask) and registration (line up two visits) sit next to this list. Registration is its own job, not a preprocess footnote.

Specialized frontier. Medical data is not a second CSV. A raw DICOM is image plus metadata; a missed anonymization or a wrong window is a clinical error, not a slightly worse accuracy. Preprocessing here is the silent step that turns a scan into something a diagnostic model is allowed to see.

Elsewhere, one line each

  • Manufacturing. Sharpen and contrast so a line-scan camera can flag a crack a person would miss.
  • Remote sensing. Haze and earth-curvature correction so a satellite frame is a map, not a washed-out photo.

Those are the same geometric / photometric toolkit. They are not this page’s job.

FAQ

Preprocessing vs processing?

Preprocessing is the prep (clean, standardize, window). Processing is the meal (segment, register, detect). You prep so the analysis is not learning the mess.

Which tools?

OpenCV for 2D. Pillow for simple resize/crop. scikit-image for scientific filters. In a train loop: tf.image or torchvision.transforms. Volumes: SimpleITK (this site’s resample / crop how-tos) or MONAI compose.

What goes wrong?

An aggressive denoise that erases the faint lesion. A resize that ignores spacing. A global min-max that follows a metal artefact. There is no one pipeline. Test on the data you have.

PYCAD builds the imaging side of this when the preprocessed volume has to live in a clinic app. Case studies.

We build custom medical imaging platforms — advanced DICOM viewers, AI segmentation, and the clinical systems around them.

Get in Touch

Copyright © 2026 PYCAD. All Rights Reserved.