The idea is to read first the raw original fif file with the structure
Then change the data matrix (output of the reading) and replace it by raw data that have been ICA (removal of blink with SPM) and in the end write back the data. The ICA data are decomposed in 3 different sensors that we have to recombined into the appropriate matrix, this matrix should have the same size has the reading data..
All that could be done smoothly if I can have all the data point (i.e use the option quantum = to - from +1) which seems not to work for the moment.
Or may be am I using it incorrectly?
data are stored in buffers in fif files, so to do what you want to do
I would read
the entire raw data by chunks and store the chunks in one big matlab matrix.
Then apply your artifact rejection method before writing again the
data by chunks.
It requires a bit of coding though.
Regarding the ICA, beware that magnetometers and gradiometers have
different scales and if you don't pay attention your ICA will be dominated
by the signals with the highest variance ie. the magnetometers.
Thank you for your help
I managed to sort out my problem with working on the buffer size and everything looks ok.
Regarding the comments from Alex about ICA:
We used ICA separately for each sensors (Mag, Grad, and EEG) and remove the blink component separately.
Then we recombined all the sensors together..
Do you think it will be appropriate like that or will you recommend another way to do so?
Best wishes and happy bank holiday (in UK at least)
Sorry, I did just realize that in both of the papers I mentioned they (and we) were using a CTF machine, so only had gradiometers, so I don't have experience with using a separate ICA for each sensor type.
Thank you for your help
I managed to sort out my problem with working on the buffer size and everything looks ok.
great.
Regarding the comments from Alex about ICA:
We used ICA separately for each sensors (Mag, Grad, and EEG) and remove the blink component separately.
Then we recombined all the sensors together..
ok that works.
Do you think it will be appropriate like that or will you recommend another way to do so?
you could also scale the different group of sensors to make them comparable
in terms of variance to run the ICA jointly.
Just to add to this discussion on artifact removal (especially the
DC-level jumps which are common to several channels), here is a quick and
dirty approach that has worked for me.
For each channel
1. Differentiate the signal so that the DC jumps show up as large spikes
2. Replace the large spikes by the median of its neighborhood (median filter)
3. Re-integrate the signal
In general it seems to be more robust than ICA to remove DC-level jumps.
Hi Avniel,
Though derived using the temporal structure in the signals, ICA is
ultimately a static (i.e purely spatial) transformation. So how about
saving the ICA weights from the brain data and applying the same spatial
transformation to the empty room recordings?