Skip to content

[BUG] Can't crop image, then run localization analysis on it #1466

Description

@barentine

Describe the bug

Cropping an image before localization analysis hits a bug

Traceback (most recent call last):
  File "c:\userfiles\davis_perez\code\python-microscopy\PYME\DSView\modules\LMAnalysis.py", line 269, in <lambda>
    self.bGo.Bind(wx.EVT_BUTTON, lambda e : self.lmanal.OnGo(e))
  File "c:\userfiles\davis_perez\code\python-microscopy\PYME\DSView\modules\LMAnalysis.py", line 662, in OnGo
    self.analysisController.pushImagesCluster(self.image)
  File "c:\userfiles\davis_perez\code\python-microscopy\PYME\DSView\modules\LMAnalysis.py", line 343, in pushImagesCluster
    self.resultsMdh['DataFileID'] = fileID.genDataSourceID(image.dataSource)
AttributeError: 'ImageStack' object has no attribute 'dataSource'

Note that if you try saving the cropped image first, you hit an issue which appears to be from saving the crop slices in metadata as slice objects:

DEBUG:PYME.cluster.rules:DataSource.__class__: <class 'PYME.IO.DataSources.HDFDataSource.DataSource'>
DEBUG:PYME.cluster.rules:local_queues: ['PYMERuleServer:WEM12A - PID:14352']
DEBUG:root:resultsURI: http://127.0.0.1:54947/__aggregate_h5r//file/path.h5r
Traceback (most recent call last):
  File "c:\userfiles\davis_perez\code\python-microscopy\PYME\IO\MetaDataHandler.py", line 511, in default
    return obj.to_JSON()
AttributeError: 'slice' object has no attribute 'to_JSON'

To Reproduce
Steps to reproduce the behavior:

  1. run PYMEClusterOfOne
  2. load an h5 image file
  3. select a region and crop
  4. activate LMAnalyzer plugin in cropped PYMEImage window
  5. click go
  6. see error

Platform (please complete the following information - or copy-paste from error dialog if shown):

  • OS: [e.g. Win10] Win10
  • Python version: believe 3.7, would have to check with labmate who's computer we were using
  • numpy version:
  • wxpython version [if a UI bug]:

Additional context
Add any other context about the problem here.

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions