I'm sorry, we are not experts in this field. We do not offer specialized tools to remove this kind of artifacts yet (but contributors would be welcome!)
I don't know to what extent it is possible to correct for this DBS artifact, or if you should just accept that you can't remove it and ignore the data contaminated by it. It looks short, so it might not lose too much data. By trying to correct for the artifact with frequency filters, ICA, or other non-linear methods is that you might damage seriously the valid EEG data that you have immediately after the artifact.
Example of issues related with filtering:
The filter you used (0.5-100Hz) is 3.6 second long, with a high energy during at least 60ms. This means that if you apply this filter to a sharp transient (such as your DBS artifact), it will strongly propagate this artifact at least 60ms before and after the pulse, and more discretely up to 3.6s on each side. This will make the EEG recordings difficult to interpret at least 60ms after the last DBS pulse. If the artifact itself is shorter than 60ms, you might prefer not applying any filter.
Should I do linear detrend or do I have to reject the channel FT9
This seems really random to me...
Would it be better to use epochs as in Image 7 even if the filtering transient is possible.
In all the cases, you should not filter your data after epoching but filter the continuous files and then epoch, so the time window you consider for your epochs has no impact no the duration of the artifact.
Is it possible to do non-linear detrend to channel FT9 and should I try it?
This seems even more random than a linear detrend. You would alter your EEG data in a way you can't control. You don't know what you expect to see in the EEG after the pulse, so you don't know what to remove from your signal.
Is there some way that I could see the effect of removal of single ICA component in averaged signal without every time epoching data to database?
Not that I know of.
Is there some other method I could use to handle this edge effect?
No filter and no ICA, just marking as bad the artifact?
--
But maybe I'm wrong regarding everything that I wrote here, I am not familiar with this topic.
What I'd recommend is to contact other researchers working with EEG+DBS or EEG+TMS and ask them how they denoise their recordings if they claim they can interpret correctly the EEG during or immediately after the stimulation (during the observed artifact). You can find a list of articles published using Brainstorm on our publications page (https://neuroimage.usc.edu/brainstorm/Pub), and you should also try asking the EEGLAB, FieldTrip and MNE-Python communities.