Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

view_cube(): There is no current wx.App object - creating one now #163

Open
qm-intel opened this issue Dec 27, 2023 · 1 comment
Open

view_cube(): There is no current wx.App object - creating one now #163

qm-intel opened this issue Dec 27, 2023 · 1 comment

Comments

@qm-intel
Copy link

qm-intel commented Dec 27, 2023

@toaarnio @tboggs @donm @lewismc

I am trying to visualize my hypercube data using spectral package and I follow the commands in the main page of spectral by ipython --pylab=wx and then I loaded the data to view::

import spectral
from pylab import *
from spectral import *
spectral.settings.WX_GL_DEPTH_SIZE = 16
hsi_root = "mypath_to_hsi/"
hypercubes = os.listdir(hsi_root)
hsi_list = os.listdir(hsi_root)
idx = 3
filename = "cube_envi32"
data_path = os.path.join(hsi_root, hsi_list[idx], filename)
# Load hypercube data
data = SpyFile.load(envi.open(data_path + '.hdr', data_path + '.dat'))  # (512, 640, 92)

when I am trying to view the cube , I am getting the following message:

view_cube(data,bands=[29, 19, 9])
There is no current wx.App object - creating one now.
  warnings.warn('\nThere is no current wx.App object - creating one now.',
Out[17]: <spectral.graphics.graphics.WindowProxy at 0x7f9dd694ef10>

UPDATED:
I added the following codes to initiate wx.APP(). I followed the post here:

https://discuss.wxpython.org/t/instance-of-wx-app/36663/2

app = wx.App()
print(app)
print(wx.GetApp())
print(wx.App.Get())
print(wx.App.GetInstance())
print(wx.AppConsole.GetInstance())

it opens a pycharm window by showing nothing and then it forces to close the window
enter image description here

and the output is a blank window. How to solve this?

@qm-intel qm-intel changed the title There is no current wx.App object - creating one now view_cube(): There is no current wx.App object - creating one now Dec 27, 2023
@lewismc
Copy link
Contributor

lewismc commented Jan 4, 2024

Hi @qm-intel are you able to provide a sample of the input data? Thanks

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants