shut down the viewer loop?

Steven Drake drake.steven at gmail.com
Thu May 21 06:58:14 EDT 2015


OK, this is a trimmed down version 

This is the part which cycles through a list of images and displays them on 
at a time. Each displayed image is closed by clicking the "X" on the frame:
for item in existing_data_list:
    jpeg_name = item['jpeg']
    jpeg_set = item['set_type']
    jpeg_path = ""
    if jpeg_set == "TRAIN":
        jpeg_path = train_data_source_path
    elif jpeg_set == "TEST":
        jpeg_path = test_data_source_path
    else:
        break
    jpeg_fullname = os.path.join(jpeg_path, jpeg_name)
    jpeg_image = ndimage.imread(jpeg_fullname, mode="RGB")
    an_image = ski_viewer.ImageViewer(jpeg_image)
    an_image.show()

here's the list it cycles through:
[{'set_type': 'TRAIN', 'predicted': 9999, 'jpeg': '10_left.jpeg', 'correct': 
'unknown', 'level': '0'}, 
{'set_type': 'TRAIN', 'predicted': 9999, 'jpeg': '10_right.jpeg', 'correct': 
'unknown', 'level': '0'}, 
{'set_type': 'TEST', 'predicted': 9999, 'jpeg': '11_left.jpeg', 'correct': 
'unknown', 'level': 9999}, 
{'set_type': 'TEST', 'predicted': 9999, 'jpeg': '11_right.jpeg', 'correct': 
'unknown', 'level': 9999}, 
{'set_type': 'TEST', 'predicted': 9999, 'jpeg': '12_left.jpeg', 'correct': 
'unknown', 'level': 9999}, 
{'set_type': 'TEST', 'predicted': 9999, 'jpeg': '12_right.jpeg', 'correct': 
'unknown', 'level': 9999}]

Attached a zip file with the jpegs.  You'll need to change the script 
variables train_data_source_path and test_data_source_path to suit your 
pathing. 

Steven



-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.python.org/pipermail/scikit-image/attachments/20150521/4b453361/attachment.html>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: question_data.7z
Type: application/x-7z-compressed
Size: 5980427 bytes
Desc: not available
URL: <http://mail.python.org/pipermail/scikit-image/attachments/20150521/4b453361/attachment.7z>


More information about the scikit-image mailing list