health_multimodal.image.data.transforms

Functions

create_chest_xray_transform_for_inference(…)

Defines the image transformation pipeline for Chest-Xray datasets.

infer_resize_params(val_img_transforms)

Given the validation transforms pipeline, extract the sizes to which the image was resized and cropped, if any.

Classes

ExpandChannels()

Transforms an image with one channel to an image with three channels by copying pixel intensities of the image along the 1st dimension.

class health_multimodal.image.data.transforms.ExpandChannels[source]

Transforms an image with one channel to an image with three channels by copying pixel intensities of the image along the 1st dimension.

health_multimodal.image.data.transforms.create_chest_xray_transform_for_inference(resize, center_crop_size)[source]

Defines the image transformation pipeline for Chest-Xray datasets.

Parameters
  • resize (int) – The size to resize the image to. Linear resampling is used. Resizing is applied on the axis with smaller shape.

  • center_crop_size (int) – The size to center crop the image to. Square crop is applied.

Return type

Compose

health_multimodal.image.data.transforms.infer_resize_params(val_img_transforms)[source]

Given the validation transforms pipeline, extract the sizes to which the image was resized and cropped, if any.

Return type

Tuple[Optional[int], Optional[int]]