data_factory
Convenience functions to create NG data configurations.
create_ng_data_configuration(data_type, axes, patch_size, batch_size, augmentations=None, channels=None, in_memory=None, train_dataloader_params=None, val_dataloader_params=None, pred_dataloader_params=None, seed=None) #
Create a training NGDatasetConfig.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
data_type | (array, tiff, zarr, czi, custom) | Type of the data. | "array" |
axes | str | Axes of the data. | required |
patch_size | list of int | Size of the patches along the spatial dimensions. | required |
batch_size | int | Batch size. | required |
augmentations | list of transforms | List of transforms to apply. | None |
channels | Sequence of int | List of channels to use. If | None |
in_memory | bool | Whether to load all data into memory. This is only supported for 'array', 'tiff' and 'custom' data types. If | None |
augmentations | list of transforms or None | List of transforms to apply. If | None |
train_dataloader_params | dict | Parameters for the training dataloader, see PyTorch notes, by default None. | None |
val_dataloader_params | dict | Parameters for the validation dataloader, see PyTorch notes, by default None. | None |
pred_dataloader_params | dict | Parameters for the test dataloader, see PyTorch notes, by default None. | None |
seed | int | Random seed for reproducibility. If | None |
Returns:
| Type | Description |
|---|---|
NGDataConfig | Next-Generation Data model with the specified parameters. |
Source code in src/careamics/config/ng_factories/data_factory.py
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 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 | |
list_spatial_augmentations(augmentations=None) #
List the augmentations to apply.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
augmentations | list of transforms | List of transforms to apply, either both or one of XYFlipConfig and XYRandomRotate90Config. | None |
Returns:
| Type | Description |
|---|---|
list of transforms | List of transforms to apply. |
Raises:
| Type | Description |
|---|---|
ValueError | If the transforms are not XYFlipConfig or XYRandomRotate90Config. |
ValueError | If there are duplicate transforms. |