## Materials and Methods
### Patient Multi-Domain Assessment
#### 2.3.4 EEG Data Analysis  
Data EEG analysis was performed offline in Matlab (Mathworks, Natick, MA, USA) using the EEGLAB toolbox. After a re-sampling (fs = 500 Hz) the signals were filtered by means of a bandpass FIR filter [0.5 Hz, 45 Hz]), and re-referenced to the common average reference. The ear channels (M1 and M2), were excluded from further analysis. The movement onsets (t = 0) were individuated by the muscular activation using the EMG acquisitions and an in-house algorithm developed in MATLAB allowing the signal epoching. The epochs featuring a signal exceeding \(\pm\)100 uV and the ones affected by noise (visual inspection aided by the epochs removal tool) were rejected. As a result, in between 9 and 18 epochs were analyzed for each subject. The Independent Component Analysis (ICA) using the logistic infomax ICA algorithm, implemented in EEGLAB was performed in order to remove ocular artifacts, muscle artifacts, lost electrode connections, etc. [40]. The selection of the resulting components to be rejected was supported by SASICA, an automated method [41].  
Two frequency bands were separately analyzed, namely the alpha (8-13 Hz) and beta (13-25 Hz) bands where the modulations in power were high. The relative power (RP) values for each frequency band was calculated after averaging out all the valid epochs of a patient. RP was computed as the summed absolute band-power in a specific instant, with respect to the average power of the same frequency band at the baseline (in our case: [\(-\)4.5 s, \(-\)2 s]) as suggested by [PERSON] et al. [22]. Quantitative indices were then computed for the electrodes of the primary motor cortex (C3 and C4). The electrode C3 was labeled as 'CONTRA' (C4 = 'IPSI') when the patient lesion was located on the left hemisphere, and the movement was performed with the right limb (the lesioned one). Otherwise, the labels were switched. The absolute band-power values were used to calculate the following quantitative indices:  
1. The mean Event Related Desynchronization (ERD) in the window [0.6 s, 1.8 s] with respect to the baseline [\(-\)4.5 s, \(-\)2 s]. From now on, ERDc(P\({}_{j}\)) and ERDi(P\({}_{j}\)) will refer to the average ERD for the \(j\)-th patient computed for the CONTRA or IPSI electrode, respectively.
2. The laterality coefficient (LC), which indicates the activation of the lesioned hemisphere with respect to the other according to the following formula [28]:\[LC(Pj)=\frac{ERDc(Pj)-\ ERDi(Pj)}{ERDc(Pj)+\ ERDi(Pj)}\]  
Quantitative values of ERDi, ERDc, and LC were computed only in the central part of the movement (MOV2) in order to cope with uncertainties and to avoid artifacts related to the start/end of task. The laterality index should span from \(-1\) to \(1\), representing the complete lateralization toward the ipsi- or contra-lateral hemisphere, respectively. In case a patient shows positive values for the average relative power in the movement window (ERD \(>0\)), we set it to \(0\) (no desynchronization occurs) when computing the lateralization, for the sake of consistency with LC meaning and to cope with its range limits. All indices are assessed both at T0 and T1, to verify whether changes in the brain activity occurred after robotic rehabilitation. Variations of a generic index X are computed as \(\Delta\)X = X(T1) \(-\) X(T0). Average values are calculated and identified by the formalism \(\overline{X}\). A two-sided Wilcoxon signed rank test is performed to verify possible distribution differences for EEG-based indices pre/post rehabilitation (\(p\) = 0.05).