lcat package

Submodules

lcat.util module

Utility functions for the lcat toolkit.

lcat.util.clear_border(labels, axis=None, in_place=False)[source]

Clears any labeled components touching either border along the given axes (in axis).

lcat.util.compress_nodule_mask(mask)[source]
lcat.util.crop_to_box(arr, box)[source]

Given an array arr and boundaries boundaries (such as is returned by get_bounding_box), return arr cropped to boundaries.

lcat.util.get_bounding_box(arr)[source]

Given an array of values, returns an list of tuples, where each tuple represents the extent of the non-zero values in arr along a particular axis.

Inspired by http://stackoverflow.com/questions/31400769/bounding-box-of-numpy-array

lcat.util.get_full_nodule_mask(nodule, scan_shape)[source]
lcat.util.image_from_mask(mask)[source]

Convert a binary mask into a PIL image.

lcat.util.plot_slices(voxels, rows=6, columns=6, cmap=None)[source]

Given a 3D array of voxels, plots slices.

lcat.util.save_slices(voxels, destination_folder, prefix='slice')[source]

Given a voxel array, save each slice as a tiff file with the name prefix###.tiff in the given destination_folder.

Module contents

Main package of the Lung Cancer Action Team toolkit.