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

Method set_data

monai/data/dataset.py:1099–1113  ·  view source on GitHub ↗

Set the input data and run deterministic transforms to generate cache content. Note: should call `shutdown()` before calling this func.

(self, data: Sequence)

Source from the content-addressed store, hash-verified

1097 self._compute_data_idx()
1098
1099 def set_data(self, data: Sequence):
1100 """
1101 Set the input data and run deterministic transforms to generate cache content.
1102
1103 Note: should call `shutdown()` before calling this func.
1104
1105 """
1106 if self.is_started():
1107 warnings.warn("SmartCacheDataset is not shutdown yet, shutdown it directly.")
1108 self.shutdown()
1109
1110 if self.shuffle:
1111 data = copy(data)
1112 self.randomize(data)
1113 super().set_data(data)
1114
1115 def randomize(self, data: Sequence) -> None:
1116 try:

Callers 1

test_set_dataMethod · 0.95

Calls 4

is_startedMethod · 0.95
shutdownMethod · 0.95
randomizeMethod · 0.95
set_dataMethod · 0.45

Tested by 1

test_set_dataMethod · 0.76