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

Method __init__

monai/auto3dseg/analyzer.py:721–751  ·  view source on GitHub ↗
(
        self, stats_name: str = DataStatsKeys.LABEL_STATS, average: bool | None = True, do_ccp: bool | None = True
    )

Source from the content-addressed store, hash-verified

719 """
720
721 def __init__(
722 self, stats_name: str = DataStatsKeys.LABEL_STATS, average: bool | None = True, do_ccp: bool | None = True
723 ):
724 self.summary_average = average
725 self.do_ccp = do_ccp
726
727 report_format: dict[str, Any] = {
728 LabelStatsKeys.LABEL_UID: None,
729 LabelStatsKeys.IMAGE_INTST: None,
730 LabelStatsKeys.LABEL: [{LabelStatsKeys.PIXEL_PCT: None, LabelStatsKeys.IMAGE_INTST: None}],
731 }
732 if self.do_ccp:
733 report_format[LabelStatsKeys.LABEL][0].update(
734 {LabelStatsKeys.LABEL_SHAPE: None, LabelStatsKeys.LABEL_NCOMP: None}
735 )
736
737 super().__init__(stats_name, report_format)
738 self.update_ops(LabelStatsKeys.IMAGE_INTST, SummaryOperations())
739
740 # label-0-'pixel percentage'
741 id_seq = ID_SEP_KEY.join([LabelStatsKeys.LABEL, "0", LabelStatsKeys.PIXEL_PCT])
742 self.update_ops_nested_label(id_seq, SampleOperations())
743 # label-0-'image intensity'
744 id_seq = ID_SEP_KEY.join([LabelStatsKeys.LABEL, "0", LabelStatsKeys.IMAGE_INTST])
745 self.update_ops_nested_label(id_seq, SummaryOperations())
746 # label-0-shape
747 id_seq = ID_SEP_KEY.join([LabelStatsKeys.LABEL, "0", LabelStatsKeys.LABEL_SHAPE])
748 self.update_ops_nested_label(id_seq, SampleOperations())
749 # label-0-ncomponents
750 id_seq = ID_SEP_KEY.join([LabelStatsKeys.LABEL, "0", LabelStatsKeys.LABEL_NCOMP])
751 self.update_ops_nested_label(id_seq, SampleOperations())
752
753 def __call__(self, data: list[dict]) -> dict:
754 """

Callers

nothing calls this directly

Calls 6

SummaryOperationsClass · 0.90
SampleOperationsClass · 0.90
update_opsMethod · 0.80
updateMethod · 0.45
__init__Method · 0.45

Tested by

no test coverage detected