Microsplit Factory
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
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,MicroSplitSeparateTargetDataorMicroSplitPairedData. -
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:
-
CareamicsDataset–The configured MicroSplit dataset.
create_microsplit_pred_dataset(config, input_data, loading=None, model_constraints=None)
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.
NoneorReadFuncLoadingis used for standard array and path inputs, whileImageStackLoadingis used for custom input data. -
model_constraints(ModelConstraints, default:None) –Optional model constraints for dataset validation.
Returns:
-
CareamicsDataset–The configured MicroSplit prediction dataset.