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

feature request: import power data from matlab or python OR more options to compute power (e.g., multitaper) #45

Open
XiaoyuZeng opened this issue Nov 19, 2020 · 7 comments

Comments

@XiaoyuZeng
Copy link

Hi all.

The preprocess module of RAVE calculated power using wavelet. I wondered that is it possible to provide more options to calculate power, such as multi-taper? Alternatively, RAVE users may compute power through multitaper way via matlab or python toolbox, and import the power data to RAVE to use the power explorer module.

Best regards,
Xiaoyu

@dipterix
Copy link
Collaborator

Thanks @XiaoyuZeng ,

Yes this is totally doable. As long as they follow RAVE file convention. RAVE files are stored at project > subject > rave folder. The critical data files use HDF5, csv, or yaml formats that can be generated or read by Matlab, Python, or C.

We are working on a new grant to incorporate Python and Matlab pipelines/models into RAVE. In the future there will be RAVE extensions for Matlab and Python.

Right now RAVE only has one pipeline because we re-implemented wavelet in R to make sure the results align with Matlab code. This makes the dev procedure slow. The reason why we do wavelet is because it also generates phase data. If you really want multitaper. There is a multitaper package. I will look at it and provide code (not interactive modules) for you to play with.

@dipterix
Copy link
Collaborator

Also, just a quick reference for myself - Code to preprocess subject without GUI #18

@XiaoyuZeng
Copy link
Author

@dipterix Thanks for the reply! I will try to first do multitaper power computation in fieldtrip, and then move the power data to project/subject/rave/data/power to see whether it works.

@jmagnotti
Copy link
Collaborator

Not to discourage the attempt, but it won’t be quite as easy as that. I’m not sure we have the time to help you debug the process fully at the moment as we are working on other items currently. I think this is a worthwhile endeavor, though, and maybe our best chance of success would be to have a quick zoom chat to go over the RAVE data structures with you? The next couple weeks are hectic, but maybe the second week of December would work

@XiaoyuZeng
Copy link
Author

@jmagnotti @dipterix
Actually, our attempt to load the power data exported from MATLAB has succeeded. The key point is to export the HDF 5 file correctly. So far, the power explorer seems to work well with the replaced power data.

Thanks for your support!

@jmagnotti
Copy link
Collaborator

jmagnotti commented Nov 24, 2020

Oh, ok. So you first processed in RAVE, and then just replaced the data within the .h5 files? Gotcha, I understand now :) clever. I thought you were working with a new subject that didn't have any files in place.

Just a thought: The common average referencing probably won't work, as that relies on power and phase, but if you referenced the data prior to multi taper you should be good to go.

@XiaoyuZeng
Copy link
Author

XiaoyuZeng commented Nov 25, 2020

@jmagnotti Yes, you got me.

Here comes a short note for those RAVE users who demand to use RAVE power explorer to showcase the power data exported from other toolboxes. Basically, you can achieve the goal within two steps.

  1. Create a new subject and a new project in RAVE (via preprocess). This step serves to create the corresponding data folder and metadata files for each sub in each project. After that, revise the generated metadata files (e.g., electrode, epoch).
  2. Export the power data you produced with other toolboxes to .h5 files correctly. To make this step easier to succeed, you may load a demo .h5 file first and replace the corresponding content of the .h5 file with your own power data. Finally, you just move the .h5 files to the power folder. Note that, if you found that the power explorer didn't show the replaced power data, it's likely due to the cache power data. You may have a try to delete the cache power data ('data_dir\project\sub\rave\data\cache\power').

Good luck.

Thanks again for the helpful guide from @dipterix @jmagnotti

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

No branches or pull requests

3 participants