List of commandline tools

MedPy is shipped with a number of python scripts (little programs) that are installed on your system together with MedPy. On this page you can find a short overview over these scripts. All are prefixed with medpy_.

Basic image manipulation

↑top

medpy_info.py (notebook)

Prints basic information about an image to the stdout.

medpy_convert.py (notebook)

Converts between two image formats. Alternatively can be used to create an empty image by example.

medpy_create_empty_volume_by_example.py (notebook)

Can be used to create an empty image by example.

medpy_resample.py (notebook)

Re-samples an image using b-spline interpolation.

medpy_set_pixel_spacing.py (notebook)

Manually set the pixel/voxel spacing of an image.

medpy_diff.py (notebook)

Compares the meta-data and intensity values of two images.

medpy_grid.py (notebook)

Creates a binary volume containing a regular grid.

medpy_extract_min_max.py (notebook)

Extracts the min and max intensity values of one or more images.

medpy_swap_dimensions.py (notebook)

Swap two image dimensions.

Image volume manipulation

↑top

medpy_extract_sub_volume.py (notebook)

Extracts a sub volume from an image.

medpy_extract_sub_volume_auto.py (notebook)

Splits a volume into a number of sub volumes along a given dimension.

medpy_extract_sub_volume_by_example.py (notebook)

Takes an image and a second image containing a binary mask, then extracts the sub volume of the first image defined by the bounding box of the foreground object in the binary image.

medpy_fit_into_shape.py (notebook)

Fit an existing image into a new shape by either extending or cutting all dimensions symmetrically.

medpy_intersection.py (notebook)

Extracts the intersecting parts of two volumes regarding offset and voxel-spacing.

medpy_join_xd_to_xplus1d.py (notebook)

Joins a number of xD images by adding a new dimension, resulting in a (x+1)D image.

medpy_split_xd_to_xminus1d.py (notebook)

Splits a xD image into a number of (x-1)D images.

medpy_stack_sub_volumes.py (notebook)

Stacks a number of sub volumes together along a defined dimension.

medpy_zoom_image.py (notebook)

Enlarges an image by adding (interpolated) slices.

medpy_shrink_image.py (notebook)

Reduces an image by simply discarding slices.

medpy_reslice_3d_to_4d.py (notebook)

Reslices a 3D image formed by stacked up 3D volumes into a real 4D images (as e.g. often necessary for DICOM).

medpy_dicom_slices_to_volume.py (notebook)

Takes a number of 2D DICOM slice (a DICOM series) and creates a 3D volume from them.

medpy_dicom_to_4D.py (notebook)

Takes a number of 2D DICOM slice (a DICOM series) and creates a 4D volume from them (split-points are passed as arguments).

Binary image manipulation

↑top

medpy_binary_resampling.py (notebook)

Re-samples a binary image according to a supplied voxel spacing using shape based interpolation where necessary.

medpy_extract_contour.py (notebook)

Converts a binary volume into a surface contour.

medpy_join_masks.py (notebook)

Joins a number of binary images into a single conjunction using sum, avg, max or min.

medpy_merge.py (notebook)

Performs a logical OR on two binary images.

Image filters

↑top

medpy_gradient.py (notebook)

Gradient magnitude image filter. Output is float.

medpy_morphology.py (notebook)

Apply binary morphology (dilation, erosion, opening or closing) to a binary image.

medpy_anisotropic_diffusion.py (notebook)

Apply the edge preserving anisotropic diffusion filter to an image.

medpy_watershed.py (notebook)

Applies a watershed filter, results in a label map / region image.

Graph-cut

↑top

GC based on (and shipped with, ask!) Max-flow/min-cut by Boykov-Kolmogorov algorithm, version 3.01 [1].

medpy_graphcut_voxel.py (notebook)

Executes a voxel based graph cut. Only supports the boundary term.

medpy_graphcut_label.py (notebook)

Executes a label based graph cut. Only supports the boundary term.

medpy_graphcut_label_bgreduced.py (notebook)

Executes a label based graph cut. Only supports the boundary term. Reduces the input image by considering only the region defined by the bounding box around the background markers.

medpy_graphcut_label_wsplit.py (notebook)

Executes a label based graph cut. Only supports the boundary term. Reduces the memory requirements by splitting the image into a number of sub-volumes. Note that this will result in a non-optimal cut.

medpy_graphcut_label_w_regional.py (notebook)

Executes a label based graph cut. With boundary and regional term.

medpy_label_count.py (notebook)

Counts the number of unique intensity values in an image i.e. the amount of labelled regions.

medpy_label_fit_to_mask.py (notebook)

Fits the labelled regions of a label map image to a binary segmentation map.

medpy_label_superimposition.py (notebook)

Takes to label maps and superimpose them to create a new label image with more regions.

Others

↑top