dacapo.experiments.datasplits.datasets
Subpackages
Submodules
- dacapo.experiments.datasplits.datasets.dataset
- dacapo.experiments.datasplits.datasets.dataset_config
- dacapo.experiments.datasplits.datasets.dummy_dataset
- dacapo.experiments.datasplits.datasets.dummy_dataset_config
- dacapo.experiments.datasplits.datasets.raw_gt_dataset
- dacapo.experiments.datasplits.datasets.raw_gt_dataset_config
Classes
A class to represent a dataset. |
|
A class used to define configuration for datasets. This provides the |
|
DummyDataset is a child class of the Dataset. This class has property 'raw' of Array type and a name. |
|
A dummy configuration class for test datasets. |
|
A dataset that contains raw and ground truth data. Optionally, it can also contain a mask. |
|
This is a configuration class for the standard dataset with both raw and GT Array. |
Package Contents
- class dacapo.experiments.datasplits.datasets.Dataset
A class to represent a dataset.
- name
The name of the dataset.
- Type:
str
- weight
The weight of the dataset.
- Type:
int, optional
- sample_points
The list of sample points in the dataset.
- Type:
list[Coordinate], optional
- __eq__(other)
Overloaded equality operator for dataset objects.
- __hash__()
Calculates a hash for the dataset.
- __repr__()
Returns the official string representation of the dataset object.
- __str__()
Returns the string representation of the dataset object.
- _neuroglancer_layers(prefix='', exclude_layers=None)
Generates neuroglancer layers for raw, gt and mask if they can be viewed by neuroglance, excluding those in the exclude_layers.
Notes
This class is a base class and should not be instantiated.
- name: str
- class dacapo.experiments.datasplits.datasets.DatasetConfig
A class used to define configuration for datasets. This provides the framework to create a Dataset instance.
- name
str (eg: “sample_dataset”). A unique identifier to name the dataset. It aids in easy identification and reusability of this dataset. Advised to keep it short and refrain from using special characters.
- weight
int (default=1). A numeric value that indicates how frequently this dataset should be sampled in comparison to others. Higher the weight, more frequently it gets sampled.
- verify()
Checks and validates the dataset configuration. The specific rules for validation need to be defined by the user.
Notes
This class is used to create a configuration object for datasets.
- name: str
- weight: int
- verify() Tuple[bool, str]
Method to verify the dataset configuration.
Since there is no specific validation logic defined for this DataSet, this method will always return True as default reaction and a message stating the lack of validation.
- Returns:
A tuple of boolean value indicating the check (True or False) and message specifying result of validation.
- Return type:
tuple
- Raises:
NotImplementedError – If the method is not implemented in the derived class.
Examples
>>> dataset_config = DatasetConfig(name="sample_dataset") >>> dataset_config.verify() (True, "No validation for this DataSet")
Notes
This method is used to validate the configuration of the dataset.
- class dacapo.experiments.datasplits.datasets.DummyDataset(dataset_config)
DummyDataset is a child class of the Dataset. This class has property ‘raw’ of Array type and a name.
- raw
Array The raw data.
- __init__(dataset_config)
Initializes the array type ‘raw’ and name for the DummyDataset instance.
Notes
This class is used to create a dataset with raw data.
- name
- class dacapo.experiments.datasplits.datasets.DummyDatasetConfig
A dummy configuration class for test datasets.
- dataset_type
Clearly mentions the type of dataset
- raw_config
This attribute holds the configurations related to dataset arrays.
- verify()
A dummy verification method for testing purposes, always returns False and a message.
Notes
This class is used to create a configuration object for the dummy dataset.
- dataset_type
- verify() Tuple[bool, str]
A dummy method that always indicates the dataset config is not valid.
- Returns:
A tuple of False and a message indicating the invalidity.
- Raises:
NotImplementedError – If the method is not implemented in the derived class.
Examples
>>> dataset_config = DummyDatasetConfig(raw_config=DummyArrayConfig(name="dummy_array")) >>> dataset_config.verify() (False, "This is a DummyDatasetConfig and is never valid")
Notes
This method is used to validate the configuration of the dataset.
- class dacapo.experiments.datasplits.datasets.RawGTDataset(dataset_config)
A dataset that contains raw and ground truth data. Optionally, it can also contain a mask.
- raw
Array The raw data.
- gt
Array The ground truth data.
- mask
Optional[Array] The mask data.
- sample_points
Optional[List[Coordinate]] The sample points in the graph.
- weight
Optional[float] The weight of the dataset.
- __init__(dataset_config)
Initialize the dataset.
Notes
This class is a base class and should not be instantiated.
- name
- weight
- class dacapo.experiments.datasplits.datasets.RawGTDatasetConfig
This is a configuration class for the standard dataset with both raw and GT Array.
The configuration includes array configurations for raw data, ground truth data and mask data. The configuration for ground truth (GT) data is mandatory, whereas configurations for raw and mask data are optional. It also includes an optional list of points around which training samples will be extracted.
- dataset_type
The type of dataset that is being configured.
- Type:
class
- raw_config
Configuration for the raw data associated with this dataset.
- Type:
Optional[ArrayConfig]
- gt_config
Configuration for the ground truth data associated with this dataset.
- Type:
Optional[ArrayConfig]
- mask_config
An optional mask configuration that sets the loss equal to zero on voxels where the mask is 1.
- Type:
Optional[ArrayConfig]
- sample_points
An optional list of points around which training samples will be extracted.
- Type:
Optional[List[Coordinate]]
- verify()
A method to verify the validity of the configuration.
Notes
This class is used to create a configuration object for the standard dataset with both raw and GT Array.
- dataset_type
- mask_config: dacapo.experiments.datasplits.datasets.arrays.ArrayConfig | None