[Insight-developers] New class: ProgressReporter

Brad King brad . king at kitware . com
Fri, 30 Aug 2002 15:08:16 -0400 (EDT)


Will,

> I haven't looked at this too carefully but you might want to update as a
> percentage of completion rather than the number of updates. That way
> you'll get 20 updates every execution (using a 5% completion increment)
> no matter the size of the data. Using the number versus a percentage
> means that on small data sets you'll get no updates, and on large
> datasets 100's or even thousands of updates. Probably the best way is to
> use timer events, but this is asking for trouble. What do you think?

The third argument to the constructor is the TOTAL number of pixels, and
the (optional) fourth argument is the total number of updates, chosen
independently of the number of pixels (default is 100, for 1 update per
percentage point).  The number of pixels per update is calculated by the
constructor.

If the number of updates is larger than the number of pixels,
ProgressReporter automatically reduces the number of updates to the number
of pixels, and will have one update per pixel.  This way, small data sets
and large data sets will both have a reasonable number of updates.

-Brad