Description
Calculate region of interest pixel share from explicit caller-supplied inputs.
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.
Calculate region of interest pixel share from explicit caller-supplied inputs.
When to use this tool
Use it for region of interest pixel share when the required inputs and conventions are already available.
How to use the tool and how it works
- Enter regionPixels, includedPixels. Use the stated units and boundary conventions.
- Run the calculation. Correct any input error before interpreting a result.
- Read share, defined. Inspect any known, defined, inclusion, or boundary flags before interpreting numeric values.
Require nonnegative integer includedPixels and regionPixels with regionPixels no larger than includedPixels. Divide the region count by the included count when positive.1
| Input field | Meaning and units | Accepted input |
|---|---|---|
| regionPixels | Region Pixels | Required. Safe integer; minimum 0. |
| includedPixels | Included Pixels | Required. Safe integer; minimum 0. |
| Output field | Interpretation | Returned shape |
|---|---|---|
| share | Dimensionless fraction using the denominator described above; not a percentage numeral. | Required. Finite number. |
| defined | Whether the associated denominator or quantity is defined; read this before interpreting a zero placeholder. | Required. Boolean. |
{
"input": {
"regionPixels": 20,
"includedPixels": 100
},
"output": {
"share": 0.2,
"defined": true
}
} Limitations and assumptions
- With no included pixels, share is zero and defined is false. Counts must come from the same mask and grid; the tool neither segments a region nor infers which pixels should be included.
- 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 region of interest pixel share, 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
Similar or alternative tools
- DICOM Pixel Representation Signextension Mask
Unsigned-word masking and two-complement interpretation/sign extension for at most 32 stored bits; no endian or transfer-syntax decoding.
- DICOM Pixel Spacing Row Column Crosswalk
DICOM Pixel Spacing order is row then column, in millimeters; distances are in the image plane, not patient-coordinate reconstruction.