MCPcopy Create free account
hub / github.com/KerenLab/CellSighter / create_slices

Function create_slices

data/utils.py:75–89  ·  view source on GitHub ↗

Args: slices: slices that bound the cell crop_size: the needed size of the crop bounds: shape of the image containing the cell Returns: new slices that bound the cell the size of crop_size

(slices, crop_size, bounds)

Source from the content-addressed store, hash-verified

73
74
75def create_slices(slices, crop_size, bounds):
76 """
77
78 Args:
79 slices: slices that bound the cell
80 crop_size: the needed size of the crop
81 bounds: shape of the image containing the cell
82
83 Returns:
84 new slices that bound the cell the size of crop_size
85 """
86 all_dim_slices = []
87 for slc, cs, max_size in zip(slices, crop_size, bounds):
88 all_dim_slices += [_extend_slices_1d(slc, cs, max_size)]
89 return tuple(all_dim_slices)
90
91
92def load_samples(images_dir, cells_dir, cells2labels_dir, images_names, crop_size, to_pad=False, channels=None):

Callers 1

load_samplesFunction · 0.85

Calls 1

_extend_slices_1dFunction · 0.85

Tested by

no test coverage detected