5 Replies Latest reply on Jul 20, 2013 10:35 AM by mdidish84

    Draw a continuous surface



      I search a function to automate this process (look at the picture below for an example) :

      - I have a picture with a lot of black pixels

      - I would like to group all black pixels which are separated by less than "X" pixels, to draw a continuous surface.

      Maybe with ExtendScript ?

      Thank you for your help.



        • 1. Re: Draw a continuous surface
          Noel Carboni Level 8

          I was able to use Filter - Other - Minimum with a particular set of parameters, followed by a Median filter to smooth the results, to get something not unlike what you showed, but given that I derived the parameters empirically from your very limited image, at exactly the size given, I wouldn't be surprised if the characteristics of this sequence of operations are way off from what you want.




          In any case, if you'd like to see this "proof of concept" action to understand what I did, here it is:






          Keep in mind this will be VERY sensitive to the thresholds and sizes chosen for the various steps, and is crafted to work at an image with just the resolution you showed above.



          • 2. Re: Draw a continuous surface
            mdidish84 Level 1

            Thank you a lot for your proposition, It's not perfetc but it's a good (indirect) solution, and I can customize your action.


            • 3. Re: Draw a continuous surface
              Trevor.Dennis Adobe Community Professional

              That was pretty clever Noel.

              • 4. Re: Draw a continuous surface
                Noel Carboni Level 8

                Glad I could help get you started, mdidish84.  Are we diagnosing tumors or something here?  Just curious.


                Thanks, Trevor.



                • 5. Re: Draw a continuous surface
                  mdidish84 Level 1

                  Indeed I quantifies a subtype of cells in the pancreas, but the staining is very "light" on several image, and our usual methods to quantify do not work.

                  Your work helps me a lot for a first estimate !


                  Now I try to do a more detailled solution, with a script:

                  - for each pixel, I get color;

                  - If the pixel is black, I'm looking if there is a black pixel around (eg within 10 pixels)

                  - If this is the case, I draw a black line between the two black pixels

                  - from there, I can quantify the total area (lines inside) with an other software.

                  Just one problem, I know a little Java, but I never do script with photoshop; so I'm reading the documentation (Photoshop-CS6-Scripting-Guide).