Skip to content

Main content

Radiology Image Crop Origin Shift Tool

Zero-based raster crop-origin translation with half-open bounds, not a patient-coordinate transform.

Loading tool…

Description

Zero-based raster crop-origin translation with half-open bounds, not a patient-coordinate transform.

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.

Zero-based raster crop-origin translation with half-open bounds, not a patient-coordinate transform.

When to use this tool

Use it for radiology image crop origin shift when the required inputs and conventions are already available.

How to use the tool and how it works

  1. Enter row, column, cropTop, cropLeft, rows, columns. Use the stated units and boundary conventions.
  2. Run the calculation. Correct any input error before interpreting a result.
  3. Read croppedRow, croppedColumn, inside. Inspect any known, defined, inclusion, or boundary flags before interpreting numeric values.

Subtract cropTop from row and cropLeft from column. Report inside when the original coordinates lie in the half-open crop rectangle starting at cropTop/cropLeft with the supplied rows and columns.1

Input fieldMeaning and unitsAccepted input
rowRowRequired. Safe integer; minimum 0.
columnColumnRequired. Safe integer; minimum 0.
cropTopCrop TopRequired. Safe integer; minimum 0.
cropLeftCrop LeftRequired. Safe integer; minimum 0.
rowsNumber of rows in the crop rectangle.Required. Safe integer; minimum 1.
columnsNumber of columns in the crop rectangle.Required. Safe integer; minimum 1.
Output fieldInterpretationReturned shape
croppedRowCropped RowRequired. Safe integer.
croppedColumnCropped ColumnRequired. Safe integer.
insideInsideRequired. Boolean.
json
{
  "input": {
    "row": 15,
    "column": 25,
    "cropTop": 10,
    "cropLeft": 20,
    "rows": 50,
    "columns": 60
  },
  "output": {
    "croppedRow": 5,
    "croppedColumn": 5,
    "inside": true
  }
}

Limitations and assumptions

  • Rows and columns describe the crop dimensions. Translated coordinates may be negative outside the crop; source-image bounds, padding, and image data are not checked or modified.
  • 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 radiology image crop origin shift, 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/radiology-image-crop-origin-shift — tool.io

Similar or alternative tools