I have been playing around with both mne and fieldtrip for analysing resting state continuous data. MNE is my go to, but others have recommended that fieldtrip is more appropriate for clinical data. What are peoples thoughts on this?
So far I have found that MNE is not sufficiently removing artifacts using automatic detection. However, following a nearly identical pipeline with FieldTrip, it does not seem to me that good separation has occured for the components. What could be driving this issue?
It does indeed look as if ICA decomposition didnāt really work.
May I ask why you switched over to FieldTrip just for visualizing the components? Iām asking because MNE-Python provides similar functionality.
As for the reasons ā could be that there are problematic channels that should be marked as bad, or there are some segments in the data with ānon-stereotypedā artifacts that should be excluded. Itās difficult to tell without actually looking at the data ā¦
I switched over the FieldTrip for the whole preprocessing pipeline. This is because whereas in the past Iāve always used mne for ERP data, currently Iām working on clinical data, and have been recommended by colleagues that FieldTrip is more standardised and potentially more powerful in a clinical context.
I used FieldTrips visual reject option to get rid of bad segments, the individual channels seem mostly okay. As for components, I am fitting 64 (there are 64 channels), but yes only showed 10 on the visualisation.
Yes it was full rank data, I tried with reduced rank to 40 components, and still unmixed and weird ICA results.
I just ran more or less the same pipelien in EEGLAB (only changes was applying CleanLine and not rejecting messy segments as in ft_rejectvisual option for FieldTrip). It seems ICA output is somewhat better? Would love to hear your thoughts on this.
@hWils just looking at the ICA topographies, I have a similar impression like @richard. It seems like something is wrong with your input data i.e., the source topographies look very focal. There are various reasons that can potentially affect ICA decomposition. Did you consider using a 1hz high-pass filter to remove the slow drift noise before applying ICA pipeline?
I agree that the reason for these ābadā ICs is probably the input data.
And to address the elephant in the room:
I donāt believe thatās true. āMore standardizedā and āpotentially more powerfulā also sound very generic, and I usually hear such arguments from people who are familiar with one tool (e.g. FieldTrip) and donāt know a lot about the other tool (e.g. MNE). It almost sounds like āMATLAB is better suited for real problems because it is developed by a companyā.
@hWils , coming from a clinical MEG background, I agree with the rest - fieldtrip doesnāt seem to be any more āpowerfulā or āstandardizedā for clinical analysis. All of these packages have their strengths and weaknesses and special functions (I have used MNE/Brainstorm/Fieldtrip extensively + commercial software)( different MRI tools have the same tradeoffs). And if this is a Matlab v Python argument - python currently has 16 times the global usage of Matlab, so it is plenty validated (TIOBE Index - TIOBE) .
It would be good to hear the specifics on what the investigators believe are missing in the MNE suite, so that functionality could be added.
oh wow! Thanks so much for the response everyone! Really grateful for the input
@dasdiptyajit yes, 1hz high pass filter was applied. Do you have any recommendations for how to best debug what is problematic in the input data? There do not seem to be so many gross muscle artifacts, and tried segmenting out data identified as bad via the ft_rejectvisual. Richard thanks for pointing out about the channel on the left side, I will experiment with removing bad channels next.
cbrnr and jstout211 the recommendation was actually made by a fellow mne user. It may be because myself and my colleague do not use fieldtrip or eeglab that we have put them on a bit of a pedestal. My other motivation for FT is that I have never seen MNE used in papers within my field, and being relatively new to this particularly research area, I wanted to keep everything as āstandardā as possible so I could closely follow pipelines in past research,
@jstout211, I love working with mne! The only functionality that comes to mind it being able to convert epochs back into a continuous data format. This is something FT enables
Defaulted back to MNE (yay) - using much more stringent segment rejection - Iāve got to these ICA components - to me they look far more reasonable, but would really appreciate a santiy check second glance on these at this point!!
Iām still not happy with the first two components. Thereās still something odd going on here. Please do check the corresponding property plots (if you pass the inst parameter to plot_components(), you can then right-click on the topographies to open the property plot)
But overall this already looks much better than before, yes!
Thanks @richard! I had assumed the first two were eye movement related - but not so sure now after seeing the propery plots. Do you have any recommendations for resources for upping my component artifact identification skills? Would really love to improve on this
Thereās something very fishy going on at around epoch number 150, according to the āDropped segmentsā plot. Iād look at those epochs again, you may find that thereās a strong artifact and one or more epochs may need to be removed before running ICA.
To convert epochs back to continuous, just put the epochs back into the numpy array. Assuming that you have no gaps between epochs, the following code will give you a continuous output (even though there may be jump discontinuities in the traces due to edge effects on processing). Some additional work can help to fix the āmissingā section below.
Also - if all you is just the ICAs on the continuous data - create the ICA solution on the epochs and apply to the raw data object.
raw = mne.io.read_raw_ctf('sub-ON28693_ses-01_task-sternberg_run-01_meg.ds', preload=True, system_clock='ignore')
#" Do Raw processing here"
raw.filter(1,None) #....
#" Do epoch stuff here "
epo = mne.make_fixed_length_epochs(raw, preload=True)
# <<Missing part - fix edge effects, set 0s/Nans/BadsLabel for rejected epo >>
# Recompose into continuous
raw._data=epo._data.transpose([1,0,2]).reshape([raw._data.shape[0],-1])
Also - the above is a quick hack to get back to continuous data (there may be some intricacies that are not accounted for that I donāt know about).
Thereās something very fishy going on at around epoch number 150, according to the āDropped segmentsā plot.
Definitely, Iām guessing you should mark as bad a segment around the end of your recording. Those 2 first components are not eye-related. Iām guessing ICA006 and ICA007 are the eye-movement components.