src/main/java/org/stowers/microscopy/ij1plugins/SpotInNucleus.java
protected void map2Image(ImageProcessor ip) {

        int w = ip.getWidth();
        int h = ip.getHeight();
        float[] pixels = (float[])ip.getPixels();
        for (Map.Entry<Integer, List<Integer>> s :map.entrySet()) {
            List<Integer> x =s.getValue();
            int inum = s.getKey();
            System.out.println("########### " + inum + " ##############");
            HashMap<Integer, Float> a = new HashMap();

            for (Integer i : x) {
                a.put(i, pixels[i]);
            }

            Comparator<Map.Entry<Integer, Float>> byValue = (entry1, entry2) -> entry1.getValue()
                    .compareTo(entry2.getValue());

            a.entrySet().stream()
                    .sorted(byValue.reversed())
                    .limit(10)
                    .forEach(System.out::println);
        }

    }
/* use the instance variable map for the map
    Sort the pixels values in each region of the green channel.
    Smooth the image first (do that somewhere else) to get the intensity of the neighborhood)
    */
use the instance variable map for the map
Sort the pixels values in each region of the green channel.
Smooth the image first (do that somewhere else) to get the intensity of the neighborhood)
use the instance variable map for the map Sort the pixels values in each region of the green channel . Smooth the image first ( do that somewhere else ) to get the intensity of the neighborhood )
protected void map2Image(ImageProcessor ip) {
        int w = ip.getWidth();
        int h = ip.getHeight();
        float[] pixels = (float[])ip.getPixels();
        for (Map.Entry<Integer, List<Integer>> s :map.entrySet()) {
            List<Integer> x =s.getValue();
            int inum = s.getKey();
            System.out.println("########### " + inum + " ##############");
            HashMap<Integer, Float> a = new HashMap();
            for (Integer i : x) {
                a.put(i, pixels[i]);
            }
            Comparator<Map.Entry<Integer, Float>> byValue = (entry1, entry2) -> entry1.getValue()
                    .compareTo(entry2.getValue());
            a.entrySet().stream()
                    .sorted(byValue.reversed())
                    .limit(10)
                    .forEach(System.out::println);
        }
    }
protected void map2Image ( ImageProcessor ip ) { int w = ip . getWidth ( ) ; int h = ip . getHeight ( ) ; float [ ] pixels = ( float [ ] ) ip . getPixels ( ) ; for ( Map . Entry < Integer , List < Integer > > s : map . entrySet ( ) ) { List < Integer > x = s . getValue ( ) ; int inum = s . getKey ( ) ; System . out . println ( "########### " + inum + " ##############" ) ; HashMap < Integer , Float > a = new HashMap ( ) ; for ( Integer i : x ) { a . put ( i , pixels [ i ] ) ; } Comparator < Map . Entry < Integer , Float > > byValue = ( entry1 , entry2 ) -> entry1 . getValue ( ) . compareTo ( entry2 . getValue ( ) ) ; a . entrySet ( ) . stream ( ) . sorted ( byValue . reversed ( ) ) . limit ( 10 ) . forEach ( System . out :: println ) ; } }
use the instance variable map for the map
Sort the pixels values in each region of the green channel.
use the instance variable map for the map Sort the pixels values in each region of the green channel .