sub get_bboxes_pdl_bad { my $flat = $sgm-> flat-> setvaltobad( 0 ); my $idx = $flat-> qsorti; $idx = $idx-> where( $flat-> index( $idx )-> isgood ); my ( $runs ) = $flat-> index( $idx )-> rle; $runs = $runs-> where( $runs != 0 )-> cumusumover - 1; my ( $x, $y ) = $sgm-> one2nd( $idx ); my $stop = -1; return [ map { my $start = $stop + 1; $stop = $_; [[ $x( $start:$stop )-> minmax ], [ $y( $start:$stop )-> minmax ]] } $runs-> list ] }