Image Operations 4d#

The ‘image_operations_4d’ module provides several functions used to do preprocessing on 4D PET imaging series. These functions typically take one or more paths to imaging data in NIfTI format, and save modified data to a NIfTI file, and may return the modified imaging array as output.

Todo

  • (weighted_series_sum) Refactor the DecayFactor key extraction into its own function

  • (weighted_series_sum) Refactor verbose reporting into the class as it is unrelated to computation

  • (extract_tac_from_4dnifty_using_mask) Write the number of voxels in the mask, or the volume of the mask. This is necessary for certain analyses with the resulting tacs, such as finding the average uptake encompassing two regions.

  • Methods that create new images should copy over a previous metadata file, if one exists, and create a new one if it does not.

  • (stitch_broken_scans) Separate ‘add desc entity’ section to its own function somewhere.

  • (stitch_broken_scans) Assumes non-BIDS key ‘DecayFactor’ instead of BIDS-required ‘DecayCorrectionFactor’ for ease-of-use with NIL data. Should be changed in the future.

  • (stitch_broken_scans) Currently writes intermediate files even if output_image_path is None.

Classes#

SimpleAutoImageCropper

Class for automatically cropping 3D or 4D medical images based on pixel intensity thresholds.

Functions#

stitch_broken_scans(→ ants.ANTsImage)

'Stitch' together 2 or more images from one session into a single image.

crop_image(input_image_path, out_image_path[, x_dim, ...])

Crops an image in the X and Y axes to exclude voxels outside of the head. This is done to

rescale_image(→ ants.core.ANTsImage)

Rescales a 3D or 4D ANTsImage intensity values by performing division or

extract_mean_roi_tac_from_nifti_using_segmentation(...)

Creates a time-activity curve (TAC) by computing the average value within a region, for each

threshold(input_image_numpy[, lower_bound, upper_bound])

Threshold an image above and/or below a pair of values.

binarize_image_with_threshold(input_image_numpy[, ...])

Threshold an image above and/or below a pair of values, and return a binary mask.

gauss_blur(input_image_path, blur_size_mm, ...[, use_fwhm])

Blur an image with a 3D Gaussian kernal of a provided size in mm. Extracts

roi_tac(input_image_path, roi_image_path, region, ...)

Function to write Tissue Activity Curves for a single region, given a mask,