MarineBioAcousticsRC / DetEdit

A graphical user interface for annotating and editing events detected in long-term acoustic monitoring data
https://journals.plos.org/ploscompbiol/article?id=10.1371/journal.pcbi.1007598
Other
24 stars 12 forks source link

Solve brush for version matlab 2014 #26

Closed asolsonaberga closed 5 years ago

asolsonaberga commented 6 years ago

Explore different possibilities to make the brush work on matlab versions after 2014.

  1. Grouping all plots in one big figure.
  2. Through callbacks.
  3. Other ways.
asolsonaberga commented 6 years ago

This is how I managed for the ICIgrams for sperm whales. I will look at this and see if I can make it work if all the plots are in one big figure

%%%%%%%%%%%%% class defined manually by user %%%%%%%%%%%%%%%%%% % get key stroke brush on h = brush;

        w = waitforbuttonpress;  % wait for user input.

        disp('Press key or brush points + press key')
        key = get(gcf,'CurrentCharacter');
        if w == 0
            % detections were flagged by user
            w = waitforbuttonpress;
            key = get(gcf,'CurrentCharacter');
            % get brushed data and figure out what to do based on color:
            class = brush_selection(hPoints,key,class);

            disp(['Session',num2str(m),' Class selected: ', key])
            disp('Select other class or go to next window')
            run = 0;
        else

            if strcmp(key,'f') % All points to class: female
                pointsDet = ~isnan(groupscores.Class);
                pointsDet = sum(pointsDet,2);
                index = find(pointsDet > 0);
                class.Female(index) = 1;
                disp(['Session',num2str(m),' All Female Detections = ',num2str(nansum(class.Female))])
                m = m + 1;
                run = 1;
            elseif strcmp(key,'j') % All points to class: juvenile
                pointsDet = ~isnan(groupscores.Class);
                pointsDet = sum(pointsDet,2);
                index = find(pointsDet > 0);
                class.Juvenile(index) = 1;
                disp(['Session',num2str(m),' All Juvenile Detections = ',num2str(nansum(class.Juvenile))])
                m = m + 1;
                run = 1;

........ brush_selection.txt