Pixel inspector + rugosity

Previous Topic Next Topic
 
classic Classic list List threaded Threaded
3 messages Options
Reply | Threaded
Open this post in threaded view
|

Pixel inspector + rugosity

Balazadeh Mohtadi, Carlos
Hi everyone,

I'm currently looking at trying to generate a value for rugosity or average
roughness from a set number of pixels or a frame within a grayscale image.

Pixel inspector gives me a wide array of pixel data with intensity values
per pixel which can be translated into a surface plot easily.  I would like
to translate that data into a rugosity measurement of the plot generated,
in this case, height would be designated by max peaks recorded in the pixel
data frame.

One issue I have with pixel inspector is that it can only give me a pixel
inspection radius of 10 pixels.  I need something slightly bigger and I'm
not sure if I could potentially override this setting or not.

I'm linking an image of the surface plot I'm generating within a specified
area using the rectangle tool (unfortunately, I don't know if I can extract
pixel data for the rectangle tool).
The next image is an example of the surface plot I'm generating using the
pixel inspector along with a .csv that contains the pixel data for that
plot.

1 - rectangle tool surface plot ROI
https://www.dropbox.com/s/jim0svvd0h8ycou/1.bmp?dl=0

2 - Pixel inspector ROI surface plot (much smaller than the first
https://www.dropbox.com/s/bh061xdl8y3yrzk/2.bmp?dl=0

Pixel data2 - Pixel data for image "2".

https://www.dropbox.com/s/43dpfffifv4bfof/Pixel%20data2.csv?dl=0

I'm converting all my images to 8-bit before generating these.
As you see with picture 1, there is plenty of peaks and valleys that can be
used to assess a rugosity value or roughness.

If anyone has done similar work I'd greatly appreciate the help.

Best regards,

Keyvan Balazadeh

--
ImageJ mailing list: http://imagej.nih.gov/ij/list.html
Reply | Threaded
Open this post in threaded view
|

Re: Pixel inspector + rugosity

Michael Schmid
Hi Keyvan,

as long as the slope angles are low, it seems to me that rugosity can be approximated by
  1 + 0.5((dv/dx)^2 + (dv/dy)^2)
where v is the pixel value.

This is essentially 1 + 0.5 times the square of the Sobel operator.
  http://en.wikipedia.org/wiki/Sobel_operator
The Sobel operator is implemented in ImageJ as Process>Find Edges.

For higher slopes, you need 1/cos(Sobel_output). In any case, make sure that your z units are the same as the distance between the pixels (use a 32-bit image, i.e. floating-point precision).

You can then average over the rugosity in any area by Analyze>Measure.

The result will be slightly different than what you get when calculating rugosity from the single pixel values because the Sobel operator does slight smoothing of the data (to avoid that, you may resize the image to twice or 3x the original size with bicubic interpolation).

---

The reason why the Pixel Inspector is limited in size is showing no more data than what fits the typical screen size, but also performance: When writing the plugin, I did not expect that any one would ever use it for sizes larger than roughly 7x7, so I simply took a jawa.awt.Label for each single number. This becomes quite slow for large amounts of numbers.

---

Another option if you need the pixel values for a larger area: Duplicate the selection and save as Text Image. Then you can read the values into your own program to calculate rugosity by the method of your choice. Or implement that method directly in an ImageJ macro or plugin.


Michael
________________________________________________________________
On Oct 21, 2014, at 20:03, Balazadeh Mohtadi, Carlos wrote:

> Hi everyone,
>
> I'm currently looking at trying to generate a value for rugosity or average
> roughness from a set number of pixels or a frame within a grayscale image.
>
> Pixel inspector gives me a wide array of pixel data with intensity values
> per pixel which can be translated into a surface plot easily.  I would like
> to translate that data into a rugosity measurement of the plot generated,
> in this case, height would be designated by max peaks recorded in the pixel
> data frame.
>
> One issue I have with pixel inspector is that it can only give me a pixel
> inspection radius of 10 pixels.  I need something slightly bigger and I'm
> not sure if I could potentially override this setting or not.
>
> I'm linking an image of the surface plot I'm generating within a specified
> area using the rectangle tool (unfortunately, I don't know if I can extract
> pixel data for the rectangle tool).
> The next image is an example of the surface plot I'm generating using the
> pixel inspector along with a .csv that contains the pixel data for that
> plot.
>
> 1 - rectangle tool surface plot ROI
> https://www.dropbox.com/s/jim0svvd0h8ycou/1.bmp?dl=0
>
> 2 - Pixel inspector ROI surface plot (much smaller than the first
> https://www.dropbox.com/s/bh061xdl8y3yrzk/2.bmp?dl=0
>
> Pixel data2 - Pixel data for image "2".
>
> https://www.dropbox.com/s/43dpfffifv4bfof/Pixel%20data2.csv?dl=0
>
> I'm converting all my images to 8-bit before generating these.
> As you see with picture 1, there is plenty of peaks and valleys that can be
> used to assess a rugosity value or roughness.
>
> If anyone has done similar work I'd greatly appreciate the help.
>
> Best regards,
>
> Keyvan Balazadeh
>
> --
> ImageJ mailing list: http://imagej.nih.gov/ij/list.html

--
ImageJ mailing list: http://imagej.nih.gov/ij/list.html
Reply | Threaded
Open this post in threaded view
|

Re: Pixel inspector + rugosity

Balazadeh Mohtadi, Carlos
Thanks for the response Michael!

I played around with that method a little but my image resolutions are
pretty low, any sort of filter throws it off way too much.  I have found
another path to explore regarding lacunarity with fractal analysis, it
seems a tad complex but it has the applications I'm looking for in this
particular scenario.

Thanks again for the prompt response and the help!

Best regards,

Keyvan Balazadeh

On Wed, Oct 22, 2014 at 4:54 AM, Michael Schmid <[hidden email]>
wrote:

> Hi Keyvan,
>
> as long as the slope angles are low, it seems to me that rugosity can be
> approximated by
>   1 + 0.5((dv/dx)^2 + (dv/dy)^2)
> where v is the pixel value.
>
> This is essentially 1 + 0.5 times the square of the Sobel operator.
>   http://en.wikipedia.org/wiki/Sobel_operator
> The Sobel operator is implemented in ImageJ as Process>Find Edges.
>
> For higher slopes, you need 1/cos(Sobel_output). In any case, make sure
> that your z units are the same as the distance between the pixels (use a
> 32-bit image, i.e. floating-point precision).
>
> You can then average over the rugosity in any area by Analyze>Measure.
>
> The result will be slightly different than what you get when calculating
> rugosity from the single pixel values because the Sobel operator does
> slight smoothing of the data (to avoid that, you may resize the image to
> twice or 3x the original size with bicubic interpolation).
>
> ---
>
> The reason why the Pixel Inspector is limited in size is showing no more
> data than what fits the typical screen size, but also performance: When
> writing the plugin, I did not expect that any one would ever use it for
> sizes larger than roughly 7x7, so I simply took a jawa.awt.Label for each
> single number. This becomes quite slow for large amounts of numbers.
>
> ---
>
> Another option if you need the pixel values for a larger area: Duplicate
> the selection and save as Text Image. Then you can read the values into
> your own program to calculate rugosity by the method of your choice. Or
> implement that method directly in an ImageJ macro or plugin.
>
>
> Michael
> ________________________________________________________________
> On Oct 21, 2014, at 20:03, Balazadeh Mohtadi, Carlos wrote:
>
> > Hi everyone,
> >
> > I'm currently looking at trying to generate a value for rugosity or
> average
> > roughness from a set number of pixels or a frame within a grayscale
> image.
> >
> > Pixel inspector gives me a wide array of pixel data with intensity values
> > per pixel which can be translated into a surface plot easily.  I would
> like
> > to translate that data into a rugosity measurement of the plot generated,
> > in this case, height would be designated by max peaks recorded in the
> pixel
> > data frame.
> >
> > One issue I have with pixel inspector is that it can only give me a pixel
> > inspection radius of 10 pixels.  I need something slightly bigger and I'm
> > not sure if I could potentially override this setting or not.
> >
> > I'm linking an image of the surface plot I'm generating within a
> specified
> > area using the rectangle tool (unfortunately, I don't know if I can
> extract
> > pixel data for the rectangle tool).
> > The next image is an example of the surface plot I'm generating using the
> > pixel inspector along with a .csv that contains the pixel data for that
> > plot.
> >
> > 1 - rectangle tool surface plot ROI
> > https://www.dropbox.com/s/jim0svvd0h8ycou/1.bmp?dl=0
> >
> > 2 - Pixel inspector ROI surface plot (much smaller than the first
> > https://www.dropbox.com/s/bh061xdl8y3yrzk/2.bmp?dl=0
> >
> > Pixel data2 - Pixel data for image "2".
> >
> > https://www.dropbox.com/s/43dpfffifv4bfof/Pixel%20data2.csv?dl=0
> >
> > I'm converting all my images to 8-bit before generating these.
> > As you see with picture 1, there is plenty of peaks and valleys that can
> be
> > used to assess a rugosity value or roughness.
> >
> > If anyone has done similar work I'd greatly appreciate the help.
> >
> > Best regards,
> >
> > Keyvan Balazadeh
> >
> > --
> > ImageJ mailing list: http://imagej.nih.gov/ij/list.html
>
> --
> ImageJ mailing list: http://imagej.nih.gov/ij/list.html
>

--
ImageJ mailing list: http://imagej.nih.gov/ij/list.html