diff --git a/almkanal/almkanal.py b/almkanal/almkanal.py index 630d820..f714c9e 100644 --- a/almkanal/almkanal.py +++ b/almkanal/almkanal.py @@ -80,6 +80,8 @@ def do_ica( train: bool = True, train_freq: int = 16, threshold: float = 0.4, + img_path: None | str = None, + fname: None | str = None, ) -> None: # this should do an ica ica_info = ICAInfoDict( @@ -92,6 +94,8 @@ def do_ica( train=train, train_freq=train_freq, ica_corr_thresh=threshold, + img_path=img_path, + fname=fname, ) if self.info.ica is None: diff --git a/almkanal/data_utils/data_classes.py b/almkanal/data_utils/data_classes.py index acfbe7e..7febbef 100644 --- a/almkanal/data_utils/data_classes.py +++ b/almkanal/data_utils/data_classes.py @@ -25,6 +25,8 @@ class ICAInfoDict(TypedDict): train: bool train_freq: int ica_corr_thresh: float + img_path: None | str + fname: None | str @define diff --git a/tests/test_epoched.py b/tests/test_epoched.py index 357cd7d..5478b8a 100644 --- a/tests/test_epoched.py +++ b/tests/test_epoched.py @@ -2,10 +2,11 @@ from almkanal.almkanal import AlmKanal def test_src(gen_mne_data_epochs): #, ch_picks - data_path = mne.datasets.sample.data_path() - meg_path = data_path / 'MEG' / 'sample' + ak = AlmKanal(epoched=gen_mne_data_epochs) + data_path = mne.datasets.sample.data_path() + meg_path = data_path / 'MEG' / 'sample' fwd_fname = meg_path / 'sample_audvis-meg-vol-7-fwd.fif' fwd = mne.read_forward_solution(fwd_fname) ak.pick_dict['meg'] = 'mag' diff --git a/tests/test_raw.py b/tests/test_raw.py index 65e06eb..d3d8bd9 100644 --- a/tests/test_raw.py +++ b/tests/test_raw.py @@ -27,24 +27,38 @@ def test_ica(gen_mne_data_raw, train, eog, ecg, resample_freq, threshold): ) -def test_double_ica(gen_mne_data_raw): +# def test_double_ica(gen_mne_data_raw): + +# ak = AlmKanal(raw=gen_mne_data_raw) +# ak.do_ica(n_components=10, +# train=False, +# eog=True, +# ecg=False, +# resample_freq=100, +# threshold=0.4 +# ) + +# ak.do_ica(n_components=10, +# train=False, +# eog=True, +# ecg=False, +# resample_freq=100, +# threshold=0.4 +# ) + +def test_ica_plot(gen_mne_data_raw): ak = AlmKanal(raw=gen_mne_data_raw) - ak.do_ica(n_components=10, + ak.do_ica(n_components=40, train=False, eog=True, - ecg=False, + ecg=True, resample_freq=100, - threshold=0.4 + threshold=0.4, + fname='test', + img_path='./' ) - ak.do_ica(n_components=10, - train=False, - eog=True, - ecg=False, - resample_freq=100, - threshold=0.4 - ) def test_epoching(gen_mne_data_raw):