def createVectorWidget(self, name, type):
        m = re.search(r"<([a-zA-Z ]+)>", type)
        if m:
            type = m.group(1)

        w = ctk.ctkCoordinatesWidget()
        self.widgets.append(w)

        if type in ["double", "float"]:
            w.setDecimals(5)
            w.minimum = -3.40282e+038
            w.maximum = 3.40282e+038
            w.connect("coordinatesChanged(double*)",
                      lambda val, widget=w, name=name: self.
                      onFloatVectorChanged(name, widget, val))
        else:
            w.setDecimals(0)
            w.connect("coordinatesChanged(double*)",
                      lambda val, widget=w, name=name: self.onIntVectorChanged(
                          name, widget, val))

        exec('default = self.filter.Get{0}()'.format(name)
             ) in globals(), locals()
        w.coordinates = ",".join(str(x) for x in default)
        return w
  def createVectorWidget(self,name,type):
    m = re.search(r"<([a-zA-Z ]+)>", type)
    if m:
      type = m.group(1)

    w = ctk.ctkCoordinatesWidget()
    self.widgets.append(w)

    if type in ["double", "float"]:
      w.setDecimals(5)
      w.minimum=-3.40282e+038
      w.maximum=3.40282e+038
      w.connect("coordinatesChanged(double*)", lambda val,widget=w,name=name:self.onFloatVectorChanged(name,widget,val))
    elif type == "bool":
      w.setDecimals(0)
      w.minimum=0
      w.maximum=1
      w.connect("coordinatesChanged(double*)", lambda val,widget=w,name=name:self.onBoolVectorChanged(name,widget,val))
    else:
      w.setDecimals(0)
      w.connect("coordinatesChanged(double*)", lambda val,widget=w,name=name:self.onIntVectorChanged(name,widget,val))
    self.widgetConnections.append((w, "coordinatesChanged(double*)"))

    default = self._getParameterValue(name)
    w.coordinates = ",".join(str(x) for x in default)
    return w
    def createVectorWidget(self, name, type):
        m = re.search(r"<([a-zA-Z ]+)>", type)
        if m:
            type = m.group(1)

        w = ctk.ctkCoordinatesWidget()
        self.widgets.append(w)

        if type in ["double", "float"]:
            w.setDecimals(5)
            w.minimum = -3.40282e+038
            w.maximum = 3.40282e+038
            w.connect("coordinatesChanged(double*)",
                      lambda val, widget=w, name=name: self.
                      onFloatVectorChanged(name, widget, val))
        elif type == "bool":
            w.setDecimals(0)
            w.minimum = 0
            w.maximum = 1
            w.connect("coordinatesChanged(double*)",
                      lambda val, widget=w, name=name: self.
                      onBoolVectorChanged(name, widget, val))
        else:
            w.setDecimals(0)
            w.connect("coordinatesChanged(double*)",
                      lambda val, widget=w, name=name: self.onIntVectorChanged(
                          name, widget, val))
        self.widgetConnections.append((w, "coordinatesChanged(double*)"))

        default = self._getParameterValue(name)
        w.coordinates = ",".join(str(x) for x in default)
        return w
  def createVectorWidget(self,name,type):
    m = re.search(r"<([a-zA-Z ]+)>", type)
    if m:
      type = m.group(1)

    w = ctk.ctkCoordinatesWidget()
    self.widgets.append(w)

    if type in ["double", "float"]:
      w.setDecimals(5)
      w.minimum=-3.40282e+038
      w.maximum=3.40282e+038
      w.connect("coordinatesChanged(double*)", lambda val,widget=w,name=name:self.onFloatVectorChanged(name,widget,val))
    else:
      w.setDecimals(0)
      w.connect("coordinatesChanged(double*)", lambda val,widget=w,name=name:self.onIntVectorChanged(name,widget,val))

    exec('default = self.filter.Get{0}()'.format(name)) in globals(), locals()
    w.coordinates = ",".join(str(x) for x in default)
    return w
  def setup(self):
    ScriptedLoadableModuleWidget.setup(self)
    # Instantiate and connect widgets ...

    logic = MyPythonModuleLogic()
    self.coordinatesWidgetModified = False
    
    interactivePoint1Node = slicer.vtkMRMLMarkupsFiducialNode()
    interactivePoint1Node.SetName('IP1')

    interactivePoint2Node = slicer.vtkMRMLMarkupsFiducialNode()
    interactivePoint2Node.SetName('IP2')
    
 #   slicer.mrmlScene.AddNode(widgetPointsList)
    slicer.mrmlScene.AddNode(interactivePoint1Node)
    slicer.mrmlScene.AddNode(interactivePoint2Node)
    
    self.CrosshairNode = slicer.mrmlScene.GetNthNodeByClass(0, 'vtkMRMLCrosshairNode')
    if self.CrosshairNode:
      self.CrosshairNodeObserverTag = self.CrosshairNode.AddObserver(slicer.vtkMRMLCrosshairNode.CursorPositionModifiedEvent, self.interactiveCaliper)
    else:
      print "Couldn't access crosshair."

# Volumes collapsible button
    self.volumeCButton = ctk.ctkCollapsibleButton()
    self.volumeCButton.text = "Volume"
    self.layout.addWidget(self.volumeCButton)

# Layout within the volumes collapsible button
    self.volumeCLayout = qt.QFormLayout(self.volumeCButton)

    #
    # the volume selectors
    #
    self.inputFrame = qt.QFrame(self.volumeCButton)
    self.inputFrame.setLayout(qt.QHBoxLayout())
    self.volumeCLayout.addWidget(self.inputFrame)
    self.inputSelector = qt.QLabel("Input Volume: ", self.inputFrame)
    self.inputFrame.layout().addWidget(self.inputSelector)
    self.inputSelector = slicer.qMRMLNodeComboBox(self.inputFrame)
    self.inputSelector.nodeTypes = ( ("vtkMRMLScalarVolumeNode"), "" )
    self.inputSelector.addEnabled = False
    self.inputSelector.removeEnabled = False
    self.inputSelector.setMRMLScene( slicer.mrmlScene )
    self.inputFrame.layout().addWidget(self.inputSelector)

#   Coordinates collapsible button set-up 
    self.coord = ctk.ctkCollapsibleButton()
    self.coord.text = "Manually input coordinates"
    self.layout.addWidget(self.coord)

    self.coordLayout = qt.QFormLayout(self.coord)

#   Coordinate 1 Label and widget
    self.c1 = qt.QFrame(self.coord)
    self.c1.setLayout(qt.QHBoxLayout())
    self.coordLayout.addWidget(self.c1)
    self.c1Select = qt.QLabel("Coordinate 1: ", self.c1)
    self.c1.layout().addWidget(self.c1Select)

    self.c1Select = ctk.ctkCoordinatesWidget(self.c1)
    self.c1Select.connect('coordinatesChanged(double*)', self.changedCoordinates)    
    
    self.c1.layout().addWidget(self.c1Select)

#   Coordinate 2 Label and widget
    self.c2 = qt.QFrame(self.coord)
    self.c2.setLayout(qt.QHBoxLayout())
    self.coordLayout.addWidget(self.c2)
    self.c2Select = qt.QLabel("Coordinate 2: ", self.c2)
    self.c2.layout().addWidget(self.c2Select)

    self.c2Select = ctk.ctkCoordinatesWidget(self.c2)
    self.c2Select.connect('coordinatesChanged(double*)', self.changedCoordinates)
    
    self.c2.layout().addWidget(self.c2Select)
    

#   Deploy caliper button
    runCaliperButton = qt.QPushButton("Deploy Caliper")
    runCaliperButton.toolTip = "Deploy the virtual caliper on the data set."
    self.coordLayout.addWidget(runCaliperButton)
    runCaliperButton.connect('clicked(bool)', self.runCaliper)

#   Label with updating distance value results
    self.distanceLabel = qt.QFrame(self.coord)
    self.distanceLabel.setLayout(qt.QHBoxLayout())
    self.coordLayout.addWidget(self.distanceLabel)
    self.distUpdate = qt.QLabel("Distance: ", self.distanceLabel)
    self.distanceLabel.layout().addWidget(self.distUpdate)

#   Interactive coordinates collapsible button set-up 
    self.interactiveCoord = ctk.ctkCollapsibleButton()
    self.interactiveCoord.text = "Interactive coordinates"
    self.layout.addWidget(self.interactiveCoord)

    self.interactiveCoordLayout = qt.QFormLayout(self.interactiveCoord)

#   Interactive caliper 1 button
    buttonIC1 = qt.QPushButton("Interactive Caliper - Point 1")
    buttonIC1.toolTip = "Run the interactive caliper for Point 1."
    self.interactiveCoordLayout.addWidget(buttonIC1)
    buttonIC1.connect('clicked(bool)', logic.saveInteractivePoint1)

#   Interactive caliper 2 button
    buttonIC2 = qt.QPushButton("Interactive Caliper - Point 2")
    buttonIC2.toolTip = "Run the interactive caliper for Point 2."
    self.interactiveCoordLayout.addWidget(buttonIC2)
    buttonIC2.connect('clicked(bool)', logic.saveInteractivePoint2)

#   Interactive caliper 1 label with axes
    self.labelIC1 = qt.QFrame(self.interactiveCoord)
    self.labelIC1.setLayout(qt.QHBoxLayout())
    self.interactiveCoordLayout.addWidget(self.labelIC1)
    self.labelIC1update = qt.QLabel("X: NaN  Y: NaN  Z: NaN  ", self.labelIC1)
    self.labelIC1.layout().addWidget(self.labelIC1update)

#   Label with updating distance value results
    self.intDistanceLabel = qt.QFrame(self.interactiveCoord)
    self.intDistanceLabel.setLayout(qt.QHBoxLayout())
    self.interactiveCoordLayout.addWidget(self.intDistanceLabel)
    self.intDistUpdate = qt.QLabel("Distance: ", self.intDistanceLabel)
    self.intDistanceLabel.layout().addWidget(self.intDistUpdate)

#   Blur gaussian collapsible button set-up 
    self.blurButton = ctk.ctkCollapsibleButton()
    self.blurButton.text = "Add gaussian blur"
    self.layout.addWidget(self.blurButton)

    self.blurButtonLayout = qt.QFormLayout(self.blurButton)

#   Blur checkmark
    self.blur = qt.QCheckBox("Blur image", self.blurButton)
    self.blur.toolTip = "When checked, blur image based on distance"
    self.blur.checked = False
    self.blurButtonLayout.addWidget(self.blur)
    self.blur.connect('stateChanged(int)', self.blurCheckBox)

#   Display original checkmark
    self.orig = qt.QCheckBox("Display original", self.blurButton)
    self.orig.toolTip = "When checked, blur image based on distance"
    self.orig.checked = True
    self.blurButtonLayout.addWidget(self.orig)
    self.orig.connect('stateChanged(int)', self.origCheckBox)
    
    # Add vertical spacer
    self.layout.addStretch(1)

    # Set local var as instance attribute
    self.runCaliperButton = runCaliperButton