Ejemplo n.º 1
0
    def setUp(self):
        ''' load inital parameters and/or data for testing'''
        self.fnameAdj = 'data/3d_grid_adj.txt'
        self.fnameCo = 'data/3d_grid_coords.txt'
        self.fnameProp = 'data/3d_grid_properties.txt'

        self.brain = mb.brainObj()
Ejemplo n.º 2
0
 def setUp(self):
     ''' load inital parameters and/or data for testing'''
     self.fnameAdj = 'data/3d_grid_adj.txt'
     self.fnameCo = 'data/3d_grid_coords.txt'
     self.fnameProp = 'data/3d_grid_properties.txt'
     
     self.brain = mb.brainObj()
Ejemplo n.º 3
0
 def setUp(self):
     ''' load inital parameters and/or data for testing'''
     self.fnameAdj = 'data/3d_grid_adj.txt'
     self.fnameCo = 'data/3d_grid_coords.txt'
     self.fnameProps = 'data/3d_grid_properties.txt'
     
     # initialise brain and plot objects
     self.a = mb.brainObj()
     self.b = plotObj()
     
     # some data
     self.edges = [(0,2),(0,4),(0,6)]
     
     self.locations = {0:(1,1,1), 2:(2,2,2), 4:(3,3,3), 6:(4,4,4)}
Ejemplo n.º 4
0
    def loadSkull(self):
        """ load a skull file """
        # get filename
        f = str(self.ui.skullFilename.text())
        # get brain name
        brainName, brUsedBool = self.findBrainName()

        # create brain object if it doesn't exist
        if not (brUsedBool):
            br = mb.brainObj()
            self.brains[brainName] = br
        else:
            br = self.brains[brainName]
        # read in file
        br.importSkull(f)

        # enable plot button
        self.ui.skullPlot.setEnabled(True)
Ejemplo n.º 5
0
    def loadSkull(self):
        ''' load a skull file '''
        # get filename
        f = str(self.ui.skullFilename.text())
        # get brain name
        brainName, brUsedBool = self.findBrainName()

        # create brain object if it doesn't exist
        if not (brUsedBool):
            br = mb.brainObj()
            self.brains[brainName] = br
        else:
            br = self.brains[brainName]
        # read in file
        br.importSkull(f)

        # enable plot button
        self.ui.skullPlot.setEnabled(True)
Ejemplo n.º 6
0
    def setUp(self):
        ''' load inital parameters and/or data for testing'''
        self.fnameAdj = 'data/3d_grid_adj.txt'
        self.fnameCo = 'data/3d_grid_coords.txt'
        self.fnameProps = 'data/3d_grid_properties.txt'

        # initialise brain and plot objects
        self.a = mb.brainObj()
        self.b = plotObj()

        # some data
        self.edges = [(0, 2), (0, 4), (0, 6)]

        self.locations = {
            0: (1, 1, 1),
            2: (2, 2, 2),
            4: (3, 3, 3),
            6: (4, 4, 4)
        }
Ejemplo n.º 7
0
    def loadBrain(self):
        ''' load a brain using given filenames '''
        self.ui.adjPlot.setEnabled(False)        
        
        # get adjacency filename
        adj = str(self.ui.adjFilename.text())
        # get threshold
        thType, thVal = self.getThresholdType()
        # get spatial info file
        coords = str(self.ui.spatialFilename.text())
        
        # make name for brain
        brName, brainUsedBool = self.findBrainName()
        self.currentBrainName = brName
        
        # create and add to list of brains
        if brainUsedBool:
            # case where brain name exists already
            br = self.brains[brName]
        else:
            # make a new brain
            br = mb.brainObj()
                        
        # add properties
        br.importAdjFile(adj)
        br.importSpatialInfo(coords)
        br.applyThreshold(thresholdType = thType, value = thVal)
        
        self.brains[brName] = br
        
        # add to brains selected for highlighting
        if not(brainUsedBool):
            self.ui.brainSelect.addItem(brName)
                   
        # enable plot button
#        try:
#            QtCore.QObject.disconnect(self.ui.adjPlot, QtCore.SIGNAL('clicked()'), self.rePlotBrain)
#        except:
#            pass
        QtCore.QObject.connect(self.ui.adjPlot, QtCore.SIGNAL('clicked()'), self.plotBrain)
        self.ui.adjPlot.setEnabled(True)