monailabel.datastore.dicom module

class monailabel.datastore.dicom.DICOMWebDatastore(client, cache_path=None)[source]

Bases: monailabel.datastore.local.LocalDatastore

Creates a LocalDataset object

Parameters:

datastore_path: str

a string to the directory tree of the desired dataset

datastore_config: str

optional file name of the dataset configuration file (by default dataset.json)

datalist(full_path=True)[source]

Return a dictionary of image and label pairs corresponding to the ‘image’ and ‘label’ keys respectively

Return type

List[Dict[str, str]]

Returns

the {‘label’: image, ‘label’: label} pairs for training

get_image_uri(image_id)[source]

Retrieve image uri based on image id

Parameters

image_id (str) – the desired image’s id

Return type

str

Returns

return the image uri

get_label_uri(label_id, label_tag, image_id='')[source]

Retrieve label uri based on image id

Parameters
  • label_id (str) – the desired label’s id

  • label_tag (str) – the matching label’s tag

Return type

str

Returns

return the label uri

get_labeled_images()[source]

Get all images that have a corresponding label

Return type

List[str]

Returns

list of image ids List[str]

get_unlabeled_images()[source]

Get all images that have no corresponding label

Return type

List[str]

Returns

list of image ids List[str]

list_images()[source]

Return list of image ids available in the datastore

Return type

List[str]

Returns

list of image ids List[str]

name()[source]

Dataset name (if one is assigned)

Returns

Dataset name as string

Return type

name (str)

save_label(image_id, label_filename, label_tag, label_info, label_id='')[source]

Save a label for the given image id and return the newly saved label’s id

Parameters
  • image_id (str) – the image id for the label

  • label_filename (str) – the path to the label file

  • label_tag (str) – the tag for the label

  • label_info (Dict[str, Any]) – additional info for the label

Return type

str

Returns

the label id for the given label filename

status()[source]

Return current statistics of datastore

Return type

Dict[str, Any]