created by Christoph Hofstetter 2012
christophhofstetter (at) gmail.com | http://labnic.unige.ch

Disclaimer: use at your own risk, no warranty of functioning, when in doubt verify in SPM

xjViewBrowser is a function developed for the SPM contrast visualisation tool xjView to display contrasts more easily. Instead of needing to know which contrast has what number, in xjViewBrowser you can load an SPM.mat file and all the available contrasts will be listed with their names. Then you only need to click on a contrast and the image is loaded into xjView. You can also select several contrasts at the same time (hold the CTRL or SHIFT key when clicking) and all the contrast images are sent to xjView. There is a colour bar at the right end of the xjViewBrowser window which indicates the colour-coding, where the topmost selected contrast corresponds to the topmost colour, etc. You can also load a second SPM.mat file and send contrast images from the two files to xjView, simply add another row and load your SPM.mat. xjViewBrowser
Most basic view of browseXJ  Parent browsing  Multiple rows Options Dialog
Basic Interface Parent Browsing Multiple Rows Options Dialog

xjViewBrowser with xjview
one contrast selected  two contrasts selected
One contrast selected Two contrasts selected
Inspired by the useful tool xjView, xjViewBrowser was created in order to have a tool to easily explore data. It can be used to easily compare or browse through subjects and or analyses. Even though many researchers focus on group studies, I still find it important to have a look at single subjects. In terms of programmation, xjViewBrowser is a single function that just needs to be inserted into xjview, i.e. the code of xjview itself is not changed.
Overall, xjViewBrowser is intended to improve quality and productivity of your work. By clicking "+col" you add a listbox holding all the directories one level above the loaded SPM.mat file. By clicking "+col" another time it will add another listbox holding directories two levels above, etc. The highlighted entry corresponds to the path from the loaded SPM.mat. If your data is organised systematically (which is very likely when you have used a batch to run your analyses) maybe the upper directories hold different analyses or different subjects. If this is the case you can try to click for example on the directory of another subject. If a contrast was selected xjViewBrowser will then reconstruct the path to the selected contrast corresponding to the selected subject:

selected from loaded SPM.mat:


This way you should be able to browse through subjects or analyses. Importantly, this sort of browsing will only be successful when you have the same contrast structure in the involved analyses. There is an option which performs a check, to see if the selected contrast(s) name and number, which were loaded originally correspond to the contrast(s) name and number for the requested subject or analyses.
Further, you can either select multiple contrasts OR multiple parents (e.g. subject or analyses), if you try to select several analyses and several contrasts one will be reset to 1.
By unticking the checkbox located above a parent column you can hide it to have more space to display the other columns. The xjViewBrowser window is fully resizable, i.e. you can change the size in either direction and the content will adapt to the new size. The navigation button at the very top are fixed, and so a minimum width of around 500 pixels is recommended. There is an option to save the size and position of the xjViewBrowser and xjView windows, so it will be reinstated at next start up. For contrasts and parents you can use a filter (regular expression) to restrain the displayed entries. If your data is organised in a subject based way (i.e. a folder holding all subjects, a subject folder that holds analyses and structural images) you can try to visualise automatically a corresponding anatomical image of the selected subject. You only need to enable the option and define a relative path (relative to the loaded SPM.mat) and a filter (regular expression) to identify the anatomical image. If everything is set and you click a contrast or parent, the listbox in xjView should highlight now an entry called "OWN" and the matlab command line should tell you what image was loaded. If no image was found a standard image will be used. If you select several subjects only the first will be used, if several structural images where found, only the first will be used. It is possible to save your options to a config file, which is loaded at next startup. This way you can keep the window sizes and positions, the options chosen and a list of recently loaded SPM.mat files. saving Appearance: Saves size and position of both windows (xjViewBrowser and xjView) and reinstates these parameters at next startup. This way, you only need position and resize the windows one time and then they will be the same next time.

closing both: Will close both windows (xjViewBrowser and xjView) when the xjViewBrowser window is closed.

instant reload: When clicking on a new parent, xjViewBrowser will try to load the correponding SPM automatically. This option may take a bit longer for loading, on the other hand you directly see the contrasts of the selected SPM. The reload will only take place if a single parent is selected.

You can also set the font size for the listbox entries, just change the number and save. I usually use all options mentioned above, exept checkCon. To run xjViewBrowser you need MATLAB, SPM and xjView. xjViewBrowser was/is developed on Windows XP with MATLAB 7.7.0 (R2008b). It seems to work on other versions of MATLAB but has not been tested systematically on many different computers, operating systems and MATLAB versions. If you encounter a problem please notify me. In order to use xjViewBrowser you will need to merge a xjViewBrowser version with an xjView version. You can perform this either manually (see Installation below) or by using this builder function [download builder].

Please test if your xJview is working before building the version with xjViewBrowser. Also be aware that the TDDatabase file (provided with xjView) must reside in the same folder as the newly built version of xjView-xjViewBrowser.

To download xjViewBrowser you will be asked to enter your name, email, institution and country, which should give an idea who is using the software. After completing and sending the form you will receive an email with the download link, which is valid for four hours. Go to download. If you don't want to use the automatic builder described above in Download, please follow the instructions here. The matlab function xjViewBrowser only needs to be copied into the xjview code and a call to it should be made at the end of xjView figure creation at around line 600.

thisStruct.DIM = DIM';
CallBack_loadImagePush(handles.loadImagePush, [], thisStruct);

function varargout = xjViewBrowser(varargin)
0.322added button and checkbox for manually/automatically passing on images
0.321added colors directly in listbox and removed color panels, changed figure colors to standards, experimental: colored intensity values
0.317added check for updates
0.316bug fix (reset xjview window option)
0.315bug fix (reset button for xjview window), enable resize xjview window
Locations of Site Visitors