[IPOL discuss] computing and displaying contours

Juan Cardelino juan.cardelino at gmail.com
Tue Mar 15 17:38:49 CET 2011


Dear all,
          I remember that we discussed the topic of visualization in
the september meeting. I'm not sure if you have advanced in that
direction in January, if that's the case, please update me.
So far I contributed in demos for me and for people that were also in
IPOL. I'm facing the first case of helping a non-member of the crew,
and I have some doubts about were to draw the line of what's
responsibility of the author and what's the task of the editor.

The case is the following: the author is Mauricio Delbracio and his
algorithm that estimates a PSF, so the output are regular samples of a
2D function. When thinking about visualization, the wanted to display
the level lines of that function. This involves a couple of tasks:

1) actually computing the contours:
a) I think this should be done by the author
b) however, it won't hurt to have a handful of simple functions at
hand, to provide the authors. Maybe we can just reuse the code done by
the first autor interested in doing the task.
c) I think about many cases in which we could be interested in
computing/showing level lines, so maybe the definition of an interface
(how to specify the points of the contour) could be useful.
d) I google'd for a bit to find any clean C implementation of the
marching squares algorithm but without luck. do you know/have any
piece of C code to compute contours? I know implementations in ITK and
VTK, but that's out of the question. I find sad that there is no
reference implementation of such well-know and established algorithms.

2) drawing the contours on the web page:
a) the first ugly way to do this is to just ask the author for an
image with white pixels over a black background. I think this is
efortless but poses many problems (low resolution, no scaling, etc).
b) Ask the user to draw in a vectorial format like eps or svg. As far
as I know, svg support varies too much across browsers. (correct me
please if I'm wrong)
c) ask the author for a description of the curve as in 1c) and render
it using javascript of whatever we like. Here we need a precise
definition of the curve, as I guess we don't want to recode that part
for each new demo.
d) I think in general this should be our concern, not the authors.

Personally, I would go for the svg, but sadly technology is not on our side yet.
What do you think? Is there any hack to make an svg look the same in
different browsers?

Thanks in advance.
Best regards,
                  Juan



More information about the discuss mailing list