spectralpython / spectral

Python module for hyperspectral image processing
MIT License
571 stars 139 forks source link

Spectral Python _ Hypercube not Responding #90

Closed FarFromBoston closed 5 years ago

FarFromBoston commented 5 years ago

Im using the spectral python documentation to learn it: http://www.spectralpython.net/graphics.html

Im up to showing the hypercube but cant figure out whats wrong. I can import everything just fine - I have wxpython and PyOpenGL installed correctly with conda

When i run cell '24' I get the hypercube window as "hypercube not responding" then when i close it i get "Kernal died" I have to then restart Jupyter...

Why cant I see the hypercube? im following the documentation page exactly.

22222222222222

tboggs commented 5 years ago

I'm not sure if that will work from Jupyter due to the way the OpenGL window needs to run in a separate thread. Try running the same commands from the command line (outside of Jupyter) and see if it works for you there. If it doesn't work there, then you may just have a configuration issue. If it does work, then there is probably an incompatibility between the Jupyter kernel and python threading.

FarFromBoston commented 5 years ago

Using the windows powershell in the folder i tried to import wx and tried to run view_cube(img, bands=[29, 19, 9])

Both came back with:

import wx File "C:\Users\lewis\Anaconda3\Lib\site-packages\wx__init.py", line 12, in version = wx.version__.VERSION_STRING AttributeError: 'module' object has no attribute 'version'

my 'wx' package is bugged :/

apparently u have to comment a line like below, but i cant find it:

taken from this link: https://github.com/Azure/azure-iot-sdk-python/issues/24

zspatter commented 5 years ago

I'm having similar trouble with view_cube() function. I've been trying to follow the tutorial in the spectral documentation with scripts instead of Jupyter; however, I don't believe that is the intended usage. If I understand the documentation correctly, it is expected to be used with IPython.

As for displaying the hypercube - the note at the bottom of the Hypercube Display section seems to have addressed this for me.

tboggs commented 5 years ago

@zspatter, yes the view_cube function is intended for interactive use so it should be used from the IPython command line.

FarFromBoston commented 5 years ago

yeh only jupyter is supposed to work,

i also tried using a cfommand prompt and setting it with ipython --pylab=wx but although everything works (and like in jupyter i can import wx just fine) still view_cube is broken but for a different error this time: module 'wx' has no attribute 'Thread_IsMain'

Unless one of you got it working i really dont think i can be able to get this... oh well. maybe there is conflicting Ipython version with wx?

To clarify im using python 3.7

Ridhee commented 3 years ago

NameError Traceback (most recent call last)

in 2 #from wx import glcanvas 3 ----> 4 view_cube(img,[29, 19, 9]) NameError: name 'view_cube' is not defined I am getting its error. I have install wx. ![view cube prbl](https://user-images.githubusercontent.com/84409371/118706284-d23eae00-b836-11eb-876e-b3bb000d4a29.PNG) How to solve this?
tboggs commented 3 years ago

@Ridhee You need to import the function first:

from spectral.graphics import view_cube

Or just call spectral.view_cube instead.

Ridhee commented 3 years ago

Thank you Thomas. It worked

On Wed, 19 May, 2021, 10:09 PM Thomas Boggs, @.***> wrote:

@Ridhee https://github.com/Ridhee You need to import the function first:

from spectral.graphics import view_cube

Or just call spectral.view_cube instead.

— You are receiving this because you were mentioned. Reply to this email directly, view it on GitHub https://github.com/spectralpython/spectral/issues/90#issuecomment-844276381, or unsubscribe https://github.com/notifications/unsubscribe-auth/AUD7YG6G7LUA5LYREZ77I4DTOPSVFANCNFSM4H22JMXQ .