Hi everyone,<br><br>This is not a VTK question per se, but I am hoping some algorithm experts can help me here.<br><br>I am a curve defined by a set of floating point numbers. So each x, y pair descrives a curve and the curve is created by simple joining these point pairs.
<br><br>Now, my probem is that the curve should snap to each pixel that it touches.<br><br>So, if we consider the x part of the coordinates... then the points lying on the &quot;left side&quot; of the curve should round off to the lower value...
<br><br>So, if you have x value like 63.5 on the lft side, it should becomne 63.0.<br><br>and if you have points on the &quot;right side&quot; of the curve, it should round off to the upper value...<br><br>So, if you have value like 
130.5 on the right side, it should become 131.0<br><br>Similar logic should follow for the y values.<br><br>My initial idea was to increment/decrement the values by 1.0 and see if that pixel lies in my region. If the pixel to the right lies in thr region, then I take the floow of the value, else I take the ceiling.
<br><br>This worked for most of ther curves but every now and then I come across curves that act not int he way I want.<br><br>I was wondering if there is an algorithm for growing a curve so that it snaps to the touched pixel...
<br><br>Thanks for any help you might give me here. I would really appreciate it.<br><br><br>Cheers,<br><br>Anja