opticks.imaging_model.processing

Image processing component: resampling, sharpening, and related MTF models.

Classes

Processing(**data)

Image processing component (resampling, sharpening, etc.).

ProcessingParams(**data)

Image processing configuration parameters.

class Processing(**data)[source]

Image processing component (resampling, sharpening, etc.).

Loaded from processing.yaml. Holds the fixed processing configuration; the local SSD (input_pitch) is supplied at call time and can vary per image region.

Create a new model by parsing and validating input data from keyword arguments.

Raises [ValidationError][pydantic_core.ValidationError] if the input data cannot be validated to form a valid model.

self is explicitly positional-only to allow self as a field name.

Parameters:
get_resampling_mtf_1d(input_pitch, output_pitch=None)[source]

Return the resampling MTF model for a given local input pitch.

Vary input_pitch (= local SSD on the ground) per image region to map the SSD-driven MTF variation across the frame. output_pitch defaults to the value in processing_params but can be overridden at call time (e.g. to compare different output resolutions).

Return type:

MTF_Model_1D

Parameters:
  • input_pitch (Quantity[``”length”``]) – Local input sample spacing (= SSD on the ground for ortho correction). Varies per image region.

  • output_pitch (Quantity[``”length”``], optional) – Output resampling grid pitch. Defaults to processing_params.output_pitch.

Returns:

MTF_Model_1D – Resampling MTF model for this (input_pitch, output_pitch) pair.

Raises:

ValueError – If processing_params is not configured, resampling_kernel is not set, or no output_pitch is available.

model_config: ClassVar[ConfigDict] = {'arbitrary_types_allowed': True}

Configuration for the model, should be a dictionary conforming to [ConfigDict][pydantic.config.ConfigDict].

name: str
processing_params: ProcessingParams | None
class ProcessingParams(**data)[source]

Image processing configuration parameters.

Stores the fixed (pipeline-level) processing settings. Runtime-varying inputs (local SSD) are passed as arguments to the get_* methods on Processing. The output_pitch is stored here as the default output grid pitch but can be overridden at call time.

Create a new model by parsing and validating input data from keyword arguments.

Raises [ValidationError][pydantic_core.ValidationError] if the input data cannot be validated to form a valid model.

self is explicitly positional-only to allow self as a field name.

Parameters:
  • resampling_kernel (str | None)

  • output_pitch (Annotated[Quantity, BeforeValidator(func=~opticks.utils.parser_helpers._parse_quantity, json_schema_input_type=PydanticUndefined), AfterValidator(func=~opticks.utils.parser_helpers._validate_positive_quantity), PlainSerializer(func=~opticks.utils.parser_helpers._serialize_quantity, return_type=str, when_used=always)] | None)

  • bicubic_a (float | None)

  • lanczos_n (int | None)

bicubic_a: float | None
lanczos_n: int | None
model_config: ClassVar[ConfigDict] = {'arbitrary_types_allowed': True}

Configuration for the model, should be a dictionary conforming to [ConfigDict][pydantic.config.ConfigDict].

output_pitch: Annotated[Quantity, BeforeValidator(func=_parse_quantity, json_schema_input_type=PydanticUndefined), AfterValidator(func=_validate_positive_quantity), PlainSerializer(func=_serialize_quantity, return_type=str, when_used=always)] | None
resampling_kernel: str | None