(self, lab, seg_lab, iterations=1)
| 185 | return True |
| 186 | |
| 187 | def __call__(self, lab, seg_lab, iterations=1): |
| 188 | self.previous_bifurPts = [] |
| 189 | self.output = np.zeros_like(lab) |
| 190 | self.lst_output = np.zeros_like(lab) |
| 191 | components = get_largest_two_component_2D(lab, threshold=15) |
| 192 | if len(components) > 1: |
| 193 | for c in components: |
| 194 | start = self.__find_start(c) |
| 195 | self.__detect_neighbor_bifur_state(c, start) |
| 196 | else: |
| 197 | c = components[0] |
| 198 | start = self.__find_start(c) |
| 199 | self.__detect_neighbor_bifur_state(c, start) |
| 200 | self.__detect_loop_branch(self.end) |
| 201 | struct = ndimage.generate_binary_structure(2, 2) |
| 202 | output = ndimage.morphology.binary_dilation( |
| 203 | self.output, structure=struct, iterations=iterations) |
| 204 | shift_y = random.randint(-6, 6) |
| 205 | shift_x = random.randint(-6, 6) |
| 206 | if np.sum(seg_lab) > 1000: |
| 207 | output = translate_img(output.astype(np.uint8), shift_x, shift_y) |
| 208 | output = random_rotation(output) |
| 209 | output = output * seg_lab |
| 210 | return output |
| 211 | |
| 212 | |
| 213 | def scrible_2d(label, iteration=[4, 10]): |
nothing calls this directly
no test coverage detected