collection of routines used by other plugins of drosotrack:
One of the major classes is virtualSequence, which is a hack of the regular sequence to load 1 image at a time. The new virtual sequence proposed by Stephane makes this mechanism obsolete.
SequenceVirtual is composed of a series of classes used by fmp plugins:
1) Sequence-related classes
This plugin written with EzPlug allows to open a stack of files (jpg) or and avi with sequenceVirtual. The viewer can browse through the stack. It can also load ROIs (line and polygons) from proprietary files (called capillarytrack.xml and drosotrack.xml).
SequenceVirtual is at the core of functions which allow one to open a stack of jpg files or an avi files as a virtual file. As for ImageJ virtual stacks, all data are not stored in memory at once, but just a buffer of 100 images which is continuously updated using a separate thread. This class extend Sequence, adding a few functions to manipulate images from this stack, to build a list of file names of images within a directory, and to store and read data used by different plugins such as CapillaryTrack. It also saves xml files with parameters and data as well as ROIs, generated by these different plugins. Also taylored to work with these specific plugins, it could be stripped of these functions to make it more generic as it piggy backs Sequence functions. The threading mechanism is adapted/borrowed from Fabrice de Chaumont MiceTrack plugin.
SequencePlus is another extension of Sequence, that stores and handle ROIs and data arrays used by CapillaryTrack, to manipulate measures made on kymographs.
2) Image-operations classes
A series of 4 classes is used to manipulate images and perform simple operations on them. These classes are used to let the user define interactively an image filter to create a mask, and then to run a threshold over the mask to count the number of pixels thus filtered. These classes are mostly used within the plugins AreaTrack, DrosoTrack and CapillaryTrack. The idea behind this is to make a pipeline with 2 steps, with a first pass where an image is transformed or filtered, and a second pass where a threshold is applied to the transformed image.
This class is used as a stub to pass parameters to ImageTransformTools or ImageThresholdTools, parameters which are stored in the class ImageOperationsStruct. In order to speed up the operations, the calls to the different functions can be cached (or not) by storing the results of the different operations into images saved in an associated SequenceVirtual object.
This class defines a series of parameters which are used to call the image transform and thresholding operations, as well as a couple of elemental operations which facilitate their use.
This class groups a series of functions that either take an image from a SequenceVirtual object, or an IcyBufferedImage and returns a transformed image. The operations currently available are defined in an enum list (TransformOp) as:
NONE: no operation
R_RGB: (RGB) -> R ; G_RGB: (RGB)-> G; B_RGB: (RGB)->B; RGB: (RGB) -> (R+G+B)/3
H_HSB: (RGB)->H; S_HSB: (RGB)-> S; B_HSB: (RGB)->S
R2MINUS_GB: (RGB) -> R*2 – (G+B); G2MINUS_RB: (RGB) -> G*2 -(R+B); B2MINUS_RG: B*2-(R+G)
GBMINUS_2R: (RGB) -> (B+G)-2R; RBMINUS_2G: (RGB) ->(R+B)-2G; RGMINUS_2B: (RGB) -> (R+G)-2B
NORM_BRMINUSG: (RGB) ->((R/255 + B/255)-2G/255)*255
RTOGB: (RGB) ->(RRR)
REF_T0: image(t) – image(t0); REF: image(t) – image x; REF_PREVIOUS: image(t) – image(t-1)
XDIFFN: pixel(x, y) = pixel (x (-3,-2-1)+x(3,2,1), y)
YDIFFN: pixel(x,y) = pixel(x, y (-3,-2-1)+y(3,2,1))
XYDIFFN: pixel(x, y) = pixel (x (-3,-2-1)+x(3,2,1), y (-3,-2-1)+y(3,2,1))
RGB_TO_HSV: (RGB)-> (HSV); RGB_TO_H1H2H3: (RGB)->(H1H2H3) using Nicolas Hervé algorithms
This class regroups 2 ways to threshold an image: by comparing each pixel to a single threshold, or by comparing each pixel to a series of reference colors + a distance, using algorithms designed by Nicolas Herve. These functions return a binary array as an IcyBufferedImage. This buffer can be transformed into a boolean array.
3) Color classes
This set of classes are cut and paste (with minor modifications) of Nicolas Herve toolboxes classes used in his plugin. These classes are named:
In addition, the class ComboBoxColorRenderer is used to store and display colors picked by a user on an image, within a combobox.
4) Overlay classes
Three overlay classes are used to display a mask over an image
OverlayColorMask: this overlay masks all pixels which have colors close to a list of colors
OverlayThreshold: this overlay shows all pixels which are lower than a threshold applied on a transformed image
OverlayTrapMouse: this overlay is used to trap mouse events (in order to pick the color of a pixel)
5) Additional functions
Line2DPlus: computes x when given y from a line defined by 2 points & get the intersection between 2 lines defined each by 2 points.
StringSorter: sort strings alphabetically, or numerically – these routines are used to sort file names collected from a directory
Tools: get a list of files given a filter, save file as dialog, comparator of lines, comparator of ROI names, ranking of doubles, strings), order vertices of a polygon, choose a directory dialog.