-
Notifications
You must be signed in to change notification settings - Fork 0
Developing
#summary Documentation on how to use ImageAnalysisTools as a library from your code.
The core of the library focuses around four types of objects: Images, Filters, Metrics, and Methods. Images represent a collection of pixel values and any associated metadata. Filters are the basic unit of image processing, representing a single operation on an image. Metrics take processed images and quantify them, producing numerical output. Methods take Images as input, and contain a series of filters to process the input and a metric to quantify the result.
Complete javadocs for the library are available here
New analysis methods can also be scripted using jruby; see the scripting with jruby wiki page for documentation.
The Image interface (javadoc) and its accompanying WritableImage interface support five-dimensional X, Y, Z, color, time images. The interface was designed to make it simple to iterate over all pixels in an image and to process particular regions of an image. To that end, Image extends Collection<ImageCoordinate> to make foreach-style iteration over all pixels possible. This eliminates the need for multiply-nested loops over all dimensions (and allows the same code to process images that may have different numbers of dimensions.
For example:
Image im = ...;
for(ImageCoordinate ic : im) {
do_something();
}
would, regardless of the dimensionality of the image, process every coordinate in the image.
In order to iterate only over a subset of dimensions or to iterate only over a region of the image, use the setBoxOfInterest method. Calling this method will cause foreach-style iteration to occur only over this region until a new box is set or until clearBoxOfInterest is called.
To obtain Image objects, use the methods of ImageFactory to create them.
Filters are the classes that do the image processing. The apply(Image) method, which is called when the filter is being run, processes the Image supplied to it in place so that several filters can easily be run in series. Filters can also take a reference image, which is another image that is not modified (by contract), and can be used for additional information during the processing. For instance, the image to which the filter is being applied might be a mask that is being constructed, while the reference image might contain an actual microscope image whose data will be used unchanged during the filtering operation.
Metrics perform quantification on an Image. They take a mask that labels the regions of interest to be quantified and a list of images to be quantified using the same mask. They output some scalar measure for each region of interest in each image in the form of a Quantification object.
Methods provide an easy way to link a series of filters and a metric together.
Create your filters, initialize them with parameters, and a reference image as needed, and add them to a java.util.List<Filter>.
Then call iterateOnFiltersAndStoreResult(List<Filter>, Image, Metric) with that list of filters, an image to process (this will have the filters applied directly to it, so make a copy if needed), and a metric to quantify the images, and each filter will be applied in series, and the output image and quantification stored such that the code that runs the methods will automatically format the output and write it to disk.