bauerdavid/napari-nD-annotator

annotator cannot handle more than 50 objects?

Closed this issue · 1 comments

From Balázs:
I can create 50+ objects. I can see them in the object list. But if I click on any of them with id>50, I get the following error: index 50 out of bounds for axis 0 with size 50.
And from that on, I cannot scroll between slices or annotate anything.

Traceback:

IndexError Traceback (most recent call last)
~\Desktop\napari-nD-annotator\widgets\projections.py in on_slider_change(val=17)
266 def on_slider_change(val):
267 for projection in self.projections:
--> 268 projection.setSlices(dim, val)
projection.setSlices = >
global dim = undefined
val = 17
269 return on_slider_change
270

~\Desktop\napari-nD-annotator\widgets\projections.py in setSlices(self=, *args=(2, 17))
40 for i in range(0, len(args), 2):
41 self.slices[args[i]] = max(min(args[i+1], self.image_data.shape[args[i]]-1), 0)
---> 42 self.update()
self.update = >
43
44 @Property

~\Desktop\napari-nD-annotator\widgets\projections.py in update(self=, update_icon=True, new_size=None)
125 mask = np.tile(mask[..., np.newaxis], (1, 1, 4))
126 else:
--> 127 mask = (self.mask_colormap[self.mask_data[self.im_idx]] * 255).astype(np.uint8)
mask = undefined
self.mask_colormap = (50, 4) float64
self.mask_data = (39, 78, 53) uint32
self.im_idx.astype = undefined
global np.uint8 =
128 alpha = (mask.max(2) > 0).astype(np.uint8) * 180
129 mask[..., -1] = alpha

IndexError: index 50 is out of bounds for axis 0 with size 50

TRY TO DRAW ANYTHING: error: list.remove(x): x not in list
Traceback:

ValueError Traceback (most recent call last)
~\Desktop\napari-nD-annotator\object_list_bb.py in select_item(self=, item=)
303
304 def select_item(self, item):
--> 305 item.on_select()
item.on_select = >
306 selected_idx = self.indexFromItem(item)
307 if selected_idx == self.selected_idx:

~\Desktop\napari-nD-annotator\object_list_bb.py in on_select(self=)
179
180 def on_select(self):
--> 181 self.unselect()
self.unselect = >
182 self.parent.crop_image_layer, self.parent.crop_mask_layer = self.create_layers(self.image_layer.colormap)
183 self.parent.crop_image_layer.name = "[tmp] " + self.parent.crop_image_layer.name

~\Desktop\napari-nD-annotator\object_list_bb.py in unselect(self=)
170 if self.parent.crop_mask_layer in self.viewer.layers:
171 self.viewer.layers.remove(self.parent.crop_mask_layer)
--> 172 self.parent.crop_mask_layer.mouse_drag_callbacks.remove(QObjectListWidgetItem.update_layer)
self.parent.crop_mask_layer.mouse_drag_callbacks.remove =
global QObjectListWidgetItem.update_layer =
173 self.parent.crop_mask_layer = None
174 if self.parent.projections_widget is not None:

ValueError: list.remove(x): x not in list

resolved in 0f58f5d