tumourkit.utils.preprocessing.read_json
- tumourkit.utils.preprocessing.read_json(json_path: str) Dict[str, Any]
Reads a Hovernet JSON file from the specified path and returns the nuclei information as a dictionary.
- Parameters:
json_path (str) – The path to the Hovernet JSON file.
- Returns:
A dictionary containing the nuclei information.
- Return type:
Dict[str, Any] or None
This function reads a Hovernet JSON file from the specified path and returns the nuclei information as a dictionary. If the function is unable to read the file or encounters an error, it returns None. The function expects the JSON file to contain a ‘nuc’ key with the nuclei information.