Skip to content

Commit 80fc935

Browse files
committed
Added structure search add
When adding 3d structure: added search and list results feature
1 parent 485046b commit 80fc935

File tree

1 file changed

+22
-5
lines changed

1 file changed

+22
-5
lines changed

Browsing Functions/allen_ccf_npx.m

Lines changed: 22 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -297,13 +297,29 @@ function key_press(probe_atlas_gui,eventdata)
297297

298298
if ~any(strcmp(eventdata.Modifier,'shift'))
299299
% (no shift: list in native CCF order)
300+
300301
parsed_structures = unique(reshape(gui_data.av(1:slice_spacing:end, ...
301-
1:slice_spacing:end,1:slice_spacing:end),[],1));
302-
plot_structures_parsed = listdlg('PromptString','Select a structure to plot:', ...
303-
'ListString',gui_data.st.safe_name(parsed_structures),'ListSize',[520,500]);
304-
plot_structures = parsed_structures(plot_structures_parsed);
305-
302+
1:slice_spacing:end,1:slice_spacing:end),[],1));
306303

304+
if ~any(strcmp(eventdata.Modifier,'alt'))
305+
% (no alt: list all)
306+
plot_structures_parsed = listdlg('PromptString','Select a structure to plot:', ...
307+
'ListString',gui_data.st.safe_name(parsed_structures),'ListSize',[520,500]);
308+
plot_structures = parsed_structures(plot_structures_parsed);
309+
else
310+
% (alt: search list)
311+
structure_search = lower(inputdlg('Search structures'));
312+
structure_match = find(contains(lower(gui_data.st.safe_name),structure_search));
313+
list_structures = intersect(parsed_structures,structure_match);
314+
if isempty(list_structures)
315+
error('No structure search results')
316+
end
317+
318+
plot_structures_parsed = listdlg('PromptString','Select a structure to plot:', ...
319+
'ListString',gui_data.st.safe_name(list_structures),'ListSize',[520,500]);
320+
plot_structures = list_structures(plot_structures_parsed);
321+
end
322+
307323
if ~isempty(plot_structures)
308324
for curr_plot_structure = reshape(plot_structures,1,[])
309325
% If this label isn't used, don't plot
@@ -731,6 +747,7 @@ function probe_histology(probe_atlas_gui)
731747
'm : set probe location manually', ...
732748
'\bf 3D brain areas: \rm' ...
733749
' =/+ : add (list selector)' ...
750+
' Alt/Option =/+ : add (search)' ...
734751
' Shift =/+ : add (hierarchy selector)' ...
735752
' - : remove', ...
736753
'\bf Visibility: \rm' ...

0 commit comments

Comments
 (0)