Login  Register

snake ROIs (was: can i draw cylinders!)

Posted by lechristophe on Oct 24, 2006; 10:51am
URL: http://imagej.273.s1.nabble.com/can-i-draw-cylinders-tp3701211p3701215.html

Thank you for your advices, but maybe I wasn't clear enough :
I don't want to paint on my image, I want to define ROIs.

First of all, I know of the elliptical brush tool trick to define
simili-freehand snakes ROIs but it's much more time-consuming than
tracing a freehand line (or even better a segmented line) and have it
expanded to a "snake".

For freehand lines I agree you can define circle at each point of the
line, but what about segmented lines ? What a waste of processing time
to interpolate all the coordinates between the extremities of each
segment and draw a circle centered on each point ! Much better would be
to incrementally define a ROI by adding elements : circle at the first
point followed by rectangle along first segment, followed circle at the
second point, repeat for each angle point  of the segmented line until
you reach the last point.

The problem is that I can't get to calculate the coordinates of the
rectangle along each segment. I tought it should be easy to calculate !
Besides, I don't know how to incrementally add elements to a
macro-defined ROI (i.e. doing in a macro what you do with shift-key when
you do it manually).


Christophe


Gabriel Landini wrote:

> On Tuesday 24 October 2006 09:58, Christophe Leterrier wrote:
>> What would be needed is a way to draw a line (wathever the type) and
>> having some kind of "expand" command to generate a thick snake from that
>> line, that would then be considered as a surface ROI, not a linear one.
>
> You can generate a thick line from a set of coordinates by painting filled
> disks with centre at each coordinate of your freehand line.
> This is almost the same as doing morphological dilation of the line with
> circular kernels.
>
> You can also obtain a similar result by drawing the line on the image and then
> calculating the Euclidean distance transform of the background. The
> transformed image can then be thresholded to obtain the thickened line by
> so-many pixels.
>
> The problem you will face is that the length of the thickened line (if it is
> irregular) becomes shorter with the increased thickening (i.e. with
> increasing thickness the small detail is erased at a rate related to the
> fractal dimension of the line). This is a known effect and typical of
> irregular/fractal objects, but you need to know the fractal dimension
> beforehand to do the correction (!). An iterative solution has been described
> in:
>
> Flook AG. The use of the dilation logic on the quantimet to achieve fractal
> dimension characterisation of textured and structured profiles. Powder
> Technology 1978;21:295-298.
>
> Flook AG. Fractal dimensions: their evaluation and their significance in
> stereological measurements. Acta Stereol, Proc 3rd Eur Symp Stereol 2nd Part
> 1982;:/79-87.
>
> I hope it helps.
>
> Gabriel
>