Lead-DBS
  • Home
  • Slack User Channel
  • About
    • Deep Brain Stimulation
    • Publications
    • Citing Lead-DBS
    • Data & Code inclusion philosophy
    • List of Lead-DBS dependencies
    • Lead Connectome
    • Lead-OR
  • News
  • Help/Support
    • Learn Lead-DBS yourself
    • Slack User Channel
    • Forum
    • Knowledge Base
      • Lead-DBS Methods
        • AC/PC to MNI conversion
        • DBS Network Mapping
        • Subcortical Electrophysiology Mapping (SEM)
      • Atlases/Resources
        • Cortical Atlas Parcellations (MNI-Space)
        • Subcortical Atlases (MNI-Space)
        • The DISTAL atlas
        • Macaque Atlases (MNI-Space)
        • Normative Connectomes
        • IXI Database
      • Walkthrough-Videos
      • Other Videos
      • Screenshots
  • Manual
  • Workshops
    • Brisbane February 2020
    • Machine Learning – Berlin September 2019
    • Berlin September 2019
    • Past workshops
      • Hamburg February 2019
      • Shanghai September 2018
      • Berlin 2016
  • Download
  • Contact
  • Click to open the search input field Click to open the search input field Search
  • Menu Menu

Import x,y,z coordinates

You are here: Home1 / Forums2 / Support Forum (ARCHIVED – Please use Slack Channel instead)3 / Import x,y,z coordinates4
Viewing 15 posts - 1 through 15 (of 18 total)
1 2 →
  • Author
    Posts
  • 01/04/2018 at 10:55 AM #3943
    Martijn Beudel
    Participant

    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 #3946
    andreashorn
    Keymaster

    Hi 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 #3950
    Martijn Beudel
    Participant

    Hi 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 #3951
    andreashorn
    Keymaster

    Hi 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 #3952
    Martijn Beudel
    Participant

    Hi 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 #3957
    andreashorn
    Keymaster

    Hi 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 #3962
    ningfei
    Keymaster

    Hi 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 and tail) of reco to make it work. So it would look like the following code (where 1 means right side and 2 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,
    Ningfei

    01/12/2018 at 2:05 PM #4002
    Martijn Beudel
    Participant

    Hi 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 #4004
    ningfei
    Keymaster

    Hi 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,
    Ningfei

    01/12/2018 at 3:57 PM #4006
    Martijn Beudel
    Participant

    thanks, that did the job! I can now import the electrodes in MNI space.

    01/12/2018 at 5:43 PM #4007
    andreashorn
    Keymaster

    Great, thanks for letting us know that it worked!

    Best, Andy

    03/10/2019 at 5:32 PM #6943
    joey.hsu
    Participant

    Hello,

    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!
    Joey

    03/10/2019 at 8:45 PM #6944
    andreashorn
    Keymaster

    Hi Joey,

    it seems like you can simply uncomment those lines (in general).
    https://github.com/netstim/leaddbs/commit/51cdd3ba26ec1671d99b53657dcea6d2fa4f8d0c

    Hope that fixes it!

    Best, Andy

    03/10/2019 at 8:45 PM #6945
    andreashorn
    Keymaster

    Hi Joey,

    it seems like you can simply uncomment those lines (in general).
    https://github.com/netstim/leaddbs/commit/51cdd3ba26ec1671d99b53657dcea6d2fa4f8d0c

    Hope that fixes it!

    Best, Andy

    03/11/2019 at 4:19 PM #6951
    joey.hsu
    Participant

    Hi 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

  • Author
    Posts
Viewing 15 posts - 1 through 15 (of 18 total)
1 2 →
  • The forum ‘Support Forum (ARCHIVED – Please use Slack Channel instead)’ is closed to new topics and replies.

Forum Statistics

Registered Users
131
Forums
1
Topics
185
Replies
607
Topic Tags
81
Empty Topic Tags
12

Subscribe to our newsletter

Recent Posts

  • Lead-DBS 3.0 out now!
  • Lead-OR out now
  • Bug in Lead-DBS v2.5
  • Lead-DBS v2.5 out now!
  • Lead-DBS on the cover of NeuroImage

Archives

  • October 2023
  • August 2021
  • July 2021
  • March 2021
  • September 2020
  • June 2019
  • November 2018
  • September 2018
  • August 2018
  • March 2018
  • November 2017
  • September 2017
  • July 2017
  • April 2017
  • July 2016
  • June 2016
  • May 2016
  • March 2016
  • December 2015
  • November 2015
  • April 2015
  • January 2015
  • December 2014
  • October 2014
  • September 2014
  • July 2014
  • June 2014

Imprint | Privacy Policy

Scroll to top Scroll to top Scroll to top
We use cookies to ensure that we give you the best experience on our website. You may “Accept All” or visit "Cookie Settings" to provide a controlled consent.
Cookie SettingsAccept All
Manage consent

Privacy Overview

This website uses cookies to improve your experience while you navigate through the website. Out of these, the cookies that are categorized as necessary are stored on your browser as they are essential for the working of basic functionalities of the website. We also use third-party cookies that help us analyze and understand how you use this website. These cookies will be stored in your browser only with your consent. You also have the option to opt-out of these cookies. But opting out of some of these cookies may affect your browsing experience.
Necessary
Always Enabled
Necessary cookies are absolutely essential for the website to function properly. These cookies ensure basic functionalities and security features of the website, anonymously.
CookieDurationDescription
cookielawinfo-checkbox-analytics11 monthsThis cookie is set by GDPR Cookie Consent plugin. The cookie is used to store the user consent for the cookies in the category "Analytics".
cookielawinfo-checkbox-functional11 monthsThe cookie is set by GDPR cookie consent to record the user consent for the cookies in the category "Functional".
cookielawinfo-checkbox-necessary11 monthsThis cookie is set by GDPR Cookie Consent plugin. The cookies is used to store the user consent for the cookies in the category "Necessary".
cookielawinfo-checkbox-others11 monthsThis cookie is set by GDPR Cookie Consent plugin. The cookie is used to store the user consent for the cookies in the category "Other.
cookielawinfo-checkbox-performance11 monthsThis cookie is set by GDPR Cookie Consent plugin. The cookie is used to store the user consent for the cookies in the category "Performance".
PHPSESSIDsessionThis cookie is native to PHP applications. The cookie is used to store and identify a users' unique session ID for the purpose of managing user session on the website. The cookie is a session cookies and is deleted when all the browser windows are closed.
viewed_cookie_policy11 monthsThe cookie is set by the GDPR Cookie Consent plugin and is used to store whether or not user has consented to the use of cookies. It does not store any personal data.
Analytics
Analytical cookies are used to understand how visitors interact with the website. These cookies help provide information on metrics the number of visitors, bounce rate, traffic source, etc.
CookieDurationDescription
_ga2 yearsThis cookie is installed by Google Analytics. The cookie is used to calculate visitor, session, campaign data and keep track of site usage for the site's analytics report. The cookies store information anonymously and assign a randomly generated number to identify unique visitors.
_gat_gtag_UA_52019623_11 minuteThis cookie is set by Google and is used to distinguish users.
_gid1 dayThis cookie is installed by Google Analytics. The cookie is used to store information of how visitors use a website and helps in creating an analytics report of how the website is doing. The data collected including the number visitors, the source where they have come from, and the pages visted in an anonymous form.
Third-party
Cookies from third-party contents on the website.
CookieDurationDescription
CONSENT16 years 5 months 17 days 13 hoursThese cookies are set via embedded youtube-videos. They register anonymous statistical data on for example how many times the video is displayed and what settings are used for playback.No sensitive data is collected unless you log in to your google account, in that case your choices are linked with your account, for example if you click “like” on a video.
IDE1 year 24 daysUsed by Google DoubleClick and stores information about how the user uses the website and any other advertisement before visiting the website. This is used to present users with ads that are relevant to them according to the user profile.
test_cookie15 minutesThis cookie is set by doubleclick.net. The purpose of the cookie is to determine if the user's browser supports cookies.
VISITOR_INFO1_LIVE5 months 27 daysThis cookie is set by Youtube. Used to track the information of the embedded YouTube videos on a website.
vuid2 yearsThis domain of this cookie is owned by Vimeo. This cookie is used by vimeo to collect tracking information. It sets a unique ID to embed videos to the website.
YSCsessionThis cookies is set by Youtube and is used to track the views of embedded videos.
yt-remote-connected-devicesneverNo description available.
yt-remote-device-idneverNo description available.
SAVE & ACCEPT
Powered by CookieYes Logo