Skip to content

Commit 3cafbbb

Browse files
show/hide point counter for atlas
1 parent 5ca2bc2 commit 3cafbbb

File tree

1 file changed

+23
-1
lines changed

1 file changed

+23
-1
lines changed

Browsing Functions/AtlasTransformBrowser.m

Lines changed: 23 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -70,6 +70,10 @@
7070
ud.angleText = annotation('textbox', [.7 0.95 0.4 0.05], ...
7171
'EdgeColor', 'none', 'Color', 'k');
7272

73+
ud.pointsText = annotation('textbox', [0.88 0.03 0.1 0.05], ...
74+
'String', '0 point', 'EdgeColor', 'none', 'Color', 'k', 'HorizontalAlignment', 'right');
75+
ud.pointsText.Visible = 'off';
76+
7377
allData.tv = templateVolume;
7478
allData.av = annotationVolume;
7579
allData.st = structureTree;
@@ -358,6 +362,10 @@ function hotkeyFcn(f, slice_figure, keydata, allData, save_location, save_suffix
358362
if ud.getPoint_for_transform
359363
disp('transform point mode on');
360364

365+
% set(ud.pointHands_for_transform(:), 'Visible', 'on') %TODO
366+
ud.pointsText.Visible = 'on';
367+
ud.pointsText.String = sprintf('%d point(s)', length(ud.pointHands_for_transform));
368+
361369
ud.currentProbe = 0;
362370

363371
% launch transform point mode
@@ -382,6 +390,7 @@ function hotkeyFcn(f, slice_figure, keydata, allData, save_location, save_suffix
382390

383391
try
384392
set(ud.pointHands_for_transform(:), 'Visible', 'off');
393+
ud.pointsText.Visible = 'off';
385394
catch
386395
end
387396

@@ -535,11 +544,18 @@ function hotkeyFcn(f, slice_figure, keydata, allData, save_location, save_suffix
535544
ud.curr_im = ud.curr_slice_trans;
536545
end
537546
% if wrong number of points clicked
538-
catch
547+
catch mexc1
548+
if mexc1.identifier == "images:geotrans:requiredNonCollinearPoints"
549+
disp(['Unable to transform -- ', mexc1.message])
550+
551+
else
552+
539553
ref_mode = true;
540554
disp(['Unable to transform -- ' num2str(size(ud_slice.pointList,1)) ...
541555
' slice points and ' num2str(size(ud.current_pointList_for_transform,1)) ' reference points']);
542556
key_letter = 'h';
557+
558+
end
543559
end
544560
end
545561
% if not doing transform, just show reference atlas
@@ -687,6 +703,8 @@ function hotkeyFcn(f, slice_figure, keydata, allData, save_location, save_suffix
687703
end
688704

689705
disp('transform point deleted');
706+
ud.pointsText.String = sprintf('%d point(s)', length(ud.pointHands_for_transform));
707+
690708

691709
elseif ud.currentProbe
692710
ud.pointList{ud.currentProbe,1} = ud.pointList{ud.currentProbe,1}(1:end-1,:);
@@ -1133,6 +1151,10 @@ function atlasClickCallback(im, keydata, slice_figure, save_location)
11331151
ud.curr_slice_num = ud.slice_at_shift_start+ud.slice_shift;
11341152
ud.loaded = 0;
11351153
ud.clicked = true;
1154+
1155+
ud.pointsText.String = sprintf('%d point(s)', length(ud.pointHands_for_transform));
1156+
1157+
11361158
end
11371159
set(f, 'UserData', ud);
11381160

0 commit comments

Comments
 (0)