MASK_THRESHOLDING Module

The MASK_THRESHOLDING module removes voxels from a mask if their intensity falls outside a specified range, allowing for selective masking based on intensity.

Options

The MASK_THRESHOLDING module supports the following options:

  • verbose: Enable verbose output for more detailed process information (default: False).

  • timer: Enable a timer to record execution time (default: False).

  • inputFolder: Path to the folder containing the input images.

  • outputFolder: Path to save the thresholded mask files.

  • outputFolderSuffix: Adds a suffix to the inputFolder name to create the output folder.

  • log: Path to a log file for saving detailed output information.

  • new_log_file: Create a new log file, overwriting any existing file with the same name.

  • skip: Path to a file listing subfolders in inputFolder to exclude from processing.

  • multiprocessing: Specify the number of CPU cores to use for parallel processing.

  • image_filename: Name of the image file to read for thresholding.

  • mask_filename: Name of the mask file to apply the threshold.

  • suffix_name: Suffix to append to the filename of the new thresholded mask.

  • min_threshold: Minimum intensity threshold; voxels with lower intensity will be removed from the mask.

  • max_threshold: Maximum intensity threshold; voxels with higher intensity will be removed from the mask.

Example Usage

The following example demonstrates how to use the MASK_THRESHOLDING module:

MASK_THRESHOLDING:
{
    inputFolder: /path/to/NIFTI_folder
    image_filename: img.nii.gz
    mask_filename: msk.nii.gz
    suffix_name: no_fat
    min_threshold: 0
    log: /path/to/logs/mask_thr.log
}

In this example:

  • inputFolder: Specifies the folder containing NIfTI files for thresholding.

  • image_filename and mask_filename: Define the image and mask files to apply the thresholding.

  • suffix_name: Adds the suffix “no_fat” to the thresholded mask filename.

  • min_threshold: Sets the minimum voxel intensity to include.

  • log: Specifies the log file path to record processing details.

NiftiMaskThresholding_multiprocessing.crop_volume(patient, inpath, outpath, min_thr, max_thr, img_name, mask_name, suffix, skip_files, include_files, dif_path, verbose, log)[source]
NiftiMaskThresholding_multiprocessing.main(argv)[source]