Skip to content

Conf

Source

Configuration building convenience functions for the CAREamics CLI.

ConfOptions dataclass

Data class for containing CLI conf command option values.

care(ctx, experiment_name, axes, patch_size, batch_size, num_epochs=100, num_steps=None, data_type='tiff', use_augmentations=True, independent_channels=False, loss='mae', n_channels_in=None, n_channels_out=None, logger='none')

Create a configuration for training CARE.

If "Z" is present in axes, then path_size must be a list of length 3, otherwise 2.

If "C" is present in axes, then you need to set n_channels_in to the number of channels. Likewise, if you set the number of channels, then "C" must be present in axes.

To set the number of output channels, use the n_channels_out parameter. If it is not specified, it will be assumed to be equal to n_channels_in.

By default, all channels are trained together. To train all channels independently, set independent_channels to True.

By setting use_augmentations to False, the only transformation applied will be normalization.

conf_options(ctx, dir=WORK_DIR, name='config', force=False, print=False)

Build and save CAREamics configuration files.

n2n(ctx, experiment_name, axes, patch_size, batch_size, num_epochs=100, num_steps=None, data_type='tiff', use_augmentations=True, independent_channels=False, loss='mae', n_channels_in=None, n_channels_out=None, logger='none')

Create a configuration for training Noise2Noise.

If "Z" is present in axes, then path_size must be a list of length 3, otherwise 2.

If "C" is present in axes, then you need to set n_channels to the number of channels. Likewise, if you set the number of channels, then "C" must be present in axes.

By default, all channels are trained together. To train all channels independently, set independent_channels to True.

By setting use_augmentations to False, the only transformation applied will be normalization.

n2v(ctx, experiment_name, axes, patch_size, batch_size, num_epochs=100, num_steps=None, data_type='tiff', use_augmentations=True, independent_channels=True, use_n2v2=False, n_channels=None, roi_size=11, masked_pixel_percentage=0.2, struct_n2v_axis='none', struct_n2v_span=5, logger='none')

Create a configuration for training Noise2Void.

N2V uses a UNet model to denoise images in a self-supervised manner. To use its variants structN2V and N2V2, set the struct_n2v_axis and struct_n2v_span (structN2V) parameters, or set use_n2v2 to True (N2V2).

N2V2 modifies the UNet architecture by adding blur pool layers and removes the skip connections, thus removing checkboard artefacts. StructN2V is used when vertical or horizontal correlations are present in the noise; it applies an additional mask to the manipulated pixel neighbors.

If "Z" is present in axes, then path_size must be a list of length 3, otherwise 2.

If "C" is present in axes, then you need to set n_channels to the number of channels.

By default, all channels are trained independently. To train all channels together, set independent_channels to False.

By setting use_augmentations to False, the only transformations applied will be normalization and N2V manipulation.

The roi_size parameter specifies the size of the area around each pixel that will be manipulated by N2V. The masked_pixel_percentage parameter specifies how many pixels per patch will be manipulated.

The parameters of the UNet can be specified in the model_kwargs (passed as a parameter-value dictionary). Note that use_n2v2 and 'n_channels' override the corresponding parameters passed in model_kwargs.

If you pass "horizontal" or "vertical" to struct_n2v_axis, then structN2V mask will be applied to each manipulated pixel.