def removeAdjacentsInArray(contourArray):
    """
    removeAdjacentsInArray. remove adjacents in array
       
    :param contourArray: (Array) all contours
    :returns noAdjacentsArray: (Array) adjacents removed and with last array value
    """
    noAdjacentsArray = []

    if(len(contourArray)> 0):
        #r = [a for a,b in zip(contourArray, contourArray[1:]+[not contourArray[-1]]) if a != b]
        #fixed - included last array value
        noAdjacentsArray = [a for a,b in zip(contourArray, contourArray[1:]+[not contourArray[-1]]) if a != b]+[contourArray[-1]]
    else:
        noAdjacentsArray = []
    return noAdjacentsArray