Forum Replies Created
-
AuthorPosts
-
andreashornKeymaster
Hi Sushain,
sorry that you are having so much trouble.. But at least we got one step further.
It could either be a Matlab-version problem or some weird issue with the normalization routine you used.
Could you please tell me which ML version you use, which SPM version you use and which normalization routine you selected/used within Lead-DBS?Best, Andy
andreashornKeymasterDear Sushain,
just as a follow up – just realized after sending my last response that the Download page indeed was broken.
Thanks for the hint. I saw you could download now.Best, Andy
andreashornKeymasterDear Sushain,
on my end, the download page works fine. We also have continuous downloads from other users.
Maybe you could try using a different browser?
If you still can’t dl the software, please shoot me an email.Best, Andy
andreashornKeymasterHi Bechir,
now it seems that there’s some problem that the algorithm can’t find the trajectory.
What you could do is:
1. Set the Entrypoint to manual. You’ll be prompted to click on the electrodes. Do you see them at all? Has the data been properly normalized?
2. Instead of “auto” in mask size, you can try to enter a number between ~ 7 and 15. This keeps the mask size fixed and helps in some cases.What dataset are you using? Is it T1-weighted data? Because here, the algorithm sometimes gets lost in the ventricles. If you have a different dataset, maybe try to skip this patient first. I totally need to upload an easy sample dataset one day.
I hope this helps.
Best, Andy
andreashornKeymasterDear Bechir,
I could replace the xcorr function with a custom built one. I’ll upload an update this evening and you should be able to grab it via the green Update button from within Lead in Matlab tomorrow morning at the latest.
Please let me know if there are other functions that are Signal Processing Toolbox dependent (it’s not easy to find out or at least I don’t know how to do this).Will be happy to make the version run w/o Sig Proc. Tbx.
Best, Andy
andreashornKeymasterDear Sushain,
sorry to hear. We did have a small problem with the last release (which is already fixed) but I think it didn’t really concern bb.nii
Just to be sure, I just downloaded the web-version of Lead-DBS myself and found the file bb.nii correctly within the /templates directory. Did you perchance get Lead-DBS completely from github? Because if so, we don’t have all the large datafiles in the git repository. Github is great to get fast bugfixes and updates but you need to once download the whole repository here from the website.Could you please retry and download Lead-DBS and check yourself whether bb.nii lies within the /templates directory? Then go ahead and replace your old version of it, make sure, it is on the Matlab path and retry?
Please tell us if there are more issues.
Best, Andy
andreashornKeymasterDear Bechir,
thanks for your feedback and sorry to hear that you went through that trouble. We’ll add these toolboxes to the requirements sections.
The toolboxes I use to develop Lead-DBS are the following one:• Image Processing Toolbox
• Signal Processing Toolbox
• Curve Fitting Toolbox
• Statistics and Machine Learning ToolboxHowever, we always try to make things work with the least number of toolboxes possible. So maybe we could even fix the issue without you needing to buy another toolbox. If you could kindly post the error concerning the Signal Processing Toolbox, maybe I could find alternative functions and post an update that works w/o this toolbox, soon?
Best, Andy
andreashornKeymasterGlad to hear!
I cannot really tell what is best here. Depending on which FSL template was used, it should even be the same template. mni_hires.nii is exactly the same as the ICBM2009b nonlinear asymmetric t2 template (http://www.bic.mni.mcgill.ca/ServicesAtlases/ICBM152NLin2009). Novel versions of FSL at least also use templates from the ICBM2009 series. So anatomy should be quite similar. Depending on the nonlinear co-registration algorithm you would use to co-register the FSL template to the mni_hires.nii template, it could introduce more error than benefit. As said, I just can’t give good advice on this, don’t know any empirical data about inter-template co-registrations.
The routines that visualize anything in lead-dbs are called by ea_write.m -> it’s a simple function from which you can easily find the 2D and 3D calls. If you happen to make adjustments to the functions that could also help others feel free to make a pull request (https://github.com/leaddbs/leaddbs; or just send me the modifications if you’re unfamiliar with git/github).
Best, Andy
andreashornKeymasterSorry just saw that you used SPM for the normalization. I think in this case you can just use the y_* file that SPM outputs for this (just make a copy and rename it to y_ea_normparams.nii – should work.
andreashornKeymasterHi macbeth83,
this used to work in the past but in the novel versions, Lead-DBS performs reconstructions hybridly within patient and MNI space. Thus, a file that warps from subject to MNI space is needed. However, it doesn’t need to be an SPM file, ANTs is also supported. With which software did you normalize your data? Maybe the deformation file mapping from subject to MNI is similarly structured than y_ files or ANTs normalization parameters and we can figure out a workaround for you?
Best, Andy
03/18/2016 at 2:44 PM in reply to: Processing on post-op ct data with single electrode trajectory #842andreashornKeymasterDear Gene,
unfortunately, for now, unilateral leads are not really supported (and they were, you’re right).
You wouldn’t think so, but especially in the lead_group analyses, including unilateral lead cases just makes the whole implementation a lot more complex.If it’s just for visualization, what you can do, however, is to set the entrypoint in the main lead GUI to “Manual” and just put two leads into the same artifact by clicking on it for both hemispheres. In the 3D visualization viewer, you can then just deselect one of the leads.
If you’re a little bit into programming, you can also set a breakpoint at the beginning of ea_autocoord.m (which is the main trigger function following the button press of “Run”) and set options.sides to either 1 (right lead only) or 2 (left lead only). In the normal case, this value is set to [1,2]. This would trigger the functions as in the old version and should still work for most of the one-subject-only functions (even though I can’t guarantee it).We will re-introduce the unilateral case support again in the future, just need to find the time to do so..
To export final output for visualization in other software: Atlases are present as .nii files. VATs are now generated as .nii files, as well. The electrodes can be exported to a JSON string which is similar to .stl format by pressing the cloud button (“Export to server”) in the 3D viewer. They are not uploaded to any real server or similar, it’s just that you can make results web-viewable e.g. for an intranet server that you set up for your hospital.
I can also provide you a script that will export the tips of the electrodes as nifti files, if you want. This is being done for headmodel generation in the novel VAT model code. You’d need to send me your email address or similar.
Hope this helps,
Best, Andy
03/08/2016 at 5:43 PM in reply to: error message when I save the leads localization manually reviewd #822andreashornKeymasterDear Paolo,
thanks for reporting this bug. I forgot to move the function from /dev to the main repository.
Glad you found it. I just uploaded a new release which should correct this. Please tell me if it still doesn’t work.Best, Andy
andreashornKeymasterDear Paolo,
I’m very sorry but lead_group is still widely undocumented. We just lack the man-power to do so but plan to update the manual soon and also add some more walkthrough videos. Lead group is also not really streamlined for a good user experience (also not so simple given there is not a real “one processing stream everybody should do”). Most of the few users that use it are probably in contact with me directly at the moment. There’s much more work to do on this and we certainly are working on it..
In general, there are probably the following goals that you can achieve with it:
1. Simple visualization in 2D and 3D of the whole group of electrodes
2. Tag certain electrodes with different colors to show a multi-group visualization (e.g. “responders” vs. “non-responders”).-> I hope the above is more or less self-explaining, if not, please tell me. In 3D, you can render electrodes as solid or transparent or simply show a point-cloud of the contact centers. If you want to do the latter, you can specify only to show active or only passive contacts (or both). You can also highlight active contacts using all three visualizations. To do so, you need to…
3. Enter stimulation parameters. This largely changed with the new release, please use the newest version. The Mädler/Kuncel models implemented so far are designed for monopolar stimulations only. You can add up to 4 sources and for each specify one contact that you like to activate as anode (versus the case). There’s a novel VAT-model in the pipeline which will let you simulate more complex stimulations but that will take some months until release.
4. Determine which contacts are within a certain atlas structure. To do so, you need to calculate the “DBS stats” first. Choose an atlasset and press “calculate” in the “prepare DBS stats” panel. This will take a while. In the background, lead DBS will run 3D visualizations for each subject which also generates the stats. I think you need to have some stimulation parameters set for each patient for this to run. If you don’t know the real ones, you can just add fake ones here unless you also want to calculate connectivities (see below). If you just want to know which contact is e.g. within the STN, the stim params don’t matter.
After this is done, you can e.g. select the STN in the “Volume” list on the top and press “Generate target report”. This will generate a table with the distances from each electrode contact center to its closest atlas voxel. It also asks you for a threshold for this distance that will lead to “inside” or “outside” based on the distance. Please note that the distances never get to zero, even if the electrode is directly within the nucleus (since the nucleus voxels are mathematical points in this case). I feel that a distance between 0.5 and 1.5 is sensible, depending what you are analyzing. Of course, the distance used should be reported.5. The “calculate DBS stats” button is very important, it basically calculates everything. The VAT for each patient, the stats of connectivities, etc. So for everything below, you probably need to run it once.
6. You can add regressors (top right). These can be basically anything. clinical variables (e.g. improvement in UPDRS scores), electrophysiological variables, whatever you can think of. You can enter regressors that have one scalar value for each patient, each hemisphere, each contact or each contact pair. With these regressors, you can do quite a few things:
6a. you can correlate the portion of VAT within an anatomical structure or the number of fibertracts between the VAT and a certain structure to the regressor (it needs to be a one per hemisphere or one per patient regressor). Again, select the anatomical structure in “Volumes” in the top (or the connectivity area in “Fibercounts” below that. Then press “Correlation between Regressors and Volume Intersections / Fibercounts”. It will give you some scatterplots. Please note that the raw output from this function will also be available in the Matlab workspace if you want to generate different figures/stats on your own with the data.
6b. if you have two groups, you can press “Group Comparison (Two-sample t-test)”. E.g. if you want to test whether your responders have significantly more portion of VAT inside the STN than your nonresponders or similar.
6c. You can tag the VATs of each patient with the regressor (again should be one per hemisphere or patient regressors). Select “Map regressor to VATs” and e.g. press Visualize 3D. It will generate a folder named “statvat_results” inside the lead_group directory.
6d. You can also map regressors to electrode contacts or contact pairs (e.g. electrophysiological variables recorded from an electrode pair). You can use any type of regressor here (if one-per-patient or -hemisphere, it will map it to the active contacts). This generates a pointcloud with values in 3D which is then being interpolated and exported as a probabilistic atlas.
More general functions:
1. Detach from single patient data means that after detaching, the lead_group file works “autonomously”. Good for sharing with collaborators or similar. If data is not detached, it is automatically updated e.g. if you change the reconstruction in a single patient folder.
2. Open Reconstruction GUI just opens lead with the selected patient. Can be handy some times.
3. LEAD Connectome Results are non-DBS functions. Interesting if you have a DTI and/or fMRI dataset of patients/subjects. I can tell you about these if interested.
Please feel free to ask if you have further specific questions. Please also note that lead_group is still quite buggy in terms of usability (there should be no errors concerning results). If you bump into errors, please just post them here, I’m usually quick in fixing stuff.
Best, Andy
andreashornKeymasterDear Sushain,
it seems that the problem is simply that SPM is not on your Matlab path.
Lead DBS essentially needs SPM8 or 12 to run. SPM8 is not really supported anymore but should in principle work for most functions. I’d recommend you download SPM12 (http://www.fil.ion.ucl.ac.uk/spm/software/spm12/), save it to a convenient permanent destination and add it to your Matlab path.I might be wrong with this diagnosis so please write back if this didn’t solve your problem.
Best, Andy
- This reply was modified 8 years, 8 months ago by andreashorn.
andreashornKeymasterDear Remi,
thanks for your kind words. We have thought about implementing a “native space” mode already and I guess it will be done at some point – at the moment, there are things with higher priority on the list, however. Of course, if you/someone from your lab is interested in implementing something similar, please feel free to fork us on github.
Still, there are some rather manual options:
1. transposing the coordinates from the reconstructions into native space is fairly easy – you can e.g. use SPM and the y_ea_inv_normparams.nii file to warp all coordinates that you find in the ea_reconstruction.mat file in the patient’s folder into native space. You can then add a patient specific anatomy file in the 3D viewer’s small “Anatomy Slices” window (Choose a .nii file manually in the Dropdown menu that is by default set to “MNI-Template”). Finally, you can add your manually segmented anatomy by either
a. adding the segmented files to a folder in lead_dbs/atlases/youratlasname -> put left hemispheric files into a subfolder called “lh” and right-hemispheric ones to a subfolder called “rh”. All .nii files should have the same name for lh and rh files. This new atlas is automatically detected when you restart lead-dbs.
b. you can manually add .nii files to a scene in the 3D-viewer by choosing “open ROI” in the “Add Objects” Menu in the 3D-viewer’s main window.
2. a more simple option would be to warp manually segmented structures into MNI space and add these as an atlas. You would be working in MNI space but using (warped) patient specific anatomy. Probably not as precise but given the great work of ANTs and/or DARTEL probably nearly as precise as the imaging modalities (MRI/CT) themselves..
I hope this helps you somehow!
Best, Andy
-
AuthorPosts