ROI crashes with an exception for bounding rectangle larger than 1000

30 views
Skip to first unread message

Mrinal Kanti Bera

unread,
May 2, 2017, 12:16:14 PM5/2/17
to pyqtgraph
Hi!
I am developing a software using pyqtgraph which uses the ROI capabilities to create mask for area detectors. Everything works when the bounding rectangle of the  ROIs are less than 1000. But recently I had to work with some of the detectors which are large in size i.e 2000X2000 pixels and sometimes I need to create mask using polyline ROI, the bounding rectangle of which may become larger than 1000. Once the bounding rectangle becomes larger than 1000 the ROI.getArrayRegion crashes giving an exception as shown below:

Traceback (most recent call last):
  File "C:\Users\Mrinal Bera\Documents\Visual Studio 2017\Projects\XRTools\XRTools\maskWidget.py", line 260, in create_all_masks
    self.create_mask(key)
  File "C:\Users\Mrinal Bera\Documents\Visual Studio 2017\Projects\XRTools\XRTools\maskWidget.py", line 237, in create_mask
    mpossx=self.mask[mask_number].getArrayRegion(possx,self.pg_image)
  File "C:\Program Files\Anaconda3\lib\site-packages\pyqtgraph\graphicsItems\ROI.py", line 2025, in getArrayRegion
    raise Exception()
Exception

As per the exception raised in line 2025 of ROI.getArrayRegion method there is indeed an exception for bounding rectangle larger than 1000. This exception only raises with polylineROIs.

My question to Luke or any other who knows about this is: Is there any reason for this exception to be put in explicitly? Can I get around this exception by any other means without commenting the lines 2024-2025 of ROI.getArrayRegion method?

Thanks in Advance!

Best,
Mrinal
Reply all
Reply to author
Forward
0 new messages