Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Brush tool cannot make annotations in tiled rectangular area. #50

Closed
c-schloss opened this issue Feb 9, 2017 · 3 comments
Closed

Brush tool cannot make annotations in tiled rectangular area. #50

c-schloss opened this issue Feb 9, 2017 · 3 comments

Comments

@c-schloss
Copy link

After creating a rectangular annotation and tiling it, the brush tools seems to be unable to make new annotations within the rectangle. Other tools work fine and can be used for selecting tiles for training a classifier, but the brush will only appear if started outside the rectangle and even when created, will not capture any objects.
brush-in-rectangle

@Svidro
Copy link

Svidro commented Feb 9, 2017

Yes, it will try to select the object you already have created. If you want to draw within the annotation object (square) you have created, right click on it, drop down to Annotations, and select "Lock." Otherwise, it thinks you are trying to fill in the annotation you already have created. One way to see this is, with the annotation unlocked, hold down Alt and draw with the brush tool. You will see you are creating holes in your annotation now.

One important thing to note when creating annotations within annotations, is that if your second brush tool annotation exits the first annotation, none of the detections within will be considered part of the brush tool annotation. This is probably most important when dealing with TMAs, because if the region you draw leaves the TMA circle, it is treated as being entirely outside!

@c-schloss
Copy link
Author

Great. Thanks for the clarification. That behavior was a little unexpected to me since the other tools create distinct annotations within the rectangle, but I can see that in the case of brushing over other smaller annotations (esp. other brush regions) it's preferable for the default behavior to modify the regions (add or subtract) instead of making a new annotation.

@petebankhead
Copy link
Member

Thanks Svidro and ClnSchlssr - yes, it is mostly 'expected behavior'.

You can also work around it slightly by drawing a polygon inside your annotation, and then switch to the brush tool to edit it (using the shortcuts 'p' and 'b' to switch tools). The polygon is able to create the new annotation, and when clicking inside the new polygon with the brush tool then it should be selected (rather than the original annotation).

But I think locking annotations is the best solution, since this also prevents you from accidentally moving the annotation within which the tiles were created. Some commands (e.g. cell detection) automatically lock the annotations that they are run inside, but 'Create tiles' doesn't. It probably should.

As Svidro mentions, the need for annotations to be completely inside other annotations to 'capture' further objects is really important... there is some explanation for it at https://github.com/qupath/qupath/wiki/Object-hierarchies

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants