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

Method __call__

monai/apps/nuclick/transforms.py:101–112  ·  view source on GitHub ↗
(self, data)

Source from the content-addressed store, hash-verified

99 self.kwargs = kwargs
100
101 def __call__(self, data):
102 d = dict(data)
103
104 centroid = d[self.centroid_key] # create mask based on centroid (select nuclei based on centroid)
105 roi_size = (self.patch_size, self.patch_size)
106
107 for key in self.keys:
108 img = d[key]
109 x_start, x_end, y_start, y_end = self.bbox(self.patch_size, centroid, img.shape[-2:])
110 cropped = img[:, x_start:x_end, y_start:y_end]
111 d[key] = SpatialPad(spatial_size=roi_size, **self.kwargs)(cropped)
112 return d
113
114 def bbox(self, patch_size, centroid, size):
115 x, y = centroid

Callers

nothing calls this directly

Calls 2

bboxMethod · 0.95
SpatialPadClass · 0.90

Tested by

no test coverage detected