コード例 #1
0
ファイル: ibc.py プロジェクト: smdabdoub/ProkaryMetrics
    def _cmdUpdate_click(self, events):
        s = self.settings
        
        # name
        if self.txtImageSetName.Value != s['Name']:
            self._UpdateName(self.txtImageSetName.Value)
        
        # data spacing
        if self.txtSpacingX.Value != str(s['DataSpacing'][0]) or \
           self.txtSpacingY.Value != str(s['DataSpacing'][1]) or \
           self.txtSpacingZ.Value != str(s['DataSpacing'][2]):
            print "Updating data spacing"
            self._UpdateDataSpacing()
        
        # image slices
        if self.txtSliceLower.Value != str(s['SliceRange'][0]) or \
           self.txtSliceUpper.Value != str(s['SliceRange'][1]):
            print 'Updating slice range'
            self._UpdateSliceRange()
        
        # isovalues can be a range, so check for '-' and make it a list
        isovals = [int(x) for x in self.txtIsocontour.Value.split('-')]
        if len(isovals) == 1:
            isovals.append(isovals[0])
        if isovals != s['IsocontourLevel']:
            print 'Updating isocontour level'
            self._UpdateIsocontourLevel(isovals)
        
        # pixel extents
#        if self.txtXPixelExtLower.Value != str(s['PixelExtents'][0]) or \
#           self.txtXPixelExtUpper.Value != str(s['PixelExtents'][1]) or \
#           self.txtYPixelExtLower.Value != str(s['PixelExtents'][2]) or \
#           self.txtYPixelExtUpper.Value != str(s['PixelExtents'][3]):
#            print 'Updating pixel extents'
#            self._UpdatePixelExtents()
        
        color = Color.fromWX(self.btnColor.GetColour().Get())
        if color != s['Color']:
            s['Color'] = color
            self._UpdateColor(color)

        # visibility
        visible = self.chkVisible.Value
        if visible != s['Visible']:
            s['Visible'] = visible
            self.ibcRenderer.UpdateVisibility(visible)
コード例 #2
0
ファイル: bacteria.py プロジェクト: smdabdoub/ProkaryMetrics
 def _cmdUpdate_click(self, events):
     s = self.settings
     
     radius = float(self.txtRadius.Value)
     if radius != s['ActorRadius']:
         self.bactLayer.UpdateRadius(radius)
         s['ActorRadius'] = radius
     
     visible = self.chkVisible.Value
     if visible != s['Visible']:
         self.bactLayer.UpdateVisibility(visible)
         s['Visible'] = visible
     
     color = Color.fromWX(self.btnColor.GetColour().Get())
     if color != s['Color']:
         self.bactLayer.UpdateColor(color)
         s['Color'] = color