Giter VIP home page Giter VIP logo

samuroi's Introduction

SamuROI

You can find the API documentation and examples at: http://samuroi.readthedocs.io/en/latest/

Installation

SamuROI installation was tested on:

  • Windows7-64bit, newer windows should also work.
  • Ubuntu 16.04 LTS
  • macOS

Development installation with conda

  1. Download and install anaconda

  2. Download and extract or git clone SamuROI

  3. Install dependencies

    Open a terminal to first install SamuROI dependencies. Text in this font represents terminal commands.

    • conda install conda-build
    • conda install pyqt=4
    • conda install cached-property

    Finally, opencv does not ship official packages for all operation systems. On windows try conda install -c menpo opencv=2.4.11, on linux and mac try conda install opencv. If the opencv installation fails, SamuROI should still work, but the image stabilization will not be supported.

  4. Install SamuROI as a conda develop package: conda develop <path/to/samuroi>. Here <path/to/samuroi> denotes the samuroi root directory where you can e.g. find this Readme.md file.

You should now be able to import samuroi in python. To try it out open an IPython notebook and type in the following:

%matplotlib qt4
import samuroi
import numpy

# create some random data
data = numpy.random.normal(size=(100,100,30))
morphology = numpy.random.normal(size = (100,100))

#show the gui 
app = samuroi.SamuROIWindow(data = data,morphology=morphology)
app.show()

Troubleshooting

If problems with dependency conflicts of python packages arise we recommend to use condas virtual environment functionality. To do so, open a terminal, navigate to the downloaded samuroi directory, and type:

conda env create -n samuroi

This creates an environment with all of the packages that SamuROI is dependent on installed. An environment is a working space with its own version of python. All packages you install into the environment are distinct from your main system's python packages and will not clash with your other installed packages. More info: https://conda.io/docs/using/envs.html

Until we have set up SamuROI installation directly with conda, there is one final step, which tells conda where to look to find your version of SamuROI, which you should have downloaded or cloned somewhere on your computer:

conda develop -n samuroi <path/to/samuroi>

When you need to use SamuROI, you need to type source activate samuroi in a terminal. If you are using windows you can simply type activate samuroi.

Via package manager (hopefully comming soon)

We hope to support a conda package soon! Contributions including a travis-ci setup are highly appreciated. As there exist no official pip packages for opencv and pyqt, installation of SamuROI via pip is not officially supported.

samuroi's People

Contributors

fjohenning avatar martinitus avatar stephenlenzi avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar

samuroi's Issues

upgrade to pyqt5

Since the new conda now provides pyqt5 as default it would be nice to use that.

creating a samuroi window requires a QApplication running

When launched from ipython, samuroi complains about a missing QApplication running in background.
This happens when the selected matplotlib frontend from ipython is not qt4 and can be avoided by setting the frontend explicitly with
%matplotlib qt4

Docker image?

Are there plans to make a Docker image for SamuROI?

Convert example documentation to markdown

Currently the readme files in the example directory are written in rich text format. Maybe it would be better to have that in markdown. then they can easily be read online via github.

current channel not available

Hi,
I'm trying to install samuroi on my mac but whenever I attempt to install either the pyqt=4 or actual samuroi package I get this error message:

Last login: Sun Apr 12 11:38:49 on ttys000
(base) cex@CEXs-MacBook-Pro ~ % cd ./documents
(base) cex@CEXs-MacBook-Pro documents % conda install SamuROI-develop
Collecting package metadata (current_repodata.json): done
Solving environment: failed with initial frozen solve. Retrying with flexible solve.
Collecting package metadata (repodata.json): done
Solving environment: failed with initial frozen solve. Retrying with flexible solve.

PackagesNotFoundError: The following packages are not available from current channels:

  • samuroi-develop

Current channels:

To search for alternate channels that may provide the conda package you're
looking for, navigate to

https://anaconda.org

and use the search bar at the top of the page.

Are there additional channels that I need to install these packages?

Thanks for your help!

cannot unpack non-iterable numpy.float64 object

I am trying to understand the use of SamuROI to analyze some data.

  1. If I follow the basic instructions in Jupyter the GIU comes out but (load from TIFF) does not shows anything.

  2. If i set my own data from the console:

data = load_tif('filename_Ch1_000001.ome.tif')
app = SamuROIWindow(data=data)

it gives me the "cannot unpack non-iterable numpy.float64 object".

branch rois cannot be manually generated anymore

here is the error code

[I 11:18:12.468 NotebookApp] 0 active kernels 
[I 11:18:12.468 NotebookApp] The IPython Notebook is running at: http://localhost:8888/
[I 11:18:12.468 NotebookApp] Use Control-C to stop this server and shut down all kernels (twice to skip confirmation).
[W 11:18:27.463 NotebookApp] 404 GET /nbextensions/widgets/notebook/js/extension.js?v=20170106111812 (::1) 15.02ms referer=http://localhost:8888/notebooks/python/arbeitsversionen/analysiscalciumimaging/SAMUROIexamplenotebook161214.ipynb
[I 11:18:27.703 NotebookApp] Kernel started: fa4afe40-278a-4bc3-a95d-f7f0689fcae1
[I 11:20:27.691 NotebookApp] Saving file at /python/arbeitsversionen/analysiscalciumimaging/SAMUROIexamplenotebook161214.ipynb
---------------------------------------------------------------------------
TypeError                                 Traceback (most recent call last)
/Users/friedrichjohenning/anaconda/lib/python2.7/site-packages/matplotlib/backends/backend_qt5.pyc in keyPressEvent(self=<samuroi.gui.widgets.frameview.FrameViewCanvas object>, event=<PyQt4.QtGui.QKeyEvent object>)
    311         if key is None:
    312             return
--> 313         FigureCanvasBase.key_press_event(self, key, guiEvent=event)
        global FigureCanvasBase.key_press_event = <unbound method FigureCanvasBase.key_press_event>
        self = <samuroi.gui.widgets.frameview.FrameViewCanvas object at 0x11d7305a8>
        key = u'enter'
        global guiEvent = undefined
        event = <PyQt4.QtGui.QKeyEvent object at 0x1234b8df8>
    314         if DEBUG:
    315             print('key press', key)

/Users/friedrichjohenning/anaconda/lib/python2.7/site-packages/matplotlib/backend_bases.pyc in key_press_event(self=<samuroi.gui.widgets.frameview.FrameViewCanvas object>, key=u'enter', guiEvent=<PyQt4.QtGui.QKeyEvent object>)
   1845         event = KeyEvent(
   1846             s, self, key, self._lastx, self._lasty, guiEvent=guiEvent)
-> 1847         self.callbacks.process(s, event)
        self.callbacks.process = <bound method CallbackRegistry.process of <matplotlib.cbook.CallbackRegistry object at 0x11d749090>>
        s = u'key_press_event'
        event = <matplotlib.backend_bases.KeyEvent object at 0x12352ce50>
   1848 
   1849     def key_release_event(self, key, guiEvent=None):

/Users/friedrichjohenning/anaconda/lib/python2.7/site-packages/matplotlib/cbook.pyc in process(self=<matplotlib.cbook.CallbackRegistry object>, s=u'key_press_event', *args=(<matplotlib.backend_bases.KeyEvent object>,), **kwargs={})
    561             for cid, proxy in list(six.iteritems(self.callbacks[s])):
    562                 try:
--> 563                     proxy(*args, **kwargs)
        proxy = <matplotlib.cbook._BoundMethodProxy object at 0x11d3387d0>
        args = (<matplotlib.backend_bases.KeyEvent object at 0x12352ce50>,)
        kwargs = {}
    564                 except ReferenceError:
    565                     self._remove_proxy(proxy)

/Users/friedrichjohenning/anaconda/lib/python2.7/site-packages/matplotlib/cbook.pyc in __call__(self=<matplotlib.cbook._BoundMethodProxy object>, *args=(<matplotlib.backend_bases.KeyEvent object>,), **kwargs={})
    428             mtd = self.func
    429         # invoke the callable and return the result
--> 430         return mtd(*args, **kwargs)
        mtd = <bound method ?.__onkey of <samuroi.util.branchmaskcreator.BranchMaskCreator object at 0x11292c890>>
        args = (<matplotlib.backend_bases.KeyEvent object at 0x12352ce50>,)
        kwargs = {}
    431 
    432     def __eq__(self, other):

/Users/friedrichjohenning/python/samuroi/samuroi/util/maskcreator.pyc in __onkey(self=<samuroi.util.branchmaskcreator.BranchMaskCreator object>, event=<matplotlib.backend_bases.KeyEvent object>)
     67     def __onkey(self, event):
     68         # forward call to baseclass event handling
---> 69         self.onkey(event)
        self.onkey = <bound method BranchMaskCreator.onkey of <samuroi.util.branchmaskcreator.BranchMaskCreator object at 0x11292c890>>
        event = <matplotlib.backend_bases.KeyEvent object at 0x12352ce50>

/Users/friedrichjohenning/python/samuroi/samuroi/util/branchmaskcreator.pyc in onkey(self=<samuroi.util.branchmaskcreator.BranchMaskCreator object>, event=<matplotlib.backend_bases.KeyEvent object>)
    107                     # shift by 0.5 to compensate for pixel offset in imshow
    108                     mask = BranchMask(x=numpy.array(self.x) + 0.5, y=numpy.array(self.y) + 0.5,
--> 109                                       z=[0 for i in self.x], r=self.r)
        global z = undefined
        i = 120.00227674999398
        self.x = [36.30114451608155, 41.96066968940189, 50.598862837330017, 58.045581068302553, 69.6624615086197, 97.662122057076402, 108.98113376815465, 117.61932691608278, 117.61932691608278, 120.00227674999398]
        global r = undefined
        self.r = [8.0, 8.0, 8.0, 8.0, 8.0, 8.0, 8.0, 8.0, 8.0, 8.0]
    110                 self.x, self.y, self.r = [], [], []
    111                 self.notify(mask)

TypeError: __init__() got an unexpected keyword argument 'y'

HD5 file dialog shows exceptions in background

Since the checkbox update requires opening hd5 files, if a non hd5 file is selected, the opening of the file fails and the exception in printed to terminal.

corresponding file and line:
h5dialogs.py line 91.

The kernel appears to have died. It will restart automatically

Hi,

I'm really new to this, but I've followed the instruction how to install samuROI on my mac, but when I tried to run from the setup in a jupyter notebook:

%matplotlib qt4
import samuroi
import numpy

#create some random data
data = numpy.random.normal(size=(100,100,30))
morphology = numpy.random.normal(size = (100,100))

#show the gui 
app = samuroi.SamuROIWindow(data = data,morphology=morphology)
app.show()

I get the following message:

The kernel appears to have died. It will restart automatically

With python crashing and nothing else happening. I've installed all the required packages from the list into my environment.

What am I doing wrong?

Cheers,
Ben

hd5 file import renames branches

when importing an hdf5 file, branches are given new names than when saved. this is very problematic when i try to reconstruct what I have done. (original branches 1, 3,5,7,9,11: hdf5 import results in 0,1, 2, 3, 4, 5

QWidget: Must construct a QApplication before a QPaintDevice

Hi,
I was able to run the test code listed in the documentation with the dummy numpy data on my windows VM, using a separate conda env with the samuroi dependencies. I was able to do this once. I did this using jupyter notebook. Any more run attempts brings about the error "QWidget: Must construct a QApplication before a QPaintDevice".
Any advice would be appreciated.
many thanks
Sotiris

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.