N4-BIAS-FIELD-CORRECTION Module
The N4-BIAS-FIELD-CORRECTION module corrects images for bias field inhomogeneities, which are often present in MRI images. This module allows users to specify target areas for correction using masks and can output the estimated bias field as a separate image.
Options
The N4-BIAS-FIELD-CORRECTION module supports the following options:
verbose: Enable verbose mode for 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 corrected images.
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 bias correction.
mask_filename: Name of the mask file to apply correction only within a specified area (optional).
corrected_image_filename: Name for the corrected output image (default: img_n4biasCorr.nii.gz).
bias_field_image_filename: Specify an output name for saving the estimated bias field image (optional).
suffix_name: Suffix to add to the corrected image name, overriding corrected_image_filename if specified.
Example Usage
The following example demonstrates how to use the N4-BIAS-FIELD-CORRECTION module:
N4-BIAS-FIELD-CORRECTION:
{
inputFolder: /path/to/NIFTI_folder
image_filename: img.nii.gz
mask_filename: msk.nii.gz # Optional: apply correction only within mask
corrected_image_filename: img_n4biasCorr.nii.gz
bias_field_image_filename: field.nii.gz # Optional: output for estimated bias field
log: /path/to/logs/bias_field_correction.log
new_log: True # Create a new log file or append to an existing one
}
In this example:
inputFolder: Specifies the folder containing images for bias correction.
image_filename and corrected_image_filename: Define input and output filenames.
bias_field_image_filename: Saves the estimated bias field image.
log: Specifies the path for the log file.