ppsp-team / HyPyP

The Hyperscanning Python Pipeline
BSD 3-Clause "New" or "Revised" License
75 stars 42 forks source link

Adjust_loc functionality #19

Closed nigeljanssens closed 4 years ago

nigeljanssens commented 4 years ago

Should the function adjust a particular set of electrodes, say Fp1, Fp2, etc.? Or do all of the electrodes need to be adjusted? We are having issues using a 64-channel dataset so I wanted to confirm with you what the purpose of this function was so that I can align that dataset either by reducing my channels to 31 or by adjusting the corresponding electrodes to our dataset!

def adjust_loc(locs: np.ndarray, traZ: float=0.1) -> np.ndarray:
"""
Calculates new locations for the EEG locations.

Arguments:
    locs: array of shape (n_sensors, 3)
      3d coordinates of the sensors
    traZ: float
      Z translation to apply to the sensors

Returns:
    result: array (n_sensors, 3)
      new 3d coordinates of the sensors"""
# Added this line of code if we need to adjust all locations of an electrode set.
# locs = [locs[i,2] + traZ for i, in enumerate(locs)]

locs[0, 2] = locs[0, 2] + traZ
locs[1, 2] = locs[1, 2] + traZ
locs[2, 2] = locs[2, 2] + traZ
locs[3, 2] = locs[3, 2] + traZ
locs[13, 2] = locs[13, 2] + traZ
locs[17, 2] = locs[17, 2] + traZ
locs[24, 2] = locs[24, 2] + traZ
locs[28, 2] = locs[28, 2] + traZ
locs[29, 2] = locs[29, 2] + traZ
locs[30, 2] = locs[30, 2] + traZ
aayrolles commented 4 years ago

Thank you for your notification. The initial aim was to adjust some particular electrodes but we should remove this function and use only the transform function to adjust all the electrodes to the head model in order fit with larger channel dataset

aayrolles commented 4 years ago

We remove the adjust function that only worked with specific electrodes and now only use the transform function. It should be working with a 64-channels dataset now!

3D_Update_loc