@@ -83,7 +83,7 @@ case strcmp(atlas_label, 'dsurqe')
83
83
bc = D .atlas .brain_coor ;
84
84
% Create all the objects depending on the top axes
85
85
h.im_top = imagesc(bc .yscale , bc .xscale , D .atlas .surf_top ' , ' Parent' , h .axes_top );
86
- set(h .axes_top , ' ydir' , ' normal ' ,' DataAspectRatio' ,[1 1 1 ], ' NextPlot' , ' add' )
86
+ set(h .axes_top , ' ydir' , ' reverse ' ,' DataAspectRatio' ,[1 1 1 ], ' NextPlot' , ' add' )
87
87
set(h .axes_top ,' UserData' , round(bc .y2i(0 ))) % WIndow motion callback
88
88
xlabel(h .axes_top , ' AP' ), ylabel(h .axes_top , ' ML' )
89
89
colormap(h .axes_top , cmap );
@@ -97,7 +97,7 @@ case strcmp(atlas_label, 'dsurqe')
97
97
98
98
% Create all the objects depending on the contrast axes
99
99
h.im_phy = imagesc(bc .xscale , bc .zscale , D .atlas .vol_image(: ,: ,round(bc .y2i(0 ))), ' Parent' , h .axes_phy );
100
- set(h .axes_phy , ' DataAspectRatio' ,[1 1 1 ], ' NextPlot' , ' add' , ' xdir' , ' reverse ' )
100
+ set(h .axes_phy , ' DataAspectRatio' ,[1 1 1 ], ' NextPlot' , ' add' , ' xdir' , ' normal ' )
101
101
h.pl_phy_origin = plot(h .axes_phy , 0 ,0 , ' r+' );
102
102
h.pl_phy_xr = plot(h .axes_phy , [bc .xlim NaN 0 0 ], [0 0 NaN bc .ylim ], ' Color' , color_from_index(2 ));
103
103
h.pl_phy_zone = plot(h .axes_phy , NaN , 0 ,' .' ,' MarkerSize' ,4 ,' Color' ,color_from_index(5 ), ' ButtonDownFcn' , @pl_zone_ButtonDownFcn );
@@ -110,8 +110,8 @@ case strcmp(atlas_label, 'dsurqe')
110
110
xlabel(h .axes_phy , ' ML' ), ylabel(h .axes_phy , ' DV' )
111
111
colormap(h .axes_phy , cmap )
112
112
% Create all the objects depending on the label axes
113
- h.im_lab = imagesc(bc .xscale , bc .zscale , D .atlas .vol_labels(: ,: ,round(bc .y2i(0 ))), ' Parent' , h .axes_label );
114
- set(h .axes_label , ' DataAspectRatio' ,[1 1 1 ], ' NextPlot' , ' add' , ' xdir' , ' reverse ' )
113
+ h.im_lab = imagesc(- bc .xscale , bc .zscale , D .atlas .vol_labels(: ,: ,round(bc .y2i(0 ))), ' Parent' , h .axes_label );
114
+ set(h .axes_label , ' DataAspectRatio' ,[1 1 1 ], ' NextPlot' , ' add' , ' xdir' , ' normal ' )
115
115
h.pl_lab_origin = plot(h .axes_label , 0 ,0 , ' r+' );
116
116
h.pl_lab_xr = plot(h .axes_label , [bc .xlim NaN 0 0 ], [0 0 NaN bc .ylim ], ' Color' , color_from_index(2 ));
117
117
h.pl_lab_zone = plot(h .axes_label , NaN , 0 ,' .' ,' MarkerSize' ,4 ,' Color' ,color_from_index(5 ), ' ButtonDownFcn' , @pl_zone_ButtonDownFcn );
@@ -127,7 +127,8 @@ case strcmp(atlas_label, 'dsurqe')
127
127
set([h .pl_phy_xr , h .pl_lab_xr , h .pl_phy_zone , h .pl_lab_zone ], ' Visible' , ' Off' )
128
128
set(h .fig_main ,' WindowButtonMotionFcn' , {@fig_main_WindowButtonMotionFcn , h })
129
129
% prevents from re-loading the Atlas for the time being
130
- set([h .menu_file_allen50 , h .menu_file_dsurqe ], ' Enable' , ' off' )
130
+ set(h .menu_file , ' Enable' , ' off' )
131
+ set(h .menu_3d_plot , ' Enable' , ' on' )
131
132
h.txt_top_apline = text(NaN , NaN , ' ' , ' Parent' , h .axes_top , ' Color' , color_from_index(2 ),' Fontsize' ,12 , ' Fontweight' , ' bold' );
132
133
guidata(h .fig_main , h )
133
134
setappdata(h .fig_main , ' Data' , D )
@@ -410,3 +411,37 @@ function menu_file_dsurqe_Callback(hobj, evt, h)
410
411
function menu_electrode_table_Callback(hobj , evt , h )
411
412
function menu_electrode_load_Callback(hobj , evt , h )
412
413
function menu_electrode_write_Callback(hobj , evt , h )
414
+
415
+
416
+ % --------------------------------------------------------------------
417
+ function menu_3d_plot_Callback(hobj , evt , h )
418
+ h = guidata(h .fig_main );
419
+ D = getappdata(h .fig_main , ' Data' );
420
+
421
+ h3d = D .atlas .show();
422
+ set(h3d .ax , ' NextPlot' , ' add' )
423
+ pl3d = plot3(h3d .ax , D .E .dvmlap_entry(: ,2 ), D .E .dvmlap_entry(: ,3 ), D .E .dvmlap_entry(: ,1 ), ' k*' );
424
+ set(h3d .p , ' FaceAlpha' , 0.2 )
425
+ %% now display electrodes
426
+ E = D .E ;
427
+ col = get(gca ,' colororder' );
428
+ try delete(pl ), end
429
+ ie = find(E .pitch >= 0 );
430
+ high = E .site_highest(ie );
431
+ low = E .site_lowest(ie );
432
+
433
+ pl(1 ) = plot3((flatten([high(: ,2 ) low(: ,2 ) ie .* NaN ]' )) ,...
434
+ (flatten([high(: ,3 ) low(: ,3 ) ie .* NaN ]' )), ...
435
+ (flatten([high(: ,1 ) low(: ,1 ) ie .* NaN ]' )), ...
436
+ ' color' , col(4 ,: ), ' parent' , h3d .ax );
437
+ set(pl ,' linewidth' ,1.5 )
438
+
439
+ ie = find(E .pitch < 0 );
440
+ high = E .site_highest(ie );
441
+ low = E .site_lowest(ie );
442
+
443
+ pl(2 ) = plot3((flatten([high(: ,2 ) low(: ,2 ) ie .* NaN ]' )) ,...
444
+ (flatten([high(: ,3 ) low(: ,3 ) ie .* NaN ]' )), ...
445
+ (flatten([high(: ,1 ) low(: ,1 ) ie .* NaN ]' )), ...
446
+ ' color' , col(5 ,: ), ' parent' , h3d .ax );
447
+ set(pl ,' linewidth' ,1.5 )
0 commit comments