guiqwt progammable zoom

82 views
Skip to first unread message

Gilles Bordas

unread,
Dec 11, 2014, 11:35:39 AM12/11/14
to guidata...@googlegroups.com

Hello

With guiqwt I display CCD camera images.
I would like to know if it is possible to program the guiqwt zoom tool for displaying 1 pixel on my screen equal to 1 pixel of my camera's ccd sensor ?
In fact I mean 1 pixel in my guiqwt plot area correspond to 1 point (x,y,z) of my data array.

Regards
Gilles

Russ Berg

unread,
Dec 12, 2014, 12:55:46 PM12/12/14
to guidata...@googlegroups.com

Hi Gilles,

I’m not exactly sure what you are asking in regards to the zoom tool but if your goal is to display your image in the same resolution as your ccd you should only need to set the image parameters (ImageParam and ImageAxesParam) of your image Item when you first create your image, I wrote the following to do this:

 

def set_image_parameters(self, imgItem, xmin, xmax, ymin, ymax):

            

              ImageParam:

                    Image title: Image

                    Alpha channel: False

                    Global alpha: 1.0

                    Colormap: gist_gray

                    Interpolation: None (nearest pixel)

                    _formats:

                      X-Axis: %.1f

                      Y-Axis: %.1f

                      Z-Axis: %.1f

                    Background color: #000000

                    _xdata:

                      x|min: -

                      x|max: -

                    _ydata:

                      y|min: -

                      y|max: -

                                

             """

             iparam = ImageParam()

             iparam.xmin = xmin

             iparam.ymin = ymin

             iparam.xmax = xmax

             iparam.ymax = ymax

             self.zoom_rngx = float(xmax - xmin)

             self.zoom_rngy = float(ymax - ymin)

            

             axparam = ImageAxesParam()

             axparam.xmin = xmin

             axparam.ymin = ymin

             axparam.xmax = xmax

             axparam.ymax = ymax

            

             imgItem.set_item_parameters({"ImageParam":iparam})

             imgItem.set_item_parameters({"ImageAxesParam":axparam})

 

hope it helps,

-Russ

--
You received this message because you are subscribed to the Google Groups "guidata/guiqwt" group.
To unsubscribe from this group and stop receiving emails from it, send an email to guidata_guiqw...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Gilles Bordas

unread,
Dec 15, 2014, 9:24:43 AM12/15/14
to guidata...@googlegroups.com
Hi Russ.
Thanks a lot for your proposals. It opened me new way of investigation.

I have tested your code example and I obtain the result below :
Picture 1 (Fig1) : initial image
Picture 2 (Fig 2) : After changing Image parameters according to your example (I have put : iparamxmax=500, iparamymax=500)
Picture 3 (Fig3) : what i would like to programm. For the moment I obtain it manually by zooming with the mouse (right click).

Regards
Gilles

Reply all
Reply to author
Forward
0 new messages