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

Method __call__

monai/apps/deepgrow/transforms.py:57–69  ·  view source on GitHub ↗
(self, data: Any)

Source from the content-addressed store, hash-verified

55 return np.asarray(sids)
56
57 def __call__(self, data: Any) -> dict:
58 d: dict = dict(data)
59 label = d[self.label].numpy() if isinstance(data[self.label], torch.Tensor) else data[self.label]
60 if label.shape[0] != 1:
61 raise ValueError(f"Only supports single channel labels, got label shape {label.shape}!")
62
63 if len(label.shape) != 4: # only for 3D
64 raise ValueError(f"Only supports label with shape CDHW, got label shape {label.shape}!")
65
66 sids = self._apply(label)
67 if sids is not None and len(sids):
68 d[self.sids] = sids
69 return d
70
71
72class AddInitialSeedPointd(Randomizable, Transform):

Callers

nothing calls this directly

Calls 1

_applyMethod · 0.95

Tested by

no test coverage detected