def fix_missing_data(contour_data_list):
    '\n    Fixes missing points in contouring using simple linear interpolation\n\n\n    Args:\n        contour_data_list (list): The contour data for each slice\n\n    Returns:\n        contour_data (numpy array): Interpolated contour data\n    '
    contour_data = np.array(contour_data_list)
    if (contour_data.any() == ''):
        logger.warning('    Missing values detected.')
        missing_values = np.where((contour_data == ''))[0]
        if (missing_values.shape[0] > 1):
            logger.warning("    More than one value missing, fixing this isn't implemented yet...")
        else:
            logger.warning('    Only one value missing.')
            missing_index = missing_values[0]
            missing_axis = (missing_index % 3)
            if (missing_axis == 0):
                logger.warning('    Missing value in x axis: interpolating.')
                if (missing_index > (len(contour_data) - 3)):
                    lower_val = contour_data[(missing_index - 3)]
                    upper_val = contour_data[0]
                elif (missing_index == 0):
                    lower_val = contour_data[(- 3)]
                    upper_val = contour_data[3]
                else:
                    lower_val = contour_data[(missing_index - 3)]
                    upper_val = contour_data[(missing_index + 3)]
                contour_data[missing_index] = (0.5 * (lower_val + upper_val))
            elif (missing_axis == 1):
                logger.warning('    Missing value in y axis: interpolating.')
                if (missing_index > (len(contour_data) - 2)):
                    lower_val = contour_data[(missing_index - 3)]
                    upper_val = contour_data[1]
                elif (missing_index == 0):
                    lower_val = contour_data[(- 2)]
                    upper_val = contour_data[4]
                else:
                    lower_val = contour_data[(missing_index - 3)]
                    upper_val = contour_data[(missing_index + 3)]
                contour_data[missing_index] = (0.5 * (lower_val + upper_val))
            else:
                logger.warning('    Missing value in z axis: taking slice value')
                temp = contour_data[2::3].tolist()
                temp.remove('')
                contour_data[missing_index] = np.min(np.array(temp, dtype=np.double))
    return contour_data
Fixes missing points in contouring using simple linear interpolation


Args:
    contour_data_list (list): The contour data for each slice

Returns:
    contour_data (numpy array): Interpolated contour data
def fix_missing_data(contour_data_list):
    '\n    Fixes missing points in contouring using simple linear interpolation\n\n\n    Args:\n        contour_data_list (list): The contour data for each slice\n\n    Returns:\n        contour_data (numpy array): Interpolated contour data\n    '
    contour_data = np.array(contour_data_list)
    if (contour_data.any() == ):
        logger.warning('    Missing values detected.')
        missing_values = np.where((contour_data == ))[0]
        if (missing_values.shape[0] > 1):
            logger.warning("    More than one value missing, fixing this isn't implemented yet...")
        else:
            logger.warning('    Only one value missing.')
            missing_index = missing_values[0]
            missing_axis = (missing_index % 3)
            if (missing_axis == 0):
                logger.warning('    Missing value in x axis: interpolating.')
                if (missing_index > (len(contour_data) - 3)):
                    lower_val = contour_data[(missing_index - 3)]
                    upper_val = contour_data[0]
                elif (missing_index == 0):
                    lower_val = contour_data[(- 3)]
                    upper_val = contour_data[3]
                else:
                    lower_val = contour_data[(missing_index - 3)]
                    upper_val = contour_data[(missing_index + 3)]
                contour_data[missing_index] = (0.5 * (lower_val + upper_val))
            elif (missing_axis == 1):
                logger.warning('    Missing value in y axis: interpolating.')
                if (missing_index > (len(contour_data) - 2)):
                    lower_val = contour_data[(missing_index - 3)]
                    upper_val = contour_data[1]
                elif (missing_index == 0):
                    lower_val = contour_data[(- 2)]
                    upper_val = contour_data[4]
                else:
                    lower_val = contour_data[(missing_index - 3)]
                    upper_val = contour_data[(missing_index + 3)]
                contour_data[missing_index] = (0.5 * (lower_val + upper_val))
            else:
                logger.warning('    Missing value in z axis: taking slice value')
                temp = contour_data[2::3].tolist()
                temp.remove()
                contour_data[missing_index] = np.min(np.array(temp, dtype=np.double))
    return contour_data