src/main/java/org/stowers/microscopy/ijplugins/utils/NucleusPixels.java
public void findMaxima() {

//        ImagePlus t = new ImagePlus("test", patchIp);
//        t.show();
        MaximumFinder maxFinder = new MaximumFinder();
        double tol = stdDev;
        ByteProcessor mfip = maxFinder.findMaxima(patchIp, tol, 0, false);

        byte[] p = (byte[])mfip.getPixels();

        HashMap<Integer, Double>  map = new HashMap<>();
        for (int i = 0; i < p.length; i++) {
            //need to used != 0 because the max pixel value 255 is a negative byte
            if (p[i] != 0) {
                //System.out.println("GT0 " + " "  + i + " " + patchPixels[i]);
                map.put(i, (double)patchPixels[i]);
            }
        }

        maxMap = map.entrySet().stream()
                .sorted(Map.Entry.comparingByValue(Comparator.reverseOrder()))
                .collect(Collectors.toMap(
                        Map.Entry::getKey,
                        Map.Entry::getValue,
                        (x, y) -> {throw new AssertionError();},
                        LinkedHashMap::new
                ));

    }
/*
    Find the bright  spots in the image using Find Maxima - if more than one maxima is present, need to decide what
    happens.
     */
Find the bright  spots in the image using Find Maxima - if more than one maxima is present, need to decide what
happens.
Find the bright spots in the image using Find Maxima - if more than one maxima is present need to decide what happens .
public void findMaxima() {
        MaximumFinder maxFinder = new MaximumFinder();
        double tol = stdDev;
        ByteProcessor mfip = maxFinder.findMaxima(patchIp, tol, 0, false);
        byte[] p = (byte[])mfip.getPixels();
        HashMap<Integer, Double>  map = new HashMap<>();
        for (int i = 0; i < p.length; i++) {
            if (p[i] != 0) {
                map.put(i, (double)patchPixels[i]);
            }
        }
        maxMap = map.entrySet().stream()
                .sorted(Map.Entry.comparingByValue(Comparator.reverseOrder()))
                .collect(Collectors.toMap(
                        Map.Entry::getKey,
                        Map.Entry::getValue,
                        (x, y) -> {throw new AssertionError();},
                        LinkedHashMap::new
                ));
    }
public void findMaxima ( ) { MaximumFinder maxFinder = new MaximumFinder ( ) ; double tol = stdDev ; ByteProcessor mfip = maxFinder . findMaxima ( patchIp , tol , 0 , false ) ; byte [ ] p = ( byte [ ] ) mfip . getPixels ( ) ; HashMap < Integer , Double > map = new HashMap < > ( ) ; for ( int i = 0 ; i < p . length ; i ++ ) { if ( p [ i ] != 0 ) { map . put ( i , ( double ) patchPixels [ i ] ) ; } } maxMap = map . entrySet ( ) . stream ( ) . sorted ( Map . Entry . comparingByValue ( Comparator . reverseOrder ( ) ) ) . collect ( Collectors . toMap ( Map . Entry :: getKey , Map . Entry :: getValue , ( x , y ) -> { throw new AssertionError ( ) ; } , LinkedHashMap :: new ) ) ; }
Find the bright  spots in the image using Find Maxima - if more than one maxima is present, need to decide what
happens.
Find the bright spots in the image using Find Maxima - if more than one maxima is present need to decide what happens .
//        ImagePlus t = new ImagePlus("test", patchIp); //        t.show(); //need to used != 0 because the max pixel value 255 is a negative byte //System.out.println("GT0 " + " "  + i + " " + patchPixels[i]);