Dataset
LCMultiChDloader
Bases: MultiChDloader
Multi-channel dataset loader for LC-style datasets.
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.
MicroSplitDataConfig
Bases: BaseModel
data_type
instance-attribute
Type of the dataset, should be one of DataType
datasplit_type = None
class-attribute
instance-attribute
Whether to return training, validation or test split, should be one of DataSplitType
depth3D = 1
class-attribute
instance-attribute
Number of slices in 3D. If data is 2D depth3D is equal to 1
empty_patch_replacement_enabled = False
class-attribute
instance-attribute
Whether to replace the content of one of the channels with background with given probability
enable_gaussian_noise = False
class-attribute
instance-attribute
Whether to enable gaussian noise
grid_size = None
class-attribute
instance-attribute
Frame is divided into square grids of this size. A patch centered on a grid
having size image_size is returned. Grid size not used in training,
used only during val / test, grid size controls the overlap of the patches
image_size
instance-attribute
Size of one patch of data
input_idx = None
class-attribute
instance-attribute
Index of the channel where the input is stored in the data
input_is_sum = False
class-attribute
instance-attribute
Whether the input is the sum or average of channels
max_val = None
class-attribute
instance-attribute
Maximum data in the dataset. Is calculated for train split, and should be externally set for val and test splits.
mode_3D = False
class-attribute
instance-attribute
If training in 3D mode or not
multiscale_lowres_count = None
class-attribute
instance-attribute
Number of LC scales
normalized_input = True
class-attribute
instance-attribute
If this is set to true, then one mean and stdev is used for both channels. Otherwise, two different mean and stdev are used.
num_channels = 2
class-attribute
instance-attribute
Number of channels in the input
overlapping_padding_kwargs = None
class-attribute
instance-attribute
Parameters for np.pad method
poisson_noise_factor = -1
class-attribute
instance-attribute
The added poisson noise factor
target_idx_list = None
class-attribute
instance-attribute
Indices of the channels where the targets are stored in the data
uncorrelated_channels = False
class-attribute
instance-attribute
Replace the content in one of the channels with given probability to make channel content 'uncorrelated'
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.
MultiChDloaderRef
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_num_frames()
Returns the number of the longest channel.
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.
MultiFileDset
Here, we handle dataset having multiple files. Each file can have a different spatial dimension and number of frames (Z stack).