1. A method for real-time mapping during surgery of subterritories of the subthalamic nucleus (STN) in the brain, the method comprising the steps of: (i) inserting one or more electrodes into the brain according to a predetermined insertion trajectory; (ii) advancing said one or more electrodes towards the estimated location of a dorsolateral oscillatory region (DLOR) of the STN; (iii) recording beta oscillatory activity by said one or more electrodes along the insertion trajectory; (iv) calculating power spectral analysis values for the beta oscillatory activity recorded along the insertion trajectory; and (v) using a Hidden Markov Model (HMM) based on part or all of the calculated power spectral analysis values along the insertion trajectory for detecting the borders of said DLOR and assigning to each selected point along the insertion trajectory one of the following regions with the highest probability value: 1. the DLOR of the STN; 2. the region in the insertion trajectory before the STN; 3. the region inside the non-oscillatory STN; or 4. the region in the insertion trajectory after the STN, thereby detecting borders of said subterritories of the STN in the brain.