groakat / videotagger

10 stars 2 forks source link

edit annotation rectangle broken #101

Open groakat opened 8 years ago

groakat commented 8 years ago

KeyError                                  Traceback (most recent call last)
/Users/peter/Documents/phd/projects/pyTools/pyTools/videoTagger/modifyableRect.pyc in itemChange(self, change, value)
    281
    282         if change == QtGui.QGraphicsItem.ItemPositionChange and self.rectChangedCallback:
--> 283             self.rectChangedCallback(self)
    284
    285         return super(ResizeableGraphicsRectItem, self).itemChange(change, value)

/Users/peter/Documents/phd/projects/pyTools/pyTools/videoTagger/videoTagger.py in labelRectChangedSlot(self, activeRect)
   2038             self.editAnnoROI(activeRect.annotator,
   2039                              activeRect.behaviour,
-> 2040                              roi)
   2041
   2042     def setupLabelMenu(self):

/Users/peter/Documents/phd/projects/pyTools/pyTools/videoTagger/videoTagger.py in editAnnoROI(self, annotator, behaviour, newROI)
   3199     def editAnnoROI(self, annotator, behaviour, newROI):
   3200         self.unsavedChanges = True
-> 3201         self.editAnnoMeta(annotator, behaviour, "boundingBox", newROI)
   3202
   3203     def editAnnoMeta(self, annotator, behaviour, newMetaKey, newMetaValue):

/Users/peter/Documents/phd/projects/pyTools/pyTools/videoTagger/videoTagger.py in editAnnoMeta(self, annotator, behaviour, newMetaKey, newMetaValue)
   3204         self.unsavedChanges = True
   3205         self.vh.editAnnotationMetaCurrentFrame(self.getSelectedVial(), annotator,
-> 3206                                     behaviour, newMetaKey, newMetaValue)
   3207
   3208     def editAnnoLabel(self, annotatorOld, behaviourOld, annotatorNew, behaviourNew):

/Users/peter/Documents/phd/projects/pyTools/pyTools/videoTagger/videoHandler.pyc in editAnnotationMetaCurrentFrame(self, selectedVial, annotator, behaviour, metaKey, newMetaValue)
   1503                                                     selectedVial, self.idx,
   1504                                                     annotator, behaviour,
-> 1505                                                     metaKey, newMetaValue)
   1506
   1507     def editAnnotationLabel(self, vial, annotatorOld,

/Users/peter/Documents/phd/projects/pyTools/pyTools/videoProc/annotation.pyc in editMetadata(self, vials, frame, annotator, behaviour, metaKey, newMetaValue)
    365                                       label=behaviour,
    366                                       metaKey=metaKey,
--> 367                                       newMetaValue=newMetaValue)
    368
    369     def getPropertyFromFrameAnno(self, metaKey):

/Users/peter/Documents/phd/projects/pyTools/pyTools/videoProc/annotation.pyc in editMetadata(df, frames, annotator, label, metaKey, newMetaValue)
   1076         frames = [frames]
   1077
-> 1078     selectedDf = filterDataframe(df, frames, annotator, label)
   1079
   1080

/Users/peter/Documents/phd/projects/pyTools/pyTools/videoProc/annotation.pyc in filterDataframe(df, frames, annotator, label, exact_match, update_behaviour_indeces)
    946
    947     try:
--> 948         out = df.loc[tuple(indexer), :]
    949     except TypeError, e:
    950         # cfg.log.error("probably reduce error in df: {}".format(e))

/Users/peter/anaconda/lib/python2.7/site-packages/pandas/core/indexing.pyc in __getitem__(self, key)
   1194     def __getitem__(self, key):
   1195         if type(key) is tuple:
-> 1196             return self._getitem_tuple(key)
   1197         else:
   1198             return self._getitem_axis(key, axis=0)

/Users/peter/anaconda/lib/python2.7/site-packages/pandas/core/indexing.pyc in _getitem_tuple(self, tup)
    707     def _getitem_tuple(self, tup):
    708         try:
--> 709             return self._getitem_lowerdim(tup)
    710         except IndexingError:
    711             pass

/Users/peter/anaconda/lib/python2.7/site-packages/pandas/core/indexing.pyc in _getitem_lowerdim(self, tup)
    815         # we may have a nested tuples indexer here
    816         if self._is_nested_tuple_indexer(tup):
--> 817             return self._getitem_nested_tuple(tup)
    818
    819         # we maybe be using a tuple to represent multiple dimensions here

/Users/peter/anaconda/lib/python2.7/site-packages/pandas/core/indexing.pyc in _getitem_nested_tuple(self, tup)
    887
    888             current_ndim = obj.ndim
--> 889             obj = getattr(obj, self.name)._getitem_axis(key, axis=axis)
    890             axis += 1
    891

/Users/peter/anaconda/lib/python2.7/site-packages/pandas/core/indexing.pyc in _getitem_axis(self, key, axis)
   1334             # nested tuple slicing
   1335             if is_nested_tuple(key, labels):
-> 1336                 locs = labels.get_locs(key)
   1337                 indexer = [ slice(None) ] * self.ndim
   1338                 indexer[axis] = locs

/Users/peter/anaconda/lib/python2.7/site-packages/pandas/core/index.pyc in get_locs(self, tup)
   5569         if not self.is_lexsorted_for_tuple(tup):
   5570             raise KeyError('MultiIndex Slicing requires the index to be fully lexsorted'
-> 5571                            ' tuple len ({0}), lexsort depth ({1})'.format(len(tup), self.lexsort_depth))
   5572
   5573         # indexer

KeyError: 'MultiIndex Slicing requires the index to be fully lexsorted tuple len (3), lexsort depth (2)'