Recent Changes


Jump to: navigation, search
Related pages:
* Bugs
* Troubleshooting

This page is intended to document substantial updates to functionality in mrVista.


[edit] Recent Updates

[edit] 2009.07.10

  • New ROI selection dialog, which allows for better organization of ROIs
  • Added a few months ago, but documented now: a new tool for the population receptive field method which allows you to compare models while looking at time courses.
  • Some code to generate .avi movies for pRF analyses.
  • Minor bug fixes in ROI drawing and motion compensation

The new ROI dialog (code roiDialog.m in the mrVista2 code base) allows you to browse between many ROI folders, search across ROIs, select multiple ROIs easily, browse the metadata on ROIs, and organize a large number of ROIs into subfolders. I am making it the default way to select an ROI in mrVista. More documentation will be given on the ROI page. If this works well, as we may integrate the upcoming database functionality, this interface may be useful for versioning ROIs and keeping track of different ROI definitions.

The new pRF comparison tool, rmCompareModelsGUI , behaves similar to the rmPlotGUI (TODO: document both on the wiki) in that it loads the time series from a selected ROI, and allows you to browse time series across voxels. For the rmPlotGUI, you can view a single model fit to each voxel's time series. For the rmCompareModelsGUI, you can view the time series for that voxel from different data types (or the same data type), and view the predictions made by different pRF models. This was originally created to help me generate presentations on the object pRF project.

The movie-generating functions are rmPlotGUI_predictionMovie and rmMeshPlusStimMovie . The former will make a movie where the stimulus representation plays, superimposed on the voxel's pRF, and the predicted response from the model is drawn in over time. The latter will project the thresholded BOLD percent signal change onto a Mesh, and composite that movie with a movie of the stimulus representation, so you can view the relationship between the stimulus and the resultant "ripples in the brain".

The bug fixes for ROI drawing affect a bug in the 3-view window where some ROIs weren't drawn when there were multiple ROIs loaded, and in the between-scans motion compensation for when non-sequential scans are motion-corrected.

Example of the new ROI dialog.
File:RmCompareModelsGUI Example.png
Example of the pRF Compare Models GUI.

Sayres 15:13, 10 July 2009 (PDT)

[edit] 2008.10.01

  • a number of small changes to the pRF code. I don't believe any of these are huge, or fundamentally change the way the code works.

Mostly, they are fixes I made to solve a problem with keeping time series and coordinates in sync. This was particularly an issue with rmPlotGUI, but I believe this may crop up in other ways as well. The big change is a fix to a more central function: getTSeriesROI. This function would give you the time series from a given ROI, in the selected slice for the view. (For gray/volume views, this meant everything). There is a 'preserveCoords' flag you can set to ensure that the time series you get back corresponds one-to-one to the coordinates you give in. The bug was, this flag didn't work properly; I made a somewhat slower loop which fixed it. (I may have even introduced the flag, and if so, I'm sorry for not having caught the bug sooner.)

There are some other changes in the accessor functions (e.g., rmGetData) related to how this grabs the time series and coordinates. In these cases, the changes were made from a lot of debugging, in trying to get the time series and coords to match. Sayres 14:59, 1 October 2008 (PDT)

[edit] 2008.09.23

  • Updated the function which projects data from Volume or Gray views on to Meshes such that the updated mesh colors are now remembered in the view structure. The net result is: if you project data onto a mesh, then save the mesh, the saved mesh will have those colors in the file. This is extremely useful for saving results for later presentation using mrmViewer.
  • Adding some example analysis scripts for systematically taking snapshots of meshes from different view angles, and saving the images as image files (PNG in this case, but many formats are possible). Also adding a script which loads these PNG images, and composites them into a PowerPoint deck. These functions will be included in the folder vistadisp/trunk/mrLoadRet/Scripts. Sayres 23:13, 23 September 2008 (PDT)

[edit] 2008.08.01

  • Edit Preferences Option: I set up a GUI to edit the Preferences variables which affect mrVista. This is available in the view windows, under Edit | Edit Preferences... (Ctrl-;). Note that these preferences include a flag to set the file save format: the options are 'default' and 'nifti'. Currently only 'default' is fully supported; these are the standard MATLAB-oriented formats (.mat files for parameter maps and inplane anatomies; mrGray .dat for volume anatomies, and .class and .gray files for segmentations). More full-blooded NIFTI support will be forthcoming in the next couple of months (target date: Oct 2008). This dialog will be used for back-compatibility.
  • Load maps into coherence slot: although the co, amp, and ph slots are specialized for traveling wave analyses (and not as generally useful as the multiple map support in mrViewer), most of our functionality still operates through the standard Inplane, Volume, and Flat windows, and are therefore dependent on these slots. To improve thresholding options when using parameter maps, I added some utilities to load a parameter map into the co slot of these views. (Function name is loadCoherenceMap.) The four sub-options are:
    • Load and rescale: The map values are divided by max( abs(map) ) , and the absolute value is returned. This will scale any map into the range [0 1] (which is what the co slot requires). 1 will represent the most positive and/or negative map value. This is useful for arbitrary maps (e.g., eccentricity from a pRF model).
    • Divide absolute value by 100: this is useful for thresholding by statistical significance maps, where the units are the -log(p) value of a T- or F-test. So, setting co>0.02 will threshold at p < 10^-2 for either A>B or B>A (two sided threshold), co>0.05 will threshold at p < 10^-5, etc.
    • Load raw values: load a map values directly into the co slot. This is useful for things like the proportion variance explained by a general linear model or population receptive field model. The data already lie in the range [0 1] and don't need to be scaled in this case. (If the data lie outside this range, that can introduce difficulties for thresholding).
  • Compute Contrast Map auto-loads proportion variance explained into the co slot: related to the above change, computing contrast maps ( computeContrastMap2 ) will now cause the co slot to contain the proportion variance explained by the GLM model used for the map. This will be saved with the contrast map, so it will be auto-loaded when the map is loaded. (Since this applies only to data in the "GLMs" data type--for which traveling wave analyses can't be applied--there shouldn't be a conflict with this and CorAnal results.)
  • Updated pRF model features. The pRF visualization code now has options to use the MPLAY matlab movie player to show stimulus-projected activation movies, export movies to AVI format, and overlay the stimulus at each time point. The rmPlotGUI interface now has a menu, with options to sort voxels in the ROI according to the model's explanatory power for each voxel, and to temporally blur each voxel's time series when viewing the model fit.

Sayres 18:16, 1 August 2008 (PDT)

[edit] 2008.06.26

Retinotopy Model code update: There are a number of small changes to the code, and a few larger ones:

  • A new function was added to save predicted time series given a retinotopy model and a set of stimulus parameters ( prfSavePredictions )
  • Added callbacks for several functions which already exist for visualizing fMRI activations projected into retinotopic space, and viewing the distribution of pRF parameters across one or more ROIs.

Sayres 16:53, 26 June 2008 (PDT)

[edit] 2008.05.15

Fixed several bugs in the mrInit2 initialization routines. The code now works fairly nicely with sets of files, even using the GUI. The one thing the GUI is still not great at is initializing from sets of files which need to be concatenated across several dimensions (e.g., slices and time points), or for which the saved files contain 2D images which are montages across slices. mrReadDICOM has some tools to read these at the command line; mrSave can then save them in a relevant format. Sayres 19:43, 15 May 2008 (PDT)

[edit] 2008.04.15

Several smaller updates have been made to the code in the past few months. These include some new features for mrRx, as well as some visualization tools for multi-voxel analyses.

[edit] mrRx: nudging functionals onto inplanes

For some scanning sessions, the subject may move between the time the inplanes are scanned and the first (or last, in case the inplanes are collected later) functional scan. One solution to this problem has been to use the mutual information alignment code to align to the anatomy. However, this doesn't always work; the alignment can sometimes impose a severe skew (see Functional#Newer_Motion_Compensation_Tools_.28MI.29). To fix this, I've written a functino which allows the user to manually "nudge" the mean functional from a reference scan onto the inplane image, and save a copy of the original time series with this nudge applied.

To use this, type:


[edit] 2007.12.10

I replaced the earlier 'Segmentation' menu with a 'Gray' menu. This new menu includes the previous options (related to installing gray / white segmentations and flattened cortical patches for Flat views), but adds additional options related to visualizing data on 3D surface meshes. This is an alternative to the 3D Window. It's not yet a replacement, since it doesn't yet include all the same options as the 3D Window, and the 3D window still operates as usual.

Why use the new menu? The chief reasons are to save space (don't need a superfluous window), and to work more sensibly with multiple meshes. One concern with the 3D window was that, if you have two volume/gray windows open with meshes, the window would get confused about which view's mesh to use, and this led to several bugs (such as trying to add a new mesh to a pre-existing window). The window utilized the global variable selectedVOLUME, which was flakey and suboptimal. With the menu, each mesh is kept specific to a particular volume view. Different volume views can be opened, for the same session or a different one, without causing confusion or bugs.

[edit] 2007.09.10

Minor update: I've removed the old function 'homeDir.m' from the repository, as well as dependencies on this function. This function was a problem for several reasons: first, it conflicted with the global variable HOMEDIR; second, it actually returned something different than HOMEDIR (the caps HOMEDIR refers to the session directory, e.g. 010203ab , while the 'homeDir' function returned the view-appropriate subdirectory, e.g 010203ab/Inplane or 010203ab/FlatOccipital .) The function viewDir has been around for awhile, as an intended replacement. Today, I completed the process, removing the old file.

[edit] 2007.09.02

This first update documents several updates I (Rory Sayres) have made over the summer.

  • Imported mrVista2 repository into VISTASOFT.
    • Note: The tools in mrVista2 were intended to develop into a separate, standalone repository; and may yet do so. However, a lot of the functionality it provides ( initialization from multiple file types, in viewing multiple overlays, in allowing for smooth control of transparency on mesh overlays, and others) has been relied on in the regular mrVista routines; conversely, the mrVista2 tools relied on the older code. So, for now, they're all together. In updating, I'd like to follow the policy of reducing dependencies of mrVista2 functions on older code, while allowing older code to rely more on the mrVista2 functions. There's a lot of cruft in the code base, and at some point mrVista2 will become a standalone repository with a much smaller footprint than the current one.
    • To make sure you get the new directory, you'll want to run cvs update -d from the command-line CVS (users of a GUI like Tortoise CVS should update from the VISTASOFT directory, and it will be downloaded.)
  • New Initialization Tools: mrInit2 is a new tool for initializing from a wider range of input formats than Lucas mag files / DICOM files. Users at Stanford should also be fine using mrInitRet, which still works fine; although the new tool offers some more preprocessing steps, like motion compensation and slice-time correction.
  • Mesh: new mesh preference 'coThreshold'; allows mrMesh code to 'fade out' overlays according to the coherence map, making cortical activations with coherence values closer to (and above) the cothresh to become more transparent.
    • Usage: use mrmPreferences (Edit | Mesh Preferences in the 3D Window); set the coThreshold preference to 1. The level of transparency will vary linear from the cothresh to one-half the maximum clip value for coherence mode. That is, if the colorbar in coherence mode maps from [0 1], and the cothresh is 0.2, activations with co=0.2 and below will not be shown, co=.5 and above will be fully opaque, and coherence between these values will be more or less transparent. (It divides it by half because this seems to be an empirically useful relationship; setting it to use the full range makes activations too faint.) You can set the clip mode by selecting the menu (in the Volume/Gray window): Colormap | Coherence Mode | Manual Clip Mode. Setting [0 .8] produces the nicest effects for most of the retinotopy data in the KGS lab.
  • Retinotopy tools: tools for automatically setting the color bar to a blue-green-red visual hemifield color wheel, similar to those used in some Freesurfer papers.
    • Usage: first you must correctly set the retinotopic mapping parameters for a polar angle-mapping scan ( retinoSetParams or menu Colormap | Retinotopy Parameters | Set Retinotopy Params (cur scan)). This causes the color bar to be rendered as a colorwheel: instead of marking the corAnal phase (which is the degrees, in radians, of the zero-crossing of the best-fitting sinusoid, and which depends on your experiment to map to visual degrees), it marks the predicted visual angle corresponding to each phase value. Next, set Colormap | Retinotopy Parameters | Left Visual Field Color Wheel, or Right Visual Field, depending on the hemisphere (contralateral mapping). This code will set the colormap such that blue is always up (like the sky), green always horizontal (like trees), and red always down (like mud or, for the more prosaic, the fires o' Hades).
  • Alignment: you can now call the mrAlignMI functionality from within rxAlign.
    • Usage: To initialize the alignment (using the I-file headers to get a starting alignment into scanner space, then using the SPM MI code to align the inplanes to volume anatomies), select Alignment | Coarse | Mutual Inf. Align (mrAlignMI). You can also refine from the current alignment, using Alignment | Fine | Mutual Inf. Align (mrAlignMI). This seems to produce good results for several sessions (though not all), and in some cases manual alignment isn't necessary.
Personal tools