conf
Configuration building convenience functions for the CAREamics CLI.
ConfOptions
dataclass
#
care(ctx, experiment_name, axes, patch_size, batch_size, num_epochs, data_type='tiff', use_augmentations=True, independent_channels=False, loss='mae', n_channels_in=None, n_channels_out=None, logger='none')
#
Create a configuration for training CARE.
If "Z" is present in axes
, then path_size
must be a list of length 3, otherwise 2.
If "C" is present in axes
, then you need to set n_channels_in
to the number of channels. Likewise, if you set the number of channels, then "C" must be present in axes
.
To set the number of output channels, use the n_channels_out
parameter. If it is not specified, it will be assumed to be equal to n_channels_in
.
By default, all channels are trained together. To train all channels independently, set independent_channels
to True.
By setting use_augmentations
to False, the only transformation applied will be normalization.
Source code in src/careamics/cli/conf.py
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 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 |
|
conf_options(ctx, dir=WORK_DIR, name='config', force=False, print=False)
#
Build and save CAREamics configuration files.
Source code in src/careamics/cli/conf.py
n2n(ctx, experiment_name, axes, patch_size, batch_size, num_epochs, data_type='tiff', use_augmentations=True, independent_channels=False, loss='mae', n_channels_in=None, n_channels_out=None, logger='none')
#
Create a configuration for training Noise2Noise.
If "Z" is present in axes
, then path_size
must be a list of length 3, otherwise 2.
If "C" is present in axes
, then you need to set n_channels
to the number of channels. Likewise, if you set the number of channels, then "C" must be present in axes
.
By default, all channels are trained together. To train all channels independently, set independent_channels
to True.
By setting use_augmentations
to False, the only transformation applied will be normalization.
Source code in src/careamics/cli/conf.py
189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 204 205 206 207 208 209 210 211 212 213 214 215 216 217 218 219 220 221 222 223 224 225 226 227 228 229 230 231 232 233 234 235 236 237 238 239 240 241 242 243 244 245 246 247 248 249 250 251 252 253 254 255 256 257 258 259 260 261 262 263 264 265 266 267 268 269 270 |
|
n2v(ctx, experiment_name, axes, patch_size, batch_size, num_epochs, data_type='tiff', use_augmentations=True, independent_channels=True, use_n2v2=False, n_channels=None, roi_size=11, masked_pixel_percentage=0.2, struct_n2v_axis='none', struct_n2v_span=5, logger='none')
#
Create a configuration for training Noise2Void.
N2V uses a UNet model to denoise images in a self-supervised manner. To use its variants structN2V and N2V2, set the struct_n2v_axis
and struct_n2v_span
(structN2V) parameters, or set use_n2v2
to True (N2V2).
N2V2 modifies the UNet architecture by adding blur pool layers and removes the skip connections, thus removing checkboard artefacts. StructN2V is used when vertical or horizontal correlations are present in the noise; it applies an additional mask to the manipulated pixel neighbors.
If "Z" is present in axes
, then path_size
must be a list of length 3, otherwise 2.
If "C" is present in axes
, then you need to set n_channels
to the number of channels.
By default, all channels are trained independently. To train all channels together, set independent_channels
to False.
By setting use_augmentations
to False, the only transformations applied will be normalization and N2V manipulation.
The roi_size
parameter specifies the size of the area around each pixel that will be manipulated by N2V. The masked_pixel_percentage
parameter specifies how many pixels per patch will be manipulated.
The parameters of the UNet can be specified in the model_kwargs
(passed as a parameter-value dictionary). Note that use_n2v2
and 'n_channels' override the corresponding parameters passed in model_kwargs
.
If you pass "horizontal" or "vertical" to struct_n2v_axis
, then structN2V mask will be applied to each manipulated pixel.
Source code in src/careamics/cli/conf.py
273 274 275 276 277 278 279 280 281 282 283 284 285 286 287 288 289 290 291 292 293 294 295 296 297 298 299 300 301 302 303 304 305 306 307 308 309 310 311 312 313 314 315 316 317 318 319 320 321 322 323 324 325 326 327 328 329 330 331 332 333 334 335 336 337 338 339 340 341 342 343 344 345 346 347 348 349 350 351 352 353 354 355 356 357 358 359 360 361 362 363 364 365 366 367 368 369 370 371 372 373 374 375 376 377 378 379 |
|