Page MenuHomePhabricator

PointSetInteractor, number of points does not work on 0 or 1
Closed, ResolvedPublic

Description

The constructor

mitk::PointSetInteractor::New("pointsetinteractor", m_poPointNode,0);

or

m_oInteractor = mitk::PointSetInteractor::New("pointsetinteractor", m_poPointNode,1);

should not allow to add points on PointData of size 1, but one single point can be added (with shift) so that the total size is 2!

Event Timeline

I can reproduce the bug with N = 0 but not with N = 1.
I used bundle PoiintSetInteraction and modified the PointListWidget to instanciate a PointSetInteractor with N=0 and N=1.
For N=1: was a point manually added and not added by interaction (shift left mouse button click)?

For N=0 I will add a warning in constructor and deactivate the statemachine, because an interaction on no points doesn't make sense!

You must take a point set which already has one point in it. Then you must initialte the PointSetInteractor with 1: mitk::PointSetInteractor::New("pointsetinteractor", m_poPointNode,1);

Now you can add one point so that the final size is 2.

If m_poPointNode is of size 0 you are correct, then it is only possible to add one point....

PointSetInteractor is not meant to be used with PointSets already containing points. This breaks the interaction mechanism. I will check to add a warning in the constructor, that checks this. Also I will check to enhance the mechanism to support filled PointSets.

(In reply to comment #3)

PointSetInteractor is not meant to be used with PointSets already containing
points.

What if the user creates a new point set with one point, saves it, loads it and want to change the point.... should that not be possible with MITK ?

This breaks the interaction mechanism. I will check to add a warning in
the constructor, that checks this.

Also I will check to enhance the mechanism to support filled PointSets.

That would be great because it still works (only this bug must be closed), so there should not be great changes i think...

Up to now the result of the algorithm that used a seed point was saved and not the seedpoint itself.

I will add a method that checks the number of points in the point set after initialization. Then the according state will be set and the statemachine should behave as needed.

I have adapted PointListWidget (+ view and model) to keept to interaction mechanism. See #4947 for further documentation

Instanciation of a pointsetinteractor, that is only allowed to add 0 (!) points does't make sense. Thus I define the min. number of points to be 1. Adding a check in constructor of PointSetInteractor with a warning in case a 0 is defined for m_N.

asking for core modification flag!

patch containing initial changes

(In reply to comment #8)

Instanciation of a pointsetinteractor, that is only allowed to add 0 (!) points
does't make sense. Thus I define the min. number of points to be 1. Adding a
check in constructor of PointSetInteractor with a warning in case a 0 is
defined for m_N.

Yes it can make sense to allow the point set interactor to ADD 0 points!!! If i want to change an already existing point set where no new points should be added (or removed)!

N represents the number of points to take care of. If one loads a pointset the interactor (after the commit) adapts to the number of loaded points. So it will be in the right state and add points if n<N and won't add points if >=N.

If you don't want the user to add points but only to modify them, then you will have to use a different statemachine pattern. E.g. one that doesn't add or remove points but only selects and moves points. That's an easy job!

I will add a new pattern for the interaction with loaded points without adding or deleting points called "onlymovepointsetinteractor" to statemachine.xml.

@Gerald: use this for the 0 point interaction

Yet no 4D pointsets are supported when loading points. Found a bug in when using PointListWidget: Select a point in list, move the point by mouse interaction and click Del button->selected point cannot be deleted. To be checked using a different bug report.

(In reply to comment #14)

I will add a new pattern for the interaction with loaded points without adding
or deleting points called "onlymovepointsetinteractor" to statemachine.xml.
@Gerald: use this for the 0 point interaction

Ok, i will wait for it, thanks!

[SVN revision 25762]
FIX (#4836): setting GetStyleName to const and adding Documentation (minor)

[SVN revision 25766]
ENH (#4836): adding support for interaction with loaded points. for detailed description, see T4836. Adding new statemachine pattern onlymovepointsetinteractor. Adding new PointSetInteractorTest. Yet no 4D support.

[SVN revision 25767]
COMP (#4836): removing unsigned signed warning

@Gerald: See mitkPointSetInteractionTest for testing of new statemachine pattern "onlymovepointsetinteractor" which does what you asked for. Loading of points now is supported.

thanks, i will test it next weeks