OCTOPUS.utils subpackage

OCTOPUS.utils.dataio module

Author: Marina Manso Jimeno Last modified: 07/21/2020

OCTOPUS.utils.dataio.get_data_from_file(input)

Get the data of a file given a string or a dictionary independently of the data format

Parameters:input (str or dict) – Input path or dictionary in case of user upload (Colab)
Returns:file_data – Data extracted from the file
Return type:np.ndarray
OCTOPUS.utils.dataio.read_dicom(path)

Reads dicom file from path

Parameters:path (str) – Path of the file/dicom folder
Returns:vol – Array containing the image volume
Return type:np.ndarray

OCTOPUS.utils.metrics module

Methods to calculate off-resonance correction performance metrics

Author: Marina Manso Jimeno

Last updated: 06/03/2020

OCTOPUS.utils.metrics.HFEN(im1, im2)

High Frequency Error Norm calculation for two images

Parameters:
  • im1 (nupy.ndarray) – Image 1. Reference image, same shape as im2
  • im2 (numpy.ndarray) – Image 2
Returns:

hfen – Measured HFEN value

Return type:

float

OCTOPUS.utils.metrics.LoG(im)

Laplacian of a Gaussian implementation with kernel size (15, 15) and sigma equal to 1.5 pixels

Parameters:im (numpy.ndarray) – Input image
Returns:log_im – Laplacian of a gaussian of the image
Return type:numpy.ndarray
OCTOPUS.utils.metrics.create_table(stack_of_images, col_names, franges)

Displays a table with the metrics for images corrected using the different ORC methods

Parameters:
  • stack_of_images (numpy.ndarray) – stack_of_images[0] : ground truth. stack_of_images[1] : CPR corrected. stack_of_images[2] : fs-CPR corrected. stack_of_images[3] : MFI corrected.
  • col_names (tuple) – Names for the columns
  • franges (tuple) – Frequency ranges of the original field map

OCTOPUS.utils.plotting module

Methods to plot the resulting images from off-resonance correction

Author: Marina Manso Jimeno

Last updated: 06/03/2020

OCTOPUS.utils.plotting.plot_correction_results(im_stack, col_names, row_names)

Creates a plot with the resulting correction images in a grid

Parameters:
  • im_stack (numpy.ndarray) – Stack of images. [0] Corrupted images, [1]-[len(im_stack] corrected images using the different methods
  • col_names (tuple) – Titles for the columns of the plot. Correction methods.
  • row_names (tuple) – Titles for the rows of the plot. Off-resonance frequency ranges.