wonambi icon indicating copy to clipboard operation
wonambi copied to clipboard

Possibility to run analysis on several datasets in GUI?

Open skjerns opened this issue 2 years ago • 2 comments

I'm having a colleague with no coding experience that would like to run some spindle analysis. Wonambi seems perfect for this!

However, it seems like each participantt would need to be loaded&analysed individually, is that correct?

skjerns avatar Mar 14 '22 12:03 skjerns

Hi ! Yes that's right, we don't offer any way of batch processing datasets from the GUI. In order to do so, you'll need to run a script, e.g.

`from wonambi import Dataset from wonambi.detect import DetectSpindle

method = 'Lacourse2018' records_list = ['Subject1.edf', 'Suibject2.edf', ...] annotations_list = ['Subject1.xml', 'Subject2.xml', ...] rater = 'rater_name_here' stage = ['NREM2'] cat = (1, 1, 1, 0) chan = ['Cz'] ref_chan = ['M1', 'M2'] event_name = 'event_name_here'

detector =DetectSpindle(method) for rec_file, annot_file in zip(records_list, annotations_list): dset = Dataset(rec_file) annot = Annotations(annot_file, rater=rater) segments = fetch(dset, annot, cat=cat, stage=stage) segments.read_data(chan=chan, ref_chan=ref_chan) data = segments[0]['data'] spindles = detector(data) spindles.to_annot(annot_file)`

One day soon I plan to post some simple example scripts.

jnobyrne avatar Mar 16 '22 18:03 jnobyrne

perfect, thanks :)

skjerns avatar Mar 17 '22 08:03 skjerns