EPICS Controls 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  2018  2019  2020  2021  2022  <20232024  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  2018  2019  2020  2021  2022  <20232024 
<== Date ==> <== Thread ==>

Subject: Re: Increasing NDArray XSize and YSize with areaDetector
From: Mark Rivers via Tech-talk <tech-talk at aps.anl.gov>
To: "tech-talk at aps.anl.gov" <tech-talk at aps.anl.gov>, "Marco A. Barra Montevechi Filho" <marco.filho at lnls.br>
Date: Mon, 8 May 2023 22:09:24 +0000
Hi Marco,

NDPluginWarp could easily be modified so that its output array is a different size from the input array.  The NDPluginROI does that for example.  In that case the output arrays are always smaller than the input arrays, but that is not a requirement.  

But if you do that you need to consider what that means for the CenterX and CenterY records.  If you put the rotated array into a new larger array, the rotation center in the new array coordinates will no longer be the CenterX and CenterY that the user specified.

The behavior of NDPluginWarp is exactly the same as IDL, a program that is good for image processing and display, and is heavily used in remote sensing applications.

This creates an array called "a" as a 512x512 byte array like ADSimDetector:
IDL> a = bindgen(512, 512)*10

This displays it:
IDL> tv, a



This creates a new array "b" that is "a" rotated by 45 degrees, scaled by 1.0, rotation center=[300,200]
IDL> b = rot(a, 45, 1, 300, 200)

This shows that "b" is the same size as "a".
IDL> help, b
B               INT       = Array[512, 512]

This displays it:
IDL> tv, b



Note that there is data in "a" that is missing from "b".

In IDL you would need to pad "a" before rotating it to ensure that "b" was not missing any of the data from "a".

Mark


From: Tech-talk <tech-talk-bounces at aps.anl.gov> on behalf of Marco A. Barra Montevechi Filho via Tech-talk <tech-talk at aps.anl.gov>
Sent: Monday, May 8, 2023 3:44 PM
To: tech-talk at aps.anl.gov <tech-talk at aps.anl.gov>
Subject: Increasing NDArray XSize and YSize with areaDetector
 
Hello all!

Im again using ADSimDetector to do some PoC's with areaDetector. I wanted to rotate an image by an arbitrary angle and i managed to do so with the NDWarp plugin that i found here: https://epics.anl.gov/tech-talk/2021/msg01414.php

The plugin works very nicely (by the way: couldnt it be in the areaDetector main user guide page? It seems that it could be useful for a ton of people) but, as obviously the diagonal of the initial array is bigger than the sides, i end up with a trimmed image (i append the original and rotated image).

What is the ideal way of passing the array to something that doesnt cut the diagonal corners as is happening with my current implementation?
I thought about using PluginGather in some way, but couldnt figure it out. The only way i can think about is by writing a whole new ADDriver that is called in .cmd file and instantiates a new NDArray, bigger than the first.

Can i instantiate a bigger NDArray in some easier way? 

Thanks,

Marco

Aviso Legal: Esta mensagem e seus anexos podem conter informações confidenciais e/ou de uso restrito. Observe atentamente seu conteúdo e considere eventual consulta ao remetente antes de copiá-la, divulgá-la ou distribuí-la. Se você recebeu esta mensagem por engano, por favor avise o remetente e apague-a imediatamente.

Disclaimer: This email and its attachments may contain confidential and/or privileged information. Observe its content carefully and consider possible querying to the sender before copying, disclosing or distributing it. If you have received this email by mistake, please notify the sender and delete it immediately.


References:
Increasing NDArray XSize and YSize with areaDetector Marco A. Barra Montevechi Filho via Tech-talk

Navigate by Date:
Prev: Increasing NDArray XSize and YSize with areaDetector Marco A. Barra Montevechi Filho via Tech-talk
Next: Re: Why does libca.so depend on libreadline.so? Dmitry Yu. Bolkhovityanov via Tech-talk
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  2018  2019  2020  2021  2022  <20232024 
Navigate by Thread:
Prev: Increasing NDArray XSize and YSize with areaDetector Marco A. Barra Montevechi Filho via Tech-talk
Next: Save the date! Timo Korhonen via Tech-talk
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  2018  2019  2020  2021  2022  <20232024 
ANJ, 09 May 2023 Valid HTML 4.01! · Home · News · About · Base · Modules · Extensions · Distributions · Download ·
· Search · EPICS V4 · IRMIS · Talk · Bugs · Documents · Links · Licensing ·