-
Notifications
You must be signed in to change notification settings - Fork 0
Draw a region, then click the place outside the region without mouse-up, try to drag, CARTA will crash #161
Comments
I just want to check, is this issue still open? I think this should have been resolved in this commit which introduced the region UI changes and bug fixes. |
I tested with a build (dev branch) on June 19 and it seems that moving a region around will not trigger the crash event anymore. I will keep an eye on it. |
OK, I got the crash now. When you have TWO regions created, somehow you can move the two regions at the same time and one region may move completely outside the image and trigger the crash. I suggest we should limit the regions to be completely inside the image. In other words, all pixels inside a region should have pixel values (including nan, the masked out pixels). [41mFatal: Exception (std::exception): Exception: Ellipsoid lies completely outside the lattice. |
Ah ok. That shouldn't be happening. Somehow I still can't reproduce the crash but indeed it makes no sense that regions can be outside the image. |
There are use cases for regions outside of the image. For example, you can load a region file (or mask) that is larger than a given image and would want to understand where those regions were. A common use case would be a set of markers indicating where objects of interest are. Consider also what happens when there are two images of different sizes being simultaneously analyzed. As to whether the UI should allow the manipulation of regions outside of image, that's something that is less clear. However, I would think that this is an unnecessary limitation. |
An example to reproduce the crash:
Note that now region is defined by pixel coordinates. Therefore if a region is defined in the smaller HD163296_CO_2_1_mom0_zoom.image.fits and then use animator to switch to the bigger spire250_ext.fits, you should see that region locates at two different places on the two images. This is the root cause to trigger the crash. That is, if two images with different pixel dimensions are opened, a valid region in one image may be invalid in another and results in crash from "casacore". If we really allow a region defined outside the image, we need to find out a way to bypass casacore crash. |
I've managed to reproduce the crash by modifying the code to allow a region to be dragged outside of the image bounds. (Previously this could only be done inadvertently by having multiple regions selected as @kswang1029 described). As @kswang1029 says, we either have to somehow bypass the casacore crash or disallow regions outside the image bounds. |
Crash on casacore libs.
https://github.com/casacore/casacore/blob/v2.2/lattices/LRegions/LCBox.cc#L238
void Region::handleDrag( const Carta::Lib::InputEvents::Drag2Event& ev, const QPointF& location ){
after executaing this, then crash
}
The text was updated successfully, but these errors were encountered: