ajay:neuroelf_usage_notes
Differences
This shows you the differences between two versions of the page.
Both sides previous revisionPrevious revisionNext revision | Previous revision | ||
ajay:neuroelf_usage_notes [2012/11/14 22:34] – [Scripting and Batching: Dangers] ajay | ajay:neuroelf_usage_notes [2025/01/21 02:00] (current) – [Exporting files to SPM, FSL, etc.] asatpute | ||
---|---|---|---|
Line 45: | Line 45: | ||
- the SPM preprocessing dialog (Run) should also create VTC files at the end (basically the preprocessed image files in another format that allows for rapid processing of data), which you can simply check by using the File -> Open menu option in NeuroElf | - the SPM preprocessing dialog (Run) should also create VTC files at the end (basically the preprocessed image files in another format that allows for rapid processing of data), which you can simply check by using the File -> Open menu option in NeuroElf | ||
+ | |||
+ | - Jochen: The blue bars (boxes, really) represent a spike-detection algorithm that I have implemented together with Katherine Duncan (Daphna' | ||
+ | |||
+ | ==== VTC file formats ==== | ||
+ | - The preprocessed data are transformed from NII to VTC in the final step. | ||
+ | - VTC formats have an advantage in speed of processing for later steps because they put time as the first dimension in the 4D image matrix. | ||
+ | - VTC axes are not in the same exact ordering as NII axes: it goes time, Y, X, Z. | ||
+ | - The defaults set the bounding box of the image to cover the MNI brain. | ||
+ | - The defaults use 3mm voxel sizes, timepointsx66x52x47 size... note that the 66 is in the y direction... | ||
+ | |||
==== Making Design Files (prt files) ==== | ==== Making Design Files (prt files) ==== | ||
Line 80: | Line 90: | ||
- save the mdm with '' | - save the mdm with '' | ||
- compute the glm (with filter settings): <code matlab ajay_computeglm.m> | - compute the glm (with filter settings): <code matlab ajay_computeglm.m> | ||
+ | - you may prefer to use ' | ||
- to run a FIR model: <code matlab ajay_computefirglm.m> | - to run a FIR model: <code matlab ajay_computefirglm.m> | ||
- the struct allows you to add optional commands and options (such as filtering) | - the struct allows you to add optional commands and options (such as filtering) | ||
Line 302: | Line 313: | ||
- Then...< | - Then...< | ||
- | voi_betas = glm.VOIBetas(voi);</ | + | voi_betas = glm.VOIBetas(voi); |
- | + | %or to get all the beta maps not limited to a voi | |
+ | betas = glm.GLMData.Subject(S).BetaMaps(:,:,:,: | ||
+ | </ | ||
==== Using command lines to extract design information from glm NeuroElf ==== | ==== Using command lines to extract design information from glm NeuroElf ==== | ||
- glm.SubjectPredictors provides names of predictors | - glm.SubjectPredictors provides names of predictors | ||
Line 310: | Line 322: | ||
- glm.Study(1).RunTimeVars contains more information, | - glm.Study(1).RunTimeVars contains more information, | ||
- To view the design matrix including filters: plot(ztrans(g1.Study(1).RunTimeVars.SDMMatrix)) | - To view the design matrix including filters: plot(ztrans(g1.Study(1).RunTimeVars.SDMMatrix)) | ||
- | - | + | - To get a sense of the correlations between regressors including the filters |
+ | - mdm.Handles.SDMs{1}.PredictorNames' | ||
+ | - plot(mdm.Handles.SDMs{1}.SDMMatrix) :this plots the matrix. | ||
+ | - corrcoef(mdm.Handles.SDMs{1}.SDMMatrix(:, | ||
+ | ===== Visualization Tools ===== | ||
+ | |||
+ | ==== Scripting Output Displays ==== | ||
+ | For outputting many slices for several maps, this section describes how to script the output visuals at the command line. | ||
+ | |||
===== Using the surface rendering ===== | ===== Using the surface rendering ===== | ||
- load up your VMP and threshold it (height threshold) | - load up your VMP and threshold it (height threshold) | ||
Line 326: | Line 347: | ||
- then, repeat these steps with the hiresolution ones for figures | - then, repeat these steps with the hiresolution ones for figures | ||
- smoothing values (as a starting suggestion) for hires: 400 iterations, and force between .4 and .6 | - smoothing values (as a starting suggestion) for hires: 400 iterations, and force between .4 and .6 | ||
- | |||
===== Using the voxel rendering ===== | ===== Using the voxel rendering ===== | ||
- load up your VMP and threshold it (height and cluster threshold) | - load up your VMP and threshold it (height and cluster threshold) | ||
Line 354: | Line 374: | ||
- to restrict stats to voxels with brain data, keep the multiplication box checked; potentially alter the minimum anatomical value to increase/ | - to restrict stats to voxels with brain data, keep the multiplication box checked; potentially alter the minimum anatomical value to increase/ | ||
- higher interpolation (cubic/ | - higher interpolation (cubic/ | ||
+ | |||
+ | ===== Using the new 3D rendering tool with skull ===== | ||
+ | Jochen Email | ||
+ | - download and install the latest snapshot: http:// | ||
+ | - then use " | ||
+ | - when you next open the NeuroElf GUI, load the following VMR/ | ||
+ | - in the main UI, ensure that the colin_hires_ICBMnorm.vmr is selected | ||
+ | - use the render button (below the surface view button) on the right side to switch to render view | ||
+ | - in the newly open render UI, select the colin_brain_rendskull_ICBMnorm.vmr dataset as the "Alpha volume" | ||
+ | - once the rendering is complete, you can use the same controls as for the surface view (mouse; with shift to translate and alt to zoom; and also cursor keys) | ||
+ | |||
+ | When you want to add a stats map (or several maps), please know that each map will be resampled into the resolution of the anatomical prior to rendering, so to display 3 stats maps (at the same time) on top of the high-res colin brain, you probably need between 2 and 3 GB free memory! Also, for stats maps, I suggest changing them to " | ||
===== Drawing/ | ===== Drawing/ | ||
Line 396: | Line 428: | ||
- Starting with your meta-analysis in an xls sheet... | - Starting with your meta-analysis in an xls sheet... | ||
- The header row must have: Study, x, y, z | - The header row must have: Study, x, y, z | ||
+ | - Study must be a string... to ensure this, add a dummy string prior to each study name e.g. ' | ||
- It should also have: CoordSys with " | - It should also have: CoordSys with " | ||
- The header row may optionally and usefully have: N (nr of subjects), FixedRandom (0/1 coding of FFX or RFX) | - The header row may optionally and usefully have: N (nr of subjects), FixedRandom (0/1 coding of FFX or RFX) | ||
Line 402: | Line 435: | ||
- If a column has ' | - If a column has ' | ||
- Make sure you have a place holder for empty cells or missing values (and not NaNs unless it's a numeric column). E.g. " | - Make sure you have a place holder for empty cells or missing values (and not NaNs unless it's a numeric column). E.g. " | ||
+ | - Do not have any empty columns included. | ||
- Now save your data as a .csv file from Excel. | - Now save your data as a .csv file from Excel. | ||
- Rename as a .txt file. | - Rename as a .txt file. | ||
Line 435: | Line 469: | ||
- | ==== Scripting and Batching: | + | ==== Scripting and Batching: |
- | Sometimes we may want to run multiple glms changing one or another option. | + | |
- | If this is what you want to do, BE SURE TO DO THESE TWO THINGS | + | Verify the parameters for you GLM. In the command line, once you load the glm (E.g. by using >>glm = xff(' |
+ | - glm.Study(1).RunTimeVars.Predictors' | ||
+ | - glm.RunTimeVars | ||
+ | |||
+ | Sometimes we may want to run multiple glms changing one or another option. If so, BE SURE TO DO THESE TWO THINGS: | ||
- clear the object between analyses. glm.ClearObject; | - clear the object between analyses. glm.ClearObject; | ||
- ' | - ' | ||
+ | |||
+ | A second potential error when making a glm is to not set the options structure correctly. Specifically, | ||
+ | - CORRECT: struct(' | ||
+ | - INCORRECT: struct(' | ||
+ | - where rps is a cell array pointing to files name for realignment parameters | ||
+ | - VERIFY YOUR GLM using the methods indicated above. | ||
+ | |||
+ | If your scripting is running inordinately slow, it may be because NeuroElf is loading, closing, and re-loading relevant data for a given step in your code. For example, when obtaining the betas from a glm for a set of vois, if you iterate across the vois to load the GLM, then it may reload all the GLM data each time. This is because NeuroElf runs efficiently by not loading up all the data unless it really needs to, but if you're coding, then you need to specify that. Use the following: | ||
+ | >> | ||
+ | |||
+ | |||
+ | |||
+ | ==== Exporting files to SPM, FSL, etc. ==== | ||
+ | Neuroelf has export functions in the gui menus. | ||
+ | The default options for some of these didn't work well for FSLview. | ||
+ | To deal with this, be sure to use a recent version of NeuroElf (12/12/12 or later). | ||
+ | - vmp.ExportNifti(' | ||
+ | - where the second argument, true, makes the output be written in TAL order, such that it complies with FSL's internal preference. | ||
+ | - also works with vtc, glm, etc. | ||
+ | |||
+ | ==== Installing Neuroelf on Apple Silicon | ||
+ | |||
+ | 1. Update MAC OS | ||
+ | 2. Update Matlab | ||
+ | 3. Download neuroelf | ||
+ | 4. You may run into issues with mexmaca64 files. You either have to tell OS that those files are allowed to be opened by trying to open them. Or you can delete all of them, install XCode, and then recompile the mexmaca64 files from scratch (see below). | ||
+ | 5. in matlab, add path to the parent neuroelf directory (not with subdirectories) | ||
+ | 7. then, save path | ||
+ | 8. >>n = neuroelf | ||
+ | 9. >> | ||
+ | 10. >> | ||
+ | |||
+ | |||
+ |
ajay/neuroelf_usage_notes.1352932493.txt.gz · Last modified: 2012/11/14 22:34 by ajay