Units for compute_current_source_density

Hi everyone,

I’m confused about the units in compute_current_source_density(). What unit does the function return as output, if we have Volts as input?

In my code below, if I enter µV in the function, what does it return? V/m² or µV/m²?
Then, when I want to retrieve my data with get_data(), is it necessary to specify the units?

Because all MNE should be in SI units, I suppose we have to work with Volt, and convert it later to µV? I only found this and this subject in forum.

In fact, my question is which unit comes out of compute_current_source_density() according to its input, and how do I get them back as an array with the right unity?

Here’s my code:

### Compute CSD
# Convert array data to epochs mne
epochs_MNE = mne.EpochsArray(epochs_array[ :,:64, :] * 1e6, info_temp) # I multiply epochs (in V) to obtain µV

# CSD calculation (input is µV so I supposed output is µVm²)
epochs_MNE_CSD = mne.preprocessing.compute_current_source_density(epochs_MNE)

# Convert to array and select units
epochs_MNE_CSD.copy().get_data(units='µV/m²') 

Thanks to all !

Johan

Why not work in SI units in which case the unit will be V/m² as suggested here Units before and after compute_current_source_density - #4 by larsoner ?

epochs_MNE = mne.EpochsArray(epochs_array[ :,:64, :], info_temp) # don't convert to µV
# CSD calculation (input is V so output is V/m²)
epochs_MNE_CSD = mne.preprocessing.compute_current_source_density(epochs_MNE)
epochs_MNE_CSD.get_data()

Mathieu

@mscheltienne Thanks for the answer.
Yes indeed you’re right, I also did it that way for safety.

In this case, with Volts at the input, I’m sure I’ll get V/m² at the output and I won’t make any unit errors?

@Johan yes that should be correct unless we have some bug – we try to stick to SI units for data storage and retrieval

1 Like

@larsoner Thank you very much !

This topic was automatically closed 7 days after the last reply. New replies are no longer allowed.