Description
Format row/column pixel spacing and calculate nominal pixel area.
Medical-image metadata separates patient position, laterality, pixel spacing, slice spacing, padding and frame timing. Row and column spacing order matters, and slice spacing is distinct from slice thickness. A rectangular voxel or constant-frame model uses declared geometry; it does not inspect images, confirm a patient or establish a clinical finding.
Format row/column pixel spacing and calculate nominal pixel area.
When to use this tool
Use DICOM Pixel Spacing Pair when you already have rowSpacingMillimeters, columnSpacingMillimeters and need to format row/column pixel spacing and calculate nominal pixel area.
How to use the tool and how it works
- Enter rowSpacingMillimeters, columnSpacingMillimeters. Use the units and conventions below.
- Run the tool. Correct any format, range, or cross-field input error before interpreting the output.
- Read dicomValue, pixelAreaSquareMillimeters. Use the output convention below.
Require nonnegative mm spacings and each JavaScript number string at most 16 characters. Join row then column with a backslash and multiply for mm².1
Pixel spacing is ordered row then column in millimetres. The standard restricts zero values to particular singleton dimensions; this helper does not check image dimensions.2
A DS value is limited to 16 bytes. This helper checks each unrounded JavaScript number spelling against that length, without constructing or validating a complete DICOM element.3
| Input field | Meaning and units | Accepted input |
|---|---|---|
| rowSpacingMillimeters | Row-to-row centre spacing in mm; serialized first, with unrounded string length<=16. | Required. Finite number; minimum 0. |
| columnSpacingMillimeters | Column-to-column centre spacing in mm; serialized second, with unrounded string length<=16. | Required. Finite number; minimum 0. |
| Output field | Interpretation | Returned shape |
|---|---|---|
| dicomValue | Dicom Value | Required. Text; maximum UTF-16 length 8192. |
| pixelAreaSquareMillimeters | Pixel Area Square Millimeters | Required. Finite number. |
{
"input": {
"rowSpacingMillimeters": 0.5,
"columnSpacingMillimeters": 0.8
},
"output": {
"dicomValue": "0.5\\0.8",
"pixelAreaSquareMillimeters": 0.4
}
} Limitations and assumptions
- Uses unrounded numeric spelling and allows zero; this is not full DICOM DS/attribute validation and does not distinguish every image-specific zero-spacing rule.
- Inputs must satisfy both the field types and the cross-field conditions above. Invalid input causes an error; a successful false flag or documented placeholder is a different result.
- Numeric calculations use binary floating point unless exact decimal-integer arithmetic is explicitly stated. No hidden measurement tolerance or decimal rounding is added; nonfinite or out-of-contract results are rejected. Numeric signed-zero results are exported as zero.
Alternative or Complementary methods
Inspect the original DICOM attributes and complete image geometry when validating an image record. Use the relevant attribute and value-representation checks for format compliance, and actual per-frame timing when constant spacing or frame time is inadequate.
References
-
Calculation and input contract: radiology/dicom-pixel-spacing-pair — tool.io
-
DICOM PS3.3: Basic Pixel Spacing Calibration Macro — DICOM Standards Committee
-
DICOM PS3.5: Decimal String value representation — DICOM Standards Committee
Similar or alternative tools
- Image Slice Position Gap
Measure signed and absolute gaps between supplied slice-position coordinates.
- DICOM Frame Time Offset
Calculate a frame's time offset under a constant frame-time model.