Skip to content

Commit

Permalink
Merge pull request #278 from NaturalHistoryMuseum/feature/277-subsegment
Browse files Browse the repository at this point in the history
[#277] Subsegment box broken
  • Loading branch information
quicklizard99 committed Apr 17, 2016
2 parents 9be4fd8 + 1dfbe3c commit 4b8fa24
Show file tree
Hide file tree
Showing 4 changed files with 15 additions and 4 deletions.
5 changes: 5 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,10 @@
This is an overview of major changes. Refer to the git repository for a full log change.

Version 0.1.27
-------------
- Fixed #277 - Subsegment box broken
- Fixed #275 - Test image has executable bit set (@edwbaker)

Version 0.1.26
-------------
- Fixed #263 - Subsegment box should copy metadata to new boxes
Expand Down
2 changes: 1 addition & 1 deletion inselect/__init__.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
"""Segmentation, validation and annotation of images of museum specimens
"""
__version__ = '0.1.26'
__version__ = '0.1.27'
# distutils/version.py and win32/lib/win32verstamp.py have different
# restrictions on the format of version numbers - both must be met.
# Three numbers separated by dots is a safe format.
2 changes: 1 addition & 1 deletion inselect/gui/plugins/subsegment.py
Original file line number Diff line number Diff line change
Expand Up @@ -76,7 +76,7 @@ def __call__(self, progress):
# new rects and replace the existing item
existing = items[row]
new_items = [None] * len(rects)
for index, rect in enumerate(image.to_normalised(rects)):
for index, rect in enumerate(rects):
new_items[index] = existing.copy()
new_items[index]['rect'] = rect
items[row:(1+row)] = new_items
Expand Down
10 changes: 8 additions & 2 deletions inselect/tests/gui/test_subsegment.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,10 +4,10 @@
from mock import patch
from pathlib import Path

from PySide.QtCore import QPointF
from PySide.QtCore import QPointF, QRect
from PySide.QtGui import QMessageBox

from inselect.gui.roles import MetadataRole
from inselect.gui.roles import MetadataRole, RectRole

from gui_test import MainWindowTest

Expand Down Expand Up @@ -44,10 +44,16 @@ def test_subsegment(self):
self.assertEqual(3, w.model.rowCount())
self.assertEqual({'Genus': 'Morganucodon'},
w.model.data(w.model.index(0, 0), MetadataRole))
self.assertEqual(QRect(11, 31, 502, 278),
w.model.data(w.model.index(0, 0), RectRole))
self.assertEqual({'Genus': 'Morganucodon'},
w.model.data(w.model.index(1, 0), MetadataRole))
self.assertEqual(QRect(395, 157, 404, 253),
w.model.data(w.model.index(1, 0), RectRole))
self.assertEqual({'Genus': 'Morganucodon'},
w.model.data(w.model.index(2, 0), MetadataRole))
self.assertEqual(QRect(18, 370, 510, 209),
w.model.data(w.model.index(2, 0), RectRole))
self.assertTrue(w.model.is_modified)

# Close the document
Expand Down

0 comments on commit 4b8fa24

Please sign in to comment.