INTENSITY_RESAMPLING Module

The INTENSITY_RESAMPLING module resamples voxel intensities in a NIfTI image using various methods, including a fixed number of bins, fixed bin width, linear scaling, robust scaling (linear scaling within a percentile range), or z-score normalization. The resampling can be performed on the entire image or only on voxels within a mask specified by the mask_filename option.

Options

The INTENSITY_RESAMPLING module supports the following options:

  • verbose: Enable or disable verbose mode for more detailed output (default: False).

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

  • inputFolder: Path to the folder containing the input NIfTI files.

  • outputFolder: Path to the folder where the resampled images will be saved.

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

  • image_filename: Specify the filename of the image to read.

  • mask_filename: Specify the filename of the mask to apply during resampling (optional).

  • resampled_image_filename: Specify the filename for the output resampled image.

  • method: Resampling method to apply. Options: binning_number (fixed number of bins), binning_width (fixed bin width), linear_scaling, robust_scaling (linear scaling within a percentile range), or zscore_normalization.

  • n_bins: Number of bins if method is binning_number (default: 256).

  • bin_width: Bin width if method is binning_width (default: 25).

  • min_scaling: Minimum value for scaling if using linear_scaling (default: 0).

  • max_scaling: Maximum value for scaling if using linear_scaling (default: 1).

  • lower_bound: Lower percentile bound for robust scaling (default: 2).

  • upper_bound: Upper percentile bound for robust scaling (default: 98).

  • 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.

  • include: Path to a file listing subfolders in inputFolder to include in processing (all subfolders are included by default).

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

  • suffix_name: Suffix to add to the filename of the resampled image.

Example Usage

The following example demonstrates how to use the INTENSITY_RESAMPLING module:

INTENSITY_RESAMPLING:
{
    inputFolder: /path/to/NIFTI_folder
    suffix_name: fb256
    method: binning_number
    n_bins: 256
    log: /path/to/logs/intensity_resampling.log
}

In this example:

  • inputFolder: Specifies the folder containing the NIfTI files to be resampled.

  • suffix_name: Adds “fb256” as a suffix to the filenames of the resampled data.

  • method: Sets the resampling method to binning_number, using a fixed number of bins.

  • n_bins: Sets the number of bins to 256.

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

NiftiIntensityResampling_multiprocessing.main(argv)[source]
NiftiIntensityResampling_multiprocessing.ordinal_suffix(n)[source]
NiftiIntensityResampling_multiprocessing.resampling(patient, inpath, outpath, img_name, r_img_name, msk_name, method, scale_min, scale_max, lower_bound, upper_bound, n_bins, bin_width, dif_path, skip_files, include_files, verbose, log)[source]