Argonne National Laboratory

Experimental Physics and
Industrial Control System

1994  1995  1996  1997  1998  1999  2000  2001  2002  2003  2004  2005  2006  2007  2008  2009  2010  2011  2012  2013  2014  2015  2016  <2017 Index 1994  1995  1996  1997  1998  1999  2000  2001  2002  2003  2004  2005  2006  2007  2008  2009  2010  2011  2012  2013  2014  2015  2016  <2017
<== Date ==> <== Thread ==>

Subject: RE: PVs controlling image size in AreaDetector
From: Iain Marcuson <Iain.Marcuson@sydorinstruments.com>
To: Mark Rivers <rivers@cars.uchicago.edu>, "tech-talk@aps.anl.gov >> EPICS Tech Talk" <tech-talk@aps.anl.gov>
Date: Fri, 18 Aug 2017 17:45:49 +0000
Indeed, changing the dimensions where I alloc() the NDArrayPool creates the correct size image.  Thank you.

Iain.

> -----Original Message-----
> From: Mark Rivers [mailto:rivers@cars.uchicago.edu]
> Sent: Friday, August 18, 2017 1:37 PM
> To: Iain Marcuson <Iain.Marcuson@sydorinstruments.com>; tech-
> talk@aps.anl.gov >> EPICS Tech Talk <tech-talk@aps.anl.gov>
> Subject: RE: PVs controlling image size in AreaDetector
> 
> > I have set ADMaxSizeX and ADMaxSizeY to the maximum for this sensor
> > type.  To change the image size, I am writing to SizeX and SizeY with
> dbPutField and setIntegerParam followed  by callParamCallbacks().
> > However, the image that comes to the AreaDetector plugin seems to be at
> the maximum size I specify.
> > What parameters do I change to change the output image size?
> 
> > The detector does have the capacity for a change in image size, and I have
> verified that the correct number of bytes is being sent by the detector.
> 
> The dimensions of the NDArray that your plugins receive is not directly
> controlled by ADSizeX and ADSizeY.
> Rather, it is directly controlled by the dimensions that you pass to
> NDArrayPool->alloc() when you allocate the new NDArray.
> So perhaps you are not correctly setting those dimensions?
> 
> Mark
> 
> -----Original Message-----
> From: Iain Marcuson [mailto:Iain.Marcuson@sydorinstruments.com]
> Sent: Friday, August 18, 2017 9:31 AM
> To: Mark Rivers; tech-talk@aps.anl.gov >> EPICS Tech Talk
> Subject: RE: PVs controlling image size in AreaDetector
> 
> SizeX and SizeY are changed somewhat reactively from a different PV.  The
> detector does have the capacity for a change in image size, and I have
> verified that the correct number of bytes is being sent by the detector.
> 
> Iain.
> 
> > -----Original Message-----
> > From: Mark Rivers [mailto:rivers@cars.uchicago.edu]
> > Sent: Thursday, August 17, 2017 5:37 PM
> > To: Iain Marcuson <Iain.Marcuson@sydorinstruments.com>; tech-
> > talk@aps.anl.gov >> EPICS Tech Talk <tech-talk@aps.anl.gov>
> > Subject: RE: PVs controlling image size in AreaDetector
> >
> > Hi Iain,
> >
> > When your driver's writeInt32() function receives new values for SizeX
> > and SizeY it needs to do something that actually causes the image size to
> change.
> > This is typically a call to the vendor SDK to set the readout area of
> > the detector.  Does your detector have this capability?  If not, you
> > could implement it in software in your driver, but I would not recommend
> that.
> > Rather I would suggest that you use the NDPluginROI plugin to select
> > the desired sub-region.
> >
> > Here is how it is handled in the ADProsilica driver.  When the
> > writeInt32() function receives new values for ADBin[X,Y], ADMin[X,Y] ,
> > or ADSize[X,Y] it calls setGeometry which makes the calls to the
> > vendor API to set the readout region of the camera.
> >
> > ************************************
> > asynStatus prosilica::writeInt32(asynUser *pasynUser, epicsInt32 value) {
> >     int function = pasynUser->reason;
> >     int status = asynSuccess;
> >     tPvUint32 syncs;
> >     static const char *functionName = "writeInt32";
> >
> >     /* Set the parameter and readback in the parameter library.  This
> > may be overwritten when we read back the
> >      * status at the end, but that's OK */
> >     status |= setIntegerParam(function, value);
> >
> >     if ((function == ADBinX) ||
> >         (function == ADBinY) ||
> >         (function == ADMinX) ||
> >         (function == ADSizeX) ||
> >         (function == ADMinY) ||
> >         (function == ADSizeY)) {
> >         /* These commands change the chip readout geometry.  We need
> > to cache them and apply them in the
> >          * correct order */
> >         status |= setGeometry();
> > ...
> >
> > asynStatus prosilica::setGeometry()
> > {
> >     int status = asynSuccess;
> >     int s;
> >     int binX, binY, minY, minX, sizeX, sizeY, maxSizeX, maxSizeY;
> >     static const char *functionName = "setGeometry";
> >
> >     /* Get all of the current geometry parameters from the parameter
> > library */
> >     status |= getIntegerParam(ADBinX, &binX);
> >     if (binX < 1) binX = 1;
> >     status |= getIntegerParam(ADBinY, &binY);
> >     if (binY < 1) binY = 1;
> >     status |= getIntegerParam(ADMinX, &minX);
> >     status |= getIntegerParam(ADMinY, &minY);
> >     status |= getIntegerParam(ADSizeX, &sizeX);
> >     status |= getIntegerParam(ADSizeY, &sizeY);
> >     status |= getIntegerParam(ADMaxSizeX, &maxSizeX);
> >     status |= getIntegerParam(ADMaxSizeY, &maxSizeY);
> >
> >     if (minX + sizeX > maxSizeX) {
> >         sizeX = maxSizeX - minX;
> >         setIntegerParam(ADSizeX, sizeX);
> >     }
> >     if (minY + sizeY > maxSizeY) {
> >         sizeY = maxSizeY - minY;
> >         setIntegerParam(ADSizeY, sizeY);
> >     }
> >
> >     /* CMOS cameras don't support binning, so ignore ePvErrNotFound
> > errors */
> >     s = PvAttrUint32Set(this->PvHandle, "BinningX", binX);
> >     if (s != ePvErrNotFound) status |= s;
> >     s = PvAttrUint32Set(this->PvHandle, "BinningY", binY);
> >     if (s != ePvErrNotFound) status |= s;
> >
> >     if(!status){
> >       status |= PvAttrUint32Set(this->PvHandle, "RegionX", minX/binX);
> >       status |= PvAttrUint32Set(this->PvHandle, "RegionY", minY/binY);
> >       status |= PvAttrUint32Set(this->PvHandle, "Width",   sizeX/binX);
> >       status |= PvAttrUint32Set(this->PvHandle, "Height",  sizeY/binY);
> >     }
> >
> >     if (status) asynPrint(this->pasynUserSelf, ASYN_TRACE_ERROR,
> >                       "%s:%s: error, status=%d\n",
> >                       driverName, functionName, status);
> >     return((asynStatus)status);
> > }
> > ************************************
> >
> > Mark
> >
> >
> > -----Original Message-----
> > From: tech-talk-bounces@aps.anl.gov [mailto:tech-talk-
> > bounces@aps.anl.gov] On Behalf Of Iain Marcuson
> > Sent: Thursday, August 17, 2017 3:56 PM
> > To: tech-talk@aps.anl.gov >> EPICS Tech Talk
> > Subject: PVs controlling image size in AreaDetector
> >
> > I am expanding on options for an AreaDetector driver I wrote.  The
> > feature I am trying to add is a variable image size.  I have set
> > ADMaxSizeX and ADMaxSizeY to the maximum for this sensor type.  To
> > change the image size, I am writing to SizeX and SizeY with dbPutField
> > and setIntegerParam followed by callParamCallbacks().  However, the
> > image that comes to the AreaDetector plugin seems to be at the maximum
> > size I specify.  What parameters do I change to change the output image
> size?
> >
> > Thank you,
> >
> > Iain Marcuson.

References:
PVs controlling image size in AreaDetector Iain Marcuson
RE: PVs controlling image size in AreaDetector Mark Rivers
RE: PVs controlling image size in AreaDetector Iain Marcuson
RE: PVs controlling image size in AreaDetector Mark Rivers

Navigate by Date:
Prev: RE: PVs controlling image size in AreaDetector Mark Rivers
Next: Upgrading to CSS 4.5 Abdalla Ahmad
Index: 1994  1995  1996  1997  1998  1999  2000  2001  2002  2003  2004  2005  2006  2007  2008  2009  2010  2011  2012  2013  2014  2015  2016  <2017
Navigate by Thread:
Prev: RE: PVs controlling image size in AreaDetector Mark Rivers
Next: Location of plugin attributes in HDF5 Hinko Kocevar
Index: 1994  1995  1996  1997  1998  1999  2000  2001  2002  2003  2004  2005  2006  2007  2008  2009  2010  2011  2012  2013  2014  2015  2016  <2017
ANJ, 20 Aug 2017 Valid HTML 4.01! · Home · News · About · Base · Modules · Extensions · Distributions · Download ·
· EPICS V4 · IRMIS · Talk · Bugs · Documents · Links · Licensing ·