Multich Dataset
A place for Datasets and Dataloaders.
MultiChDloader
Bases: Dataset
Multi-channel dataset loader.
compute_mean_std(allow_for_validation_data=False)
Note that we must compute this only for training data.
get_begin_end_padding(start_pos, end_pos, max_len)
The effect is that the image with size self._grid_sz is in the center of the patch with sufficient padding on all four sides so that the final patch size is self._img_sz.
get_uncorrelated_img_tuples(index)
Content of channels like actin and nuclei is "correlated" in its respective location, this function allows to pick channels' content from different patches of the image to make it "uncorrelated".
replace_with_empty_patch(img_tuples)
Replaces the content of one of the channels with background
set_img_sz(image_size, grid_size)
If one wants to change the image size on the go, then this can be used.
Args:
image_size: size of one patch
grid_size: frame is divided into square grids of this size. A patch centered on a grid having size image_size is returned.