PREDICT.helpers package

Submodules

PREDICT.helpers.contour_functions module

PREDICT.helpers.contour_functions.cmp(a, b)

Built in in python 2, but defined for python 3

PREDICT.helpers.contour_functions.convex_hull(contour)

Returns points on convex hull for contour, uses Graham Scan

PREDICT.helpers.contour_functions.convex_hull_points(points)

Returns points on convex hull of an array of points in CCW order. Uses Graham Scan

PREDICT.helpers.contour_functions.get_contour_boundary(contour)

Labels pixels on edge of boundary

PREDICT.helpers.contour_functions.get_contour_boundary_points(contour)

Get boundary coordinates from contour

PREDICT.helpers.contour_functions.get_not_voi_voxels(contour, image)

Sets all voxels within VOI to 0

PREDICT.helpers.contour_functions.get_smooth_contour(mask, N_min, N_max)

Find local convex hull for given contour

PREDICT.helpers.contour_functions.get_voi_voxels(contour, image)

Gives back VOI (non-zero slices), and indices of slices

PREDICT.helpers.contour_functions.local_convex_hull(contour, N_min, N_max)

Find local convex hull for given contour

PREDICT.helpers.contour_functions.local_convex_hull_points(points, N_min, N_max)

Find local convex points, can be used for smoothing boundary

PREDICT.helpers.contour_functions.sort_points(points)

Order supplied points in clockwise order

PREDICT.helpers.contour_functions.turn(p, q, r)

PREDICT.helpers.contour_functions_3d module

PREDICT.helpers.contour_functions_3d.cmp(a, b)

Built in in python 2, but defined for python 3

PREDICT.helpers.contour_functions_3d.convex_hull(contour)

Returns points on convex hull for contour, uses Graham Scan

PREDICT.helpers.contour_functions_3d.convex_hull_points(points)

Returns points on convex hull of an array of points in CCW order. Uses Graham Scan

PREDICT.helpers.contour_functions_3d.get_contour_boundary(contour)

Labels pixels on edge of boundary

PREDICT.helpers.contour_functions_3d.get_contour_boundary_points(contour)

Get boundary coordinates from contour

PREDICT.helpers.contour_functions_3d.get_not_voi_voxels(contour, image)

Sets all voxels within VOI to 0

PREDICT.helpers.contour_functions_3d.get_smooth_contour(mask, N_min, N_max)

Find local convex hull for given contour

PREDICT.helpers.contour_functions_3d.get_voi_voxels(contour, image)

Gives back VOI (non-zero slices), and indices of slices

PREDICT.helpers.contour_functions_3d.local_convex_hull(contour, N_min, N_max)

Find local convex hull for given contour

PREDICT.helpers.contour_functions_3d.local_convex_hull_points(points, N_min, N_max)

Find local convex points, can be used for smoothing boundary

PREDICT.helpers.contour_functions_3d.sort_points(points)

Order supplied points in clockwise order

PREDICT.helpers.contour_functions_3d.turn(p, q, r)

PREDICT.helpers.image_helper module

PREDICT.helpers.image_helper.get_masked_slices_image(image_array, mask_array)

For a 3-D array, get only those axial slices which contains non-zero numbers in the mask.

image_array: numpy array, mandatory
Array containing the array to be masked.
mask_array: numpy array, mandatory
Array containing the mask.
image_array: numpy array, mandatory
Array containing the masked image array.
mask_array: numpy array, mandatory
Array containing the masked mask array.
PREDICT.helpers.image_helper.get_masked_slices_mask(mask_image)

Remove the axial slices in a 3-D mask array for which there are non-zero elements.

mask_image: numpy array, mandatory
Boolean 3D array.
mask_sliced: numpy array, mandatory
Array containing only those slices of which there are non-zero elements in the mask.
PREDICT.helpers.image_helper.get_masked_voxels(image_array, mask_array)

Returns only those voxels of an array for which the mask array value is True.

image_array: numpy array, mandatory
Array containing the array to be masked.
mask_array: numpy array, mandatory
Array containing the mask.
masked_voxels: numpy array
1D Array containing only those voxels for which the mask was True.

PREDICT.helpers.orientation_functions module

PREDICT.helpers.orientation_functions.data_regularize(data, type='spheric', divs=10)
PREDICT.helpers.orientation_functions.ellipsoid_fit(X)
PREDICT.helpers.orientation_functions.ellipsoid_plot(center, radii, rotation, ax, plotAxes=False, cageColor='b', cageAlpha=0.2)

Plot an ellipsoid

PREDICT.helpers.sitk_helper module

PREDICT.helpers.sitk_helper.GetArrayFromImage(image)

GetArrayFromImage converts an ITK image to a numpy array, while ensuring the orientation is kept the same.

Args:
image (ITK image): 2D or 3D ITK image
Returns:
numpy array
PREDICT.helpers.sitk_helper.GetImageFromArray(array)

GetImageFromArray converts a numpy array to an ITK image, while ensuring the orientation is kept the same.

Args:
array (numpy array): 2D or 3D array of image
Returns:
ITK image

Module contents