Skip to content

Main content

DICOM Overlay Bit Position Mask Tool

Unsigned 32-bit stored-word bit extraction and clearing, without signed JavaScript shift coercion or decoding an overlay plane.

Loading tool…

Description

Unsigned 32-bit stored-word bit extraction and clearing, without signed JavaScript shift coercion or decoding an overlay plane.

An image grid has array indices as well as physical spacing, timing, and signal conventions. A calculation on supplied metadata describes one part of that grid or signal; it does not inspect an image, validate a complete file, or interpret anatomy.

Unsigned 32-bit stored-word bit extraction and clearing, without signed JavaScript shift coercion or decoding an overlay plane.

When to use this tool

Use it for dicom overlay bit position mask when the required inputs and conventions are already available.

How to use the tool and how it works

  1. Enter word, bitPosition. Use the stated units and boundary conventions.
  2. Run the calculation. Correct any input error before interpreting a result.
  3. Read bitValue, weight, clearedWord. Inspect any known, defined, inclusion, or boundary flags before interpreting numeric values.

Require an integer word from zero through 2^32-1 and bitPosition from zero through 31. Calculate weight=2^bitPosition, test the bit arithmetically, and subtract its weight only when set to produce clearedWord.1

Input fieldMeaning and unitsAccepted input
wordWordRequired. Safe integer; minimum 0; maximum 4294967295.
bitPositionBit PositionRequired. Safe integer; minimum 0; maximum 31.
Output fieldInterpretationReturned shape
bitValueBit ValueRequired. Boolean.
weightWeightRequired. Finite number.
clearedWordCleared WordRequired. Safe integer.
json
{
  "input": {
    "word": 10,
    "bitPosition": 1
  },
  "output": {
    "bitValue": true,
    "weight": 2,
    "clearedWord": 8
  }
}

Limitations and assumptions

  • Bit 31 retains its positive unsigned weight. This tests one supplied numeric word; it does not decode an overlay stream or determine which DICOM overlay representation is applicable.
  • The field tables describe structural bounds; the mechanics also state cross-field requirements. Malformed input shapes, disallowed keys, and invalid domains cause input errors. Results must remain finite and within the declared output contract. A successful false flag or zero placeholder is distinct from an error.
  • Numeric arithmetic uses binary floating point. Exact comparisons have no hidden tolerance or decimal rounding; negative zero is exported as zero. Decimal-text integer operations retain the exactness specifically stated above.

Alternative or Complementary methods

For dicom overlay bit position mask, check the source records and the supplied rule before comparing the result with another method. Use a full image reader and geometry or signal analysis when the task requires interpreting image data.

References

  1. Calculation and input contract: radiology/dicom-overlay-bit-position-mask — tool.io

Similar or alternative tools