embl-cba / imagej-utils

BSD 2-Clause "Simplified" License
2 stars 4 forks source link

Prevent selection of label 0 #45

Open tischi opened 3 years ago

tischi commented 3 years ago

The label 0 should not be selectable.

Not sure whether to implement this on the level of the selection model or on the level of the applications that feed the selection model.

I think it is tricky on the level of the TableView because it does not know that the table rows correspond to image segments (but maybe it knows about the label column, have to check).

@constantinpape should we consider making it part of the spec that label 0 must not occur in the table?

constantinpape commented 3 years ago

I think it is tricky on the level of the TableView because it does not know that the table rows correspond to image segments (but maybe it knows about the label column, have to check).

I agree, it sounds better to implement this on the application side.

@constantinpape should we consider making it part of the spec that label 0 must not occur in the table?

I agree, that this is a good idea. However, we have a lot of tables which contain a 0 label and I am a bit hesitant to rewrite them alll... Maybe we add to the spec that the table SHOULD NOT contain the label 0. So we don't break compatibility with existing projects. And I and @K-Meech can update our table creation code so that 0 gets excluded from the table in the future.

As far as I understand having the zero label also doesn't cause big issues, it's just a bit weird that it's selectable in the table but not in the image.

tischi commented 3 years ago

As far as I understand having the zero label also doesn't cause big issues, it's just a bit weird that it's selectable in the table but not in the image.

Yes, it is not a big deal, but may cause slightly unexpected behavior when moving through the table, e.g. using the arrow keys, so SHOULD NOT could be a good idea.