imaging.py has no attribute 'misc'

62 views
Skip to first unread message

erik flister

unread,
May 20, 2015, 9:39:26 PM5/20/15
to sima-...@googlegroups.com
i'm on win7/64, winpython/64/2.7.9.5

i installed with:
>pip install sima

* note -- the docs warn that prerequisites should be installed prior to installing sima.  isn't this what pip is for?  seemed to work for me, except shapely (pip installs it fine, but when running, it can't find geos.dll).

i fixed shapely with:
http://www.lfd.uci.edu/~gohlke/pythonlibs/48dkx8tj/Shapely-1.5.8-cp27-none-win_amd64.whl
> pip install --upgrade "C:\Users\nlab\Downloads\Shapely-1.5.8-cp27-none-win_amd64.whl"

to get \sima\examples\workflow.py, i cloned:

* note -- why isn't this included in the pypi install?

and downloaded/extracted:

i tried to run \sima\examples\workflow.py, which works for a while, then:

  File "C:\Users\nlab\Downloads\WinPython-64bit-2.7.9.5\python-2.7.9.amd64\lib\site-packages\sima\imaging.py", line 593, in export_averages
    out = sima.misc.to16bit(im)

AttributeError: 'module' object has no attribute 'misc'


other questions:
- according to the doc, i will also need OpenCV, picos, bottleneck, mdp, and MOSEK.  what is the recommended way to install these?  each individually manually with pip?

- i might prefer to run from the git repository, but the doc warns building is complex.  what should i be aware of?  the doc refers to this page, but it is blank:

- i want to try the method discussed here:
but i don't see a corresponding method under \sima\sima\segment -- i only see imaging.py/infer_spikes() and spikes.py -- but isn't the method about co-inferring segmentation and spikes?  does this mean i just run infer_spikes on an ImagingDataset, without running segment?

- i will probably want to interoperate with matlab, my usual environment.  what is the recommended method?  i was planning to try:
are there any gotchas going either direction with this (regarding speed, precision, version (v7 vs v7.3, which is apparently HDF5), endian across OS's, or less subtle issues)?  i tend to use lots of n-d numerics, structs, and cell arrays, but not tables, objects, categoricals, maps, timeseries, or ascii/csv.

thanks!
-e

Patrick Kaifosh

unread,
May 20, 2015, 11:20:58 PM5/20/15
to sima-...@googlegroups.com
Hi Eric,
Thanks for the feedback. I've put some comments in line.
Patrick


On Wednesday, May 20, 2015 at 9:39:26 PM UTC-4, erik flister wrote:
i'm on win7/64, winpython/64/2.7.9.5

i installed with:
>pip install sima

* note -- the docs warn that prerequisites should be installed prior to installing sima.  isn't this what pip is for?  seemed to work for me, except shapely (pip installs it fine, but when running, it can't find geos.dll).

Yes, it's mainly because of shapely and a few other hiccups that we recommend that people install the dependencies first.
 

i fixed shapely with:
http://www.lfd.uci.edu/~gohlke/pythonlibs/48dkx8tj/Shapely-1.5.8-cp27-none-win_amd64.whl
> pip install --upgrade "C:\Users\nlab\Downloads\Shapely-1.5.8-cp27-none-win_amd64.whl"

to get \sima\examples\workflow.py, i cloned:

* note -- why isn't this included in the pypi install?

If you find that the examples are not included in the installation, I would consider this a bug. Please submit a bug report here: https://github.com/losonczylab/sima
 

and downloaded/extracted:

i tried to run \sima\examples\workflow.py, which works for a while, then:

  File "C:\Users\nlab\Downloads\WinPython-64bit-2.7.9.5\python-2.7.9.amd64\lib\site-packages\sima\imaging.py", line 593, in export_averages
    out = sima.misc.to16bit(im)

AttributeError: 'module' object has no attribute 'misc'

This sounds like a bug as well. We recently changed things to reduce imports of all sub-modules. It looks like we may be missing a necessary import though. Please submit a bug report here: https://github.com/losonczylab/sima
 


other questions:
- according to the doc, i will also need OpenCV, picos, bottleneck, mdp, and MOSEK.  what is the recommended way to install these?  each individually manually with pip?

I would only recommend the various packages for the functionality that you intend to use. Some of these can be installed with pip, but OpenCV and MOSEK cannot. You can find out how to install them from their websites. Let us know if you have any trouble with this.
 

- i might prefer to run from the git repository, but the doc warns building is complex.  what should i be aware of?  the doc refers to this page, but it is blank:

It's not really that hard -- it's gotten easier as long as you have the dependencies installed correctly. Also, some people have trouble with the Cython compilation, especially on Windows. I'm not sure why the link above went blank, but the instructions seem to have moved here: https://github.com/cython/cython/wiki/CythonExtensionsOnWindows
Bug reports for problems with the documentation (e.g. broken links) are also very much appreciated.
 
- i want to try the method discussed here:
but i don't see a corresponding method under \sima\sima\segment -- i only see imaging.py/infer_spikes() and spikes.py -- but isn't the method about co-inferring segmentation and spikes?  does this mean i just run infer_spikes on an ImagingDataset, without running segment?

We are currently working with some collaborators to finish up the implementation of combined spike inference and segmentation. Currently, you first have to segment and then extract, and then use the infer_spikes() method to infer spikes from the extracted signals.

- i will probably want to interoperate with matlab, my usual environment.  what is the recommended method?  i was planning to try:
are there any gotchas going either direction with this (regarding speed, precision, version (v7 vs v7.3, which is apparently HDF5), endian across OS's, or less subtle issues)?  i tend to use lots of n-d numerics, structs, and cell arrays, but not tables, objects, categoricals, maps, timeseries, or ascii/csv.

We have created a few methods to export various data (time averages, imaging time series, signals time series) from sima into standard formats that can be read by MATLAB. You can use these, our develop your own custom exporting using the tools you have linked to above.
 

thanks!
-e

erik flister

unread,
May 21, 2015, 12:46:18 AM5/21/15
to sima-...@googlegroups.com
> The group sima-...@googlegroups.com does not allow posting through email.

hmm, why this setting?  

thanks patrick, issues submitted.


>> - i want to try the method discussed here:
>>
>> http://labrigger.com/blog/2015/04/23/new-spike-inference-for-sima/comment-page-1/
>> but i don't see a corresponding method under \sima\sima\segment -- i only
>> see imaging.py/infer_spikes() and spikes.py -- but isn't the method about
>> co-inferring segmentation and spikes?  does this mean i just run
>> infer_spikes on an ImagingDataset, without running segment?
>
> We are currently working with some collaborators to finish up the
> implementation of combined spike inference and segmentation. Currently, you
> first have to segment and then extract, and then use the infer_spikes()
> method to infer spikes from the extracted signals.

which segment method?


> We have created a few methods to export various data (time averages, imaging
> time series, signals time series) from sima into standard formats that can
> be read by MATLAB.

how about importing .mat image data?  i do my own motion correction
etc and want to try out just the segmentation at first, then spike
inference.  if it's straightforward with scipy.io.loadmat, no
problem...

-e

Patrick Kaifosh

unread,
May 21, 2015, 10:37:04 AM5/21/15
to sima-...@googlegroups.com, erik.f...@gmail.com
On Thursday, May 21, 2015 at 12:46:18 AM UTC-4, erik flister wrote:
> The group sima-users@googlegroups.com does not allow posting through email.

hmm, why this setting?  

Thanks for pointing this out. Email posting is now allowed.

erik flister

unread,
May 23, 2015, 6:30:35 PM5/23/15
to Patrick Kaifosh, sima-...@googlegroups.com
some issues left unresolved in the issue i opened for this that got closed:
(copy pasting from
https://github.com/losonczylab/sima/issues/172#issuecomment-104787005)

it's not spyder, it's ipython. from within ipython running standalone:
(see linked comment for trace showing EOF problem when calling input()
in ipython)

that's without typing anything in response to the question regarding
overwriting, it just EOF's immediately. within spyder's ipython, you
don't see any of that, it just hangs.

-what about show not recognizing the block argument?
(described at bottom of
https://github.com/losonczylab/sima/issues/172#issuecomment-104456926)

-to get opencv working with sima on windows, is it necessary
to add \opencv\build\x64\vc12\bin to windows' path, or is it enough to just
copy \opencv\build\python\2.7\x64\cv2.pyd to
\WinPython-64bit-2.7.9.5\python-2.7.9.amd64\Lib\site-packages\?

-which segment method implements the method discussed here?
http://labrigger.com/blog/2015/04/23/new-spike-inference-for-sima/

thanks!
-e

Patrick Kaifosh

unread,
May 24, 2015, 2:17:44 PM5/24/15
to sima-...@googlegroups.com, erik.f...@gmail.com
Hi Erik,

We can reopen the issue if the problem occurs generally with IPython.

Regarding the other issues, it would be appreciated if you could open a separate issue for each distinct problem so that we can more easily keep track of our progress trying to verify and fix each issue, and so that others with similar problems can find the relevant information more easily.

Thanks,
Patrick
Reply all
Reply to author
Forward
0 new messages