HyPyP icon indicating copy to clipboard operation
HyPyP copied to clipboard

Cross-Wavelet Transform (CWT)

Open deep-introspection opened this issue 3 years ago • 16 comments

Later on, consider cross-frequency.

deep-introspection avatar Nov 16 '21 13:11 deep-introspection

@deep-introspection is there any version of wavelet transform coherence analysis currently in HyPyP? I assumed there was, and on looking at compute_sync, I can't tell but assume the 'coh' connectivity measure refers to cross-spectral coherence?

I am planning to do my analysis using wavelet transform coherence analysis and I am happy to contribute to this toolbox however possible, if the feature does not exist yet.

claytonjschneider avatar Jun 08 '22 21:06 claytonjschneider

Hi- we are currently in the process of working on some wavelet based analysis tools based on the cross wavelet transform described in Torrence and Compo's 1998 paper (https://paos.colorado.edu/research/wavelets/). Currently, this works for EEG, but I am still working on some bugs for fNIRS. Later this week, I am planning to upload what I have so far to my branch of HyPyP as a rough draft and provide a link to that here so that you can see what I have so far and if it suits your needs.

katied-neuro avatar Jun 14 '22 17:06 katied-neuro

Awesome, thank you for the update @katied-neuro . If you happen to think of it, please @ me here when you push that to your branch! I can do my best to help debug / show you how it works for our data.

claytonjschneider avatar Jun 15 '22 20:06 claytonjschneider

Hi @claytonjschneider,

Here is the wavelet draft. I need to add error messages to warn people about duplicate/identical datasets and using too small a time frame for the analyses. I also need to program the plots so that the COI is indicated (i.e. the area not fit for use).

Let me know what you think. https://github.com/katied-neuro/HyPyP/blob/master/tutorial/fnirs-wavelets-2022-07-06kd.ipynb

Thanks!

katied-neuro avatar Jul 06 '22 19:07 katied-neuro

Hi @katied-neuro !! Thank you so much! I will take a look now :D appreciate you sharing this with me and all that you are doing at HyPyP

claytonjschneider avatar Jul 06 '22 20:07 claytonjschneider

@katied-neuro do I need to be using a specific branch to access this code for now? If it's the branch under your name, I don't know that I can access it. I got a 404 when trying to look.

claytonjschneider avatar Jul 07 '22 20:07 claytonjschneider

Weird- what about if you try to access my branch directly and then find the wavelets in the tutorial section? https://github.com/katied-neuro/HyPyP

katied-neuro avatar Jul 07 '22 20:07 katied-neuro

Nice, looks like that works. So I'm going to give this a shot now by cloning the repo, rather than installing via pip, and checkout to your branch, and import the library from sys path before import. Hopefully that works?

claytonjschneider avatar Jul 07 '22 20:07 claytonjschneider

Go- for it... Just head's up, I'm a self-taught coder and not very good with Github. So once, the wavelets are finished, I'm going to have to reset my branch to the original HyPyP using git and then upload the final version of the wavelets to avoid anything too weird happening. The other option is just to download the wavelet tutorial and go through it with your current version of HyPyP with out relying on a clone of my repository (this what I am doing!).

katied-neuro avatar Jul 07 '22 20:07 katied-neuro

@katied-neuro somehow I'm still running into issues with my versions. ugh.

What is the result when you run import mne >>> mne.version ? I have v1.0.3. When I try to import your hypyp package, I get the same error every time even in the production version: no module named 'mne.externals'. I'm really frustrated with this darned bug I can't seem to get my versions to match up. Using python v3.7.5

claytonjschneider avatar Jul 07 '22 20:07 claytonjschneider

Are you talking about my repository or HyPyP in general?I have mne 0.24.0. and looking at HyPyP, it is currently set-up according to the requirements.txt for mne 0.24.0.

katied-neuro avatar Jul 07 '22 20:07 katied-neuro

OK I'm back to mne 0.24.0, hopefully that works as I've ran into problems with the previous versions of MNE loading NIRx data before.

Also - how are you adding your local HyPyP branch to your python modules? I tried adding it to the path with sys.path.append, then import hypyp, and got this error: DistributionNotFound: The 'hypyp' distribution was not found and is required by the application.

Then I tried running pip install . from inside the cloned repository, but got an error that the wheel building failed.

I can't seem to find a setup.py if one exists - so how do I import your branch?

claytonjschneider avatar Jul 07 '22 21:07 claytonjschneider

Thanks for helping me through this, I am pretty new to it as well

claytonjschneider avatar Jul 07 '22 21:07 claytonjschneider

I think you are doing something a little too complex here. Do you use jupyter notebooks? It might be best to call and try and talk this throug. Do you have an email you can be reached at (if you don't want to post it on github, you could message me on twitter)?

katied-neuro avatar Jul 07 '22 21:07 katied-neuro

Aweome! I messaged you on twitter

claytonjschneider avatar Jul 07 '22 21:07 claytonjschneider