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

Method save_prob_map

monai/handlers/probability_maps.py:117–131  ·  view source on GitHub ↗

This method save the probability map for an image, when its inference is finished, and delete that probability map from memory. Args: name: the name of image to be saved.

(self, name: str)

Source from the content-addressed store, hash-verified

115 self.save_prob_map(name)
116
117 def save_prob_map(self, name: str) -> None:
118 """
119 This method save the probability map for an image, when its inference is finished,
120 and delete that probability map from memory.
121
122 Args:
123 name: the name of image to be saved.
124 """
125 file_path = self.folder_layout.filename(name)
126 np.save(file_path, self.prob_map[name])
127
128 self.num_done_images += 1
129 self.logger.info(f"Inference of '{name}' is done [{self.num_done_images}/{self.num_images}]!")
130 del self.prob_map[name]
131 del self.counter[name]
132
133 def finalize(self, engine: Engine) -> None:
134 self.logger.info(f"Probability map is created for {self.num_done_images}/{self.num_images} images!")

Callers 1

__call__Method · 0.95

Calls 3

saveMethod · 0.80
infoMethod · 0.80
filenameMethod · 0.45

Tested by

no test coverage detected