'Load a codebook from file using the datafile. The datafile
should point to a local image for the source patch image.'

def load(self, datafile):

    myFile = open(datafile, 'r')
    temp = myFile.readline()
    self.mNumCodes = int(myFile.readline())
    w = int(myFile.readline())
    h = int(myFile.readline())
    self.mPatchSize = (w, h)
    self.mPadding = int(myFile.readline())
    w = int(myFile.readline())
    h = int(myFile.readline())
    self.mLayout = (w, h)
    imgfname = myFile.readline().strip()
    self.mCodebookImg = Image(imgfname)
    self.mCodebook = self._img2Codebook(self.mCodebookImg, self.mPatchSize, self.mNumCodes, self.mLayout, self.mPadding)
    return
