Skip to content

cornucopia.psf

This module contains transforms that modify the resolution and/or point spread function of an image.

SmoothTransform

SmoothTransform(fwhm=1, **kwargs)

Bases: FinalTransform

Apply Gaussian smoothing

Parameters:

Name Type Description Default
fwhm float

Full-width at half-maximum of the Gaussian kernel

1

Other Parameters:

Name Type Description
returns [list or dict of] {'input', 'output'}

Which tensors to return.

RandomSmoothTransform

RandomSmoothTransform(fwhm=2, *, shared=False, **kwargs)

Bases: RandomizedTransform

Apply Gaussian smoothing with random FWHM

Parameters:

Name Type Description Default
fwhm Sampler or float

Sampler or upper bound for the full-width at half-maximum

2

Other Parameters:

Name Type Description
returns [list or dict of] {'input', 'output'}

Which tensors to return.

shared (channels, tensors, channels + tensors, '')

Use the same fwhm for all channels/tensors

LowResSliceTransform

LowResSliceTransform(resolution=3, thickness=0.8, axis=-1, noise=None, **kwargs)

Bases: NonFinalTransform

Model a low-resolution slice direction, with Gaussian profile

Parameters:

Name Type Description Default
resolution float

Resolution of the slice dimension, in terms of high-res voxels. This is the distance between the centers of two consecutive slices.

3
thickness float in 0..1

Slice thickness, as a proportion of resolution. This is how much data is averaged into one low-resolution slice.

0.8
axis int

Slice axis

-1
noise Transform

A transform that adds noise in the low-resolution space

None

Other Parameters:

Name Type Description
returns [list or dict of] {'input', 'lowres', 'output'}

Which tensors to return.

RandomLowResSliceTransform

RandomLowResSliceTransform(resolution=3, thickness=0.1, axis=None, noise=None, *, shared=False, **kwargs)

Bases: RandomizedTransform

Random low-resolution slice direction, with Gaussian profile

Parameters:

Name Type Description Default
resolution Sampler or float

Distribution from which to sample the resolution. If a float, sample from Uniform(1, value). To force a fixed value, pass Fixed(value). The resolution is the distance (in terms of high-res voxels) between the centers of two consecutive low-res slices.

3
thickness Sampler or float in 0..1

Distribution from which to sample the resolution. If a float, sample from Uniform(value, 1). To force a fixed value, pass Fixed(value). Thickness is defined as a proportion of the resolution, and determines how much data is averaged into one low-resolution slice.

0.1
axis int

Slice axis. If None, select one randomly.

None
noise Transform

A transform that adds noise in the low-resolution space

None

Other Parameters:

Name Type Description
returns [list or dict of] {'input', 'lowres', 'output'}

Which tensors to return.

shared (channels, tensors, channels + tensors, '')

Use the same resolution for all channels/tensors

LowResTransform

LowResTransform(resolution=2, noise=None, **kwargs)

Bases: NonFinalTransform

Model a lower-resolution image

Parameters:

Name Type Description Default
resolution float or list[float]

Resolution of the low-res image, in terms of high-res voxels

2
noise Transform

A transform that adds noise in the low-resolution space

None
returns [list or dict of] {'input', 'lowres', 'output'}

Which tensors to return.

required

RandomLowResTransform

RandomLowResTransform(resolution=2, noise=None, *, shared=False, **kwargs)

Bases: RandomizedTransform

Random lower-resolution image

Parameters:

Name Type Description Default
resolution Sampler or float

Distribution from which to sample the resolution. If a float, sample from Uniform(1, value). To force a fixed value, pass Fixed(value). The resolution is the distance (in terms of high-res voxels) between the centers of two consecutive low-res voxels.

2
noise Transform

A transform that adds noise in the low-resolution space

None

Other Parameters:

Name Type Description
returns [list or dict of] {'input', 'lowres', 'output'}

Which tensors to return.

shared (channels, tensors, channels + tensors, '')

Use the same resolution for all channels/tensors