imagestack

This module provides the core functionality for handling a stack of images at once.

Image stacks are objects that hold multiple images and act in many cases like python lists. They can be indexed and images in the stack can be changed. All images in one image stack must have the same dtype. If an image with another dtype is added or an image in the stack is replaced with an other image with different dtype, the incoming image is automatically converted to match the dtype of the image stack.

It is strongly recommended that np.float32 is used when performing a crack detection. The crack detecion is tested and developed for images of dtypes float, np.float64, np.float32 or np.float16.

Currently, there are two image stack objects that can be used. All image stack have the same structure. Accessing images, replacing images in the stack and adding new images works the same for all image stacks.

  • ImageStack: A simple wrapper around a list. This container holds all images in the system memory (RAM).

  • ImageStackSQL: Manages RAM usage of the image stack. Images are held in memory as long as the total available memory does not exceed a certain percentage of available memory or the image stack exceeds a set number of MB. If any more images are added, all current loaded images get stored in a database and only references to the images are kept in memory. The images are only loaded when directly accessed. This allows working and changing images of a stack even if the stack is too big to fit into the memory. The loaded images will be kept in memory until the stack exceeds the RAM limits again. This reduces the number loading and storing operations and therefore saves time since this can be quite time consuming for a lot of images.

The image stack is quite easy to use.

Classes

ImageStack([dtype])

This object holds multiple images.

ImageStackSQL([database, stack_name, dtype, ...])

This class works the same as ImageStack.

NumpyType()

Numpy Type for sql databases when using sqlalchemy.