MCPcopy Create free account
hub / github.com/Project-MONAI/MONAI / bbox

Method bbox

monai/apps/nuclick/transforms.py:114–128  ·  view source on GitHub ↗
(self, patch_size, centroid, size)

Source from the content-addressed store, hash-verified

112 return d
113
114 def bbox(self, patch_size, centroid, size):
115 x, y = centroid
116 m, n = size
117
118 x_start = int(max(x - patch_size / 2, 0))
119 y_start = int(max(y - patch_size / 2, 0))
120 x_end = x_start + patch_size
121 y_end = y_start + patch_size
122 if x_end > m:
123 x_end = m
124 x_start = m - patch_size
125 if y_end > n:
126 y_end = n
127 y_start = n - patch_size
128 return x_start, x_end, y_start, y_end
129
130
131class SplitLabeld(MapTransform):

Callers 2

__call__Method · 0.95
__call__Method · 0.80

Calls 1

maxFunction · 0.85

Tested by

no test coverage detected