コード例 #1
0
    def PCAGenerateModel(self,
                         pcaDirectory,
                         labelList,
                         dryRun=0,
                         maxNumberOfEigenVectors=10,
                         saveFileFormat="nrrd",
                         combineStructures=0):
        '''
            Calls the PCAGenerate function
           
            pcaDirectory
                filePath to a directory containing appropriate distanceMaps
            labelList
                list of labels to use for PCA
           
            Returns
               n/a
        '''
        pathToAtlasCreator = os.path.normpath(
            str(slicer.Application.GetPluginsDir()) +
            '/../Modules/AtlasCreator')

        if not self.__pcaDistanceSourced:
            # only source the tcl files once
            self.SourceTclFile(pathToAtlasCreator + os.sep + "HelperFct.tcl")
            self.SourceTclFile(pathToAtlasCreator + os.sep +
                               "PCA_ModellingFct.tcl")
            self.__pcaDistanceSourced = 1

        # convert labelList to a huge string with space as delimiter
        labelListAsString = ""

        for label in labelList:
            labelListAsString += str(label)
            labelListAsString += ","

        labelListAsString = labelListAsString.rstrip(",")

        output1 = "set ::acLabelListAsString " + labelListAsString

        # set the variable for the labelList
        if not dryRun:
            slicer.TkCall(output1)

        # we use the wrapper to start the generation of PCA models
        # we pass all arguments but the labelList which gets handled using the global variable,
        # since we can not pass space divided lists via the Slicer Python<->Tcl interface!!
        output2 = "GeneratePCAModelWrapper"
        output2 += " " + str(pcaDirectory)
        output2 += " " + str(maxNumberOfEigenVectors)
        output2 += " " + str(saveFileFormat)
        output2 += " " + str(combineStructures)

        self.debug("Invoking TCL code: " + output1)
        self.debug("Invoking TCL code: " + output2)

        if not dryRun:
            slicer.TkCall(output2)
        else:
            self.info("Skipping execution of GeneratePCAModel..")
コード例 #2
0
    def BuildGUI(self):
        self.GetUIPanel().AddPage(self._title, self._title, "")
        pageWidget = self.GetUIPanel().GetPageWidget("DiffusionWelcome")
        self.BuildHelpAndAboutFrame(pageWidget, self._helpText,
                                    self._aboutText)

        moduleFrame = slicer.vtkSlicerModuleCollapsibleFrame()
        moduleFrame.SetParent(self.GetUIPanel().GetPageWidget(self._title))
        moduleFrame.Create()
        moduleFrame.SetLabelText(self._title)
        moduleFrame.ExpandFrame()
        widgetName = moduleFrame.GetWidgetName()
        pageWidgetName = self.GetUIPanel().GetPageWidget(
            "DiffusionWelcome").GetWidgetName()
        slicer.TkCall(
            "pack %s -side top -anchor nw -fill x -padx 2 -pady 2 -in %s" %
            (widgetName, pageWidgetName))

        text = slicer.vtkKWTextWithHyperlinksWithScrollbars()
        text.SetParent(moduleFrame.GetFrame())
        text.Create()
        text.SetHorizontalScrollbarVisibility(0)
        text.GetWidget().SetReliefToFlat()
        text.GetWidget().SetWrapToWord()
        text.GetWidget().QuickFormattingOn()
        text.GetWidget().SetHeight(35)
        text.SetText(self._helpText + "\n\n\n" + self._mainText)
        # Important that Read only after SetText otherwise it doesn't work
        text.GetWidget().ReadOnlyOn()
        slicer.TkCall("pack %s -side top -anchor nw -fill x -padx 2 -pady 2" %
                      text.GetWidgetName())
    def BuildGUI(self):
        self._firstRowFrame.SetParent(self._parentFrame)
        self._firstRowFrame.Create()

        self._isosurfaceLevelFrame.SetParent(self._parentFrame)
        self._isosurfaceLevelFrame.Create()

        self._isosurfaceLevelThumbWheel.SetParent(
            self._isosurfaceLevelFrame.GetFrame())
        self._isosurfaceLevelThumbWheel.Create()

        self._startButton.SetParent(self._parentFrame)
        self._startButton.Create()

        self._resetButton.SetParent(self._parentFrame)
        self._resetButton.Create()

        self.UpdateGUIByState()

        slicer.TkCall("pack %s -side top -expand y -padx 2 -pady 2 -in %s" %
                      (self._firstRowFrame.GetWidgetName(),
                       self._parentFrame.GetWidgetName()))

        slicer.TkCall("pack %s -side left -expand y -padx 2 -pady 2 -in %s" %
                      (self._isosurfaceLevelFrame.GetWidgetName(),
                       self._firstRowFrame.GetWidgetName()))
        slicer.TkCall("pack %s -side left -expand y -padx 2 -pady 2" %
                      (self._isosurfaceLevelThumbWheel.GetWidgetName()))

        slicer.TkCall("pack %s -side right -expand n -padx 2 -pady 2 -in %s" %
                      (self._startButton.GetWidgetName(),
                       self._parentFrame.GetWidgetName()))
        slicer.TkCall("pack %s -side right -expand n -padx 2 -pady 2 -in %s" %
                      (self._resetButton.GetWidgetName(),
                       self._parentFrame.GetWidgetName()))
コード例 #4
0
    def BuildGUI(self):
        self.GetUIPanel().AddPage("Endoscopy", "Endoscopy", "")
        pageWidget = self.GetUIPanel().GetPageWidget("Endoscopy")
        helpText = "Create a path model as a spline interpolation of a set of fiducial points.  See <a>http://www.slicer.org/slicerWiki/index.php/Modules:Endoscopy-Documentation-3.6</a> for more information.\n\nPick the Camera to be modified by the path and the Fiducial List defining the control points.  Clicking Apply will bring up the flythrough panel.\n\nYou can manually scroll though the path with the Frame slider.\n\nThe Play/Pause button toggles animated flythrough.\n\nThe Frame Skip slider speeds up the animation by skipping points on the path.\n\nThe Frame Delay slider slows down the animation by adding more time between frames.\n\nThe View Angle provides is used to approximate the optics of an endoscopy system.\n\nThe Close button dismisses the flyrhough panel and stops the animation."
        aboutText = "This work is supported by PAR-07-249: R01CA131718 NA-MIC Virtual Colonoscopy (See <a>http://www.na-mic.org/Wiki/index.php/NA-MIC_NCBC_Collaboration:NA-MIC_virtual_colonoscopy</a>) NA-MIC, NAC, BIRN, NCIGT, and the Slicer Community. See http://www.slicer.org for details.  Module implemented by Steve Pieper."
        self.BuildHelpAndAboutFrame(pageWidget, helpText, aboutText)

        moduleFrame = slicer.vtkSlicerModuleCollapsibleFrame()
        moduleFrame.SetParent(self.GetUIPanel().GetPageWidget("Endoscopy"))
        moduleFrame.Create()
        moduleFrame.SetLabelText("Endoscopy")
        moduleFrame.ExpandFrame()
        widgetName = moduleFrame.GetWidgetName()
        pageWidgetName = self.GetUIPanel().GetPageWidget(
            "Endoscopy").GetWidgetName()
        slicer.TkCall(
            "pack %s -side top -anchor nw -fill x -padx 2 -pady 2 -in %s" %
            (widgetName, pageWidgetName))

        self.CameraNodeSelector.SetNodeClass("vtkMRMLCameraNode", "", "", "")
        self.CameraNodeSelector.SetParent(moduleFrame.GetFrame())
        self.CameraNodeSelector.Create()
        self.CameraNodeSelector.SetMRMLScene(self.GetLogic().GetMRMLScene())
        self.CameraNodeSelector.UpdateMenu()
        self.CameraNodeSelector.SetBorderWidth(2)
        self.CameraNodeSelector.SetLabelText("Camera: ")
        self.CameraNodeSelector.SetBalloonHelpString(
            "select a camera that will fly along this path.")
        slicer.TkCall(
            "pack %s -side top -anchor e -padx 20 -pady 4 -expand true -fill x"
            % self.CameraNodeSelector.GetWidgetName())

        self.FiducialsNodeSelector.SetNodeClass("vtkMRMLFiducialListNode", "",
                                                "", "")
        self.FiducialsNodeSelector.SetParent(moduleFrame.GetFrame())
        self.FiducialsNodeSelector.Create()
        self.FiducialsNodeSelector.SetMRMLScene(self.GetLogic().GetMRMLScene())
        self.FiducialsNodeSelector.UpdateMenu()
        self.FiducialsNodeSelector.SetBorderWidth(2)
        self.FiducialsNodeSelector.SetLabelText("Input Fiducials: ")
        self.FiducialsNodeSelector.SetBalloonHelpString(
            "select a fiducial list to define control points for the path.")
        slicer.TkCall(
            "pack %s -side top -anchor e -padx 20 -pady 4 -expand true -fill x"
            % self.FiducialsNodeSelector.GetWidgetName())

        self.ApplyButton.SetParent(moduleFrame.GetFrame())
        self.ApplyButton.Create()
        self.ApplyButton.SetText("Apply")
        self.ApplyButton.SetWidth(8)
        self.ApplyButton.SetBalloonHelpString(
            "create the path and show the fly through controller.")
        slicer.TkCall("pack %s -side top -anchor e -padx 20 -pady 10" %
                      self.ApplyButton.GetWidgetName())
    def BuildGUI(self):
        SlicerVMTKAdvancedPageSkeleton.BuildGUI(self)

        self._firstRowFrame.SetParent(self._parentFrame)
        self._firstRowFrame.Create()

        self._addSourcePointButton.SetParent(self._firstRowFrame)
        self._addSourcePointButton.Create()

        self._addTargetPointButton.SetParent(self._firstRowFrame)
        self._addTargetPointButton.Create()

        self._secondRowFrame.SetParent(self._parentFrame)
        self._secondRowFrame.Create()

        self._thresholdFrame.SetParent(self._parentFrame)
        self._thresholdFrame.Create()

        self._thresholdSlider.SetParent(self._thresholdFrame.GetFrame())
        self._thresholdSlider.Create()

        self._startButton.SetParent(self._parentFrame)
        self._startButton.Create()

        self._resetButton.SetParent(self._parentFrame)
        self._resetButton.Create()

        self.UpdateGUIByState()

        slicer.TkCall("pack %s -side top -expand y -padx 2 -pady 2 -in %s" %
                      (self._firstRowFrame.GetWidgetName(),
                       self._parentFrame.GetWidgetName()))
        slicer.TkCall("pack %s -side top -expand y -padx 2 -pady 2 -in %s" %
                      (self._secondRowFrame.GetWidgetName(),
                       self._parentFrame.GetWidgetName()))

        slicer.TkCall("pack %s -side top -expand n -padx 2 -pady 2" %
                      (self._addSourcePointButton.GetWidgetName()))
        slicer.TkCall("pack %s -side top -expand n -padx 2 -pady 2" %
                      (self._addTargetPointButton.GetWidgetName()))
        slicer.TkCall("pack %s -side left -expand y -padx 2 -pady 2 -in %s" %
                      (self._thresholdFrame.GetWidgetName(),
                       self._secondRowFrame.GetWidgetName()))
        slicer.TkCall("pack %s -side top -expand n -padx 2 -pady 2" %
                      (self._thresholdSlider.GetWidgetName()))

        slicer.TkCall("pack %s -side right -expand n -padx 2 -pady 2 -in %s" %
                      (self._startButton.GetWidgetName(),
                       self._parentFrame.GetWidgetName()))
        slicer.TkCall("pack %s -side right -expand n -padx 2 -pady 2 -in %s" %
                      (self._resetButton.GetWidgetName(),
                       self._parentFrame.GetWidgetName()))
コード例 #6
0
    def BuildGUI(self):
        SlicerVMTKAdvancedPageSkeleton.BuildGUI(self)


        self._welcomeMessage.SetParent(self._parentFrame)
        self._welcomeMessage.Create()
        self._welcomeMessage.GetWidget().SetWrapToWord()
        self._welcomeMessage.GetWidget().SetHeight(15)
        self._welcomeMessage.GetWidget().QuickFormattingOn()
        self._welcomeMessage.SetHorizontalScrollbarVisibility(0)
        self._welcomeMessage.SetVerticalScrollbarVisibility(1)
        self._welcomeMessage.SetText("**Level-Set Segmentation using VMTK** (<a>http://www.vmtk.org</a>):\n\n\nThe following initialization methods exist:\n\n**Colliding Fronts**: very effective when it is necessary to initialize the tract of a vessel, side branches will be ignored.\n\n**Fast Marching**: effective when it is necessary to segment round objects such as aneurysms. For example, by simply placing one seed at the center and one target on the wall, the volume will be initialized.\n\n**Threshold**: pixels comprised within two specified thresholds will be selected as the initial level sets.\n\n**Isosurface**: initial level sets will correspond to an isosurface of the image with sub-pixel precision.\n\n**Seeds**: initial deformable model is chosen by placing seeds.")
        self._welcomeMessage.GetWidget().ReadOnlyOn()


        slicer.TkCall("pack %s -side top -anchor nw -fill x -padx 2 -pady 2 -in %s" % (self._welcomeMessage.GetWidgetName(),self._parentFrame.GetWidgetName()))
コード例 #7
0
    def PCAGenerateDistanceMaps(self,
                                imageFilePath,
                                label,
                                outputFilePath,
                                dryRun=0,
                                maxDist=100,
                                distBound=10):
        '''
            Calls the PCADistance function
           
            imageFilePath
                filePath to an existing image
            label
                Label to use for PCA
            outputFilePath
                output filePath to the generated distance map
            
           
            Returns
                n/a
        '''
        pathToAtlasCreator = os.path.normpath(
            str(slicer.Application.GetPluginsDir()) +
            '/../Modules/AtlasCreator')

        if not self.__pcaDistanceSourced:
            # only source the tcl files once
            self.SourceTclFile(pathToAtlasCreator + os.sep + "HelperFct.tcl")
            self.SourceTclFile(pathToAtlasCreator + os.sep +
                               "PCA_ModellingFct.tcl")
            self.__pcaDistanceSourced = 1

        output = "GenerateDistanceMapWrapper"
        output += " " + str(imageFilePath)
        output += " " + str(label)
        output += " " + str(maxDist)
        output += " " + str(distBound)
        output += " " + str(outputFilePath)

        self.debug("Invoking TCL code: " + output)

        if not dryRun:
            slicer.TkCall(output)
        else:
            self.info("Skipping execution of GeneratePCAModel..")
コード例 #8
0
    def BuildGUI(self):
        SlicerVMTKAdvancedPageSkeleton.BuildGUI(self)

        self._welcomeMessage.SetParent(self._parentFrame)
        self._welcomeMessage.Create()
        self._welcomeMessage.GetWidget().SetWrapToWord()
        self._welcomeMessage.GetWidget().SetHeight(15)
        self._welcomeMessage.GetWidget().QuickFormattingOn()
        self._welcomeMessage.SetHorizontalScrollbarVisibility(0)
        self._welcomeMessage.SetVerticalScrollbarVisibility(1)
        self._welcomeMessage.SetText(
            "**Level-Set Segmentation using VMTK** (<a>http://www.vmtk.org</a>):\n\n\nThe following evolution methods exist:\n\n**Geodesic**: evolution using the geodesic active contour filter\n\n**Curves**: evolution using the curves image filter\n\n**Parameters**:\n**Number of iterations** is the number of deformation steps the model will perform.\n\n**Propagation scaling** is the weight you assign to model inflation.\n\n**Curvature scaling** is the weight you assign to model surface regularization\n\n**Advection scaling** regulates the attraction of the surface of the image gradient modulus ridges"
        )
        self._welcomeMessage.GetWidget().ReadOnlyOn()

        slicer.TkCall(
            "pack %s -side top -anchor nw -fill x -padx 2 -pady 2 -in %s" %
            (self._welcomeMessage.GetWidgetName(),
             self._parentFrame.GetWidgetName()))
コード例 #9
0
    def BuildGUI(self):

        self._helper.debug("main BuildGUI called")

        self.GetUIPanel().AddPage("Level-Set Segmentation using VMTK",
                                  "Level-Set Segmentation using VMTK", "")
        self._vmtkLvlSetPage = self.GetUIPanel().GetPageWidget(
            "Level-Set Segmentation using VMTK")
        helpText = "**VMTK Level-Set Segmentation in 3D Slicer**, developed by Daniel Haehn. This module uses the Vascular Modeling Toolkit (<a>http://www.vmtk.org</a>) and depends on VmtkSlicerModule.\n\nDocumentation is available here: <a>http://wiki.slicer.org/slicerWiki/index.php/Modules:VMTKLevelSetSegmentation</a>."
        aboutText = "This work is supported by NA-MIC, NAC, BIRN, NCIGT, and the Slicer Community. See http://www.slicer.org for details."
        self._helpAboutFrame = self.BuildHelpAndAboutFrame(
            self._vmtkLvlSetPage, helpText, aboutText)

        self._topFrame.SetParent(self._vmtkLvlSetPage)
        self._topFrame.Create()
        self._topFrame.SetLabelText("Level-Set Segmentation Parameters")
        self._topFrame.ExpandFrame()
        slicer.TkCall(
            "pack %s -side top -anchor nw -fill x -padx 2 -pady 2 -in %s" %
            (self._topFrame.GetWidgetName(),
             self._vmtkLvlSetPage.GetWidgetName()))

        self._moduleNodeSelector.SetNodeClass("vtkMRMLScriptedModuleNode",
                                              "ScriptedModuleName",
                                              self.GetLogic().GetModuleName(),
                                              "VMTKParameters")
        self._moduleNodeSelector.NewNodeEnabledOn()
        self._moduleNodeSelector.NoneEnabledOn()
        self._moduleNodeSelector.ShowHiddenOn()
        self._moduleNodeSelector.SetParent(self._topFrame.GetFrame())
        self._moduleNodeSelector.Create()
        self._moduleNodeSelector.SetMRMLScene(self.GetLogic().GetMRMLScene())
        self._moduleNodeSelector.UpdateMenu()
        self._moduleNodeSelector.SetBorderWidth(2)
        self._moduleNodeSelector.SetLabelText("Module Parameters:")
        self._moduleNodeSelector.SetBalloonHelpString(
            "select a VMTK node from the current mrml scene.")
        slicer.TkCall("pack %s -side top -anchor e -padx 20 -pady 4" %
                      self._moduleNodeSelector.GetWidgetName())

        self._inVolumeSelector.SetNodeClass("vtkMRMLScalarVolumeNode", "", "",
                                            "")
        self._inVolumeSelector.SetParent(self._topFrame.GetFrame())
        self._inVolumeSelector.Create()
        self._inVolumeSelector.SetMRMLScene(self.GetLogic().GetMRMLScene())
        self._inVolumeSelector.UpdateMenu()
        self._inVolumeSelector.SetBorderWidth(2)
        self._inVolumeSelector.SetLabelText("Original Volume:")
        self._inVolumeSelector.SetBalloonHelpString(
            "select an input volume from the current mrml scene.")
        slicer.TkCall("pack %s -side top -anchor e -padx 20 -pady 4" %
                      self._inVolumeSelector.GetWidgetName())

        self._inVolumeSelectorSnd.SetNodeClass("vtkMRMLScalarVolumeNode", "",
                                               "", "")
        self._inVolumeSelectorSnd.SetParent(self._topFrame.GetFrame())
        self._inVolumeSelectorSnd.Create()
        self._inVolumeSelectorSnd.SetMRMLScene(self.GetLogic().GetMRMLScene())
        self._inVolumeSelectorSnd.UpdateMenu()
        self._inVolumeSelectorSnd.SetBorderWidth(2)
        self._inVolumeSelectorSnd.SetLabelText(
            "Vessel Enhanced Volume (optional):")
        self._inVolumeSelectorSnd.SetBalloonHelpString(
            "This optional volume can be used for initialization.")
        slicer.TkCall("pack %s -side top -anchor e -padx 20 -pady 4" %
                      self._inVolumeSelectorSnd.GetWidgetName())

        self._infoLabel.SetParent(self._vmtkLvlSetPage)
        self._infoLabel.Create()
        self._infoLabel.SetText("Choose initialization method..")
        self._infoLabel.SetImageToPredefinedIcon(20023)
        self._infoLabel.SetCompoundModeToLeft()
        self._infoLabel.SetPadX(2)
        slicer.TkCall(
            "pack %s -side top -fill x -expand n -padx 2 -pady 2 -in %s" %
            (self._infoLabel.GetWidgetName(),
             self._vmtkLvlSetPage.GetWidgetName()))

        # initialization tabs start here
        self._advancedInitFrame.SetParent(self._vmtkLvlSetPage)
        self._advancedInitFrame.Create()
        self._advancedInitFrame.SetLabelText("Initialization")
        self._advancedInitFrame.ExpandFrame()
        slicer.TkCall(
            "pack %s -side top -anchor nw -fill x -padx 2 -pady 2 -in %s" %
            (self._advancedInitFrame.GetWidgetName(),
             self._vmtkLvlSetPage.GetWidgetName()))

        self._initImageCheckbox.SetParent(self._advancedInitFrame.GetFrame())
        self._initImageCheckbox.SetText("Initialize on Vessel Enhanced Image")
        self._initImageCheckbox.SetBalloonHelpString(
            "This could enhance the initialization step but also could result in the loss of image information."
        )
        self._initImageCheckbox.Create()
        slicer.TkCall("pack %s -side top -anchor nw -fill x -padx 2 -pady 2" %
                      (self._initImageCheckbox.GetWidgetName()))

        self._advancedInitTabs.SetParent(self._advancedInitFrame.GetFrame())
        self._advancedInitTabs.Create()
        self._advancedInitTabs.AddObserver(2089, self.ProcessClickOnInitTabs)

        self._advancedInitTabs.AddPage(
            "Welcome", "An overview of the initialization methods", "")
        slicer.TkCall("pack %s -side top -anchor nw -fill x -padx 2 -pady 2" %
                      self._advancedInitTabs.GetWidgetName())
        id = self._advancedInitTabs.GetFrame("Welcome")
        self._advancedWelcomePanel = SlicerVMTKInitializationWelcomeGUI(
            id, self)
        self._advancedWelcomePanel.BuildGUI()
        self._initPages.append(self._advancedWelcomePanel)

        self._advancedInitTabs.AddPage("Colliding Fronts",
                                       "Colliding Fronts Initialization", "")
        slicer.TkCall("pack %s -side top -anchor nw -fill x -padx 2 -pady 2" %
                      self._advancedInitTabs.GetWidgetName())
        id = self._advancedInitTabs.GetFrame("Colliding Fronts")
        self._advancedCollidingFrontsPanel = SlicerVMTKInitializationCollidingFrontsGUI(
            id, self)
        self._advancedCollidingFrontsPanel.BuildGUI()
        self._initPages.append(self._advancedCollidingFrontsPanel)

        self._advancedInitTabs.AddPage("Fast Marching",
                                       "Fast Marching Initialization", "")
        slicer.TkCall("pack %s -side top -anchor nw -fill x -padx 2 -pady 2" %
                      self._advancedInitTabs.GetWidgetName())
        id = self._advancedInitTabs.GetFrame("Fast Marching")
        self._advancedFastMarchingPanel = SlicerVMTKInitializationFastMarchingGUI(
            id, self)
        self._advancedFastMarchingPanel.BuildGUI()
        self._initPages.append(self._advancedFastMarchingPanel)

        self._advancedInitTabs.AddPage("Isosurface",
                                       "Isosurface Initialization", "")
        slicer.TkCall("pack %s -side top -anchor nw -fill x -padx 2 -pady 2" %
                      self._advancedInitTabs.GetWidgetName())
        id = self._advancedInitTabs.GetFrame("Isosurface")
        self._advancedIsosurfacePanel = SlicerVMTKInitializationIsosurfaceGUI(
            id, self)
        self._advancedIsosurfacePanel.BuildGUI()
        self._initPages.append(self._advancedIsosurfacePanel)

        self._advancedInitTabs.AddPage("Threshold", "Threshold Initialization",
                                       "")
        slicer.TkCall("pack %s -side top -anchor nw -fill x -padx 2 -pady 2" %
                      self._advancedInitTabs.GetWidgetName())
        id = self._advancedInitTabs.GetFrame("Threshold")
        self._advancedThresholdPanel = SlicerVMTKInitializationThresholdGUI(
            id, self)
        self._advancedThresholdPanel.BuildGUI()
        self._initPages.append(self._advancedThresholdPanel)

        self._advancedInitTabs.AddPage("Seeds", "Seed Initialization", "")
        slicer.TkCall("pack %s -side top -anchor nw -fill x -padx 2 -pady 2" %
                      self._advancedInitTabs.GetWidgetName())
        id = self._advancedInitTabs.GetFrame("Seeds")
        self._advancedSeedsPanel = SlicerVMTKInitializationSeedsGUI(id, self)
        self._advancedSeedsPanel.BuildGUI()
        self._initPages.append(self._advancedSeedsPanel)

        # init merge and end frame

        self._advancedInitMergeAndEndFrame.SetParent(self._advancedInitFrame)
        self._advancedInitMergeAndEndFrame.Create()
        slicer.TkCall(
            "pack %s -side top -anchor nw -fill x -padx 2 -pady 2 -in %s" %
            (self._advancedInitMergeAndEndFrame.GetWidgetName(),
             self._advancedInitFrame.GetWidgetName()))

        self._advancedInitMergeAndEndButtonSet.SetParent(
            self._advancedInitMergeAndEndFrame)
        self._advancedInitMergeAndEndButtonSet.Create()
        self._advancedInitMergeAndEndButtonSet.SetBorderWidth(2)
        self._advancedInitMergeAndEndButtonSet.SetReliefToGroove()
        self._advancedInitMergeAndEndButtonSet.SetWidgetsPadX(1)
        self._advancedInitMergeAndEndButtonSet.SetWidgetsPadY(1)
        self._advancedInitMergeAndEndButtonSet.SetPadX(1)
        self._advancedInitMergeAndEndButtonSet.SetPadY(1)
        self._advancedInitMergeAndEndButtonSet.PackHorizontallyOn()
        self._advancedInitMergeAndEndButtonSet.ExpandWidgetsOn()
        self._advancedInitMergeAndEndButtonSet.SetMaximumNumberOfWidgetsInPackingDirection(
            3)

        self._advancedInitNewButton = self._advancedInitMergeAndEndButtonSet.AddWidget(
            0)
        self._advancedInitNewButton.Create()
        self._advancedInitNewButton.SetText("Add")
        self._advancedInitNewButton.SetImageToPredefinedIcon(20045)
        self._advancedInitNewButton.SetCompoundModeToLeft()
        self._advancedInitNewButton.SetForegroundColor(0.3, 0.6, 0.3)

        self._advancedInitRemoveLastButton = self._advancedInitMergeAndEndButtonSet.AddWidget(
            1)
        self._advancedInitRemoveLastButton.Create()
        self._advancedInitRemoveLastButton.SetText("Undo")
        self._advancedInitRemoveLastButton.SetImageToPredefinedIcon(20049)
        self._advancedInitRemoveLastButton.SetCompoundModeToLeft()
        self._advancedInitRemoveLastButton.SetForegroundColor(0.6, 0.3, 0.3)

        self._advancedInitEndButton = self._advancedInitMergeAndEndButtonSet.AddWidget(
            2)
        self._advancedInitEndButton.Create()
        self._advancedInitEndButton.SetText("Accept")
        self._advancedInitEndButton.SetImageToPredefinedIcon(20044)
        self._advancedInitEndButton.SetCompoundModeToLeft()
        self._advancedInitEndButton.SetForegroundColor(0.3, 0.3, 0.6)

        slicer.TkCall(
            "pack %s -side top -fill x -expand n -padx 2 -pady 2 -in %s" %
            (self._advancedInitMergeAndEndButtonSet.GetWidgetName(),
             self._advancedInitMergeAndEndFrame.GetWidgetName()))

        # evolution tabs start here
        self._advancedEvolFrame.SetParent(self._vmtkLvlSetPage)
        self._advancedEvolFrame.Create()
        self._advancedEvolFrame.SetLabelText("Evolution")
        self._advancedEvolFrame.ExpandFrame()
        slicer.TkCall(
            "pack %s -side top -anchor nw -fill x -padx 2 -pady 2 -in %s" %
            (self._advancedEvolFrame.GetWidgetName(),
             self._vmtkLvlSetPage.GetWidgetName()))

        self._evolImageCheckbox.SetParent(self._advancedEvolFrame.GetFrame())
        self._evolImageCheckbox.SetText(
            "Evolve on Gradient Based Feature Image")
        self._evolImageCheckbox.SetBalloonHelpString(
            "The gradient based feature image could provide a smoother evolution result but might result in the loss of image information."
        )
        self._evolImageCheckbox.Create()
        self._evolImageCheckbox.SetSelectedState(1)
        slicer.TkCall("pack %s -side top -anchor nw -fill x -padx 2 -pady 2" %
                      (self._evolImageCheckbox.GetWidgetName()))

        self._advancedEvolTabs.SetParent(self._advancedEvolFrame.GetFrame())
        self._advancedEvolTabs.Create()
        self._advancedEvolTabs.AddObserver(2089, self.ProcessClickOnEvolTabs)

        self._advancedEvolTabs.AddPage("Welcome",
                                       "An overview of the evolution methods",
                                       "")
        slicer.TkCall("pack %s -side top -anchor nw -fill x -padx 2 -pady 2" %
                      self._advancedEvolTabs.GetWidgetName())
        id = self._advancedEvolTabs.GetFrame("Welcome")
        self._advancedEvolWelcomePanel = SlicerVMTKEvolutionWelcomeGUI(
            id, self)
        self._advancedEvolWelcomePanel.BuildGUI()
        self._evolPages.append(self._advancedEvolWelcomePanel)

        self._advancedEvolTabs.AddPage("Geodesic", "Geodesic Evolution", "")
        slicer.TkCall("pack %s -side top -anchor nw -fill x -padx 2 -pady 2" %
                      self._advancedEvolTabs.GetWidgetName())
        id = self._advancedEvolTabs.GetFrame("Geodesic")
        self._advancedGeodesicPanel = SlicerVMTKEvolutionGeodesicGUI(id, self)
        self._advancedGeodesicPanel.BuildGUI()
        self._evolPages.append(self._advancedGeodesicPanel)

        self._advancedEvolTabs.AddPage("Curves", "Curves Evolution", "")
        slicer.TkCall("pack %s -side top -anchor nw -fill x -padx 2 -pady 2" %
                      self._advancedEvolTabs.GetWidgetName())
        id = self._advancedEvolTabs.GetFrame("Curves")
        self._advancedCurvesPanel = SlicerVMTKEvolutionCurvesGUI(id, self)
        self._advancedCurvesPanel.BuildGUI()
        self._evolPages.append(self._advancedCurvesPanel)

        # evol undo and end frame

        self._advancedEvolUndoAndEndFrame.SetParent(self._advancedEvolFrame)
        self._advancedEvolUndoAndEndFrame.Create()
        slicer.TkCall(
            "pack %s -side top -anchor nw -fill x -padx 2 -pady 2 -in %s" %
            (self._advancedEvolUndoAndEndFrame.GetWidgetName(),
             self._advancedEvolFrame.GetWidgetName()))

        self._advancedEvolUndoAndEndButtonSet.SetParent(
            self._advancedEvolUndoAndEndFrame)
        self._advancedEvolUndoAndEndButtonSet.Create()
        self._advancedEvolUndoAndEndButtonSet.SetBorderWidth(2)
        self._advancedEvolUndoAndEndButtonSet.SetReliefToGroove()
        self._advancedEvolUndoAndEndButtonSet.SetWidgetsPadX(1)
        self._advancedEvolUndoAndEndButtonSet.SetWidgetsPadY(1)
        self._advancedEvolUndoAndEndButtonSet.SetPadX(1)
        self._advancedEvolUndoAndEndButtonSet.SetPadY(1)
        self._advancedEvolUndoAndEndButtonSet.PackHorizontallyOn()
        self._advancedEvolUndoAndEndButtonSet.ExpandWidgetsOn()
        self._advancedEvolUndoAndEndButtonSet.SetMaximumNumberOfWidgetsInPackingDirection(
            2)

        self._advancedEvolRemoveLastButton = self._advancedEvolUndoAndEndButtonSet.AddWidget(
            1)
        self._advancedEvolRemoveLastButton.Create()
        self._advancedEvolRemoveLastButton.SetText("Undo")
        self._advancedEvolRemoveLastButton.SetImageToPredefinedIcon(20049)
        self._advancedEvolRemoveLastButton.SetCompoundModeToLeft()
        self._advancedEvolRemoveLastButton.SetForegroundColor(0.6, 0.3, 0.3)

        self._advancedEvolEndButton = self._advancedEvolUndoAndEndButtonSet.AddWidget(
            2)
        self._advancedEvolEndButton.Create()
        self._advancedEvolEndButton.SetText("Accept")
        self._advancedEvolEndButton.SetImageToPredefinedIcon(20044)
        self._advancedEvolEndButton.SetCompoundModeToLeft()
        self._advancedEvolEndButton.SetForegroundColor(0.3, 0.3, 0.6)

        slicer.TkCall(
            "pack %s -side top -fill x -expand n -padx 2 -pady 2 -in %s" %
            (self._advancedEvolUndoAndEndButtonSet.GetWidgetName(),
             self._advancedEvolUndoAndEndFrame.GetWidgetName()))

        self.UpdateGUIByState()
コード例 #10
0
    def BuildGUI(self):
        self.GetUIPanel().AddPage("SegmentationWelcome", "SegmentationWelcome",
                                  "")
        pageWidget = self.GetUIPanel().GetPageWidget("SegmentationWelcome")
        helpText = "This module provides a quick guide for choosing the segmentation options most appropriate for your task. More detailed information can be found on Slicer's wiki: <a>http://www.slicer.org/slicerWiki/index.php/Modules:SegmentationOverview3.6</a>.\n\nThe following provides a brief overview of the main and auxiliary  modules Slicer has to offer for image segmentation. Selecting the best module will depend on your input data and the underlying questions you are asking. The spectrum of approaches ranges from fully automated to manual segmentation; most modules are generic and can handle any image content, but a few are designed specifically for brain images."
        aboutText = "This work is supported by NA-MIC, NAC, Harvard Catalyst, NCIGT, and the Slicer Community. See http://www.slicer.org for details.  Module implemented by Wendy Plesniak and Steve Pieper."
        self.BuildHelpAndAboutFrame(pageWidget, helpText, aboutText)

        moduleFrame = slicer.vtkSlicerModuleCollapsibleFrame()
        moduleFrame.SetParent(
            self.GetUIPanel().GetPageWidget("SegmentationWelcome"))
        moduleFrame.Create()
        moduleFrame.SetLabelText("SegmentationWelcome")
        moduleFrame.ExpandFrame()
        widgetName = moduleFrame.GetWidgetName()
        pageWidgetName = self.GetUIPanel().GetPageWidget(
            "SegmentationWelcome").GetWidgetName()
        slicer.TkCall(
            "pack %s -side top -anchor nw -fill x -padx 2 -pady 2 -in %s" %
            (widgetName, pageWidgetName))

        text = slicer.vtkKWTextWithHyperlinksWithScrollbars()
        text.SetParent(moduleFrame.GetFrame())
        text.Create()
        text.SetHorizontalScrollbarVisibility(0)
        text.GetWidget().SetReliefToFlat()
        text.GetWidget().SetWrapToWord()
        text.GetWidget().QuickFormattingOn()
        text.GetWidget().SetHeight(35)
        text.SetText(
            """This module provides a quick guide for choosing the segmentation options most appropriate for your task. More detailed information can be found on Slicer's wiki: <a>http://www.slicer.org/slicerWiki/index.php/Modules:SegmentationOverview3.6</a>.
        
The following provides a brief overview of the main modules Slicer has to offer for image segmentation. Selecting the best module will depend on your input data and the underlying questions you are asking. The spectrum of approaches ranges from fully automated to manual segmentation; most modules are generic and can handle any image content, but a few are designed specifically for brain images. Slicer modules are listed below:

**Interactive Editor**
Slicer's interactive editor is a module for manual segmentation of volumes. Some of the tools mimic a painting interface like photoshop or gimp, but work on 3D arrays of voxels rather than on 2D pixels. The overall goal is to allow users to efficiently and precisely define structures within their volumes as label map volumes. These label maps can be used for building models, or further processing (using, for example, the Label Statistics module).

**EM Segment Template Builder**
This module is designed for users who perform atlas based medical image segmentation and has been tested on brain MRI images. Familiarity with statistical modeling may help but is not required. It allows the user to configure the algorithm ---step-by-step--- to a variety of imaging protocols and anatomical structures, and then apply the algorithm to segment data. Configuration settings are stored in an EMSegment parameters node in the Slicer3 MRML tree. These settings can be saved and later applied to new data via any of the EMSegment interfaces within Slicer3 or the command-line EMSegment executable.

**EMSegment Command-Line**
This module is used to simplify the process of segmenting large collections of images by providing a command line interface to the EMSegment algorithm for script and batch processing. The primary function of the EMSegment Template Builder module is to step the user through the process of calibrating, via algorithm parameters, the segmentation algorithm to a particular set of input data. However, once a successful collection of parameters is established, the user will commonly want to bypass this detailed calibration process when segmenting new images by using those parameters collected from the calibration process in EMSegment Template Builder module. The command-line executable provides this batch processing capability.

**EMSegment Simple**
This module provide a simplified ~~one-click~~ GUI interface for the EMSegment Command-line Executable. The interface is simple because the number of required command-line parameters is minimized, and it is flexible because any EM algorithm parameter can be modified, within the MRML scene, via the EMSegment GUI interface. Similar to the EMSegment Command-line Executable, once a set of parameters for segmentation algorithm is deemed satisfactory through the process of calibrating in the Template Builder module, the user will commonly want to bypass this detailed calibration process when segmenting new images. This module provides a simple interface to specify a small number of required command-line parameters --- a MRML scene (containing algorithm parameters), a target image (or multiple target images, e.g., T1 and T2), and an output labelmap image --- and to allow any EM algorithm parameters to be modified, within the MRML scene, via the EMSegment GUI interface.

**Fast Marching Segmentation**
This module is most useful to segment image regions that have similar intensity. Initialization is accomlished by selecting points within the region to be segmented and expected volume of the segmented structure. The segmentation is completed relatively quickly for typical images, allowing experimentation with choosing optimal parameters. The resulting volume can be adjusted interactively by scrolling through the evolution of the label contour.

** Otsu Treshold Segmentation**
This filter creates a labeled image from a grayscale image. First, it calculates an optimal threshold that separates the image into foreground and background. This threshold separates those two classes so that their intra-class variance is minimal (see <a>http://en.wikipedia.org/wiki/Otsu%27s_method</a>). Then the filter runs a connected component algorithm to generate unique labels for each connected region of the foreground. Finally, the resulting image is relabeled to provide consecutive numbering.

** Simple Region Growing**
Simple Region Growing is a statistical region growing algorithm. The algorithm takes one or more seeds as input. It executes using the following steps:

    * A statistical model of the foreground (mean and standard deviation of intensity) is estimated over neighborhoods of the seed points. The statistical model is converted to a scalar threshold range using the mean intensity of a seed point plus or minus a multiplier or the standard deviation.

    * The algorithm then constructs a segmentation by labeling all voxels that are connected to the seed voxels and satisfy the scalar threshold range.

After this initial segmentation, the statistical model can be iteratively refined by re-calculating the mean and standard deviation of the intensity of the voxels in the initial segmentation. The refined statistical model in turn is converted to a new scalar threshold range as described in the preceding paragraph. This is followed by a new segmentation where the algorithm labels all voxels connected to the seed voxels and satisfy the new scalar threshold range. The number of repetitions for the segmentation process is specified using an iteration parameter to the algorithm.

Through this process, Simple Region Growing attempts to adapt to the statistical properties of the image. Initially, the statistical model is based strictly on the neighborhoods about the seeds. This statistical model is precise (being based on the user supplied seeds) but also uncertain (because the number of samples in the model can be rather small). After the initial segmentation, the statistics are recalculated which yields a more certain model (because the number of samples in the model can be rather large).

** Robust Statistics **
This module is a general purpose segmenter. The target object is initialized by a label map. An active contour model then evolves to extract the desired boundary of the object.

**BRAINSROIAuto**
BRAINSROIAuto automatically generates a Binary Image (or Mask) to encompass the region in an brain image volume occupied by the brain. In general, BRAINSROIAuto takes a brain image volume, and generates a mask without requiring parameter tweaking.
""")
        # Important that Read only after SetText otherwise it doesn't work
        text.GetWidget().ReadOnlyOn()
        slicer.TkCall("pack %s -side top -anchor nw -fill x -padx 2 -pady 2" %
                      text.GetWidgetName())
コード例 #11
0
    def BuildGUI(self):

        self.GetUIPanel().AddPage("NetworkExtraction","NetworkExtraction","")
        self._centerlinePage = self.GetUIPanel().GetPageWidget("NetworkExtraction")
        helpText = "**Network Extraction using VMTK**, developed by Daniel Haehn."
        aboutText = "This work is supported by NA-MIC, NAC, BIRN, NCIGT, and the Slicer community."
        self._helpAboutFrame = self.BuildHelpAndAboutFrame(self._centerlinePage,helpText,aboutText)

        self._helper.debug("Creating NetworkExtraction GUI")

        self._moduleFrame.SetParent(self._centerlinePage)
        self._moduleFrame.Create()
        self._moduleFrame.SetLabelText("VMTKNetworkExtraction")
        self._moduleFrame.ExpandFrame()
        slicer.TkCall("pack %s -side top -anchor nw -fill x -padx 2 -pady 2 -in %s" % (self._moduleFrame.GetWidgetName(),self._centerlinePage.GetWidgetName()))

        self._topFrame.SetParent(self._moduleFrame.GetFrame())
        self._topFrame.Create()
        self._topFrame.SetLabelText("Input/Output")
        self._topFrame.ExpandFrame()
        slicer.TkCall("pack %s -side top -anchor nw -fill x -padx 2 -pady 2" % self._topFrame.GetWidgetName())

        self._inModelSelector.SetNodeClass("vtkMRMLModelNode","","","")
        self._inModelSelector.SetParent(self._topFrame.GetFrame())
        self._inModelSelector.Create()
        self._inModelSelector.SetMRMLScene(self.GetLogic().GetMRMLScene())
        self._inModelSelector.UpdateMenu()
        self._inModelSelector.SetBorderWidth(2)
        self._inModelSelector.SetLabelText("Input Model: ")
        self._inModelSelector.SetBalloonHelpString("select an input model from the current mrml scene.")
        slicer.TkCall("pack %s -side top -anchor e -padx 20 -pady 4" % self._inModelSelector.GetWidgetName())

        self._seedsSelector.SetNodeClass("vtkMRMLFiducialListNode","","","StartingPoint")                                                                                    
        self._seedsSelector.SetParent(self._topFrame.GetFrame())                                                                                                     
        self._seedsSelector.Create()                                                                                                                                 
        self._seedsSelector.SetMRMLScene(self.GetLogic().GetMRMLScene())                                                                                             
        self._seedsSelector.UpdateMenu()                                                                                                                             
        self._seedsSelector.SetNewNodeEnabled(1)                                                                                                                     
        self._seedsSelector.SetNoneEnabled(0)                                                                                                                        
        self._seedsSelector.SetBorderWidth(2)                                                                                                                        
        self._seedsSelector.SetLabelText("Seed: ")                                                                                                           
        self._seedsSelector.SetBalloonHelpString("select a fiducial list")                                                                                           
        slicer.TkCall("pack %s -side top -anchor e -padx 20 -pady 4" % self._seedsSelector.GetWidgetName()) 

        self._outModelSelector.SetNodeClass("vtkMRMLModelNode","","1","VMTKNetworkExtractionOut")
        self._outModelSelector.SetNewNodeEnabled(1)
        self._outModelSelector.SetParent(self._topFrame.GetFrame())
        self._outModelSelector.Create()
        self._outModelSelector.SetMRMLScene(self.GetLogic().GetMRMLScene())
        self._outModelSelector.UpdateMenu()
        self._outModelSelector.SetBorderWidth(2)
        self._outModelSelector.SetLabelText("Network Output Model: ")
        self._outModelSelector.SetBalloonHelpString("select an output model from the current mrml scene.")
        slicer.TkCall("pack %s -side top -anchor e -padx 20 -pady 4" % self._outModelSelector.GetWidgetName())


        self._startButton.SetParent(self._topFrame.GetFrame())
        self._startButton.Create()
        self._startButton.SetEnabled(1)
        self._startButton.SetText("Extract Network!")
        self._startButton.SetBalloonHelpString("Click to start the network extraction")
        slicer.TkCall("pack %s -side top -anchor e -padx 2 -pady 2" % self._startButton.GetWidgetName())

        #self.CreateOutModelNodes()

        self._helper.debug("Done Creating NetworkExtraction GUI")
コード例 #12
0
    def BuildGUI(self):

        self.GetUIPanel().AddPage("BranchSplitting", "BranchSplitting", "")
        self._centerlinePage = self.GetUIPanel().GetPageWidget(
            "BranchSplitting")
        helpText = "**Branch Splitting using VMTK**, developed by Johannes Schick."
        aboutText = "This work is supported by NA-MIC, NAC, BIRN, NCIGT, and the Slicer community."
        self._helpAboutFrame = self.BuildHelpAndAboutFrame(
            self._centerlinePage, helpText, aboutText)

        self._helper.debug("Creating BranchSplitting GUI")

        self._moduleFrame.SetParent(self._centerlinePage)
        self._moduleFrame.Create()
        self._moduleFrame.SetLabelText("VMTKBranchSplitting")
        self._moduleFrame.ExpandFrame()
        slicer.TkCall(
            "pack %s -side top -anchor nw -fill x -padx 2 -pady 2 -in %s" %
            (self._moduleFrame.GetWidgetName(),
             self._centerlinePage.GetWidgetName()))

        self._topFrame.SetParent(self._moduleFrame.GetFrame())
        self._topFrame.Create()
        self._topFrame.SetLabelText("Input/Output")
        self._topFrame.ExpandFrame()
        slicer.TkCall("pack %s -side top -anchor nw -fill x -padx 2 -pady 2" %
                      self._topFrame.GetWidgetName())

        self._inModelSelector.SetNodeClass("vtkMRMLModelNode", "", "", "")
        self._inModelSelector.SetParent(self._topFrame.GetFrame())
        self._inModelSelector.Create()
        self._inModelSelector.SetMRMLScene(self.GetLogic().GetMRMLScene())
        self._inModelSelector.UpdateMenu()
        self._inModelSelector.SetBorderWidth(2)
        self._inModelSelector.SetLabelText("Input Model: ")
        self._inModelSelector.SetBalloonHelpString(
            "select an input model from the current mrml scene.")
        slicer.TkCall("pack %s -side top -anchor e -padx 20 -pady 4" %
                      self._inModelSelector.GetWidgetName())

        self._inCenterLineSelector.SetNodeClass("vtkMRMLModelNode", "", "", "")
        self._inCenterLineSelector.SetParent(self._topFrame.GetFrame())
        self._inCenterLineSelector.Create()
        self._inCenterLineSelector.SetMRMLScene(self.GetLogic().GetMRMLScene())
        self._inCenterLineSelector.UpdateMenu()
        self._inCenterLineSelector.SetBorderWidth(2)
        self._inCenterLineSelector.SetLabelText("Input Centerline: ")
        self._inCenterLineSelector.SetBalloonHelpString(
            "select an input model from the current mrml scene.")
        slicer.TkCall("pack %s -side top -anchor e -padx 20 -pady 4" %
                      self._inCenterLineSelector.GetWidgetName())

        self._outModelSelector.SetNodeClass("vtkMRMLModelNode", "", "1",
                                            "VMTKBranchSplittingOut")
        self._outModelSelector.SetNewNodeEnabled(1)
        self._outModelSelector.SetParent(self._topFrame.GetFrame())
        self._outModelSelector.Create()
        self._outModelSelector.SetMRMLScene(self.GetLogic().GetMRMLScene())
        self._outModelSelector.UpdateMenu()
        self._outModelSelector.SetBorderWidth(2)
        self._outModelSelector.SetLabelText("Branch Output Model: ")
        self._outModelSelector.SetBalloonHelpString(
            "select an output model from the current mrml scene.")
        slicer.TkCall("pack %s -side top -anchor e -padx 20 -pady 4" %
                      self._outModelSelector.GetWidgetName())

        self._checkButton.SetParent(self._topFrame.GetFrame())
        self._checkButton.Create()
        self._checkButton.SetEnabled(1)
        self._checkButton.SetText("Split into models")
        self._checkButton.SetBalloonHelpString(
            "Split model into different surface models")
        slicer.TkCall("pack %s -side top -anchor e -padx 2 -pady 2" %
                      self._checkButton.GetWidgetName())

        self._startButton.SetParent(self._topFrame.GetFrame())
        self._startButton.Create()
        self._startButton.SetEnabled(1)
        self._startButton.SetText("Split Branchs")
        self._startButton.SetBalloonHelpString(
            "Click to start the network extraction")
        slicer.TkCall("pack %s -side top -anchor e -padx 2 -pady 2" %
                      self._startButton.GetWidgetName())

        #self.CreateOutModelNodes()

        self._helper.debug("Done Creating BranchSplitting GUI")
コード例 #13
0
    def BuildGUI(self):
        self.GetUIPanel().AddPage("RegistrationWelcome", "RegistrationWelcome",
                                  "")
        pageWidget = self.GetUIPanel().GetPageWidget("RegistrationWelcome")
        helpText = "This module provides a quick guide for choosing the registration option most optimal for your task. More detailed information can be found on Slicer's wiki: <a>http://www.slicer.org/slicerWiki/index.php/Slicer3:Registration</a>.\n\nThe following is a brief overview of the main and auxiliary modules Slicer has to offer for image registration. Most modules are generic and can handle any image content, but a few are designed specifically for brain images."
        aboutText = "This work is supported by NA-MIC, NAC, Harvard Catalyst, NCIGT, and the Slicer Community. See http://www.slicer.org for details.  Module implemented by Wendy Plesniak and Steve Pieper."
        self.BuildHelpAndAboutFrame(pageWidget, helpText, aboutText)

        moduleFrame = slicer.vtkSlicerModuleCollapsibleFrame()
        moduleFrame.SetParent(
            self.GetUIPanel().GetPageWidget("RegistrationWelcome"))
        moduleFrame.Create()
        moduleFrame.SetLabelText("RegistrationWelcome")
        moduleFrame.ExpandFrame()
        widgetName = moduleFrame.GetWidgetName()
        pageWidgetName = self.GetUIPanel().GetPageWidget(
            "RegistrationWelcome").GetWidgetName()
        slicer.TkCall(
            "pack %s -side top -anchor nw -fill x -padx 2 -pady 2 -in %s" %
            (widgetName, pageWidgetName))

        text = slicer.vtkKWTextWithHyperlinksWithScrollbars()
        text.SetParent(moduleFrame.GetFrame())
        text.Create()
        text.SetHorizontalScrollbarVisibility(0)
        text.GetWidget().SetReliefToFlat()
        text.GetWidget().SetWrapToWord()
        text.GetWidget().QuickFormattingOn()
        text.GetWidget().SetHeight(35)
        text.SetText(
            """This module provides a quick guide for choosing the registration option most optimal for your task. More detailed information can be found on Slicer's wiki: <a>http://www.slicer.org/slicerWiki/index.php/Slicer3:Registration</a>.\n\nThe following is a brief overview of the main and auxiliary modules Slicer has to offer for image registration. Most modules are generic and can handle any image content, but a few are designed specifically for brain images. Slicer modules are listed below by category:\n\n

**FAST REGISTRATION**\n\n

**  Transforms:** The Transformations module creates and edits slicer Transform nodes. Transformation nodes are used in Slicer to define spacial relationships between different nodes (such as volumes, models, fiducials, ROI's, or other Transform nodes) or between the nodes and the global RAS space. You can establish these relations by dragging the nodes under the Transformation nodes in the Data module. \n

**  Fast Affine Registration:** This module implements a registration algorithm based on the Mattes mutual information registration metric and the affine transformation. Both the fixed and moving images may be optionally smoothed before registration. \n

**  Fast Rigid Registration:** This module implements a registration algorithm based on the Mattes mutual information registration metric. The transformation mapping the moving image to the fixed image consists of 3 translations and 3 rotations. Thus, only rigid body transformations are permitted. Both the fixed and moving images may be optionally smoothed before registration. The module optionally breaks the optimization into multiple stages, each with a different learning rate and number of iterations. \n

**  Fast Nonrigid Registration:** This module performs non-rigid alignment/registration of two volumes based on a B-spline interpolation scheme, driven by points on a (cubic) control grid. The number of points on the grid is expected to be low to obtain a fast and feasible solution. Output consists in a transform node and/or resampled target volume. For finer grids a scale-space approach of multiple runs with gradually increasing grid size is recommended. Note that non-rigid transforms as produced here are not available for instant view in the data module in the way linear transforms are, i.e. moving a new volume under a B-spline transform in the Data/MRML tree will not show an effect in the views. To see the result the volume must be resampled, using the ResampleScalarVectorDWIVolume module. \n

**ROBUST REGISTRATION**\n\n

**  Expert Automated Registration:** This module is an integrated framework providing access to ITK registration technologies. Algorithms can be run in single mode or pipelined. Depending on the size of the data sets, a significant amount of memory is needed. There is an option to trade off speed for memory. Most of the code is parallelized and will take advantage of multicore capabilities, if available. \n

**  Robust Multiresolution Affine Registration:** This module implements mutual information based affine registration using a multi-resolution optimization strategy. Several parts of the algorithm are based on a description of the FLIRT algorithm, see the Reference section. \n

**  BRAINSDemoWarp:** BRAINSDemonWarp is a command line program for image registration by using different methods including Thirion and diffeomorphic demons algorithms. The function takes in a template image and a target image along with other optional parameters and registers the template image onto the target image. The resultant deformation fields and metric values can be written to a file. The program uses the Insight Toolkit (www.ITK.org) for all the computations, and can operate on any of the image types supported by that library. \n

**  BRAINSFit:** \n

**  BRAINSResample:** \n

**BRAIN-ONLY REGISTRATION**\n\n

**  ACPC Transform:** The ACPC Transform Module is used to orient brain images along predefined anatomical landmarks: (manually defined) fiducials for the inter-hemispheral midline, anterior- and posterior commissure are used to align an image such that these landmarks become vertical and horizontal, respectively. This transformation can then be applied to a volume using the Resample Scalar/Vector/DWI Volume module. **Note: renamed from RealignVolume**. \n

**NON-RASTER-IMAGE DATA REGISTRATION**\n\n

**  Fiducial Registration:** The Fiducial Alignment Module can align images based on pairs of manually selected fiducial points (rigid and affine). Two sets of fiducials (fiducial lists) are required, forming matching pairs to be aligned. The transform can either be translation only, rigid transform, or similarity transform. \n

**  Surface Registration: ** The ICP Surface Registration Module performs automated registration of surfaces (not images) using the Iterative Closest Point algorithm using rigid, similarity and affine transforms. This is useful if image data directly is unreliable, but surfaces can be produced from segmentations that provide good information about desired alignment. \n """
        )

        # Important that Read only after SetText otherwise it doesn't work
        text.GetWidget().ReadOnlyOn()
        slicer.TkCall("pack %s -side top -anchor nw -fill x -padx 2 -pady 2" %
                      text.GetWidgetName())
コード例 #14
0
    def BuildGUI(self):
        SlicerVMTKAdvancedPageSkeleton.BuildGUI(self)


        self._numberOfSigmaSteps.SetParent(self._parentFrame)
        self._numberOfSigmaSteps.Create()
        self._numberOfSigmaSteps.SetRange(0.0,2000.0)
        self._numberOfSigmaSteps.ClampMinimumValueOn()
        self._numberOfSigmaSteps.ClampMaximumValueOn()
        self._numberOfSigmaSteps.ClampResolutionOn()
        self._numberOfSigmaSteps.SetThumbWheelHeight(10)
        self._numberOfSigmaSteps.SetResolution(1.0)
        self._numberOfSigmaSteps.SetLength(150)
        self._numberOfSigmaSteps.DisplayEntryOn()
        self._numberOfSigmaSteps.DisplayLabelOn()
        self._numberOfSigmaSteps.GetLabel().SetText("Number of Sigma Steps")


        slicer.TkCall("pack %s -side top -expand y -padx 2 -pady 10" % self._numberOfSigmaSteps.GetWidgetName())
        
        self._numberOfIterations.SetParent(self._parentFrame)
        self._numberOfIterations.Create()
        self._numberOfIterations.SetRange(0.0,2000.0)
        self._numberOfIterations.ClampMinimumValueOn()
        self._numberOfIterations.ClampMaximumValueOn()
        self._numberOfIterations.ClampResolutionOn()
        self._numberOfIterations.SetThumbWheelHeight(10)
        self._numberOfIterations.SetResolution(1.0)
        self._numberOfIterations.SetLength(150)
        self._numberOfIterations.DisplayEntryOn()
        self._numberOfIterations.DisplayLabelOn()
        self._numberOfIterations.GetLabel().SetText("Number of Iterations")


        slicer.TkCall("pack %s -side top -expand y -padx 2 -pady 10" % self._numberOfIterations.GetWidgetName())

        self._numberOfDiffusionSubIterations.SetParent(self._parentFrame)
        self._numberOfDiffusionSubIterations.Create()
        self._numberOfDiffusionSubIterations.SetRange(0.0,2000.0)
        self._numberOfDiffusionSubIterations.ClampMinimumValueOn()
        self._numberOfDiffusionSubIterations.ClampMaximumValueOn()
        self._numberOfDiffusionSubIterations.ClampResolutionOn()
        self._numberOfDiffusionSubIterations.SetThumbWheelHeight(10)
        self._numberOfDiffusionSubIterations.SetResolution(1.0)
        self._numberOfDiffusionSubIterations.SetLength(150)
        self._numberOfDiffusionSubIterations.DisplayEntryOn()
        self._numberOfDiffusionSubIterations.DisplayLabelOn()
        self._numberOfDiffusionSubIterations.GetLabel().SetText("Number of Diffusion Sub Iterations")


        slicer.TkCall("pack %s -side top -expand y -padx 2 -pady 10" % self._numberOfDiffusionSubIterations.GetWidgetName())

        self._spinboxFrame.SetParent(self._parentFrame)
        self._spinboxFrame.Create()
        self._spinboxFrame.AllowFrameToCollapseOff()
        self._spinboxFrame.SetLabelText("Input arguments")
        self._spinboxFrame.SetReliefToSunken()    

        slicer.TkCall("pack %s -side top -expand y -padx 2 -pady 10 -in %s" % (self._spinboxFrame.GetWidgetName(), self._parentFrame.GetWidgetName()))
        
        self._sigmaMin.SetParent(self._spinboxFrame.GetFrame())
        self._sigmaMin.Create()
        self._sigmaMin.GetWidget().SetRange(0.0,100.0)
        self._sigmaMin.GetWidget().SetIncrement(0.1)
        self._sigmaMin.GetWidget().SetWidth(5)
        self._sigmaMin.GetWidget().SetValueFormat("%.1f")
        self._sigmaMin.SetLabelText("Sigma Min:")
        self._sigmaMin.SetBalloonHelpString("")

        slicer.TkCall("pack %s -side top -anchor e -expand y -padx 2 -pady 2" % self._sigmaMin.GetWidgetName())
        
        self._sigmaMax.SetParent(self._spinboxFrame.GetFrame())
        self._sigmaMax.Create()
        self._sigmaMax.GetWidget().SetRange(0.0,100.0)
        self._sigmaMax.GetWidget().SetIncrement(0.1)
        self._sigmaMax.GetWidget().SetWidth(5)
        self._sigmaMax.GetWidget().SetValueFormat("%.1f")
        self._sigmaMax.SetLabelText("Sigma Max:")
        self._sigmaMax.SetBalloonHelpString("")

        slicer.TkCall("pack %s -side top -anchor e -expand y -padx 2 -pady 2" % self._sigmaMax.GetWidgetName())

        self._alpha.SetParent(self._spinboxFrame.GetFrame())
        self._alpha.Create()
        self._alpha.GetWidget().SetRange(0.0,100.0)
        self._alpha.GetWidget().SetIncrement(0.1)
        self._alpha.GetWidget().SetWidth(5)
        self._alpha.GetWidget().SetValueFormat("%.1f")
        self._alpha.SetLabelText("Alpha:")
        self._alpha.SetBalloonHelpString("")

        slicer.TkCall("pack %s -side top -anchor e -expand y -padx 2 -pady 2" % self._alpha.GetWidgetName())

        self._beta.SetParent(self._spinboxFrame.GetFrame())
        self._beta.Create()
        self._beta.GetWidget().SetRange(0.0,100.0)
        self._beta.GetWidget().SetIncrement(0.1)
        self._beta.GetWidget().SetWidth(5)
        self._beta.GetWidget().SetValueFormat("%.1f")
        self._beta.SetLabelText("Beta:")
        self._beta.SetBalloonHelpString("")

        slicer.TkCall("pack %s -side top -anchor e -expand y -padx 2 -pady 2" % self._beta.GetWidgetName())

        self._gamma.SetParent(self._spinboxFrame.GetFrame())
        self._gamma.Create()
        self._gamma.GetWidget().SetRange(0.0,100.0)
        self._gamma.GetWidget().SetIncrement(0.1)
        self._gamma.GetWidget().SetWidth(5)
        self._gamma.GetWidget().SetValueFormat("%.1f")
        self._gamma.SetLabelText("Gamma:")
        self._gamma.SetBalloonHelpString("")

        slicer.TkCall("pack %s -side top -anchor e -expand y -padx 2 -pady 2" % self._gamma.GetWidgetName())

        self._timestep.SetParent(self._spinboxFrame.GetFrame())
        self._timestep.Create()
        self._timestep.GetWidget().SetRange(0.0,100.0)
        self._timestep.GetWidget().SetIncrement(0.01)
        self._timestep.GetWidget().SetWidth(5)
        self._timestep.GetWidget().SetValueFormat("%.2f")
        self._timestep.SetLabelText("Timestep:")
        self._timestep.SetBalloonHelpString("")

        slicer.TkCall("pack %s -side top -anchor e -expand y -padx 2 -pady 2" % self._timestep.GetWidgetName())

        self._epsilon.SetParent(self._spinboxFrame.GetFrame())
        self._epsilon.Create()
        self._epsilon.GetWidget().SetRange(0.0,100.0)
        self._epsilon.GetWidget().SetIncrement(0.01)
        self._epsilon.GetWidget().SetWidth(5)
        self._epsilon.GetWidget().SetValueFormat("%.2f")
        self._epsilon.SetLabelText("Epsilon:")
        self._epsilon.SetBalloonHelpString("")

        slicer.TkCall("pack %s -side top -anchor e -expand y -padx 2 -pady 2" % self._epsilon.GetWidgetName())

        self._wstrength.SetParent(self._spinboxFrame.GetFrame())
        self._wstrength.Create()
        self._wstrength.GetWidget().SetRange(0.0,100.0)
        self._wstrength.GetWidget().SetIncrement(0.1)
        self._wstrength.GetWidget().SetWidth(5)
        self._wstrength.GetWidget().SetValueFormat("%.1f")
        self._wstrength.SetLabelText("WStrength:")
        self._wstrength.SetBalloonHelpString("")

        slicer.TkCall("pack %s -side top -anchor e -expand y -padx 2 -pady 2" % self._wstrength.GetWidgetName())

        self._sensitivity.SetParent(self._spinboxFrame.GetFrame())
        self._sensitivity.Create()
        self._sensitivity.GetWidget().SetRange(0.0,100.0)
        self._sensitivity.GetWidget().SetIncrement(0.1)
        self._sensitivity.GetWidget().SetWidth(5)
        self._sensitivity.GetWidget().SetValueFormat("%.1f")
        self._sensitivity.SetLabelText("Sensitivity:")
        self._sensitivity.SetBalloonHelpString("")

        slicer.TkCall("pack %s -side top -anchor e -expand y -padx 2 -pady 2" % self._sensitivity.GetWidgetName())

        self._startButton.SetParent(self._parentFrame)
        self._startButton.Create()
        self._startButton.SetText("Start!")
        self._startButton.SetWidth(8)
        self._startButton.SetBalloonHelpString("Click to start")

        slicer.TkCall("pack %s -side top -anchor e -expand y -padx 2 -pady 2" % self._startButton.GetWidgetName())

        self.Reset()
コード例 #15
0
    def BuildGUI(self):

        self.GetUIPanel().AddPage("Centerlines", "Centerlines", "")
        self._centerlinePage = self.GetUIPanel().GetPageWidget("Centerlines")
        helpText = "**Centerline computation using VMTK**, developed by Daniel Haehn.\n\nAttention: This module needs the VMTK libraries which are available inside the VmtkSlicerModule extension.\n\nDocumentation and Tutorials are available at: <a>http://wiki.slicer.org/slicerWiki/index.php/Modules:VMTKCenterlines</a>\n\n**Instructions**\n1. Select the input model.\n2. Now prepare the model. Create a new output model node and click 'Prepare'. The model turns green.\n3. Place fiducials for the source and target points of the centerlines in the 3D window. One source and several target seeds are possible. The placement does not have to be exact. Create new output models for the Centerline and the Voronoi diagram. Click 'Get Centerlines!'.\n\n\nThe extracted centerlines can be exported using the export panel. Export details includes the maximum inscribed sphere radius (a.k.a. the vessel width for each centerline point)."
        aboutText = "This work is supported by NA-MIC, NAC, BIRN, NCIGT, and the Slicer Community. See http://www.slicer.org for details."
        self._helpAboutFrame = self.BuildHelpAndAboutFrame(
            self._centerlinePage, helpText, aboutText)

        self._helper.debug("Creating Centerlines GUI")

        self._moduleFrame.SetParent(self._centerlinePage)
        self._moduleFrame.Create()
        self._moduleFrame.SetLabelText("VMTKCenterlines")
        self._moduleFrame.ExpandFrame()
        slicer.TkCall(
            "pack %s -side top -anchor nw -fill x -padx 2 -pady 2 -in %s" %
            (self._moduleFrame.GetWidgetName(),
             self._centerlinePage.GetWidgetName()))

        self._topFrame.SetParent(self._moduleFrame.GetFrame())
        self._topFrame.Create()
        self._topFrame.SetLabelText("Input")
        self._topFrame.ExpandFrame()
        slicer.TkCall("pack %s -side top -anchor nw -fill x -padx 2 -pady 2" %
                      self._topFrame.GetWidgetName())

        self._inModelSelector.SetNodeClass("vtkMRMLModelNode", "", "", "")
        self._inModelSelector.SetParent(self._topFrame.GetFrame())
        self._inModelSelector.Create()
        self._inModelSelector.SetMRMLScene(self.GetLogic().GetMRMLScene())
        self._inModelSelector.UpdateMenu()
        self._inModelSelector.SetBorderWidth(2)
        self._inModelSelector.SetLabelText("Input Model: ")
        self._inModelSelector.SetBalloonHelpString(
            "select an input model from the current mrml scene.")
        slicer.TkCall("pack %s -side top -anchor e -padx 20 -pady 4" %
                      self._inModelSelector.GetWidgetName())

        self._sndFrame.SetParent(self._moduleFrame.GetFrame())
        self._sndFrame.Create()
        self._sndFrame.SetLabelText("1. Preparation Step")
        self._sndFrame.ExpandFrame()
        slicer.TkCall("pack %s -side top -anchor nw -fill x -padx 2 -pady 2" %
                      self._sndFrame.GetWidgetName())

        self._outModelPrepSelector.SetNodeClass("vtkMRMLModelNode", "", "1",
                                                "VMTKCenterlinesPrepOut")
        self._outModelPrepSelector.SetNewNodeEnabled(1)
        self._outModelPrepSelector.SetParent(self._sndFrame.GetFrame())
        self._outModelPrepSelector.Create()
        self._outModelPrepSelector.SetMRMLScene(self.GetLogic().GetMRMLScene())
        self._outModelPrepSelector.UpdateMenu()
        self._outModelPrepSelector.SetBorderWidth(2)
        self._outModelPrepSelector.SetLabelText(
            "Preparation Step Output Model: ")
        self._outModelPrepSelector.SetBalloonHelpString(
            "select an output volume from the current mrml scene.")
        slicer.TkCall("pack %s -side top -anchor e -padx 20 -pady 4" %
                      self._outModelPrepSelector.GetWidgetName())

        self._prepButton.SetParent(self._sndFrame.GetFrame())
        self._prepButton.Create()
        self._prepButton.SetEnabled(1)
        self._prepButton.SetText("Prepare Model!")
        self._prepButton.SetBalloonHelpString(
            "Click to start the model preparation")
        slicer.TkCall("pack %s -side top -anchor e -padx 2 -pady 2" %
                      self._prepButton.GetWidgetName())

        self._thirdFrame.SetParent(self._moduleFrame.GetFrame())
        self._thirdFrame.Create()
        self._thirdFrame.SetLabelText("2. Centerlines Computation")
        self._thirdFrame.ExpandFrame()
        slicer.TkCall("pack %s -side top -anchor nw -fill x -padx 2 -pady 2" %
                      self._thirdFrame.GetWidgetName())

        self._seedsSelector.SetNodeClass("vtkMRMLFiducialListNode", "", "",
                                         "Seeds")
        self._seedsSelector.SetParent(self._thirdFrame.GetFrame())
        self._seedsSelector.Create()
        self._seedsSelector.SetMRMLScene(self.GetLogic().GetMRMLScene())
        self._seedsSelector.UpdateMenu()
        self._seedsSelector.SetNewNodeEnabled(1)
        self._seedsSelector.SetBorderWidth(2)
        self._seedsSelector.SetLabelText("Source Seeds: ")
        self._seedsSelector.SetBalloonHelpString("select a fiducial list")
        slicer.TkCall("pack %s -side top -anchor e -padx 20 -pady 4" %
                      self._seedsSelector.GetWidgetName())

        self._targetSeedsSelector.SetNodeClass("vtkMRMLFiducialListNode", "",
                                               "", "Targets")
        self._targetSeedsSelector.SetParent(self._thirdFrame.GetFrame())
        self._targetSeedsSelector.Create()
        self._targetSeedsSelector.SetMRMLScene(self.GetLogic().GetMRMLScene())
        self._targetSeedsSelector.UpdateMenu()
        self._targetSeedsSelector.SetNewNodeEnabled(1)
        self._targetSeedsSelector.SetBorderWidth(2)
        self._targetSeedsSelector.SetLabelText("Target Seeds: ")
        self._targetSeedsSelector.SetBalloonHelpString(
            "select a fiducial list")
        slicer.TkCall("pack %s -side top -anchor e -padx 20 -pady 4" %
                      self._targetSeedsSelector.GetWidgetName())

        self._outModelSelector.SetNodeClass("vtkMRMLModelNode", "", "1",
                                            "VMTKCenterlinesOut")
        self._outModelSelector.SetNewNodeEnabled(1)
        self._outModelSelector.SetParent(self._thirdFrame.GetFrame())
        self._outModelSelector.Create()
        self._outModelSelector.SetMRMLScene(self.GetLogic().GetMRMLScene())
        self._outModelSelector.UpdateMenu()
        self._outModelSelector.SetBorderWidth(2)
        self._outModelSelector.SetLabelText("Centerlines Output Model: ")
        self._outModelSelector.SetBalloonHelpString(
            "select an output model from the current mrml scene.")
        slicer.TkCall("pack %s -side top -anchor e -padx 20 -pady 4" %
                      self._outModelSelector.GetWidgetName())

        self._outVSelector.SetNodeClass("vtkMRMLModelNode", "", "1",
                                        "VMTKVoronoiOut")
        self._outVSelector.SetNewNodeEnabled(1)
        self._outVSelector.SetParent(self._thirdFrame.GetFrame())
        self._outVSelector.Create()
        self._outVSelector.SetMRMLScene(self.GetLogic().GetMRMLScene())
        self._outVSelector.UpdateMenu()
        self._outVSelector.SetBorderWidth(2)
        self._outVSelector.SetLabelText("Voronoi Diagram: ")
        self._outVSelector.SetBalloonHelpString(
            "select an output model from the current mrml scene.")
        slicer.TkCall("pack %s -side top -anchor e -padx 20 -pady 4" %
                      self._outVSelector.GetWidgetName())

        self._startButton.SetParent(self._thirdFrame.GetFrame())
        self._startButton.Create()
        self._startButton.SetEnabled(1)
        self._startButton.SetText("Get Centerlines!")
        self._startButton.SetBalloonHelpString(
            "Click to start the centerline computation")
        slicer.TkCall("pack %s -side top -anchor e -padx 2 -pady 2" %
                      self._startButton.GetWidgetName())

        self._sndFrameb.SetParent(self._moduleFrame.GetFrame())
        self._sndFrameb.Create()
        self._sndFrameb.SetLabelText("3. Convert to Fiducial List")
        self._sndFrameb.CollapseFrame()
        slicer.TkCall("pack %s -side top -anchor nw -fill x -padx 2 -pady 2" %
                      self._sndFrameb.GetWidgetName())

        self._fiducialSelector.SetNodeClass("vtkMRMLFiducialListNode", "", "",
                                            "Centerlines")
        self._fiducialSelector.SetParent(self._sndFrameb.GetFrame())
        self._fiducialSelector.Create()
        self._fiducialSelector.SetMRMLScene(self.GetLogic().GetMRMLScene())
        self._fiducialSelector.UpdateMenu()
        self._fiducialSelector.SetNewNodeEnabled(1)
        self._fiducialSelector.SetBorderWidth(2)
        self._fiducialSelector.SetLabelText("Output Fiducial List: ")
        self._fiducialSelector.SetBalloonHelpString("select a fiducial list")
        slicer.TkCall("pack %s -side top -anchor e -padx 20 -pady 4" %
                      self._fiducialSelector.GetWidgetName())

        self._fidDensity.SetParent(self._sndFrameb.GetFrame())
        self._fidDensity.Create()
        self._fidDensity.GetWidget().SetRange(1, 1000)
        self._fidDensity.GetWidget().SetIncrement(10)
        self._fidDensity.GetWidget().SetRestrictValueToInteger()
        self._fidDensity.GetWidget().SetValue(50)
        self._fidDensity.GetWidget().SetWidth(5)
        self._fidDensity.SetLabelText(
            "Points between each fiducial placement:")
        self._fidDensity.SetBalloonHelpString(
            "place fiducials every number of points entered")
        slicer.TkCall("pack %s -side top -anchor e -padx 20 -pady 2" %
                      self._fidDensity.GetWidgetName())

        self._fidButton.SetParent(self._sndFrameb.GetFrame())
        self._fidButton.Create()
        self._fidButton.SetText("Convert")
        self._fidButton.SetBalloonHelpString(
            "Click to convert the centerline to a fiducial list")
        slicer.TkCall("pack %s -side top -anchor e -padx 2 -pady 2" %
                      self._fidButton.GetWidgetName())

        self._fourthFrame.SetParent(self._moduleFrame.GetFrame())
        self._fourthFrame.Create()
        self._fourthFrame.SetLabelText("4. Export to file")
        self._fourthFrame.CollapseFrame()
        slicer.TkCall("pack %s -side top -anchor nw -fill x -padx 2 -pady 2" %
                      self._fourthFrame.GetWidgetName())

        self._exportHeaders.SetParent(self._fourthFrame.GetFrame())
        self._exportHeaders.Create()
        self._exportHeaders.SetText("Add description headers")
        slicer.TkCall("pack %s -side top -anchor w -padx 2 -pady 2" %
                      self._exportHeaders.GetWidgetName())

        self._exportNifti.SetParent(self._fourthFrame.GetFrame())
        self._exportNifti.Create()
        self._exportNifti.SetText("Invert coordinates (IJK<->NIFTI)")
        slicer.TkCall("pack %s -side top -anchor w -padx 2 -pady 2" %
                      self._exportNifti.GetWidgetName())

        self._exportDetails.SetParent(self._fourthFrame.GetFrame())
        self._exportDetails.Create()
        self._exportDetails.SetText("Export details")
        slicer.TkCall("pack %s -side top -anchor w -padx 2 -pady 2" %
                      self._exportDetails.GetWidgetName())

        self._saveButton.SetParent(self._fourthFrame.GetFrame())
        self._saveButton.Create()
        self._saveButton.SetText("Select file..")
        self._saveButton.GetLoadSaveDialog().SaveDialogOn()
        slicer.TkCall("pack %s -side top -anchor w -padx 2 -pady 2" %
                      self._saveButton.GetWidgetName())

        self._exportButton.SetParent(self._fourthFrame.GetFrame())
        self._exportButton.Create()
        self._exportButton.SetEnabled(1)
        self._exportButton.SetText("Export!")
        self._exportButton.SetBalloonHelpString("Click to export")
        slicer.TkCall("pack %s -side top -anchor e -padx 2 -pady 2" %
                      self._exportButton.GetWidgetName())

        self._fifthFrame.SetParent(self._moduleFrame.GetFrame())
        self._fifthFrame.Create()
        self._fifthFrame.SetLabelText("5. Import from file")
        self._fifthFrame.CollapseFrame()
        slicer.TkCall("pack %s -side top -anchor nw -fill x -padx 2 -pady 2" %
                      self._fifthFrame.GetWidgetName())

        self._loadButton.SetParent(self._fifthFrame.GetFrame())
        self._loadButton.Create()
        self._loadButton.SetText("Select file..")
        self._loadButton.GetLoadSaveDialog().SaveDialogOff()
        slicer.TkCall("pack %s -side top -anchor w -padx 2 -pady 2" %
                      self._loadButton.GetWidgetName())

        self._importHeaders.SetParent(self._fifthFrame.GetFrame())
        self._importHeaders.Create()
        self._importHeaders.SetText("Strip headers")
        slicer.TkCall("pack %s -side top -anchor w -padx 2 -pady 2" %
                      self._importHeaders.GetWidgetName())

        self._importNifti.SetParent(self._fifthFrame.GetFrame())
        self._importNifti.Create()
        self._importNifti.SetText("Invert coordinates (IJK<->NIFTI)")
        slicer.TkCall("pack %s -side top -anchor w -padx 2 -pady 2" %
                      self._importNifti.GetWidgetName())

        self._importModelSelector.SetNodeClass("vtkMRMLModelNode", "", "1",
                                               "VMTKCenterlinesImport")
        self._importModelSelector.SetNewNodeEnabled(1)
        self._importModelSelector.SetParent(self._fifthFrame.GetFrame())
        self._importModelSelector.Create()
        self._importModelSelector.SetMRMLScene(self.GetLogic().GetMRMLScene())
        self._importModelSelector.UpdateMenu()
        self._importModelSelector.SetBorderWidth(2)
        self._importModelSelector.SetLabelText("Imported Model Output: ")
        self._importModelSelector.SetBalloonHelpString(
            "select an output model from the current mrml scene.")
        slicer.TkCall("pack %s -side top -anchor e -padx 20 -pady 4" %
                      self._importModelSelector.GetWidgetName())

        self._importButton.SetParent(self._fifthFrame.GetFrame())
        self._importButton.Create()
        self._importButton.SetEnabled(1)
        self._importButton.SetText("Import!")
        self._importButton.SetBalloonHelpString("Click to import")
        slicer.TkCall("pack %s -side top -anchor e -padx 2 -pady 2" %
                      self._importButton.GetWidgetName())

        #self.CreateOutModelNodes()

        self._helper.debug("Done Creating Centerlines GUI")
コード例 #16
0
    def BuildGUI(self):
        SlicerVMTKAdvancedPageSkeleton.BuildGUI(self)


        
        self._spinboxFrame.SetParent(self._parentFrame)
        self._spinboxFrame.Create()
        self._spinboxFrame.AllowFrameToCollapseOff()
        self._spinboxFrame.SetLabelText("Tubular structure detection:")
        self._spinboxFrame.SetReliefToSunken()    

        slicer.TkCall("pack %s -side top -expand y -padx 2 -pady 10 -in %s" % (self._spinboxFrame.GetWidgetName(), self._parentFrame.GetWidgetName()))
        
        self._numberOfSigmaSteps.SetParent(self._spinboxFrame.GetFrame())
        self._numberOfSigmaSteps.Create()
        self._numberOfSigmaSteps.SetRange(0.0,2000.0)
        self._numberOfSigmaSteps.ClampMinimumValueOn()
        self._numberOfSigmaSteps.ClampMaximumValueOn()
        self._numberOfSigmaSteps.ClampResolutionOn()
        self._numberOfSigmaSteps.SetThumbWheelHeight(10)
        self._numberOfSigmaSteps.SetResolution(1.0)
        self._numberOfSigmaSteps.SetLength(150)
        self._numberOfSigmaSteps.DisplayEntryOn()
        self._numberOfSigmaSteps.DisplayLabelOn()
        self._numberOfSigmaSteps.GetLabel().SetText("Steps between min. and max. Diameter")
        self._numberOfSigmaSteps.SetBalloonHelpString("The discretization rate between min. and max. Diameter")

        slicer.TkCall("pack %s -side top -expand y -padx 2 -pady 10" % self._numberOfSigmaSteps.GetWidgetName())

        self._sigmaUnit.SetParent(self._spinboxFrame.GetFrame())
        self._sigmaUnit.Create()
        self._sigmaUnit.SetLabelText("Diameter specification")
        v = self._sigmaUnit.GetWidget().AddWidget(0)
        v.SetText("Physical Unit (e.g. [mm])")
        v = self._sigmaUnit.GetWidget().AddWidget(1)
        v.SetText("Voxel")

        self._sigmaUnit.GetWidget().GetWidget(0).SetSelectedState(1)

        slicer.TkCall("pack %s -side top -anchor w -expand y -padx 2 -pady 2" % self._sigmaUnit.GetWidgetName())

        self._sigmaMin.SetParent(self._spinboxFrame.GetFrame())
        self._sigmaMin.Create()
        self._sigmaMin.GetWidget().SetRange(0.0,100.0)
        self._sigmaMin.GetWidget().SetIncrement(0.1)
        self._sigmaMin.GetWidget().SetWidth(5)
        self._sigmaMin.GetWidget().SetValueFormat("%.1f")
        self._sigmaMin.SetLabelText("Min. Diameter of the Tube:")
        self._sigmaMin.SetBalloonHelpString("Select the minimal diameter of tubes to enhance.")

        slicer.TkCall("pack %s -side top -anchor e -expand y -padx 2 -pady 2" % self._sigmaMin.GetWidgetName())
        
        self._sigmaMax.SetParent(self._spinboxFrame.GetFrame())
        self._sigmaMax.Create()
        self._sigmaMax.GetWidget().SetRange(0.0,100.0)
        self._sigmaMax.GetWidget().SetIncrement(0.1)
        self._sigmaMax.GetWidget().SetWidth(5)
        self._sigmaMax.GetWidget().SetValueFormat("%.1f")
        self._sigmaMax.SetLabelText("Max. Diameter of the Tube:")
        self._sigmaMax.SetBalloonHelpString("Select the maximal diameter of tubes to enhance.")

        slicer.TkCall("pack %s -side top -anchor e -expand y -padx 2 -pady 2" % self._sigmaMax.GetWidgetName())

        self._thrFrame.SetParent(self._parentFrame)
        self._thrFrame.Create()
        self._thrFrame.AllowFrameToCollapseOff()
        self._thrFrame.SetLabelText("Sensitivity Thresholds:")
        self._thrFrame.SetReliefToSunken()    

        slicer.TkCall("pack %s -side top -expand y -padx 2 -pady 10 -in %s" % (self._thrFrame.GetWidgetName(), self._parentFrame.GetWidgetName()))
        

        self._alpha.SetParent(self._thrFrame.GetFrame())
        self._alpha.Create()
        self._alpha.GetWidget().SetRange(0.0,100.0)
        self._alpha.GetWidget().SetIncrement(0.1)
        self._alpha.GetWidget().SetWidth(5)
        self._alpha.GetWidget().SetValueFormat("%.1f")
        self._alpha.SetLabelText("Plate-like and line-like structures:")
        self._alpha.SetBalloonHelpString("This controls the sensitivity for plate-like and line-like structures.")

        slicer.TkCall("pack %s -side top -anchor e -expand y -padx 2 -pady 2" % self._alpha.GetWidgetName())


        self._alpha2.SetParent(self._thrFrame.GetFrame())
        self._alpha2.Create()
        self._alpha2.GetWidget().SetRange(0.0,100.0)
        self._alpha2.GetWidget().SetIncrement(0.1)
        self._alpha2.GetWidget().SetWidth(5)
        self._alpha2.GetWidget().SetValueFormat("%.1f")
        self._alpha2.SetLabelText("Blob-like structures:")
        self._alpha2.SetBalloonHelpString("This controls the sensitivity for blob-like structures.")

        slicer.TkCall("pack %s -side top -anchor e -expand y -padx 2 -pady 2" % self._alpha2.GetWidgetName())

        self._startButton.SetParent(self._parentFrame)
        self._startButton.Create()
        self._startButton.SetText("Start!")
        self._startButton.SetWidth(8)
        self._startButton.SetBalloonHelpString("Click to start")

        slicer.TkCall("pack %s -side top -anchor e -expand y -padx 2 -pady 2" % self._startButton.GetWidgetName())

        self.Reset()
コード例 #17
0
    def BuildGUI(self):
        SlicerVMTKAdvancedPageSkeleton.BuildGUI(self)

        self._iterationsThumbwheel.SetParent(self._parentFrame)
        self._iterationsThumbwheel.Create()
        self._iterationsThumbwheel.SetRange(0.0,2000.0)
        self._iterationsThumbwheel.ClampMinimumValueOn()
        self._iterationsThumbwheel.ClampMaximumValueOn()
        self._iterationsThumbwheel.ClampResolutionOn()
        self._iterationsThumbwheel.SetThumbWheelHeight(10)
        self._iterationsThumbwheel.SetResolution(1.0)
        self._iterationsThumbwheel.SetLength(150)
        self._iterationsThumbwheel.DisplayEntryOn()
        self._iterationsThumbwheel.DisplayLabelOn()
        #self._iterationsThumbwheel.DisplayEntryAndLabelOnTopOff()
        self._iterationsThumbwheel.GetLabel().SetText("Number of iterations")

        slicer.TkCall("pack %s -side top -expand y -padx 2 -pady 10" % self._iterationsThumbwheel.GetWidgetName())
        
        self._weightsFrame.SetParent(self._parentFrame)
        self._weightsFrame.Create()
        self._weightsFrame.AllowFrameToCollapseOff()
        self._weightsFrame.SetLabelText("Scaling weights:")
        self._weightsFrame.SetReliefToSunken()    

        slicer.TkCall("pack %s -side top -expand y -padx 2 -pady 10 -in %s" % (self._weightsFrame.GetWidgetName(), self._parentFrame.GetWidgetName()))
        
        self._propagationScalingSpinBox.SetParent(self._weightsFrame.GetFrame())
        self._propagationScalingSpinBox.Create()
        self._propagationScalingSpinBox.GetWidget().SetRange(0.0,10.0)
        self._propagationScalingSpinBox.GetWidget().SetIncrement(0.1)
        self._propagationScalingSpinBox.GetWidget().SetWidth(5)
        self._propagationScalingSpinBox.GetWidget().SetValueFormat("%.1f")
        self._propagationScalingSpinBox.SetLabelText("Propagation scaling:")
        self._propagationScalingSpinBox.SetBalloonHelpString("Propagation scaling is the weight you assign to model inflation.")

        slicer.TkCall("pack %s -side top -anchor e -expand y -padx 2 -pady 2" % self._propagationScalingSpinBox.GetWidgetName())
        
        self._curvatureScalingSpinBox.SetParent(self._weightsFrame.GetFrame())
        self._curvatureScalingSpinBox.Create()
        self._curvatureScalingSpinBox.GetWidget().SetRange(0.0,10.0)
        self._curvatureScalingSpinBox.GetWidget().SetIncrement(0.1)
        self._curvatureScalingSpinBox.GetWidget().SetWidth(5)
        self._curvatureScalingSpinBox.GetWidget().SetValueFormat("%.1f")
        self._curvatureScalingSpinBox.SetLabelText("Curvature scaling:")
        self._curvatureScalingSpinBox.SetBalloonHelpString("Curvature scaling is the weight you assign to model surface regularization (this will eventually make the model collapse and vanish if it's too strong)")

        slicer.TkCall("pack %s -side top -anchor e -expand y -padx 2 -pady 2" % self._curvatureScalingSpinBox.GetWidgetName())

        self._advectionScalingSpinBox.SetParent(self._weightsFrame.GetFrame())
        self._advectionScalingSpinBox.Create()
        self._advectionScalingSpinBox.GetWidget().SetRange(0.0,10.0)
        self._advectionScalingSpinBox.GetWidget().SetIncrement(0.1)
        self._advectionScalingSpinBox.GetWidget().SetWidth(5)
        self._advectionScalingSpinBox.GetWidget().SetValueFormat("%.1f")
        self._advectionScalingSpinBox.SetLabelText("Advection scaling:")
        self._advectionScalingSpinBox.SetBalloonHelpString("Advection scaling is the most important weight. It regulates the attraction of the surface of the image gradient modulus ridges, which is ultimately what you want.")

        slicer.TkCall("pack %s -side top -anchor e -expand y -padx 2 -pady 2" % self._advectionScalingSpinBox.GetWidgetName())

        self._startButton.SetParent(self._parentFrame)
        self._startButton.Create()
        self._startButton.SetEnabled(1)
        self._startButton.SetActiveBackgroundColor(0.9,0.9,0.9)
        self._startButton.SetReliefToRaised()
        self._startButton.SetBackgroundColor(0.9,0.9,0.9)
        self._startButton.SetText("Start!")
        self._startButton.SetWidth(8)
        self._startButton.SetHeight(2)
        self._startButton.SetBalloonHelpString("Click to start")

        self._resetButton.SetParent(self._parentFrame)
        self._resetButton.Create()
        self._resetButton.SetEnabled(1)
        self._resetButton.SetActiveBackgroundColor(0.9,0.9,0.9)
        self._resetButton.SetReliefToRaised()
        self._resetButton.SetBackgroundColor(0.9,0.9,0.9)
        self._resetButton.SetText("Cancel")
        self._resetButton.SetWidth(8)
        self._resetButton.SetHeight(2)
        self._resetButton.SetBalloonHelpString("Click to reset")


        slicer.TkCall("pack %s -side right -expand n -padx 2 -pady 5 -in %s" % (self._startButton.GetWidgetName(), self._parentFrame.GetWidgetName()))
        slicer.TkCall("pack %s -side right -expand n -padx 2 -pady 5 -in %s" % (self._resetButton.GetWidgetName(), self._parentFrame.GetWidgetName()))

        self.Reset()
コード例 #18
0
    def BuildGUI(self):

        self.GetUIPanel().AddPage("VesselEnhancement", "VesselEnhancement", "")
        self._vmtkVesEnhPage = self.GetUIPanel().GetPageWidget(
            "VesselEnhancement")
        helpText = "**Vessel Enhancement using VMTK**, developed by Daniel Haehn.\n\nAttention: This module needs the VMTK libraries which are available inside the VmtkSlicerModule extension.\n\nDocumentation and Tutorials are available at: <a>http://wiki.slicer.org/slicerWiki/index.php/Modules:VMTKVesselEnhancement</a>\n\n**Instructions:**\nFrangi and Sato without Parameter Sets:\n1. Specify the Input Volume.\n2. Optional: Specify the Output Volume\n3. Choose the algorithm using the tabs.\n4. Specify the diameter size (in mm or voxels) to detect. The number of steps defines the detection accuracy between the minimal and maximal diameter size.\n5. Press Start and when finished (the stdout shows progress), the vessel enhanced volume appears within the slice viewers.\n\n\nParameter Sets for Sato Vesselness:\nParameter presets for certain Use Cases exist and set the minimal and maximal diameters automatically.\n\n\nFor further information on FrangiVesselness see <a>http://www.tecn.upf.es/~afrangi/articles/miccai1998.pdf</a>.\n\n\nDetails on SatoVesselness can be found here <a>http://www.spl.harvard.edu/archive/spl-pre2007/pages/papers/yoshi/cr.html</a>.\n\n\nInformation to Vessel Enhancement Diffusion is available at <a>http://www.springerlink.com/content/d11hxca163edccwk/fulltext.pdf</a>.\n\nPlease note that the GUI for Vessel Enhancement Diffusion is still Under Construction!"
        aboutText = "This work is supported by NA-MIC, NAC, BIRN, NCIGT, and the Slicer Community. See http://www.slicer.org for details."
        self._helpAboutFrame = self.BuildHelpAndAboutFrame(
            self._vmtkVesEnhPage, helpText, aboutText)

        self.debug("Creating VesselEnhancement GUI")

        self._moduleFrame.SetParent(self._vmtkVesEnhPage)
        self._moduleFrame.Create()
        self._moduleFrame.SetLabelText("VMTKVesselEnhancement")
        self._moduleFrame.ExpandFrame()
        slicer.TkCall(
            "pack %s -side top -anchor nw -fill x -expand y -padx 2 -pady 2 -in %s"
            % (self._moduleFrame.GetWidgetName(),
               self._vmtkVesEnhPage.GetWidgetName()))

        self._moduleExistingSetsNodeSelector.SetNodeClass(
            "vtkMRMLScriptedModuleNode", "", "", "")
        self._moduleExistingSetsNodeSelector.NoneEnabledOn()
        self._moduleExistingSetsNodeSelector.ShowHiddenOn()
        self._moduleExistingSetsNodeSelector.SetParent(
            self._moduleFrame.GetFrame())
        self._moduleExistingSetsNodeSelector.Create()
        self._moduleExistingSetsNodeSelector.SetMRMLScene(
            self.GetLogic().GetMRMLScene())
        self._moduleExistingSetsNodeSelector.UpdateMenu()
        self._moduleExistingSetsNodeSelector.SetBorderWidth(2)
        self._moduleExistingSetsNodeSelector.SetLabelText(
            "Existing Parameter Sets:")
        self._moduleExistingSetsNodeSelector.SetBalloonHelpString(
            "select a VMTK Vessel Enhancement node with existing parameters.")
        slicer.TkCall("pack %s -side top -anchor e -padx 20 -pady 4" %
                      self._moduleExistingSetsNodeSelector.GetWidgetName())

        self._moduleNodeSelector.SetNodeClass("vtkMRMLScriptedModuleNode",
                                              "VMTKVesselEnhancement",
                                              self.GetLogic().GetModuleName(),
                                              "EnhancementParameters")
        self._moduleNodeSelector.NewNodeEnabledOn()
        self._moduleNodeSelector.NoneEnabledOn()
        self._moduleNodeSelector.ShowHiddenOn()
        self._moduleNodeSelector.SetParent(self._moduleFrame.GetFrame())
        self._moduleNodeSelector.Create()
        self._moduleNodeSelector.SetMRMLScene(self.GetLogic().GetMRMLScene())
        self._moduleNodeSelector.UpdateMenu()
        self._moduleNodeSelector.SetBorderWidth(2)
        self._moduleNodeSelector.SetLabelText("Module Parameters:")
        self._moduleNodeSelector.SetBalloonHelpString(
            "select a VMTK Vessel Enhancement node from the current mrml scene."
        )
        slicer.TkCall(
            "pack %s -side top -anchor e -expand y -padx 20 -pady 4" %
            self._moduleNodeSelector.GetWidgetName())

        self._topFrame.SetParent(self._moduleFrame.GetFrame())
        self._topFrame.Create()
        self._topFrame.SetLabelText("Input/Output")
        self._topFrame.ExpandFrame()
        slicer.TkCall(
            "pack %s -side top -anchor nw -fill x -expand y -padx 2 -pady 2" %
            self._topFrame.GetWidgetName())

        self._inVolumeSelector.SetNodeClass("vtkMRMLScalarVolumeNode", "", "",
                                            "")
        self._inVolumeSelector.SetParent(self._topFrame.GetFrame())
        self._inVolumeSelector.Create()
        self._inVolumeSelector.SetMRMLScene(self.GetLogic().GetMRMLScene())
        self._inVolumeSelector.UpdateMenu()
        self._inVolumeSelector.SetBorderWidth(2)
        self._inVolumeSelector.SetLabelText("Input Volume: ")
        self._inVolumeSelector.SetBalloonHelpString(
            "select an input volume from the current mrml scene.")
        slicer.TkCall(
            "pack %s -side top -anchor e -expand y -padx 20 -pady 4" %
            self._inVolumeSelector.GetWidgetName())

        self._outVolumeSelector.SetNodeClass("vtkMRMLScalarVolumeNode", "", "",
                                             "EnhancedVesselnessOut")
        self._outVolumeSelector.SetNewNodeEnabled(1)
        self._outVolumeSelector.SetParent(self._topFrame.GetFrame())
        self._outVolumeSelector.Create()
        self._outVolumeSelector.SetMRMLScene(self.GetLogic().GetMRMLScene())
        self._outVolumeSelector.UpdateMenu()
        self._outVolumeSelector.SetBorderWidth(2)
        self._outVolumeSelector.SetLabelText("Output Volume: ")
        self._outVolumeSelector.SetBalloonHelpString(
            "select an output volume from the current mrml scene.")
        slicer.TkCall(
            "pack %s -side top -anchor e -expand y -padx 20 -pady 4" %
            self._outVolumeSelector.GetWidgetName())

        # initialization tabs start here
        self._advancedFrame.SetParent(self._moduleFrame.GetFrame())
        self._advancedFrame.Create()
        self._advancedFrame.SetLabelText("Vessel Enhancement")
        self._advancedFrame.ExpandFrame()
        slicer.TkCall(
            "pack %s -side top -anchor nw -expand y -fill x -padx 2 -pady 2" %
            self._advancedFrame.GetWidgetName())

        self._advancedTabs.SetParent(self._advancedFrame.GetFrame())
        self._advancedTabs.Create()
        self._advancedTabs.AddObserver(2089, self.ProcessClickOnInitTabs)

        slicer.TkCall(
            "pack %s -side top -anchor nw -expand y -fill both -padx 2 -pady 2"
            % self._advancedTabs.GetWidgetName())

        self._advancedTabs.AddPage("FrangiVesselness", "FrangiVesselness", "")
        id = self._advancedTabs.GetFrame("FrangiVesselness")
        self._advancedFrangiPanel = SlicerVMTKVesselEnhancementFrangiGUI(
            id, self)
        self._advancedFrangiPanel.BuildGUI()
        self._pages.append(self._advancedFrangiPanel)
        #slicer.TkCall("pack %s -side top -anchor nw -fill x -padx 2 -pady 2" % self._advancedTabs.GetWidgetName())

        self._advancedTabs.AddPage("SatoVesselness", "SatoVesselness", "")
        #slicer.TkCall("pack %s -side top -anchor nw -fill x -padx 2 -pady 2" % self._advancedTabs.GetWidgetName())
        id = self._advancedTabs.GetFrame("SatoVesselness")
        self._advancedSatoPanel = SlicerVMTKVesselEnhancementSatoGUI(id, self)
        self._advancedSatoPanel.BuildGUI()
        self._pages.append(self._advancedSatoPanel)

        self._advancedTabs.AddPage(
            "VED", "VesselEnhancingDiffusion (interface under construction)",
            "")
        id = self._advancedTabs.GetFrame("VED")
        self._advancedVEDPanel = SlicerVMTKVesselEnhancementVEDGUI(id, self)
        self._advancedVEDPanel.BuildGUI()
        self._pages.append(self._advancedVEDPanel)

        self._dummyLabel.SetParent(self._moduleFrame.GetFrame())
        self._dummyLabel.Create()
        self._dummyLabel.SetText("")
        self._dummyLabel.SetWidth(1)
        self._dummyLabel.SetReliefToFlat()
        slicer.TkCall("pack %s -side top -anchor e -expand y -padx 1 -pady 1" %
                      self._dummyLabel.GetWidgetName())

        self._advancedTabs.RaisePage(1)

        self.LoadPresets()