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 | 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 | float

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

2

Other Parameters:

Name Type Description
returns [(list | dict) of] {'input', 'output'}

Which tensors to return.

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

Use the same fwhm for all channels/tensors

Final class-attribute instance-attribute

Final = SmoothTransform

The transform type returned by make_final.

Next class-attribute instance-attribute

Next = SmoothTransform

The transform type returned by make_final.

LowResSliceFinalTransform

LowResSliceFinalTransform(axis=-1, resolution=3.0, thickness=0.8, noise=None, **kwargs)

Bases: FinalTransform

Model a low-resolution slice direction, with Gaussian profile

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 | dict) of] {'input', 'lowres', 'output'}

Which tensors to return.

Final class-attribute instance-attribute

Final = LowResSliceFinalTransform

The transform type returned by make_final.

Next class-attribute instance-attribute

Next = LowResSliceFinalTransform

The transform type returned by make_final.

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 | 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 | 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 Sampler | int | None

Slice axis. If None, select one randomly.

None
noise Transform | None

A transform that adds noise in the low-resolution space

None

Other Parameters:

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

Which tensors to return.

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

Use the same resolution for all channels/tensors

Next class-attribute instance-attribute

Next = LowResSliceTransform

The transform type returned by make_final(..., max_depth=1).

Final class-attribute instance-attribute

Final = LowResSliceFinalTransform

The transform type returned by make_final(..., max_depth=inf).

LowResFinalTransform

LowResFinalTransform(resolution, noise=None, **kwargs)

Bases: FinalTransform

Model a lower-resolution image.

Parameters:

Name Type Description Default
resolution [list of] float

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

required
noise Transform | None

A transform that adds noise in the low-resolution space

None

Other Parameters:

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

Which tensors to return.

LowResTransform

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

Bases: NonFinalTransform

Model a lower-resolution image

Parameters:

Name Type Description Default
resolution [list of] float

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

2
noise Transform | None

A transform that adds noise in the low-resolution space

None

Other Parameters:

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

Which tensors to return.

Final class-attribute instance-attribute

Final = LowResFinalTransform

The transform type returned by make_final.

Next class-attribute instance-attribute

Next = LowResFinalTransform

The transform type returned by make_final.

RandomLowResTransform

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

Bases: RandomizedTransform

Random lower-resolution image

Parameters:

Name Type Description Default
resolution Sampler | 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 | None

A transform that adds noise in the low-resolution space

None

Other Parameters:

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

Which tensors to return.

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

Use the same resolution for all channels/tensors

Next class-attribute instance-attribute

Next = LowResTransform

The transform type returned by make_final(..., max_depth=1).

Final class-attribute instance-attribute

Final = LowResFinalTransform

The transform type returned by make_final(..., max_depth=inf).