Пример #1
0
def find_last(specimen_url, padding, start, step):
    max_slice = start
    print "Images found... "
    while has_image(digimorph.get_slice_url(specimen_url, max_slice, padding)):
        print str(max_slice) + ",",
        max_slice+=step
    print
    return max_slice - step
Пример #2
0
def find_last(specimen_url, padding, start, step):
    max_slice = start
    print "Images found... "
    while has_image(digimorph.get_slice_url(specimen_url, max_slice, padding)):
        print str(max_slice) + ",",
        max_slice += step
    print
    return max_slice - step
Пример #3
0
pprint(all_species)

urls = []
for val in all_species.values():
    urls.extend(val['urls'])

pprint(urls)
slice_data = {}
for u in urls:
    specimen_url = digimorph.get_specimen_url(u)
    padding = 0
    max_slice = 0
    has_slices = True

    print "Finding images for %s" % specimen_url
    print digimorph.get_slice_url(specimen_url, 1, 3)
    # 3 or 4 padding?
    if has_image(digimorph.get_slice_url(specimen_url, 1, 3)):
        padding = 3
        print "Padding 3!"
    elif has_image(digimorph.get_slice_url(specimen_url, 1, 4)):
        padding = 4
        print "Padding 4!"
    else:
        print "Failed to find first image with 3 or 4 padding"
        has_slices = False

    if has_slices:
        # Find last slice image
        max_slice = find_last(specimen_url, padding, 100, 100)
        max_slice = find_last(specimen_url, padding, max_slice, 10)
Пример #4
0
pprint(all_species)

urls = []
for val in all_species.values():
    urls.extend(val['urls'])

pprint(urls)
slice_data = {}
for u in urls:
    specimen_url = digimorph.get_specimen_url(u)
    padding = 0
    max_slice = 0
    has_slices = True

    print "Finding images for %s" % specimen_url
    print digimorph.get_slice_url(specimen_url, 1, 3)
    # 3 or 4 padding?
    if has_image(digimorph.get_slice_url(specimen_url, 1, 3)):
        padding = 3
        print "Padding 3!"
    elif has_image(digimorph.get_slice_url(specimen_url, 1, 4)):
        padding = 4
        print "Padding 4!"
    else:
        print "Failed to find first image with 3 or 4 padding"
        has_slices = False

    if has_slices:
        # Find last slice image
        max_slice = find_last(specimen_url, padding, 100, 100)
        max_slice = find_last(specimen_url, padding, max_slice, 10)