monailabel.deepedit.transforms module

class monailabel.deepedit.transforms.AddRandomGuidanced(guidance='guidance', discrepancy='discrepancy', weight_map=None, probability='probability')[source]

Bases: monai.transforms.transform.Randomizable, monai.transforms.transform.Transform

Add random guidance based on discrepancies that were found between label and prediction.

Parameters
  • guidance (str) – key to guidance source, shape (2, N, # of dim)

  • discrepancy (str) – key to discrepancy map between label and prediction shape (2, C, H, W, D) or (2, C, H, W)

  • probability (str) – key to click/interaction probability, shape (1)

  • weight_map (Optional[str]) – optional key to predetermined weight map used to increase click likelihood in higher weight areas shape (C, H, W, D) or (C, H, W)

add_guidance(discrepancy, weight_map, will_interact)[source]
find_guidance(discrepancy, weight_map)[source]
randomize(data=None)[source]

Within this method, self.R should be used, instead of np.random, to introduce random factors.

all self.R calls happen here so that we have a better chance to identify errors of sync the random state.

This method can generate the random factors based on properties of the input data.

Raises

NotImplementedError – When the subclass does not override this method.

class monailabel.deepedit.transforms.DiscardAddGuidanced(keys, number_intensity_ch=1, probability=1.0, allow_missing_keys=False)[source]

Bases: monai.transforms.transform.MapTransform

Discard positive and negative points according to discard probability

Parameters
  • keys (Union[Collection[Hashable], Hashable]) – The keys parameter will be used to get and set the actual data item to transform

  • number_intensity_ch (int) – number of intensity channels

  • probability (float) – probability of discarding clicks

__init__(keys, number_intensity_ch=1, probability=1.0, allow_missing_keys=False)[source]

Discard positive and negative points according to discard probability

Parameters
  • keys (Union[Collection[Hashable], Hashable]) – The keys parameter will be used to get and set the actual data item to transform

  • number_intensity_ch (int) – number of intensity channels

  • probability (float) – probability of discarding clicks

class monailabel.deepedit.transforms.PosNegClickProbAddRandomGuidanced(guidance='guidance', discrepancy='discrepancy', probability='probability', pos_click_probability=0.5, weight_map=None)[source]

Bases: monai.transforms.transform.Randomizable, monai.transforms.transform.Transform

Add random guidance based on discrepancies that were found between label and prediction.

Parameters
  • guidance (str) – key to guidance source, shape (2, N, # of dim)

  • discrepancy (str) – key to discrepancy map between label and prediction shape (2, C, H, W, D) or (2, C, H, W)

  • probability (str) – key to click/interaction probability, shape (1)

  • pos_click_probability (float) – if click, probability of a positive click (probability of negative click will be 1 - pos_click_probability)

  • weight_map (Optional[str]) – optional key to predetermined weight map used to increase click likelihood in higher weight areas shape (C, H, W, D) or (C, H, W)

add_guidance(discrepancy, weight_map, will_interact)[source]
find_guidance(discrepancy, weight_map)[source]
randomize(data=None)[source]

Within this method, self.R should be used, instead of np.random, to introduce random factors.

all self.R calls happen here so that we have a better chance to identify errors of sync the random state.

This method can generate the random factors based on properties of the input data.

Raises

NotImplementedError – When the subclass does not override this method.

class monailabel.deepedit.transforms.ResizeGuidanceCustomd(guidance, ref_image)[source]

Bases: monai.transforms.transform.Transform

Resize the guidance based on cropped vs resized image.

class monailabel.deepedit.transforms.SingleLabelSingleModalityd(keys, allow_missing_keys=False)[source]

Bases: monai.transforms.transform.MapTransform

Gets single modality and single label