Image functions#

Initialization#

circle_image(→ torch.Tensor)

Synthetic image of a circle.

cshape_image(→ torch.Tensor)

Synthetic C-shaped image.

empty_image(→ torch.Tensor)

Create new batch of uninitalized image data.

grid_image(→ torch.Tensor)

Create batch of regularly spaced grid images.

ones_image(→ torch.Tensor)

Create new batch of image data filled with ones.

zeros_image(→ torch.Tensor)

Create new batch of image data filled with zeros.

Convolution#

conv(→ torch.Tensor)

Convolve images in batch with a given (separable) kernel.

conv1d(→ torch.Tensor)

Convolve data with 1-dimensional kernel along specified dimension.

Pooling#

avg_pool(→ torch.Tensor)

Average pooling of image data.

max_pool(→ torch.Tensor)

Max pooling of image data.

min_pool(→ torch.Tensor)

Min pooling of image data, i.e., negate max_pool() result of negated input data.

Resizing#

gaussian_pyramid(→ Dict[int, torch.Tensor])

Create Gaussian image resolution pyramid.

downsample(→ torch.Tensor)

Downsample images after optional convolution with truncated Gaussian kernel.

upsample(→ torch.Tensor)

Upsample images and opitonally deconvolve with truncated Gaussian kernel.

crop(→ torch.Tensor)

Crop or pad images at border.

pad(→ torch.Tensor)

Pad or crop images at border.

center_crop(→ torch.Tensor)

Crop image tensor to specified maximum size.

center_pad(→ torch.Tensor)

Pad image tensor to specified minimum size.

image_slice(→ torch.Tensor)

Get slice from image tensor.

region_of_interest(→ torch.Tensor)

Extract region of interest from image tensor.

Rescaling#

normalize_image(→ torch.Tensor)

Normalize image intensities in [min, max].

rescale(→ torch.Tensor)

Linearly rescale values to specified output interval.

Derivatives#

spatial_derivatives(→ Dict[str, torch.Tensor])

Calculate spatial image derivatives.

finite_differences(→ torch.Tensor)

Calculate spatial image derivative using finite differences.

Sampling#

grid_resample(→ torch.Tensor)

Interpolate image on minimum bounding grid with specified spacing.

grid_reshape(→ torch.Tensor)

Interpolate image with specified spatial image tensor shape.

grid_resize(→ torch.Tensor)

Interpolate image with specified spatial image tensor shape.

grid_sample(→ torch.Tensor)

Sample data at grid points.

grid_sample_mask(→ torch.Tensor)

Sample binary mask at grid points.

sample_image(→ torch.Tensor)

Sample images at given points.

rand_sample(→ Union[torch.Tensor, Sequence[torch.Tensor]])

Random sampling of voxels within an image.

Miscellaneous#

dot_batch(→ torch.Tensor)

Weighted dot product between batches of image batch tensors.

dot_channels(→ torch.Tensor)

Weighted dot product between channels of image batch tensors.

fill_border(→ torch.Tensor)

Fill image border with specified value.

flatten_channels(→ torch.Tensor)

Flatten image tensor channels.