util

util.dir_make(dirPath)[source]

Convenience function to create a directory at the given path

util.downsample_and_merge_tiffs(path_to_tiffs, voxel_sizes, desired_spacing, load_at_once=50)[source]
util.get_downsample_factor(voxel_sizes, desired_spacing)[source]
util.imgCollapseDimension(inImg, dimension=3)[source]
util.imgCopy(img)[source]

Returns a copy of the input image

util.imgRead(path)[source]

Alias for sitk.ReadImage

util.imgWrite(img, path)[source]

Write sitk image to path.

util.img_percentile(img, percentile)[source]
util.is_iterable(variable)[source]

Returns True if variable is a list, tuple or any other iterable object

util.is_number(variable)[source]

Returns True if varible is is a number

util.merge_tiffs(path_to_tiffs, filename)[source]
util.run_shell_command(command, checkReturnValue=True, verbose=False)[source]

Runs a shell command and returns the output.

util.txt_read(path)[source]

Conveinence function to read text from file at specified path

util.txt_read_list(path)[source]
util.txt_write(text, path, mode='w')[source]

Conveinence function to write text to a file at specified path

util.txt_write_list(parameterList, path)[source]
util.vtkReformat(inPath, outPath, dimension=3)[source]

Reformats vtk file so that it can be read by CIS software.