miblab.kidney_dixon_fat_water#

miblab.kidney_dixon_fat_water(input_array, clear_cache=False, verbose=False)[source]#

Calculate fat/water maps on post-contrast Dixon images.

This requires 2-channel input data with out-phase images, in-phase images.

This uses a pretrained nnunet based model, hosted on Zenodo under the hood this runs nnUNetPredictor (for more details MIC-DKFZ Wiki)

Parameters:
  • input_array (numpy.ndarray) – A 4D numpy array of shape [x, y, z, contrast] representing the input medical image volume. The last index must contain out-phase, in-phase, in that order.

  • clear_cache – If True, the downloaded pth file is removed again after running the inference.

  • verbose (bool) – If True, prints logging messages.

Returns:

A dictionary with the keys ‘fat’ and ‘water’, each containing a binary NumPy array representing the respective map.

Return type:

dict

Example

>>> import numpy as np
>>> import miblab
>>> data = np.random.rand(128, 128, 30, 2)
>>> fatwatermap = miblab.kidney_dixon_fat_water(data)
>>> print(fatwatermap['fat'].shape)
[128, 128, 30]