Pixel spacing: why measurements are in millimetres or in pixels
On one image a line measures 42.5 mm, on another 310 px. The difference lies in a single piece of information stored – or not stored – in the file.
What pixel spacing is
A digital image is a grid of pixels. To turn a number of pixels into a length, the viewer has to know how large one pixel is. DICOM files store this in the tag Pixel Spacing (0028,0030): two numbers giving the height and width of a pixel in millimetres, for example 0.143 \ 0.143.
With this value, measuring is simple arithmetic: 300 pixels × 0.143 mm = 42.9 mm.
When the value is present
- DICOM from X-ray, CT and MRI devices – almost always.
- NIfTI volumes – the voxel size is part of the header.
In these cases View DICOM shows lengths in millimetres and areas in square millimetres.
When it is missing
- JPG, PNG and other ordinary pictures – including photos of films and screenshots.
- Some DICOM files – scanned films, secondary captures or images from older devices.
Then results are given in pixels, and a note under the list of measurements says so. Angles are not affected: an angle is the same whatever the pixel size.
Millimetres on the detector, not in the body
Even a correct pixel spacing describes the size at the detector. An X-ray is a projection from a point source, so everything between the source and the detector is magnified – the further from the detector, the more. For a hip or a spine the magnification is typically several per cent to well over ten per cent.
CT and MRI are different: their slices are computed, and distances within a slice correspond to real anatomy.
How professionals calibrate
When exact sizes matter – for example when planning an implant – a marker of known size, often a metal ball, is placed at the level of the bone during the exposure. The measured size of the marker gives the magnification factor. You can measure such a marker with the ○ Circle tool and work out the factor yourself.
Comparing without calibration
Ratios do not depend on the pixel size or on magnification. If you only need to know how one length compares with another on the same image, measuring in pixels is as good as in millimetres.
Check the value yourself
Open the DICOM metadata panel and look for (0028,0030). More on reading the fields is in DICOM tags explained; the measuring tools are described in measuring on X-ray images.
More articles
- How to open a DICOM (.dcm) file onlineGot an X-ray or CT scan as a .dcm file? Open it in your web browser in a few seconds, without installing software and without uploading it anywhere.
- What is a DICOM file?DICOM in plain words: what the format contains, why hospitals and vets use it, what .dcm files and tags are, and how to look inside one.
- How to convert DICOM to JPG, PNG or TIFFHow to turn a DICOM X-ray into a JPG, PNG, WebP or TIFF picture that anyone can open – in your browser, free and without uploading the file.
- How to measure the Norberg angle on a hip X-rayWhat the Norberg angle is, how it is measured on a hip radiograph and how to do it online in six clicks with View DICOM.
- Guided X-ray measurements in one panelThe Assessment panel of View DICOM: guided measurements for hips, elbows and knees, heart and thorax, spine and hooves, with forms, protocols and report templates.
- Hip assessment on an X-rayHow to measure the distraction index, femoral head coverage, CE angle, acetabular index and neck-shaft angle on a hip X-ray in the browser.
- Vertebral heart score and other thorax measurementsHow to measure the vertebral heart score, left atrial size, tracheal ratio and cardiothoracic ratio on a chest X-ray in the browser.
- TPA, patellar position and limb axesHow to measure the tibial plateau angle for TPLO planning, the Insall-Salvati ratio and the aLDFA and mMPTA limb angles on an X-ray in the browser.
- Measuring distances, angles and areas on X-ray imagesHow to measure length, angle, circle and ellipse on a DICOM X-ray online, when the result is in millimetres and what limits the accuracy.
- Window and level: brightness and contrast of X-ray imagesWhy an X-ray looks too dark or flat, what window centre and window width mean and how to set brightness and contrast to see bone or soft tissue.
- How to view X-rays from a CD or DVDThe disc from your clinic will not play? How to find the DICOM files on a CD or USB stick and open them in your browser, on Windows and Mac.
- Is it safe to open medical images online?What personal data a DICOM file contains, what happens to it in an online viewer and how to share an X-ray without revealing the patient's identity.
- Open NIfTI, TIFF and other medical images in the browserNot every medical image is DICOM. How to view NIfTI (.nii, .nii.gz), 16-bit TIFF, PGM and ordinary JPG or PNG scans online, with contrast and measuring tools.
- A DICOM viewer for tablet and phone – also offlineHow to view X-rays and DICOM files on an iPad, Android tablet or phone, install View DICOM as an app and use it without an internet connection.
- How to open DICOM files on a MacPreview and Photos cannot open .dcm files, and the viewer on the clinic's disc is for Windows. How to view DICOM X-rays on macOS in Safari or Chrome.
- How to open DICOM files on Windows 10 and 11Windows Photos cannot open .dcm files. How to view DICOM X-ray, CT and MRI images on a Windows PC in your browser, without admin rights or installation.
- Free DICOM viewer: what to look forDesktop program, online upload service or a viewer that runs in the browser? A plain comparison of free DICOM viewers and what each is good for.
- DICOM vs JPG: what is the difference?Why clinics use DICOM instead of JPG, what you lose when an X-ray is saved as a picture, and when a JPG or PNG is the better choice.
- DICOM tags: how to read the metadata in a DICOM fileWhat DICOM tags are, how to display them online and what the most useful ones mean: patient, study, modality, pixel spacing, window and more.
- DICOM file will not open? Transfer syntax and compression explainedWhy one viewer opens a DICOM file and another does not: transfer syntaxes, JPEG, JPEG 2000 and RLE compression, and what to do with an unsupported file.
- How to browse CT and MRI series and multi-frame filesA CT or MRI study is hundreds of files. How to open a whole series in the browser, scroll through slices and find your way around studies and frames.
- How to rotate, flip and straighten an X-ray imageThe X-ray is upside down, mirrored or tilted? How to rotate it by 90° or by an exact angle, mirror it, and level it by two points – online and free.
- How to crop an X-ray and export just the detailShow only the joint, the tooth or the finding: how to crop a DICOM X-ray online, zoom in on the detail, and save or print the cropped picture.
- False colours on X-ray imagesWhy greyscale X-rays are sometimes shown in colour, what the hot metal, rainbow and bone colour maps do, and how to try them online.
- How to add notes and labels to an X-ray imageMark a finding, write the patient's name or add a comment directly on a DICOM X-ray: text notes, numbered points and labels, online and free.
- How to print an X-ray image or save it as a PDFPrint a DICOM X-ray on paper with your measurements and notes, or save it as a PDF – directly from the browser. Tips for a readable printout.
- PDF report of X-ray measurementsHow to create a PDF report with the patient details, Norberg angles and other measured values from an X-ray, directly in the browser.
- A free DICOM viewer for studentsHow veterinary, medical and radiography students can practise with real DICOM images on any laptop or tablet: windowing, measuring, annotating, no installation.
- Customise the viewer: appearance, text size, icons and languageSet up View DICOM to suit you: light or dark appearance, larger text and icons, a compact toolbar with icons only, hidden labels and 17 languages.