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)
| 73 | |
| 74 | |
| 75 | def 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 | |
| 92 | def load_samples(images_dir, cells_dir, cells2labels_dir, images_names, crop_size, to_pad=False, channels=None): |
no test coverage detected