Cancer Imaging Phenomics Toolkit (CaPTk)  1.9.0
Utilities (CLI only)

This is a command line executable containing the following functionalities (with corresponding examples):

  • Resizing
    ${CaPTk_InstallDir}/bin/Utilities.exe -i C:/test.nii.gz -o C:/test_75.nii.gz -r 75 -ri linear
  • Resampling
    ${CaPTk_InstallDir}/bin/Utilities.exe -i C:/test/input.nii.gz -o C:/output.nii.gz -rr 1.0 -ri LINEAR
    ${CaPTk_InstallDir}/bin/Utilities.exe -i C:/test/input.nii.gz -o C:/output.nii.gz -rf C:/reference.nii.gz -ri LINEAR
    ${CaPTk_InstallDir}/bin/Utilities.exe -i C:/test/input.nii.gz -o C:/output.nii.gz -rr 1.0,2.0,3.0 -ri LINEAR
    ${CaPTk_InstallDir}/bin/Utilities.exe -i C:/test/inputMask.nii.gz -o C:/outputMask.nii.gz -rr 1.0,2.0,3.0 -ri LINEAR -rm 1
  • Image information
    ${CaPTk_InstallDir}/bin/Utilities.exe -i C:/test.nii.gz -inf
    ${CaPTk_InstallDir}/bin/Utilities.exe -i C:/test/1.dcm -inf
  • Unique values in image
    ${CaPTk_InstallDir}/bin/Utilities.exe -i C:/test/1.dcm -un
  • Change values in image: The following command will change all voxels of value 1 & 2 to 2 & 4, respectively:
    ${CaPTk_InstallDir}/bin/Utilities.exe -i C:/test/1.dcm -cv 1x2,2x4
  • Get smallest bounding box in mask (optional isotropic bounding box)
    ${CaPTk_InstallDir}/bin/Utilities.exe -i C:/test/1.dcm -b C:/testMask.nii.gz -o C:/output.nii.gz
  • Test 2 images
    ${CaPTk_InstallDir}/bin/Utilities.exe -i C:/test/1.dcm -tb C:/test.nii.gz
  • Create mask from threshold
    ${CaPTk_InstallDir}/bin/Utilities.exe -i C:/test/1.dcm -o C:/test.nii.gz -cm 50,1000
  • DICOM to NIfTI conversion
    ${CaPTk_InstallDir}/bin/Utilities.exe -i C:/test/1.dcm -o C:/test.nii.gz -d2n
  • NIfTI to DICOM conversion: Note that both the NIfTI and DICOM reference images need to be defined in the same space for this to work correctly
    ${CaPTk_InstallDir}/bin/Utilities.exe -i C:/test/imageToConvert.nii.gz -o C:/outputDicom/ -n2d C:/referenceDICOM/
  • NIfTI to DICOM-Seg conversion (using DCMQI)
    ${CaPTk_InstallDir}/bin/Utilities.exe -i C:/test/maskToConvert.nii.gz -o C:/outputDicom/ -ds C:/referenceDICOM/ -dsJ C:/dicomSeg.json
    Please see DCMQI's FAQ and use case for JSON-related information.
  • Re-orient image
    ${CaPTk_InstallDir}/bin/Utilities.exe -i C:/test/1.nii.gz -o C:/output.nii.gz -or RAI
  • Cast image to another pixel type
    ${CaPTk_InstallDir}/bin/Utilities.exe -i C:/test.nii.gz -o C:/test_int.nii.gz -c int
  • Thresholding:
    • Below
      ${CaPTk_InstallDir}/bin/Utilities.exe -i C:/test/1.nii.gz -o C:/output.nii.gz -thB 100
    • Above
      ${CaPTk_InstallDir}/bin/Utilities.exe -i C:/test/1.nii.gz -o C:/output.nii.gz -thA 50
    • Above & Below
      ${CaPTk_InstallDir}/bin/Utilities.exe -i C:/test/1.nii.gz -o C:/output.nii.gz -tAB 50,100
    • Otsu
      ${CaPTk_InstallDir}/bin/Utilities.exe -i C:/test/1.nii.gz -o C:/output.nii.gz -thO 1
    • Binary
      ${CaPTk_InstallDir}/bin/Utilities.exe -i C:/test/1.nii.gz -o C:/output.nii.gz -tAB 50,100 -tBn
  • Convert file formats
    ${CaPTk_InstallDir}/bin/Utilities.exe -i C:/test.nii.gz -o C:/test.mha -cov
  • Extract Image Series from Joined stack and vice-versa (4D <-> 3D)
    ${CaPTk_InstallDir}/bin/Utilities.exe -i C:/test/1.nii.gz -o C:/output -j2e 1 # output images are written in the form C:/output_${slice}.nii.gz
    ${CaPTk_InstallDir}/bin/Utilities.exe -i C:/test/1.nii.gz -o C:/output/ -j2e 1 # output images are written in the form C:/output/extractedImage_${slice}.nii.gz
    ${CaPTk_InstallDir}/bin/Utilities.exe -i C:/test/ -o C:/output.nii.gz -e2j 1.5
  • Transform coordinates from world to image and vice-versa
    ${CaPTk_InstallDir}/bin/Utilities.exe -i C:/test.nii.gz -i2w 10,10,30
    ${CaPTk_InstallDir}/bin/Utilities.exe -i C:/test.nii.gz -w2i 10.5,10.1,30.6
  • Label similarity Metrics between 2 label images: pure mathematical formulations are given as output
    ${CaPTk_InstallDir}/bin/Utilities.exe -i C:/test/outputMask.nii.gz -l2s C:/referenceMask.nii.gz
  • BraTS similarity Metrics between 2 label images: special considerations for metrics are done in this mode because output needs to be BraTS-compliant.
    ${CaPTk_InstallDir}/bin/Utilities.exe -i C:/referenceMask.nii.gz -lsb C:/test/predictedMask.nii.gz
  • Collect information from all images in a directory and put it in CSV
    ${CaPTk_InstallDir}/bin/Utilities.exe -i C:/test/inputDirectory -o C:/test/inputDirectoryProperties.csv \
    -co 1 \ # enable recursion
    -cF volume \ # only process files that contain this string pattern 
    -cFE .nii.gz \ # only process files with this extension 
    -cP 0,1 \ # which properties to read; see usage for all options

For a full list of available applications and examples, please use the command:

${CaPTk_InstallDir}/bin/Utilities -h