netstim / leaddbs Goto Github PK
View Code? Open in Web Editor NEWLead-DBS is a MATLAB toolbox facilitating deep brain stimulation electrode localization and connectomic neuroimaging.
Home Page: https://www.lead-dbs.org
License: Other
Lead-DBS is a MATLAB toolbox facilitating deep brain stimulation electrode localization and connectomic neuroimaging.
Home Page: https://www.lead-dbs.org
License: Other
When checking checking normalisation of MR the 'A' 'S' 'C' buttons vanish when you click on them.
This only happens in the check windows other than the preoperative one (e.g transversal, coronar...)
For some people, it might be nice to just have a standalone version of Lead so they don't need Matlab at all. Maybe we should start to explore this a bit and if there are no real obstacles we could even think about a deployment routine for standalone repos of lead-dbs.
I know that they managed to make a standalone version of SPM at the FIL, but there were some obstacles in the beginning..
The normalization files generated by ANTs should be kept in the same format as SPM generates them for compatibility reasons in lead connectome.
SPM routines produce a warp file called
y_ea_normparams.nii
ANTs normalization generates 2 files:
lanat0GenericAffine.mat
and
lanat1Warp.nii.gz
-> These can probably be combined into a deformation file using the SPM deformations utility.
When opening LEAD the Thresholds for BRAINSFit are something like 0.6,0.4, but when you choose a different Coreg Method and then switch back to BRAINSFit, the Threshold is set to nan.
with -a 1, a composite transform can be output via ANTs which makes filehandling much easier.
If we embed this, also need to modify ea_map_coords to just use the unified (inverse) transform.
Dear Ningfei, you recently changed the variable type from three radio buttons to one dropdown menu in lead_group' ea_edit_regressor.fig
That's great but I would not allow the dropdown to be set into "variable type". It should have only three entries, i.e. 1 per patient, 1 per contact and 1 per pair. It can be default to 1 per patient. If you click edit in lead group, it should automatically detect the type of regressor and be set to that type.
This already worked once the code was using radiobuttons (these were toggled on/off automatically). But now, if I want to edit a regressor that is i.e. a 1 per contact pair variable, the window opens with "variable type" set, not with "1 per contact" set.
Also, it is allowed to save the regressor with "variable type" selected.
I would delete the entry "variable type" completely, if possible.
We could try to export the 3D-results to an interactive PDF via this code here:
http://www.mathworks.com/matlabcentral/fileexchange/37640-export-figure-to-3d-interactive-pdf
I still think that this would be a quite messy thing to try/do. Highly optional!
Need to change the two mfilename calls in mesoGT to make it deployable.
Error using load
Unable to read file '/lead_dbs/dev/mesoft/dwidirections.mat'. No such file or directory.
Error in mesoGT_tool (line 185)
Error in ea_ft_mesotracking_reisert (line 158)
Error in ea_perform_lc>ea_perform_ft_proxy (line 89)
Error in ea_perform_lc (line 14)
Error in performlc (line 19)
MATLAB:load:couldNotReadFile
Incorporate and maintain Gibbstracker into the lead dbs repository.
Every function should have an ea_ prefix for compatibility reasons! If not, parallel installation of DTI&Fibertools and Lead-DBS will lead to crashes.
with -a 1, a composite transform can be output via ANTs which makes filehandling much easier.
If we embed this, also need to modify ea_map_coords to just use the unified (inverse) transform.
Sometimes, CT electrodes are not visible at first in manual reconstruction window.
Already discussed with Philip. Brainsfit doesn't seem to write the xform (small textfile) out. It would be great if it did. Already modified the .m file accordingly so that it would use the priorly estimated transform matrix in a second run of Brainsfit. However, since it doesn't write out the xform, it doesn't work for now..
If anyone of you guys had an idea on how to fix this, I think it could drastically reduce time in some reconstructions.
DICOM import only shows assign window for one volume. Probably a small bug.
Should fit on a 13" laptop display in my view.
when changing contrast/offset in manual_reconstruction figure, it's possible to generate an error for extreme values.
For now, BRAINSFit can be called via Lead in CT/MRI fusion by the system() command on a Mac. Better would be a Mex-File integration of BRAINSFit in Matlab. Only if we find time for this..
Great would be
This is highly optional again..
Especially for ANTs and BRAINSFit we'd need a function that converts blanks in filenames or paths into "\ " - if not, errors will occur..
I tried to review the reconstruction but after hitting the run button this error showed up: (Subject G, folder Dystonia)
Error in
matlab.graphics.internal.figfile.FigFile/read>@(hObject,eventdata)lead('run_button_Callback',hObject,eventdata,guidata(hObject))
Error while evaluating UIControl Callback
We could try to implement multimodal normalization using the T1, T2 and PD templates from the ICBM2009b set. mni_hires.nii in lead-dbs is the T2 set. Should be able to get slightly more robust normalizations out using the other two images (from here http://www.bic.mni.mcgill.ca/ServicesAtlases/ICBM152NLin2009) as well.
reported by pDeman, "Use none" seems not to work in 2D-output:
When atlas “use none”:
Generating Atlas table (first run with new atlas only). This may take a while...
Building atlas table...
Error using spm_vol>spm_vol_hdr (line 80)
File "/home/b67-belledone/Desktop/locate_dbs/lead_dbs/atlases/Use none/gm_mask.nii" does not exist.
Error in spm_vol (line 61)
v = spm_vol_hdr(deblank(P(i,:)));
Error in ea_genatlastable (line 282) V=spm_vol([options.earoot,'atlases',filesep,options.atlasset,filesep,'gm_mask.nii']);
Error in ea_add_overlay (line 13) atlases=ea_genatlastable([],options.earoot,options);
Error in ea_writeplanes (line 210) cuts=ea_add_overlay(boundboxmm,cuts,tracor,options);
Error in ea_write (line 12) cuts=ea_writeplanes(options);
Error in ea_manualreconstruction>ea_endfcn (line 161) ea_write(options);
Error in ea_manualreconstruction>ea_keystr (line 184) ea_endfcn;
Error while evaluating figure KeyPressFcn
*** Segmentation of preoperative MRI done.
Error using checkfilename>validateFilename (line 165)
Function GUNZIP was unable to find file ''/home/philip/_git/lead_dbs/templates/dartel/create_mni_darteltemplate/dartelmni_6_hires.nii.gz''.
Error in checkfilename (line 49)
[fullfilename, fid] = validateFilename( ...
Error in gunzip>checkFilesURLInput (line 118)
[fullFileName, url] = checkfilename(inputFiles{1}, validExtensions, fcnName, ...
Error in gunzip (line 61)
[files, url, urlFilename] = checkFilesURLInput(files, {'gz'},'FILES',mfilename);
Error in ea_create_mni_darteltemplate (line 5)
gunzip([wd,'dartelmni_6_hires.nii.gz']);
Error in ea_normalize_spmdartel (line 105)
ea_create_mni_darteltemplate([options.root,filesep,options.patientname,filesep,'rc1',options.prefs.prenii_unnormalized]);
Error in ea_autocoord (line 84)
eval([options.normalize.method,'(options)']); % triggers the normalization function and passes the options struct to it.
Error in lead>run_button_Callback (line 306)
ea_autocoord(options);
Error in gui_mainfcn (line 95)
feval(varargin{:});
Error in lead (line 42)
gui_mainfcn(gui_State, varargin{:});
Error in @(hObject,eventdata)lead('run_button_Callback',hObject,eventdata,guidata(hObject))
Error while evaluating uicontrol Callback
Hi Ningfei,
starting today, my Brainsfit version shows an error:
Coregistering postop CT to preop MRI...
/PA/Neuro/_projects/lead/lead_dbs/ext_libs/BRAINSFit/BRAINSFit.MACI64: line 1: version: command not found
/PA/Neuro/_projects/lead/lead_dbs/ext_libs/BRAINSFit/BRAINSFit.MACI64: line 2: oid: command not found
__TEXT __DATA __OBJC others dec hex
error: /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/size: can't open file: 22527192 (No such file or directory)
Do you know why? Did you change it at all? Used to work fine. Could also be the data if you didn't change anything.
Best, Andy
We should add a button "group analysis" that opens lead_group with the selected patients loaded and directly asks for a group directory where to store the group analysis.
I still think that .nii should be the default since then images can be passed into SPM without unzipping/zipping wraps. But as a first step, we should use ea_load_nii for all nifti loading and one function for all nifti writeouts. For historical reasons, I often used the command pair V=spm_vol and then X=spm_read_vols(V) which loads the nifti.
In nii=ea_load_nii;
nii equals V but has the additional .img field which equals X.
This is a major hack and could lead to many errors if not properly tested.
For many SPM-related functions, the filename (and not the image itself) is passed to SPM, which doesnt support .nii.gz
So I would think that we should keep .nii as the default and maybe add .nii.gz support for reading once we have all calls canaled into ea_load_nii.
P. Deman reported the following error code:
Error when doing the update:
Error using textscan
Invalid file identifier. Use fopen to generate a valid file identifier.
Error in ea_update (line 57) dels=textscan(fopen([earoot,'
Error in lead>updatebutn_Callback (line 1466) ea_update;
Error in gui_mainfcn (line 95) feval(varargin{:});
Error in lead (line 42) gui_mainfcn(gui_State, varargin{:});
Error in @(hObject,eventdata)lead('
Error while evaluating uicontrol Callback >>
See mail BRAINSFit on Windows
You cannot use the keyboard shortcuts in Review Reconstruction when Rotate 3D ist active
At the moment, there are bugs associated with dl'ed versions that lack connectome datasets in the fibers subfolder of the toolbox.
Already discussed with philip, similar to BRAINSFit, ANTS is a highly modern normalization routine. Maybe it's even better than brainsfit for CT/MR coregistration.
It would be great to have a wrapper or mex file for ANTS in lead-dbs, too.
Potentially, we could even use ANTs for nonrigid (fluid) normalization of MR images into MNI space. For now, we only use SPM routines (especially DARTEL).
In Klein (2009, NeuroImage), several normalization routines were evaluated and the two winners were DARTEL and ANTs. Arno Klein told me, that he personally even likes ANTs better. So having an ANTs version that could be called from within LEAD could be a cool gadget.
The whole thing is highly optional, so only consider if you're bored :D
It would be cool if lead could download the group connectome by itself if it's not present.
pDeman reported that rotleft.png and roright.png icons were missing in his submission after downloading the toolbox.
A declarative, efficient, and flexible JavaScript library for building user interfaces.
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google ❤️ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.