CLIs Documentation

CLIs

A CLI (command Line Interface) is a standalone executable file that can be run either directly or from within the Slicer application. We have developed a series of CLIs that encapsulates pipelines with advanced imaging functionalities. They can help both developers and clinicians to extract and analyze different lung phenotypes, and are mainly based on VTK, ITK and Teem libraries. 

The CLIs are distributed in 6 categories according to their functionality.

  • Particles: High level tools that use algorithms based on particles to segment and clasify airways and vessels.
  • Segmentation: Segmentationof different parts of the ling following our Chest Conventions.
  • Registration: Lung registration tools.
  • Processing: Processing tools that are usually required as a previous step for another higher level tools, but that can be used independiently.
  • Quantification: Quantification of different general image statistics.
  • Utils: Auxiliary tools that are used by different CLIs.

Particles

This category includes high level tools that use algorithms based on particles to segment and clasify airways and vessels.

Classify Fissure Particles: This program is used to classify fissure particles using Fischer’s Linear Discriminant. Left or right lung fissure particles are read in along with lobe boundary shape models for the left or right lung. For each particle, its distance and angle with respect to the lobe boundaries are computed. The weighted sum of these quantities is then computed and compared to a threshold value, and a classification decision is made (either fissure or noise). If particles in the right lung are being considered, a particle is classified according to which entity it is most like (noise, right horizontal or right oblique). [Code]

Compute Airway Wall From Particles: This program is used to extract the airway wall and compute multiple airway wall metrics from a particle’s VTK files using multiple approaches.The output is another particle’s’ VTK file.[Code]

Extract Particles From Chest Region Chest Type: This program is used to extract particles from an input particles data set using either an input label map or the particles themselves.[Code]

Filter Airway Particle Data: This program is used to read airway particles and filter them based on connected components analysis.[Code]

Filter Fissure Particle Data: This program is used to read fissure particles and filter them based on connected components analysis.[Code]

Filter Vessel Particle Data: This program is used to read vessels particles and filter them based on connected components analysis.[Code]

Fit Lobe Surface Models To Particle Data: This program is used to fit left and right lobe boundary shape models to particles data.[Code]

Generate Stenciled Label Map From Particles: This program reads a particles dataset and create a stenciled label map corresponding to them.[Code]

Label Airway Particles By Generation: This program takes an input airway particles dataset and assign airway generation labels to each particle.[Code]

Merge Particle Data Sets: This program accepts as input multiple particle data sets and merges them into one data set for output.[Code]

Perturb Particles: This program can be used to perturb a particles dataset for experimentation purposes.[Code]

Read Particles Write Connected Particles: This program reads either an airway particles dataset or a vessel particles dataset and use Kruskall’s min-spanning tree algorithm to define a topology on the particles points.[Code]

Remove Particles From Particles Data Set: This program accepts two inputs: a particles dataset and another particles dataset indicating which particles should be removed from the first dataset. The output of the program is the set of particles in the first dataset but not in the second.[Code]

Scour Particle Data: This program scours an input particles data set, removing specified field data arrays. [Code]

Transfer Field Data To From Point Data: This program transfers the contents of a VTK polydata’s field data to point data and vice versa. [Code]

Processing

This category includes processing tools that are usually required as a previous step for another higher level tools, but that can be used independiently.

Compute Distance Map: This program computes a distance map from an input binary map. A donwsampling can be applied prior to the distance map computation to improve performance. The resulting distance map will by upsampled by the same amount before writing. [Code]

Compute Feature Strength: This program Computes the feature strength for an image. A feature can be a ridge line (vessel), valley line (airway), a ridge surface (fissure) or a valley surface. [Code]

Compute Fissure Feature Vectors: This program generates a collection of feature vectors at point locations indicated by an input polydata file. [Code]

Crop Lung: This program crops a CT lung volume for a specified region. [Code]

Enhance Fissures In Image: This program enhances fissure image features using logistic regression classifiers.[Code]

Extract Chest Label Map: This program takes in a lung label map and filters it with the specified regions/types. [Code]

Extract Fissure Boundary From Lobe Map: This program labels fissures from a lobe segmentation following the CIP Chest conventions. [Code]

Filter Connected Components: This program filters out connected components that are smaller than a set size. [Code]

Generate Atlas Convex Hull: This program reads atlas lung images and generates a convex hull image corresponding to them. [Code]

Generate Distance Map From Label Map: This program computes a distance map from an input label map (that adheres to the CIP label map conventions) [Code]

Generate Image Sub Volumes: This program accepts as input a CT image and a corresponding label map. It produces a collection of subvolumes of the CT image and (optionally) of the label map image. [Code]

Generate Lobe Surface Models: This program generate fissure shape models based on a training set. [Code]

Generate Median Filtered Image: This program generates a median filter of a CT volume. [Code]

Generate NLM Filtered Image: This program is a fast version of the popular Non-Local Means filter for image denoising. [Code]

Generate Statistics For Airway Generation Labeling: This program computes statistics needed as inputs to the LabelAirwayParticlesByGeneration program. [Code]

Label Map From Region And Type Points: This program reads a region and types points file and creates a label map of the labels at the specified coordinates using the CIP labeling conventions. [Code]

Perform Morphological: This program performs morphological operations such as dilation, erosion, opening and closing. [Code]

Quality Control: This program produces quality control projection (2D) images for multiple forms of input label map images. [Code]

Remap Label Map: This program maps label map values in an input image to designated values in the output image. [Code]

Remove Chest Type From Label Map Using Particles: This program m**************************** [Code]

Resample CT: This program resamples a CT using an affine transform. [Code]

Resample Label Map: This program resamples a label map using an affine transform. [Code]

Rescale Label Map: This program rescales (either upsample or downsample) a label map by a specified amount. [Code]

Quantification

This category includes tools for quantification of different general image statistics.

Compute Cross Sectional Area: This program can be used to compute cross sectional areas of structures in the input label map image. The cross-sectional area is computed with respect to the axial plane. The algorithm proceeds by tallying all voxels of various types in the label map. The tally for each entity is then multiplied by the in-plane (axial) spacing value to give the cross sectional areas. Quantities are printed to std out. [Code]

Compute Intensity Statistics: This program is used to compute intensity statistics for chest-region chest-type pairs. For every pair present in the input label map, the mean, min, max, median, and standard deviation are computed. The results are printed to the command line. [Code]

Evaluate Lung Lobe Segmentation Results: This program calculates a similarity measure between 2 CT images in a region specified by a label map. It takes as input the 2 CT images and their corresponding label maps, and a transformation file, and appends the values of the similarity metric to an existing xml file if one is provided.  [Code]

Generate Region Histograms And Parenchyma Phenotypes: This program computes regional histograms and typical parenchyma phenotypes for emphysema assessment and other parenchymal abnormalities. [Code]

Get Transformation Kappa: This program *************** [Code]

Get Transformation Kappa 2D: This program calculates a similarity measure between 2 CT images in a region specified by a label map. It takes as input the 2 CT images and their corresponding   label maps, and a transformation file, and appends the values of the similarity metric to an   existing xml file if one is provided. [Code]

Get Transformation Similarity Metric: This program calculates a similarity measure between 2 CT images in a region specified by a label map. [Code]

Label Particles By Chest Region Chest Type: This program labels particles datasets by chest region and chest type. [Code]

Read Write Image Data:  This simple program reads and writes images, either label maps or CT images. It is useful for renaming (obviating the need to need to manually modify headers. [Code]

Registration

This category includes lung registration tools.

Register CT:  This program Registers an input label map to a target label map. It takes as input the 2 label maps and generates either a transform file or outputs the values of the transformation matrix and header information to a file. [Code]

Register Label Maps:  This program Registers an input label map to a target label map. It takes as input the 2 label maps and generates either a transform file or outputs the values of the transformation matrix and header information to a file. [Code]

Register Lung Atlas:  This program registers a lung atlas convex hull mesh to the bones (ribs) in CT image. [Code]

Segmentation

This category includes tools for segmentation of different parts of the ling following our Chest Conventions.

Generate Binary Thinning 3D:  This program generates a skeleton from a binary mask. [Code]

Generate Lesion Segmentation:  This program segments a nodular lesion for quantiative assesment. [Code]

Generate Otsu Lung Cast:  This program produces an Otsu lung cast. [Code]

Generate Partial Lung Label Map:  This program segments a CT image into lung regions with an approximate aiway segmentation. [Code]

Generate Simple Lung Mask:  This program generates Simple Lung Mask [Code]

Segment Lung Lobes:  This program reads a label map image (where the labels correspond to the conventions laid out cipChestConventions.h) as well as particles defining the lobe boundaries and produces a label map with the lung lobes identified. [Code]

Split Left Lung Right Lung:  This program reads a label map and splits the left and right lungs so that they are uniquely labeled. If the input is already split, the output will be identical to the input. [Code]

Utils

This category includes auxiliary tools that are used by different CLIs.

Convert Chest Region Chest Type To Label Map Value:  This program takes chest-region and chest-type string specifications (conforming to CIP standards laid out in cipChestConventions.h) and writes to the command line the corresponding unsigned short encoding the chest region and chest type value. [Code]

Convert Dicom: This simple program takes as an argument a directory containing DICOM images, and produces a single file as output. Single files are preferred for our operations as they compactly contain the CT data. [Code]

Convert Label Map Value To Chest Region Chest Type: This program takes an unsigned short label map value that conforms to the labeling conventions laid out in cipConventhions.h and writes to the command line the corresponding chest region and chest type. [Code]

Execute System Command: This program executes any system command. [Code]

Find Patch Match: This program performs an exhaustive search through an image and identifies the coordinates that correspond to an exact match with the input image. [Code]

Generate Model: This program generates a 3D model given an input label map mask using the discrete marching cubes algorithm. [Code]

Generate Overlay Images: This program produces RGB overlay images corresponding to the input CT image and its label map. [Code]

Get Structures In Label Map: This program reads in a label map image and writes to the command line a list of the chest-region chest-type pairs that are present. [Code]

Mask Out Label Maps Structures: This program removes the specified chest structures from the input label map. [Code]

Merge Chest Label Maps: This program merges an overlay label map into a base label map. [Code]

Read Dicom Write Tags: This program reads a CT (DICOM) image, extracts tags of interest and their values and prints them to a file. [Code]

Read NRRDs Write VTK: This program reads a number of NRRD files and collects the data in those files into a single VTK polydata file for writing. The input data files typically contain particles information. [Code]

Read Vida Write CIP: This program converts VIDA labelmap information to CIP labelmap following the CIP chest conventions. [Code]

Read VTK Write NRRDs: This program reads a VTK polydata file containing particles data and writes a corresponding collection of NRRD files containing array data. [Code]

Read Write Region And Type Points: This program converts region and type points between csv and vtk file formats. [Code]

Region Type Locations To ROI Volume: This program reads a chest-region chest-type locations file (and a reference CT image) and produces an ROI volume, either a segmentation or a label map. [Code]

Transfer Region And Type Indices To From Points: This program converts region and type indices files to region and type points files and vice versa. [Code]