-
AuthorPosts
-
01/04/2018 at 10:55 AM #3943Martijn BeudelParticipant
Dear Lead DBS community,
we’re working on a neurophysiological DBS project and wan’t to map neurophysiological parameters other than beta power (Horn et al. HBM 2017) onto the STN. We did our pre-processing however in a different program and now have a x-y-z vector for each DBS contact. Up to now we couldn’t discover how to import these in lead-DBS. Is any of you familiar with this approach or do you know a workaround?
bw and many thanks in advance
Martijn Beudel
01/04/2018 at 9:26 PM #3946andreashornKeymasterHi Martijn,
I think this is doable and I recently tried, you’d need to write a script to generate the files
ea_reconstruction.mat
only. In these files, you’d only need to fill the variable:
reco.mni.markers.head and reco.mni.markers.tail
These should be the locations of lowermost (head) and uppermost (tail) contacts.As far as I assume Lead-DBS will create the rest automatically once you localize the electrodes the first time.
To do so, you’d need to load up a blank folder which has only the ea_reconstruction.mat file and run the visualization step.Hope this helps!
Best, Andy
01/05/2018 at 3:54 PM #3950Martijn BeudelParticipantHi Andy,
many thanks for your quick reply and good to hear that this approach works. When trying to generate the ea_reconstruction.mat file for one hemisphere I entered:
reco.mni.markers.head =[10 10 10]
reco.mni.markers.tail =[10 10 0]ea_reconstruction = {[reco.mni.markers.head], [reco.mni.markers.tail]}
save ea_reconstruction
however, I’m not sure whether this suffices. When specifying this file in section 1 (specifying patient, electrode model and imaging method) of leadDBS and choosing ‘ea_reconstruction’ in the second scroll down menu, the
word ‘ea_reconstruction’ is immediately replaced with ‘Recent Recent patients’ . Furthermore, when running steps 5, (6) or 7 I get the following error:** Process done.
Invalid MEX-file ‘/Applications/MATLAB74/spm12/spm_existfile.mexmaci64’: dlopen(/Applications/MATLAB74/spm12/spm_existfile.mexmaci64, 6): Library not loaded:
@loader_path/libmex.dylib
Referenced from: /Applications/MATLAB74/spm12/spm_existfile.mexmaci64
Reason: image not found.I presume this has to do with either the incorrect format of the ea_reconstruction.mat file or the wrong visualisation step.
bw
Martijn
01/05/2018 at 4:19 PM #3951andreashornKeymasterHi Martijn,
again, to do so, you’d need to load up a blank folder which has only the ea_reconstruction.mat file and run the visualization step.
It surely also makes sense to have some experience with the usual Lead-DBS workflow (e.g. localize one patient in Lead-DBS completely and get acquainted with the methods).
Moreover, we optimized normalizations and coregistrations, as well as brainshift correction highly during the last three years and new results (still unpublished) indicate that the choice of normalization method (or ANTs preset, etc) does matter drastically for DBS. So I can only recommend to use the Lead-DBS defaults over other methods (like FNIRT, DARTEL or a custom ANTs preset or similar, best in a multispectral way, i.e. feeding T1 and T2 in at least) for best results. But of course totally understand if you prefer to use your own preprocessing methods (in that case just put the ea_reconstruction file into a blank folder and select that one).Best, Andy
01/05/2018 at 4:47 PM #3952Martijn BeudelParticipantHi Andy,
Indeed we tried two of our patients with the original images and were able to produce sensible results. I now moved the ea_reconstruction.mat file to a blank folder and (tried to) load it up in step 1 (specifying patient, electrode model and imaging method) and (immediately) visualise it (step 7). Unfortunately, I got the same error:
Undefined function or variable ‘coords_mm’.
could it still be that
reco.mni.markers.head =[10 10 10]
reco.mni.markers.tail =[10 10 0]
ea_reconstruction = {[reco.mni.markers.head], [reco.mni.markers.tail]}does not generate the proper ea_reconstruction.mat file?
bw
Martijn
01/05/2018 at 8:46 PM #3957andreashornKeymasterHi Martijn,
sorry, my bad! I didn’t realize how long we didn’t update the website version (since bigger new/revised features are in the making). I actually did only recently add compatibility with such manual localizations and it should work if you use the github version – or wait for the next release.
Sorry about that, didn’t think about it properly.Best, Andy
01/05/2018 at 11:24 PM #3962ningfeiKeymasterHi Martijn,
And if you want to try the github version of LEAD DBS, you might also need to set another two fields (in addtion to
head
andtail
) ofreco
to make it work. So it would look like the following code (where1
means right side and2
means left side):reco.props(1).elmodel = 'Medtronic 3389';
reco.props(2).elmodel = 'Medtronic 3389';
reco.props(1).manually_corrected = 1;
reco.props(2).manually_corrected = 1;
reco.mni.markers(1).head = [ x x x];
reco.mni.markers(1).tail = [ x x x];
reco.mni.markers(2).head = [ x x x];
reco.mni.markers(2).tail = [ x x x];
save('ea_reconstruction.mat', 'reco');
Besides, are you using MATLAB R2007a (MATLAB74)? LEAD DBS needs MATLAB version > R2014b for some functions and visualizations. Better to use R2015b or later with LEAD DBS.
Best,
Ningfei01/12/2018 at 2:05 PM #4002Martijn BeudelParticipantHi Ningfei & Andy,
thanks once more for the update. The new 2.0.0.6 version looks good. Unfortunately it was not until this Friday afternoon that I could manage to implement your suggestions and it seems like we’re getting somewhere.
I can upload the above file in the 2.0.0.6 version in step 1 (of the ‘normal’ Lead DBS (i.e. not connectome or anatomy) toolbox and do see two electrodes in 3D in which changing parameters (i.e. z-coordinate values) result in sensible changes in space. Is, however, seems that the folder
Error using spm_vol>spm_vol_hdr (line 80)
File “/Applications/MATLAB74/leaddbs-master/templates/space/MNI_ICBM_2009b_NLIN_ASYM/t1.nii” does not exist.is missing the t1.nii file, which seems to be neccesary for visualisation. Does this sound familiar?
ps I’m running ML 17b, although my archiving is a little bit archaic
bw
Martijn
01/12/2018 at 2:17 PM #4004ningfeiKeymasterHi Martijn,
If you are using the Github version of Lead, be sure to download the additional data files as well (as indicated in the Github README). Extract the data file into Lead installation folder and try again.
Best,
Ningfei01/12/2018 at 3:57 PM #4006Martijn BeudelParticipantthanks, that did the job! I can now import the electrodes in MNI space.
01/12/2018 at 5:43 PM #4007andreashornKeymasterGreat, thanks for letting us know that it worked!
Best, Andy
03/10/2019 at 5:32 PM #6943joey.hsuParticipantHello,
Looking to follow up on this old thread.
I am attempting to do a similar procedure as Martijn has described above but to be able to visualize the manually entered localization alongside an actual localization done with lead dbs through lead group.
I’ve followed Ningfei’s advice of setting up the reco variable for the manual entered localization and putting that into a blank subject folder, and that loads OK with the 3D visualization through lead dbs.
However, when I try to visualize the two localizations together in lead group, I get the following error:
_________________________________________________________________________________________
Cell contents reference from a non-cell array object.Error in ea_showelectrode (line 34)
trajvector=mean(diff(trajectory{side}));Error in ea_trajectory>update_trajectory (line 242)
[obj.elpatch,obj.ellabel,obj.eltype]=ea_showelectrode(obj.plotFigureH,obj.elstruct,obj.pt,poptions);Error in ea_trajectory (line 159)
update_trajectory(obj);Error in ea_elvis (line 164)
el_render(end+1)=ea_trajectory(pobj);Error in lead_group>vizbutton_Callback (line 545)
resultfig=ea_elvis(options,M.elstruct(ptidx));Error in gui_mainfcn (line 95)
feval(varargin{:});Error in lead_group (line 42)
gui_mainfcn(gui_State, varargin{:});Error in
matlab.graphics.internal.figfile.FigFile/read>@(hObject,eventdata)lead_group(‘vizbutton_Callback’,hObject,eventdata,guidata(hObject))
Error while evaluating UIControl Callback._______________________________________________________________________________________
It seems to do specifically with the manually entered localization as the lead group 3d visualization works fine if I just select the subject localized with lead dbs. I suspect it has to do with the fact that there is no further imaging/trajectory information available for the manually entered localization subject for the lead group script to use.
I am running matlab 2017b and lead suite 2.1.8.1
Thank you!
Joey03/10/2019 at 8:45 PM #6944andreashornKeymasterHi Joey,
it seems like you can simply uncomment those lines (in general).
https://github.com/netstim/leaddbs/commit/51cdd3ba26ec1671d99b53657dcea6d2fa4f8d0cHope that fixes it!
Best, Andy
03/10/2019 at 8:45 PM #6945andreashornKeymasterHi Joey,
it seems like you can simply uncomment those lines (in general).
https://github.com/netstim/leaddbs/commit/51cdd3ba26ec1671d99b53657dcea6d2fa4f8d0cHope that fixes it!
Best, Andy
03/11/2019 at 4:19 PM #6951joey.hsuParticipantHi Andy,
Thanks for your response!
I commented those lines out and they resolved the specific error that was in my post, but unfortunately does not fix the general issue of the electrodes for the manually entered localization not showing up.
I believe the larger issue has to do with the assignment of the “coords_mm” and “trajectory” variables at the top of the ea_showelectrode function.
When using lead group, the “coords_mm” and “trajectory” fields of the “elstruct” input variable are empty for the subject with the manually entered localization.
However, when using lead dbs to do the visualization, these fields are populated (seemingly automatically by lead dbs since I originally only entered the head and tail information for the subject) and thus the variable assignment works. In addition, it seems a final necessary piece is the “name” field, which is present again when running using lead dbs but not when using lead group.
If I run the lead group visualization while in debugging mode for the ea_showelectrode function, and then manually assign in the coords_mm, trajectory, and name fields of elstruct saved from using lead dbs visualization, I am able to get the lead group visualization to run successfully.
I believe solving this discrepancy is perhaps the key issue?
Thanks!
Joey -
AuthorPosts
- The forum ‘Support Forum (ARCHIVED – Please use Slack Channel instead)’ is closed to new topics and replies.