arsenal9971 / Shearlab.jl

Shearlab is a Julia Library with toolbox for two- and threedimensional data processing using the Shearlet system as basis functions which generates an sparse representation of cartoon-like functions.
https://arsenal9971.github.io/Shearlab.jl/
Other
31 stars 9 forks source link

more idiomatic API #9

Closed ssfrr closed 6 years ago

ssfrr commented 7 years ago

I haven't fully wrapped my head around everything the package does, but it seems super useful, and as someone not really familiar with shearlets in general, I'm really impressed with the results.

If you're interested, there are a few things that I think you could do to make your package's API a little more "julian".

  1. You include your own image loading facilities wrapping around PyPlot, but you're also depending on Images, so maybe you can try to interoperate more with the Images/FileIO stuff? It seems like you may be able to remove PyPlot as a dependency.
  2. Once you have a ShearletSystem object, you can remove a lot of information from the function names and rely on dispatch

As an example, it seems like you could have something more like:

using FileIO, Shearlab

X = load("someimg.png")
sys = ShearletSystem(args...)
transformed = dst(X, sys) # discrete shearlet transform, analogous to `fft`, `dwt`
@assert isapprox(idst(transformed, sys),  X)

It may be that shearlet() and ishearlet() are better than dst() and idst() for clarity, but the general idea is to move information from the function names into the type system, so the shearlet() function could work for 1D, 2D, whatever, depending on how the ShearletSystem was constructed. There also may be some gotchas, but IMO this would be a nice direction to move in.

arsenal9971 commented 7 years ago

Hi Spencer, sorry for the late response, but I am pretty busy at the moment. I think sounds like a super idea, thanks for the tips, please keep using the library I am very open for advices, I already added some useful examples, if you have not check yet the inpainting and denoising examples, they are pretty impressive.

I also need to do a better documentation for everything, thanks a lot for the help, don't hesitate in asking more questions or collaborate with the library.

arsenal9971 commented 7 years ago

Hey @ssfrr could you use Shearlab.jl for some application? I am trying to track Shearlab user community

ssfrr commented 6 years ago

Though the examples are definitely impressive, I haven’t yet tried the package on my own problems. I’ll definitely let you know if/when I do, though!

arsenal9971 commented 6 years ago

Thanks!, maybe you could tell me some problem that you think it could be done by Shearlab and I can work on a demo

ssfrr commented 6 years ago

I don't have a particularly well-formed problem, but it seems like the hole-filling that shearlets seem to be good at could be useful for audio spectrogram editing. For instance, you might edit out an unwanted sound in the STFT domain, and then try to fill the gap. Does the library work for complex-valued 2D functions?

arsenal9971 commented 6 years ago

Yes, it works for complex-valued 2D functions