Skip to content

Microsplit Factory

Source

Factory functions and data types for MicroSplit datasets.

IndependentTargets dataclass

Bases: Generic[T]

MicroSplit data with independent target structures.

The data for different target structures may have a different shape.

The input will be a synthetically generated superposition of the target structures.

MultiChannelTarget dataclass

Bases: Generic[T]

MicroSplit data with target channels acquired together.

The input will be a synthetically generated superposition of the target channels.

PairedInputTarget dataclass

Bases: Generic[T]

MicroSplit data with paired inputs and multi-channel targets.

create_microsplit_dataset(config, data, loading=None, model_constraints=None, rng=None)

Create a MicroSplit training or validation dataset.

The data type determines which MicroSplit training mode to use. There are three options:

- `MicroSplitMultiplexedTargetData`: When only multiplexed target channels are
available the inputs can be synthesized by summing together the target channels.
- `MicroSplitSeparateTargetData`: Multiplexed target channels are not available,
instead, each channel are acquired separately. This should only be used for
structures which are not spatially correlated.
- `MicroSplitPairedData`: When both the multiplexed target channels and the
real input are available.

Parameters:

  • config (MicroSplitDataConfig) –

    MicroSplit data configuration.

  • data (MicroSplitTrainingData) –

    Data sources used to construct MicroSplit training patches. Either MicroSplitMultiplexedTargetData, MicroSplitSeparateTargetData or MicroSplitPairedData.

  • loading (Loading, default: None ) –

    Loading specification for custom data.

  • model_constraints (ModelConstraints, default: None ) –

    Optional model constraints for dataset validation.

  • rng (Generator, default: None ) –

    Random number generator passed to stochastic MicroSplit constructors.

Returns:

create_microsplit_pred_dataset(config, input_data, loading=None, model_constraints=None)

create_microsplit_pred_dataset(config: MicroSplitDataConfig, input_data: Sequence[NDArray[Any]] | Sequence[Path], loading: ReadFuncLoading | None = None, model_constraints: ModelConstraints | None = None) -> CareamicsDataset[ImageStack]
create_microsplit_pred_dataset(config: MicroSplitDataConfig, input_data: Any, loading: ImageStackLoading, model_constraints: ModelConstraints | None = None) -> CareamicsDataset[ImageStack]

Create a MicroSplit prediction dataset.

Parameters:

  • config (MicroSplitDataConfig) –

    MicroSplit prediction data configuration.

  • input_data ((Sequence[NDArray], Sequence[Path] or Any)) –

    Prediction data sources. For default loading, this is a list of numpy arrays or a list of file paths. If using a custom image stack loader the input can be any type that is supported by the loader.

  • loading (Loading, default: None ) –

    Loading specification. None or ReadFuncLoading is used for standard array and path inputs, while ImageStackLoading is used for custom input data.

  • model_constraints (ModelConstraints, default: None ) –

    Optional model constraints for dataset validation.

Returns: