User Tools

Site Tools


jochen:screenshots

Differences

This shows you the differences between two versions of the page.

Link to this comparison view

Both sides previous revision Previous revision
Next revision
Previous revision
jochen:screenshots [2016/05/27 22:30]
jochen
jochen:screenshots [2016/05/28 00:48] (current)
jochen shortening two code lines
Line 92: Line 92:
 To generate a scenery, multiple surfaces (or DTI fiber tracts) can be combined in a view. The function call for this is To generate a scenery, multiple surfaces (or DTI fiber tracts) can be combined in a view. The function call for this is
  
-<code matlab>​neuroelf_gui('​sceneryselect',​ {surface_object1,​ surface_object2, surface_object3}); % for the main viewer window or +<code matlab>​neuroelf_gui('​sceneryselect',​ {surface_object1,​ surface_object2});​ % for the main viewer window or 
-neuroelf_gui('​sceneryselect',​ {surface_object1,​ surface_object2, surface_object3}, '​BS123456'​);​ % for the satellite with ID BS123456</​code>​+neuroelf_gui('​sceneryselect',​ {surface_object1,​ surface_object2},​ '​BS123456'​);​ % for the satellite with ID BS123456</​code>​
  
 ==== Altering surface properties by script ==== ==== Altering surface properties by script ====
Line 125: Line 125:
  
 <code matlab>​neuroelf_gui('​satresize',​ iSat, [width, height]);</​code>​ <code matlab>​neuroelf_gui('​satresize',​ iSat, [width, height]);</​code>​
 +
 +==== Changing the background color (surfaces only for now) ====
 +Another thing you may want to do is setting the background color:
 +
 +<code matlab>​neuroelf_gui('​satsetcolor',​ iSat, [red, green, blue]);</​code>​
 +
 +whereas each of red, green, and blue are 0-255 coded RGB values (so use [255, 255, 255] for white).
  
 ==== Manipulating the viewpoint ==== ==== Manipulating the viewpoint ====
Line 139: Line 146:
  
 Whereas the image_filename can of course be a sprintf(...) expression within a loop. The "​high-q"​ flag instructs the function to use oversampling (which really is only useful for surface windows, though). Whereas the image_filename can of course be a sprintf(...) expression within a loop. The "​high-q"​ flag instructs the function to use oversampling (which really is only useful for surface windows, though).
 +
 +===== Putting it all together =====
 +So, an entire script could look like this:
 +
 +<code matlab>% files to load/​display
 +lh_srf = '/​Users/​Jochen/​Documents/​demo/​lh.srf';​
 +rh_srf = '/​Users/​Jochen/​Documents/​demo/​rh.srf';​
 +
 +% VMP (will be sampled on surfaces)
 +stast_vmp = '/​Users/​Jochen/​Documents/​demo/​stats.vmp';​
 +
 +% load objects (without loading again)
 +x = xff;
 +try
 +    lh = x.Document(lh_srf);​
 +catch
 +    lh = xff(lh_srf);​
 +end
 +try
 +    rh = x.Document(rh_srf);​
 +catch
 +    rh = xff(rh_srf);​
 +end
 +try
 +    vmp = x.Document(stats_vmp);​
 +catch
 +    vmp = xff(stats_vmp);​
 +end
 +
 +% adding all to viewer
 +vmp.Browse;
 +lh.Browse;
 +rh.Browse;
 +
 +% set in scenery
 +neuroelf_gui('​sceneryselect',​ {lh, rh});
 +
 +% then sample the stats
 +[lhsmp, rhsmp] = neuroelf_gui('​vmp_createsmp'​);​
 +
 +% undock the window
 +[hSat, tags, iSat] = neuroelf_gui('​undock'​);​
 +
 +% resize satellite
 +neuroelf_gui('​satresize',​ iSat, [1080, 720]);
 +
 +% set color (to white)
 +neuroelf_gui('​satsetcolor',​ iSat, [255, 255, 255]);
 +
 +% loop over a rotation (create movie frames)
 +mfc = 1;
 +for fc = [90:360, 1:90]
 +    ​
 +    % set position
 +    neuroelf_gui('​setsurfpos',​ iSat, {fc, 15, [0, 0, 0], 1, 0});
 +    ​
 +    % screenshot
 +    neuroelf_gui('​screenshot',​ iSat, sprintf('​movieframe%03d.png',​ mfc), '​high-q'​);​
 +    ​
 +    % increase counter
 +    mfc = mfc + 1;
 +end
 +
 +% delete satellite
 +neuroelf_gui('​closesatwindow',​ iSat);
 +
 +% unload created objects
 +rhsmp.ClearObject;​
 +lhsmp.ClearObject;</​code>​
jochen/screenshots.1464381030.txt.gz · Last modified: 2016/05/27 22:30 by jochen