zapline-plus
zapline-plus copied to clipboard
nt_zapline_plus: nremove checked on wrong dimension
In v1.2.1 nt_zapline_plus, line 54, if nremove>=size(x,1); error('!'); end
checks the wrong dimension. I think, it should be size(x,2)
.
I encountered this when trying to use zapline plus to clean two channels, only. An exception will be thrown later (in line 146), but I thought, you might want to know. The error can be bypassed by using fixed error components (= 1), but can perhaps be addressed, when set to adaptive. It is also possible, that I missed something and in that case I would be glad for advice. Cheers!
I can confirm this, I think you are right. I recommend setting this to the second dimension and using adaptive cleaning instead of fixed cleaning with 1 dimension.
Although I do think that using zapline-plus for two channels only will likely to be problematic as spatial filtering requires at least some precision there. Where does your EEG data come from?
Hi, thank you for your reply. I agree, that the 2 ch setup was indeed a very special case (see below). ;) I wanted to quickly pass on my observation, though, as adaptive cleaning also failed in my case. My use case was somewhat abductive, to put it mildly: I was briefly looking into methods to remove power line interference from EMG(!) data. A notch around 50 Hz (in my case) would already destroy too much information.
Yeah it is a valid bug report, so thanks :)
I see. Hmm, maybe in your case the cleanline function of EEGLAB might be more useful, or did zapline in the end work for you?
You are welcome. :) Yes, cleanline works fine, but has trouble working with non-stationary noise. I also looked into PREP’s cleanLineNoise, which seems a bit excessive and the implementation of the Regression-Subtraction method (Mewett, 2001) by Eiber & Pietersen, which also works, but would require some additional effort. So, yeah, Zapline plus is still tempting, but perhaps later™. Cheers!