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
 showsrs2 tips and tricks
 New Topic  Reply to Topic
 Printer Friendly
Author Previous Topic Topic Next Topic  

josh.bizzell
BIAC Staff

USA
118 Posts

Posted - Mar 17 2006 :  4:43:51 PM  Show Profile  Reply with Quote
Below are some Matlab commands users can add to display scripts or type on the command line to manually change properties of the showsrs2 figure window.


- Change the title of your showsrs2 window
This command will change the title of the active showsrs2 figure to "Patients vs Controls - Targets".
set(gcf,'Name','Patients vs Controls - Targets');


- Go straight to the 3 orthogonal plane view
Before you can go straight to the orthogonal view, you have check to see if voxel size and orientation information have been loaded with the "if" statement below.
if strcmpi(get(findobj(gcf,'Tag','ThreePlaneOrientMenu'),'Enable'),'on')
  showsrs2('ChangeOrientMenu_Callback',findobj(gcf,'Tag','ThreePlaneOrientMenu'));
end


- Don't show the legend
set(findobj(gcf,'Tag','ShowLegendMenu'),'Checked','off');


- Manually set the limits of the time plot Y-axis
For this to work, the showsrs2 window must be in orthogonal view mode. This will set the Y-axis limits to the values in "yAxisRange" and will disable automatic rescaling of the Y-axis.
yAxisRange = [-10,30];
set(getfield(get(gcf,'UserData'),'timePlotAxes'),...
  'YLimMode','manual','YLim',yAxisRange);


- Add a vertical marker to the time plot axes
This command will put a vertical marker at the time point you specify (here, time point 5). If the Y-axis is set to automatic rescaling, you will have to run this command whenever you change the current point. Like the command above, this one only works when the showsrs2 window is in orthogonal view mode. The "axes" command will make the time plot axes the active axes, so the subsequent command will apply to it rather than the image axes.
axes(getfield(get(gcf,'UserData'),'timePlotAxes'));
xLine = line([5,5],...
  [min(getfield(get(getfield(get(gcf,'UserData'),'timePlotAxes')),'YLim')),...
  max(getfield(get(getfield(get(gcf,'UserData'),'timePlotAxes')),'YLim'))]);

To delete the line, you just need to type:
delete(xLine)


- Add multiple vertical markers to time plot axes
You can use a "for" loop with the code above to add multiple markers to the time plot. This code will add a marker at every X point listed in "xlinepts".
xlinepts = [3,5,14,17];
axes(getfield(get(gcf,'UserData'),'timePlotAxes'));
xlines = zeros(1,length(xlinepts));
for i = 1:length(xlinepts)
  xlines(i) = line([xlinepts(i),xlinepts(i)],...
    [min(getfield(get(getfield(get(gcf,'UserData'),'timePlotAxes')),'YLim')),...
    max(getfield(get(getfield(get(gcf,'UserData'),'timePlotAxes')),'YLim'))]);
end

To delete all markers:
for i = 1:length(xlines)
  delete(xlines(i));
end


If you know of any other commands or have any questions, please add them to this thread.

-Josh Bizzell

Dichter
BIAC Faculty

190 Posts

Posted - Mar 23 2006 :  10:35:21 AM  Show Profile  Visit Dichter's Homepage  Reply with Quote
Is there anyway to automatically view a particular TR when looking at 4D data (e.g., displaying timepoint 5 initially instead of timepoint 1)?

Gabriel S. Dichter, PhD
UNC Departments of Psychiatry & Psychology
http://www.can.unc.edu/
Go to Top of Page

josh.bizzell
BIAC Staff

USA
118 Posts

Posted - Mar 23 2006 :  11:06:38 AM  Show Profile  Reply with Quote
Gabriel,
This command should do what you want:

- Move to specified time point
This command will move to a specified time point of 4D datasets; here time point 5.
set(findobj(gcf,'Tag','TimeSlider'),'Value',5);
showsrs2('TimeSlider_Callback',findobj(gcf,'Tag','TimeSlider'));

- Josh
Go to Top of Page

josh.bizzell
BIAC Staff

USA
118 Posts

Posted - Mar 23 2006 :  3:42:35 PM  Show Profile  Reply with Quote
Here's another:

- Flip the data without using flipdim
This will let you flip your data in any direction without explicitly using the "flipdim" on your data before displaying with showsrs2. If you have used BXH files with the correct orientation information to load your data, you probably won't need to use these commands.
It's probably obvious, but here are the descriptions of the fields to change:

'FlipMenuSI' - Will flip superior-inferior axes
'FlipMenuAP' - Will flip anterior-posterior axes
'FlipMenuRL' - Will flip right-left axes
showsrs2('FlipMenu_Callback',findobj(gcf,'Tag','FlipMenuSI'));
showsrs2('FlipMenu_Callback',findobj(gcf,'Tag','FlipMenuAP'));
showsrs2('FlipMenu_Callback',findobj(gcf,'Tag','FlipMenuRL'));

- Josh
Go to Top of Page

marion
BIAC Alum

19 Posts

Posted - May 08 2007 :  3:15:17 PM  Show Profile  Reply with Quote
Is there any way to tell it to display horizontal lines (to compare amplitudes) from within a script?

Thanks,
-Brian
Go to Top of Page

josh.bizzell
BIAC Staff

USA
118 Posts

Posted - May 08 2007 :  3:22:09 PM  Show Profile  Reply with Quote
Brian,
I haven't tested it, but I'm guessing the following would put a line at Y=5:

axes(getfield(get(gcf,'UserData'),'timePlotAxes'));
yLine = line([min(getfield(get(getfield(get(gcf,'UserData'),'timePlotAxes')),'XLim')),...
  max(getfield(get(getfield(get(gcf,'UserData'),'timePlotAxes')),'XLim'))],...
  [5,5]);

To delete the line:

delete(yLine);
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.42 seconds. Snitz Forums 2000