|
21 | 21 | from scipy.stats import circmean |
22 | 22 | from sklearn.ensemble import IsolationForest |
23 | 23 |
|
24 | | -from .io import is_pyriemann_installed, is_tensorpac_installed, set_log_level |
| 24 | +from .io import is_pyriemann_installed, set_log_level |
25 | 25 | from .numba import _detrend, _rms |
26 | 26 | from .others import ( |
27 | 27 | _index_to_events, |
28 | 28 | _merge_close, |
| 29 | + _norm_direct_pac, |
29 | 30 | _zerocrossings, |
30 | 31 | get_centered_indices, |
31 | 32 | moving_transform, |
@@ -1576,9 +1577,8 @@ def sw_detect( |
1576 | 1577 | be calculated for each slow-waves using a 2-seconds epoch centered around the negative |
1577 | 1578 | peak of the slow-waves (i.e. 1 second on each side). |
1578 | 1579 |
|
1579 | | - * ``p`` is a parameter passed to the :py:func:`tensorpac.methods.norm_direct_pac`` |
1580 | | - function. It represents the p-value to use for thresholding of unreliable coupling |
1581 | | - values. Sub-threshold PAC values will be set to 0. To disable this behavior (no masking), |
| 1580 | + * ``p`` is the p-value used for thresholding of unreliable coupling values (ndPAC). |
| 1581 | + Sub-threshold PAC values will be set to 0. To disable this behavior (no masking), |
1582 | 1582 | use ``p=1`` or ``p=None``. |
1583 | 1583 |
|
1584 | 1584 | .. versionadded:: 0.6.0 |
@@ -1710,9 +1710,6 @@ def sw_detect( |
1710 | 1710 |
|
1711 | 1711 | # Extract the spindles-related sigma signal for coupling |
1712 | 1712 | if coupling: |
1713 | | - is_tensorpac_installed() |
1714 | | - import tensorpac.methods as tpm |
1715 | | - |
1716 | 1713 | # The width of the transition band is set to 1.5 Hz on each side, |
1717 | 1714 | # meaning that for freq_sp = (12, 15 Hz), the -6 dB points are located |
1718 | 1715 | # at 11.25 and 15.75 Hz. The frequency band for the amplitude signal |
@@ -1925,9 +1922,7 @@ def sw_detect( |
1925 | 1922 | # 3) Normalized Direct PAC, with thresholding |
1926 | 1923 | # Unreliable values are set to 0 |
1927 | 1924 | ndp = np.squeeze( |
1928 | | - tpm.norm_direct_pac( |
1929 | | - sw_pha_ev[None, ...], sp_amp_ev[None, ...], p=coupling_params["p"] |
1930 | | - ) |
| 1925 | + _norm_direct_pac(sw_pha_ev[None, ...], sp_amp_ev[None, ...], p=coupling_params["p"]) |
1931 | 1926 | ) |
1932 | 1927 | sw_params["ndPAC"] = np.ones(n_peaks) * np.nan |
1933 | 1928 | sw_params["ndPAC"][idx_valid] = ndp |
|
0 commit comments