Getting Started | Documentation | Glish | Learn More | Programming | Contact Us |
Version 1.9 Build 1367 |
|
ImageTools are used to contain (a) algorithms which do something to images, and (b) the parameters which must be remembered. Rather than derive a bloated set of descendents of Image for keeping results of operations on images, we chose to define a class ImageTool which is pointed to by ImageTool* in Image, and which contains parameters as attributes and the algorithm as a service.
ImageTool must be self-identifying via the ID attribute.
As an example, to use an ImageTool such as MEMDeconvolver, first instantiate the tool with the parameters as arguments to the constructor:
MEMDeconvolver mem (1E6, -0.00156, 1.0, 100) ;
It then can be used by invoking the Tool service:
MemImage = mem.Tool (DirtyImage, PSF, DefaultImage) ; cout << "Alpha is " << mem.alpha << ", Beta is " << mem.beta << eol ; if (!mem.converged) { cout << "Not yet converged: doing 100 more iterations" << eol ; mem.niter += 100 ; MemImage = mem.Tool (DirtyImage, PSF, DefaultImage, MEMImage) ; }
Note that we obtained the parameters from mem directly and were able to continue by incrementing niter.