Ejemplo n.º 1
0
 def initializeColorNodes(self):
     from mpReview import mpReviewLogic
     self.mpReviewColorNode, self.structureNames = mpReviewLogic.loadColorTable(
         self.getSetting("Color_File_Name"))
     self.segmentedColorName = self.getSetting("Segmentation_Color_Name")
     self.segmentedLabelValue = self.mpReviewColorNode.GetColorIndexByName(
         self.segmentedColorName)
Ejemplo n.º 2
0
    def runAutomaticSegmentation(self):
        logic = AutomaticSegmentationLogic()
        logic.addEventObserver(logic.DeepLearningFinishedEvent,
                               self.onSegmentationFinished)
        logic.addEventObserver(
            logic.DeepLearningFailedEvent, lambda c, e: self.
            onPreopLoadingFailed("Automatic segmentation failed."))
        customStatusProgressBar = CustomStatusProgressbar()
        customStatusProgressBar.text = "Running DeepInfer for automatic prostate segmentation"

        from mpReview import mpReviewLogic
        mpReviewColorNode, _ = mpReviewLogic.loadColorTable(
            self.getSetting("Color_File_Name", moduleName=self.MODULE_NAME))

        domain = 'BWH_WITHOUT_ERC'
        prompt = SliceWidgetConfirmYesNoDialog(
            self.data.initialVolume,
            "Was an endorectal coil used during preop acquisition?").exec_()

        self.preopData.usedERC = False
        if prompt == qt.QDialogButtonBox.Yes:
            self.preopData.usedERC = True
            domain = 'BWH_WITH_ERC'
        elif prompt == qt.QDialogButtonBox.Cancel:
            raise PreProcessedDataError

        self.segmentationData.startTime = self.getTime()
        logic.run(self.data.initialVolume, domain, mpReviewColorNode)