CoolFace
Apppublic

Aluode/PerceptionLabPortable

sourceHugging Faceupdated 9mo agoView on Hugging Face
0likes
_css.cpython-310.pyc60 linesDownload Raw Back to __pycache__
1o

2'�Yi+
�@sXddlZddlmZddlmZddlmZmZm	Z	ddd�Z3e		d
dd	�d4d��ZdS)�N�)�
_picks_to_idx)�Evoked)�_ensure_int�_validate_type�verbose�c
Cs~tj�|j�d}tj�|j�d}t�|j|�}tj�|�\}}}||}	|}5|	dd�d|�f}|6|}|7||j8}8dS)Nr)�npZlinalgZqr�T�dotZsvd)
Zref_2Zref_1�raw_data�n_projZ9ref_1_orthZ10ref_2_orthZ11cross_corrZref_1_ch_weights�_Zproj_matZ
filtered_dataZproj_vec�weights�r��E:\DocsHouse\542 percep lab latest\PerceptionLab\PerceptionLab_Portable\python_embed\Lib\site-packages\mne/preprocessing/_css.py�12_temp_projsr)rcCs�t|td�t|d�}t|j|ddd�}t|j|ddd�}t|j|ddd�}|��}|j}||}||}	||}13t||	|14|d�|15|j|d	d	�f<|S)16a%Apply cortical signal suppression (CSS) to evoked data.17 18    Parameters19    ----------20    evoked : instance of Evoked21        The evoked object to use for CSS. Must contain magnetometer,22        gradiometer, and EEG channels.23    %(picks_good_data)s24    mag_picks : array-like of int25        Array of the first set of channel indices that will be used to find26        the common temporal subspace. If None (default), all magnetometers will27        be used.28    grad_picks : array-like of int29        Array of the second set of channel indices that will be used to find30        the common temporal subspace. If None (default), all gradiometers will31        be used.32    n_proj : int33        The number of projection vectors.34    %(verbose)s35 36    Returns37    -------38    evoked_subcortical : instance of Evoked39        The evoked object with contributions from the ``mag_picks`` and ``grad_picks``40        channels removed from the ``picks`` channels.41 42    Notes43    -----44    This method removes the common signal subspace between two sets of45    channels (``mag_picks`` and ``grad_picks``) from a set of channels46    (``picks``) via a temporal projection using ``n_proj`` number of47    projection vectors. In the reference publication :footcite:`Samuelsson2019`,48    the joint subspace between magnetometers and gradiometers is used to49    suppress the cortical signal in the EEG data. In principle, other50    combinations of sensor types (or channels) could be used to suppress51    signals from other sources.52 53    References54    ----------55    .. footbibliography::56    �evokedr
�dataZbads)�none�exclude�magZgrad)r
N)rrrr�info�copyrr)rZpicksZ	mag_picksZ57grad_picksr
rZevoked_subcorticalZall_dataZmag_dataZ	grad_datarrrr�cortical_signal_suppression!s-58r)r)NNNr)�numpyr	Z59_fiff.pickrrr�utilsrrrrrrrrr�<module>s60��
Aluode/PerceptionLabPortable · CoolFace