Пример #1
0
def ReadAffinityData(prefix):
    filename, dataset = meta_data.MetaData(prefix).AffinityFilename()

    affinities = ReadH5File(filename, dataset).astype(np.float32)

    # create the dataset so it is (z, y, x, c)
    if affinities.shape[0] == 3: affinities = np.moveaxis(affinities, 0, 3)

    return affinities
Пример #2
0
def SpawnMetaFile(prefix, segment_filename, segment_dataset):
    meta = meta_data.MetaData(prefix)

    # get the new prefix for the data from the segment file
    new_prefix = segment_filename.split('/')[1][:-3]

    # update the values for this meta data
    meta.prefix = new_prefix
    meta.segment_filename = '{} {}'.format(segment_filename, segment_dataset)

    meta.WriteMetaFile()
Пример #3
0
def GridSize(prefix):
    # return the size of this dataset
    return meta_data.MetaData(prefix).GridSize()
Пример #4
0
def ReadSegmentationData(prefix):
    filename, dataset = meta_data.MetaData(prefix).SegmentationFilename()

    return ReadH5File(filename, dataset).astype(np.int64)
Пример #5
0
def ReadImageData(prefix):
    filename, dataset = meta_data.MetaData(prefix).ImageFilename()

    return ReadH5File(filename, dataset)
Пример #6
0
def ReadGoldData(prefix):
    filename, dataset = meta_data.MetaData(prefix).GoldFilename()

    return ReadH5File(filename, dataset).astype(np.int64)
Пример #7
0
def GetGoldFilename(prefix):
    filename, _ = meta_data.MetaData(prefix).GoldFilename()

    return filename
Пример #8
0
def Resolution(prefix):
    # return the resolution for this prefix
    return meta_data.MetaData(prefix).Resolution()
Пример #9
0
def ReadMetaData(prefix):
    # return the meta data for this prefix
    return meta_data.MetaData(prefix)
Пример #10
0
def CroppingBox(prefix):
    # return which locations are valid for training and validation
    return meta_data.MetaData(prefix).CroppingBox()