ximage.util¶
Utility module for ximage
Functions:
load_raw(top, index_start) |
Load a stack of tiff images. |
shutter_off(image[, alpha]) |
Finds the first image with the shutter closed. |
particle_bed_location(image) |
Finds the image row marking the location of the particle bed. |
laser_on(rdata, particle_bed_ref[, alpha]) |
Function description. |
scale_to_one(ndata) |
Scale a stack of images between [0,1]. |
sobel_stack(ndata) |
Applies sobel filter to a stack of images. |
label(ndata[, blur_radius, alpha]) |
Counts the number of particles in a stack of images. |
-
ximage.util.load_raw(top, index_start)[source]¶ Load a stack of tiff images.
Parameters: - top (str) – Top data directory.
- index_start (int) – Image index start.
Returns: ndarray – 3D stack of images.
-
ximage.util.shutter_off(image, alpha=0.7)[source]¶ Finds the first image with the shutter closed.
Parameters: - image (ndarray) – 3D stack of images.
- alpha (float) – Threshold level.
Returns: int – Index of the first image with the shutter closed.
-
ximage.util.particle_bed_location(image)[source]¶ Finds the image row marking the location of the particle bed.
Parameters: image (ndarray) – 2D image. Returns: int – Image row marking the location of the particle bed.
-
ximage.util.laser_on(rdata, particle_bed_ref, alpha=1.0)[source]¶ Function description.
Parameters: - rdata (ndarray) – 3D stack of images.
- particle_bed_ref (int) – Image row marking the location of the particle bed.
- alpha (float) – Threshold level.
Returns: int – Index of the first image with the laser on.
-
ximage.util.scale_to_one(ndata)[source]¶ Scale a stack of images between [0,1].
Parameters: ndata (ndarray) – 3D stack of images. Returns: ndarray – 3D stack of images.
-
ximage.util.sobel_stack(ndata)[source]¶ Applies sobel filter to a stack of images.
Parameters: ndata (ndarray) – 3D stack of images. Returns: ndarray – 3D stack of images.
-
ximage.util.label(ndata, blur_radius=1.0, alpha=1)[source]¶ Counts the number of particles in a stack of images.
Parameters: - ndata (ndarray) – 3D stack of images.
- blur_radius (float) – Gaussian blur radius.
- alpha (float) – Threshold level.
Returns: ndata, nr_objects – 3D stack of images, number of particles per image.