コード例 #1
0
    def loadOther_pushButton_slot(self,fnameToLoad=False):
        """
        Load a user-selected atlas file but use the labels from the ARA in the drop-down box.
        Can optionally load a specific file name (used for de-bugging)
        """
        if fnameToLoad==False:       
            fileFilter="Images (*.mhd *.mha *.tiff *.tif *.nrrd)"
            fnameToLoad = QtGui.QFileDialog.getOpenFileName(self, 'Open file', lasHelp.readPreference('lastLoadDir'), fileFilter)
            fnameToLoad = str(fnameToLoad)

        #re-load labels        
        selectedName = str(self.araName_comboBox.itemText(self.araName_comboBox.currentIndex()))
        paths = self.paths[selectedName]
        self.data['labels'] = self.loadLabels(paths['labels'])

        #load the selected atlas (without displaying it)
        self.data['atlas'] = imageStackLoader.loadStack(fnameToLoad)

        self.data['currentlyLoadedAtlasName'] =  fnameToLoad.split(os.path.sep)[-1]
コード例 #2
0
    def loadOrig_pushButton_slot(self):
        """
        Loads the atlas file but does not display it. Coordinate loading of the ARA items defined in the dictionary paths. 
        araName is a value from the self.paths dictionary. The values will be 
        combobox item texts and will load a dictionary from self.paths. The keys
        of this dictionary have these keys: 
        'atlas' (full path to atlas volume file)
        'labels' (full path to atlas labels file - csv or json)
        """
        selectedName = str(self.araName_comboBox.itemText(self.araName_comboBox.currentIndex()))

        paths = self.paths[selectedName]

        #Load the labels (this associates brain area index values with brain area names)
        self.data['labels'] = self.loadLabels(paths['labels'])

        #Load the raw image data but do not display it.
        self.data['atlas'] = imageStackLoader.loadStack(paths['atlas'])

        self.data['currentlyLoadedAtlasName'] =  paths['atlas'].split(os.path.sep)[-1]
コード例 #3
0
    def loadOrig_pushButton_slot(self):
        """
        Loads the atlas file but does not display it. Coordinate loading of the ARA items defined in the dictionary paths. 
        araName is a value from the self.paths dictionary. The values will be 
        combobox item texts and will load a dictionary from self.paths. The keys
        of this dictionary have these keys: 
        'atlas' (full path to atlas volume file)
        'labels' (full path to atlas labels file - csv or json)
        """
        selectedName = str(
            self.araName_comboBox.itemText(
                self.araName_comboBox.currentIndex()))

        paths = self.paths[selectedName]

        #Load the labels (this associates brain area index values with brain area names)
        self.data['labels'] = self.loadLabels(paths['labels'])

        #Load the raw image data but do not display it.
        self.data['atlas'] = imageStackLoader.loadStack(paths['atlas'])

        self.data['currentlyLoadedAtlasName'] = paths['atlas'].split(
            os.path.sep)[-1]
コード例 #4
0
    def loadOther_pushButton_slot(self, fnameToLoad=False):
        """
        Load a user-selected atlas file but use the labels from the ARA in the drop-down box.
        Can optionally load a specific file name (used for de-bugging)
        """
        if fnameToLoad == False:
            fileFilter = "Images (*.mhd *.mha *.tiff *.tif *.nrrd)"
            fnameToLoad = QtGui.QFileDialog.getOpenFileName(
                self, 'Open file', lasHelp.readPreference('lastLoadDir'),
                fileFilter)
            fnameToLoad = str(fnameToLoad)

        #re-load labels
        selectedName = str(
            self.araName_comboBox.itemText(
                self.araName_comboBox.currentIndex()))
        paths = self.paths[selectedName]
        self.data['labels'] = self.loadLabels(paths['labels'])

        #load the selected atlas (without displaying it)
        self.data['atlas'] = imageStackLoader.loadStack(fnameToLoad)

        self.data['currentlyLoadedAtlasName'] = fnameToLoad.split(
            os.path.sep)[-1]