Hi Michael!
I think I understand the problem, but let's make sure we are talking about
the same behavior. This is what I did:

1. run roiAnalysis.py from your develop branch
2. `imv.addROI([0, 0])` from command line
3. Drag a handle; values in ROI plot change even if the average value
within the ROI should have been unchanged

The reason for this behavior is that getArrayRegion returns an array of the
_rectangular_ region around the ROI, with anything outside the ROI set to
0. If you take the mean over this array, then all those 0s get mixed into
the mean. A really simple option here is to add the ability to specify a
default value other than 0. You could then call getArrayRegion with
default=nan and use np.nanmean to get the correct value.


Luke

On Fri, Sep 7, 2018 at 12:42 PM Michael Graupner <[email protected]>
wrote:

> Hello,
>
> I have been working on the ImageView class since I wanted to be able to
> add multiple PolyLineROIs to the view and display the roiCurves alltogether
> in the view below. These two features work well.
>
> However, when I change the handles of an individual roi, or add an handle,
> the roiCurve does diplay false values. Something must be in the getArrayRegion
> function or around. I am not quite sure where to start looking and would
> appreciate any hint.
>
> The behavior can be tested by running  roiAnalysis.py here :
> https://github.com/mgraupe/pyqtgraph
>
> Thanks a lot in advance.
>
> Cheers,
> Michael
>
> --
> You received this message because you are subscribed to the Google Groups
> "pyqtgraph" group.
> To unsubscribe from this group and stop receiving emails from it, send an
> email to [email protected].
> To view this discussion on the web visit
> https://groups.google.com/d/msgid/pyqtgraph/b388af57-42b8-4cad-87de-12e218b6dfea%40googlegroups.com
> <https://groups.google.com/d/msgid/pyqtgraph/b388af57-42b8-4cad-87de-12e218b6dfea%40googlegroups.com?utm_medium=email&utm_source=footer>
> .
> For more options, visit https://groups.google.com/d/optout.
>

-- 
You received this message because you are subscribed to the Google Groups 
"pyqtgraph" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
To view this discussion on the web visit 
https://groups.google.com/d/msgid/pyqtgraph/CACZXET9AK89vrr8mbO14O%3D7uXtL5_SBVm4sPBDwP36Ry__e17Q%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.

Reply via email to