Duke-UNC Brain Imaging and Analysis Center
BIAC Forums | Profile | Register | Active Topics | Members | Search | FAQ
Username:
Password:
Save Password   Forgot your Password?
 All Forums
 Support Forums
 Analysis Software Support
 Linking showsrs2 windows
 New Topic  Reply to Topic
 Printer Friendly
Author Previous Topic Topic Next Topic  

josh.bizzell
BIAC Staff

USA
118 Posts

Posted - Jan 05 2005 :  11:37:29 AM  Show Profile  Reply with Quote
I was recently asked to document a Matlab function I have written that will link the cursors of two showsrs2 windows. The function I have is called showsrs2linked, and is in \\Gall\Programs\User_Scripts\beta\ (NOTE: There is a beta version of showsrs2 in this folder, so if you add this folder to the top of your path in Matlab, most likely you'll be using this beta version.)

Example:

anat = readmr('\\Server\Data\Study.01\Anat\Sub1\anat.bxh');
tmap1 = readmr('\\Server\Data\Study.01\Analysis\Sub1\tmap1.bxh');
tmap2 = readmr('\\Server\Data\Study.01\Analysis\Sub1\tmap2.bxh');
tsv1 = readmr('\\Server\Data\Study.01\Analysis\Sub1\Avg_1.bxh');
tsv2 = readmr('\\Server\Data\Study.01\Analysis\Sub1\Avg_2.bxh');
fig1 = showsrs2(anat,tmap1,tsv1);
fig2 = showsrs2(anat,tmap2,tsv2);
showsrs2linked(fig1,fig2);

There is also a more advanced example in the showsrs2linkedscript in the same folder.

Also, it is important to note that this function will only link the cursor in figure2 to figure1, but not vice versa. Thus, clicking anywhere on the image in figure2 will not update figure1.

Please let me know if you find any bugs or have any questions.
-Josh

charles.michelich
BIAC Alum

USA
183 Posts

Posted - Jan 08 2005 :  12:38:55 AM  Show Profile  Reply with Quote
Inspired by Josh's function, I updated showsrs2 to include linked cursors support. The functionality is the same as Josh's function, except it links the figures both ways (clicking in figure 1 updates figure 2 and clicking in figure 2 updates figure 1) and more than two figures can be linked together.

Example
anat = readmr('\\Server\Data\Study.01\Anat\Sub1\anat.bxh');
tmap1 = readmr('\\Server\Data\Study.01\Analysis\Sub1\tmap1.bxh');
tmap2 = readmr('\\Server\Data\Study.01\Analysis\Sub1\tmap2.bxh');
tmap3 = readmr('\\Server\Data\Study.01\Analysis\Sub1\tmap3.bxh');
tsv1 = readmr('\\Server\Data\Study.01\Analysis\Sub1\Avg_1.bxh');
tsv2 = readmr('\\Server\Data\Study.01\Analysis\Sub1\Avg_2.bxh');
fig1 = showsrs2(anat,tmap1,tsv1);
fig2 = showsrs2(anat,tmap2,tsv2);
fig3 = showsrs2(anat,tmap3);
showsrs2('LinkCursors', [fig1 fig2 fig3])
Please post to this thread if you find any problems.
-Chuck

P.S. If you have trouble with this function, just add
\\Gall\Programs\User_Scripts\beta\oldlinked to your path to use Josh's code and the old version of showsrs2.

Edited by - charles.michelich on Jan 08 2005 12:41:07 AM
Go to Top of Page

evan.gordon
BIAC Alum

12 Posts

Posted - Jan 10 2005 :  12:18:26 PM  Show Profile  Reply with Quote
Chuck,

I can't get 'LinkCursors' to work at all. I get this error:

??? Error using ==> showsrs2
Error using ==> subsref
Attempt to reference field of non-structure array.

Isn't the version you modified saved in \\Gall\Programs\MATLAB\BIAC\mr\showsrs2.m?

Evan
Go to Top of Page

jamie.morris
BIAC Alum

59 Posts

Posted - Jan 10 2005 :  12:23:52 PM  Show Profile  Reply with Quote
I think the newest version is in the Beta directory (based on the dates of the versions in the mr directory)....
Go to Top of Page

charles.michelich
BIAC Alum

USA
183 Posts

Posted - Jan 10 2005 :  12:33:53 PM  Show Profile  Reply with Quote
Evan,

The version I modified is in \\Gall\Programs\User_Scripts\beta\.

A message will be posted to the thread for the current BIAC MATLAB Tools distribution (currently here) anytime a change is made to the main distribution in \\Gall\Programs\MATLAB\BIAC. Provided that these modifications work well, the new version of showsrs2 will be included in the next release of the BIAC MATLAB Tools.

Enjoy,
Chuck
Go to Top of Page
  Previous Topic Topic Next Topic  
 New Topic  Reply to Topic
 Printer Friendly
Jump To:
BIAC Forums © 2000-2010 Brain Imaging and Analysis Center Go To Top Of Page
This page was generated in 0.38 seconds. Snitz Forums 2000