Concurrent EEG-tDCS data processing

I’m working with EEG data recorded concurrently with transcranial direct current stimulation (tDCS) and am looking for others who are analyzing similar data. I’ve come across a few papers that process tDCS-EEG data, but most of them use EEGLAB / MATLAB (e.g., https://direct.mit.edu/jocn/article/30/11/1630/28954/Prefrontal-Modulation-of-Visual-Processing-and and Modulating prefrontal cortex activity to alleviate stress-induced working memory deficits: A transcranial direct current (tDCS) study - PMC ).

In particular, I’m interested in methods for removing tDCS artifacts from EEG. Some studies perform joint Blind Source Separation (BSS) as an initial preprocessing step before epoching and running ICA again to remove eye and muscle artifacts.

However, as far as I can tell, MNE-Python does not currently support joint BSS.

So my questions are:

  1. Is anyone here working with concurrent tDCS-EEG data using MNE-Python?

  2. Has anyone found a way to implement joint Blind Source Separation in Python/MNE, or does anyone have suggestions on how to approach this problem?

Any advice or shared experience would be greatly appreciated!

We don’t record and stimulate at the same time, but interleave them. I had some digesting to do of these two articles. In the Roy et al. (2025) article, the stimulation wasn’t performed during the task. That makes things considerably easier and reduces the need to pull out tDCS artifacts.

To make things a bit more practical to your specific data:

  1. Are you always stimulating while recording EEG and doing a task?
  2. What EEG system / tDCS system do you have?
  3. What are the properties of your tDCS stimulation?
  4. I’ll also note that while not the same, tACS is considerably easier to “clean” from your data.

Much like EEG-fMRI, the stimulation is magnitude(s) above the EEG signal, I’d see your choices as:

  1. Use Blind Source Separation - ICA is implemented in MNE-Python
  2. Try template subtraction - while not implemented in MNE-Python, we wrote a prototype a while ago (GitHub - nimh-sfim/gradient_remover: Gradient Removal with templates) that is still on my list to merge into the official distribution. The main need here is to have a marker for each cycle of stimulation to build the template
  3. Adaptive Filtering - subtracting out a reference signal - if you have the pure stimulation signal, you could potentially find creative ways to remove it from your EEG channels

Are you always stimulating while recording EEG and performing a task?

  • Yes, tDCS stimulation is applied throughout the entire task. The ramp-up and ramp-down phases occur outside of the task period.

What EEG and tDCS systems are you using?

  • We use a BioSemi ActiveTwo EEG system. For stimulation, we have a NeuroConn DC PLUS stimulator, along with an equalizer box that allows us to implement a 4x1 HD-tDCS setup.

What are the parameters of your tDCS stimulation?

  • Five rubber round electrodes (20 mm diameter). Current strength: 2 mA. 30 seconds for both ramp-up and ramp-down. Impedance maintained below 10 kΩ


Thanks for thinking along with me. Regarding your suggestions:

  • ICA: Yes, ICA is definitely an option. My only concern is whether a single ICA run will effectively capture all artifacts. In Roy et al., 2025, they first applied a blind source separation AAR method in EEGLAB, followed by an ICA. Their results were overall clean. However, since that initial AAR approach isn’t available in MNE, implementing something similar would probably come down to just doing a single ICA.

  • Template Subtraction: I’m not familiar with this method, but I’ll definitely look into it. Since our stimulation is constant, using markers for each stimulation cycle might not be as relevant in our case.

  • Adaptive Filtering: I explored this based on the paper “Automatic artifact suppression in simultaneous tDCS-EEG using adaptive filtering”. However, after contacting the authors, they advised against it, mentioning it was quite a lot of work and that a straightforward ICA might actually yield better results.