Login  Register

Re: surface roughness calculation

Posted by Gabriel Landini on Jan 17, 2007; 11:38am
URL: http://imagej.273.s1.nabble.com/surface-roughness-calculation-tp3700556p3700560.html

On Wednesday 17 January 2007 08:14, Karsten Rodenacker wrote:

> I have for this purpose, in my case a bacteria carpet in 3D, applied
> a from me so-called "blanket" transformation:
> A 2D image is generated where each pixel is assigned the maximum
> stack number (Z-coordinate) of the binarized 3D-data set.
>
> Unluckily I did that in IDL since I was not able to do it in ImageJ.
> Perhaps there are ImageJ gurus with a solution in ImageJ. The result
> is something like an umbra, if you are familiar with morphologie
> mathématique, or a distance map where each pixel represents the
> distance from the base in multiples of the Z step size. I have called
> it blanket, since it is similar to let fall a very flexible blanket
> over your 3D-object.

Hi Karsten,

Yes it can be done! The macro below works as far as there are no more than 255
slices.

//--------------8<-----------------
// Blanket Transform
// Implements K. Rodenacker's blanquet tranform
// where each pixel in the result represents the
// maximum slice number in which the pixel is set.
// Assumes a binary stack where image=255 and
// the background is 0.
// G. Landini 17/1/2007

run("Divide...", "stack value=255");
s=nSlices();

for (i=2;i<=s;i++) {
 setSlice(i);
 run("Multiply...", "slice value="+i);
}
run("Z Project...", "start=1 stop=27 projection=[Max Intensity]");
rename("blanket");
run("Fire");
run("Enhance Contrast", "saturated=0");
//--------------8<-----------------

Please post any enhancements to the list.
I hope it helps.
Regards,

Gabriel