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

Method verify_suffix

monai/data/image_reader.py:1364–1373  ·  view source on GitHub ↗

Verify whether the specified file or files format is supported by PIL reader. Args: filename: file name or a list of file names to read. if a list of files, verify all the suffixes.

(self, filename: Sequence[PathLike] | PathLike)

Source from the content-addressed store, hash-verified

1362 self.kwargs = kwargs
1363
1364 def verify_suffix(self, filename: Sequence[PathLike] | PathLike) -> bool:
1365 """
1366 Verify whether the specified file or files format is supported by PIL reader.
1367
1368 Args:
1369 filename: file name or a list of file names to read.
1370 if a list of files, verify all the suffixes.
1371 """
1372 suffixes: Sequence[str] = ["png", "jpg", "jpeg", "bmp"]
1373 return has_pil and is_supported_format(filename, suffixes)
1374
1375 def read(self, data: Sequence[PathLike] | PathLike | np.ndarray, **kwargs):
1376 """

Callers

nothing calls this directly

Calls 1

is_supported_formatFunction · 0.90

Tested by

no test coverage detected