iterable_pred_dataset
Iterable prediction dataset used to load data file by file.
IterablePredDataset
#
Bases: IterableDataset
Simple iterable prediction dataset.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
prediction_config | InferenceConfig | Inference configuration. | required |
src_files | List[Path] | List of data files. | required |
read_source_func | Callable | Read source function for custom types, by default read_tiff. | read_tiff |
**kwargs | Any | Additional keyword arguments, unused. | {} |
Attributes:
Name | Type | Description |
---|---|---|
data_path | Union[str, Path] | Path to the data, must be a directory. |
axes | str | Description of axes in format STCZYX. |
mean | (Optional[float], optional) | Expected mean of the dataset, by default None. |
std | (Optional[float], optional) | Expected standard deviation of the dataset, by default None. |
patch_transform | (Optional[Callable], optional) | Patch transform callable, by default None. |
Source code in src/careamics/dataset/iterable_pred_dataset.py
20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 |
|
__init__(prediction_config, src_files, read_source_func=read_tiff, **kwargs)
#
Constructor.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
prediction_config | InferenceConfig | Inference configuration. | required |
src_files | list of pathlib.Path | List of data files. | required |
read_source_func | Callable | Read source function for custom types, by default read_tiff. | read_tiff |
**kwargs | Any | Additional keyword arguments, unused. | {} |
Raises:
Type | Description |
---|---|
ValueError | If mean and std are not provided in the inference configuration. |
Source code in src/careamics/dataset/iterable_pred_dataset.py
__iter__()
#
Iterate over data source and yield single patch.
Yields:
Type | Description |
---|---|
(ndarray, ndarray or None) | Single patch. |