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

swt2.py demo not working #595

Closed
XareniGalindo opened this issue Jul 13, 2021 · 3 comments · Fixed by #609
Closed

swt2.py demo not working #595

XareniGalindo opened this issue Jul 13, 2021 · 3 comments · Fixed by #609
Labels

Comments

@XareniGalindo
Copy link

XareniGalindo commented Jul 13, 2021

Hello!

As the title of this issue says, I am trying to use swt2.py to get to know how the pywt.swt2 works to use it on my own images. However, when I run it I get the next error value:

ValueError: 'image' is not a valid value for origin; supported values are 'upper', 'lower'

Besides, when I try to use the demo presented on the home page (https://pywavelets.readthedocs.io/en/latest/index.html) on
my own data to run by adding the next code lines:

import numpy as np
import matplotlib.pyplot as plt
import pywt
import pywt.data
from PIL import Image

Load image

path = 'C:/Users/Xareni Galindo/Pictures/'
filename = '60xclose-3_w3soSPIM-561_s5-1to85-1.tif'

opening image

arr = Image.open(path + filename)

#converting images to array
arr.load()
data = np.asarray(arr)

The rest of the demo code is not changed, after running the code I get the next error message

ValueError: start_level must be less than 1.

What could be wrong? I am a newbie in coding and in the use of wavelets, so I am not sure what could be happening.

I am using PyWavelets 1.1.1 in Anaconda. my variable "data" is of type "array of uint8".

Thank you in advance

Xareni

@rgommers
Copy link
Member

rgommers commented Nov 6, 2021

ValueError: 'image' is not a valid value for origin; supported values are 'upper', 'lower'

I can reproduce this, something got broken.

@rgommers
Copy link
Member

rgommers commented Nov 6, 2021

This is a matplotlib bc-break, got changed in 3.3.0 apparently. See origin docs in https://matplotlib.org/3.3.0/api/_as_gen/matplotlib.pyplot.imshow.html. I'll fix this.

@rgommers
Copy link
Member

rgommers commented Nov 6, 2021

'image' corresponds to 'upper', which should be used now.

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

Successfully merging a pull request may close this issue.

2 participants