make_default_dict¶

make_default_dict(data, subcat)[source]¶

Helper function to create a default typedict if none is provided.

The unique types in the data are given a prefix to differentiate types from different heads of a multi-head model. For example, types 1,2, etc. in the ‘Gland’ head will become ‘Gla: 1’, ‘Gla: 2’, etc.

Parameters:
  • data (dict) – The data loaded from the .dat file.

  • subcat (str) – The subcategory of the data, eg ‘Gland’ or ‘Nuclei’.

Returns:

A dictionary mapping types to more descriptive names.

Return type:

dict