Exemplo n.º 1
0
    def PopulateMetadata(self, mdh, acquiring=True):
        global lastCreator, lastSlideRef
        currentSlide[0] = self.slide

        creator = self.slide.creator
        slideRef = self.slide.reference
        sampleNotes = self.slide.notes
        #notes = self.tNotes.GetValue()
        #sampleNotes = self.tSlideNotes.GetValue()

        if not slideRef == lastSlideRef or not creator == lastCreator:
            lastCreator = creator
            lastSlideRef = slideRef

            for f in WantSlideChangeNotification:
                f()

        #if len(creator) == 0:
        #    creator = '<none>'

        #if len(slideRef) == 0:
        #    slideRef = '<none>'

        #if len(notes) == 0:
        #    notes = '<none>'

        #if len(sampleNotes) == 0:
        #    sampleNotes = '<none>'
        
        mdh.setEntry('Sample.Creator', creator)
        mdh.setEntry('Sample.SlideRef', slideRef)
        if len(sampleNotes) > 0:
            mdh.setEntry('Sample.Notes', sampleNotes)
        #mdh.setEntry('AcquisitionNotes', notes)
        

#        labels = []
#        for i in range(self.gLabelling.GetNumberRows()):
#            labels.append((self.gLabelling.GetCellValue(i, 0),self.gLabelling.GetCellValue(i, 1)))

        mdh.setEntry('Sample.Labelling', [(l.structure, l.dye.shortName) for l in self.slide.labelling.all()])

        mdh.setEntry('AcquiringUser', nameUtils.getUsername())

        #slide = models.Slide.Get(creator, slideRef)

#        if not self.slideExists:
#            for struct, label in self.labels:
#                l = models.Labelling(slideID=slide, structure=struct, label=label)
#                l.notes = sampleNotes
#                l.save()


        if acquiring:
            notes = self.tNotes.GetValue()
            mdh.setEntry('Notes', notes)
Exemplo n.º 2
0
    def PopulateMetadata(self, mdh, acquiring=True):
        global lastCreator, lastSlideRef
        currentSlide[0] = self.slide

        creator = self.slide.creator
        slideRef = self.slide.reference
        sampleNotes = self.slide.notes
        #notes = self.tNotes.GetValue()
        #sampleNotes = self.tSlideNotes.GetValue()

        if not slideRef == lastSlideRef or not creator == lastCreator:
            lastCreator = creator
            lastSlideRef = slideRef

            for f in WantSlideChangeNotification:
                f()

        #if len(creator) == 0:
        #    creator = '<none>'

        #if len(slideRef) == 0:
        #    slideRef = '<none>'

        #if len(notes) == 0:
        #    notes = '<none>'

        #if len(sampleNotes) == 0:
        #    sampleNotes = '<none>'

        mdh.setEntry('Sample.Creator', creator)
        mdh.setEntry('Sample.SlideRef', slideRef)
        if len(sampleNotes) > 0:
            mdh.setEntry('Sample.Notes', sampleNotes)
        #mdh.setEntry('AcquisitionNotes', notes)


#        labels = []
#        for i in range(self.gLabelling.GetNumberRows()):
#            labels.append((self.gLabelling.GetCellValue(i, 0),self.gLabelling.GetCellValue(i, 1)))

        mdh.setEntry('Sample.Labelling', [(l.structure, l.dye.shortName)
                                          for l in self.slide.labelling.all()])

        mdh.setEntry('AcquiringUser', nameUtils.getUsername())

        #slide = models.Slide.Get(creator, slideRef)

        #        if not self.slideExists:
        #            for struct, label in self.labels:
        #                l = models.Labelling(slideID=slide, structure=struct, label=label)
        #                l.notes = sampleNotes
        #                l.save()

        if acquiring:
            notes = self.tNotes.GetValue()
            mdh.setEntry('Notes', notes)
Exemplo n.º 3
0
def createImage(mdh, slide, comments=''):
    im = models.Image.GetOrCreate(mdh.getEntry('imageID'), nameUtils.getUsername(), slide, mdh.getEntry('StartTime'))
    im.comments = comments
    im.save()
Exemplo n.º 4
0
# along with this program.  If not, see <http://www.gnu.org/licenses/>.
#
##################

import wx
#import wx.grid
import  wx.lib.mixins.listctrl  as  listmix
import sys

from PYME.FileUtils import nameUtils
from PYME.misc import TextCtrlAutoComplete

from PYME.SampleDB2 import populate #just to setup the Django environment
from PYME.SampleDB2.samples import models

lastCreator = nameUtils.getUsername()
lastSlideRef = ''

currentSlide = [None]

WantSlideChangeNotification = []

from PYME.Acquire.MetaDataHandler import NestedClassMDHandler

slideMD = NestedClassMDHandler()

class AutoWidthListCtrl(wx.ListCtrl, listmix.ListCtrlAutoWidthMixin):
    def __init__(self, parent, ID, pos=wx.DefaultPosition,
                 size=wx.DefaultSize, style=0):
        wx.ListCtrl.__init__(self, parent, ID, pos, size, style)
        listmix.ListCtrlAutoWidthMixin.__init__(self)
Exemplo n.º 5
0
def createImage(mdh, slide, comments=''):
    im = models.Image.GetOrCreate(mdh.getEntry('imageID'),
                                  nameUtils.getUsername(), slide,
                                  mdh.getEntry('StartTime'))
    im.comments = comments
    im.save()
Exemplo n.º 6
0
# along with this program.  If not, see <http://www.gnu.org/licenses/>.
#
##################

import wx
#import wx.grid
import wx.lib.mixins.listctrl as listmix
import sys

from PYME.FileUtils import nameUtils
from PYME.misc import TextCtrlAutoComplete

from PYME.SampleDB2 import populate  #just to setup the Django environment
from PYME.SampleDB2.samples import models

lastCreator = nameUtils.getUsername()
lastSlideRef = ''

currentSlide = [None]

WantSlideChangeNotification = []

from PYME.Acquire.MetaDataHandler import NestedClassMDHandler

slideMD = NestedClassMDHandler()


class AutoWidthListCtrl(wx.ListCtrl, listmix.ListCtrlAutoWidthMixin):
    def __init__(self,
                 parent,
                 ID,