I am happily using the OAD module, creating several helpful scripts. However, I still cannot found a complete documentation (links are welcome!) and thus I miss some functions. In particular, I want to acquire an EDF image like in the ZEN menu. I would like something like:
image = Zen.Acquisition.AcquireImageWithEDF (zmin, zmax)
I cannot find anything useful on the forum, as well as on Github. However "EDF" is present in the OAD help, so I think it is possible to use it. If a simple function like the one I suggested is not present, can you show me a script to combine a set of images at different z to a single EDF image?
Thank you
Acquire EDF image
-
- Posts: 180
- Joined: Wed May 20, 2020 10:10 am
Re: Acquire EDF image
Hello Danilo Lussana,
I would recommend the following steps:
* Set up your ZStack experiment manually on the acquisition tab of Zen blue
* Start the experiment so that you know that it is running
* Finally save the experiment as 'MyZStack'.
* Execute the macro:
You can improve the macro e.g. by saving an EDF-Setting and hand it over to the EDF-function.
I hope this helps ...
I would recommend the following steps:
* Set up your ZStack experiment manually on the acquisition tab of Zen blue
* Start the experiment so that you know that it is running
* Finally save the experiment as 'MyZStack'.
* Execute the macro:
Code: Select all
zenExperiment = ZenExperiment()
zenExperiment.Load("MyZStack")
imageZStack = Zen.Acquisition.Execute(zenExperiment)
imageEDF = Zen.Processing.Filter.Sharpen.EDF(imageZStack)
Zen.Application.Documents.Add(imageEDF)
I hope this helps ...
-
- Posts: 2
- Joined: Fri Dec 17, 2021 11:32 am
Re: Acquire EDF image
Thanks, but the problem is that I can't record experiments because I'm using ZenCore and not Zen Blue. However, I think I have found a solution. The experiment output is a ZenImage object with all individual images. I got the same object using Add.SubImage (), then I processed it with Zen.Processing.Filter.Sharpen.EDF (). It works fine for me.
At the bottom you will find a function that is basically the one I asked for in the first post. I hope it will be useful to someone else, also because I think it is more flexible than the experiment way, you can dynamically change the range for z-stack.
Would you like to add a comment? Did I miss any important aspects?
Thanks again.
and then it can be used like:
At the bottom you will find a function that is basically the one I asked for in the first post. I hope it will be useful to someone else, also because I think it is more flexible than the experiment way, you can dynamically change the range for z-stack.
Would you like to add a comment? Did I miss any important aspects?
Thanks again.
Code: Select all
def AcquireWithEDF(step,slices):
if slices%2==0:
slices=slices+1 #so we have the actual focus slice and the same number of slices over and under
#get actual z
z0 =Zen.Devices.Focus.ActualPosition
#create Z-stack images object
z_stack=ZenImage()
#acquire images
for i in range(slices):
z=z0+(i-int(slices/2))*step
Zen.Devices.Focus.MoveTo(z)
image=Zen.Acquisition.AcquireImage()
#image.Save('d:\\EDF\\provaEDF'+str(i+1)+'.jpg')
z_stack.AddSubImage(image,0,0,i)
#return to original z
Zen.Devices.Focus.MoveTo(z0)
#Combining images with EDF
processingsetting = Zen.Processing.Filter.Settings.EDFSetting()
processingsetting.Method = ZenExtendedFocusMethod.Wavelets
processingsetting.WaveletSetting.ZStackAlignment = ZenAlignmentQuality.NoAlignment
EDFimage = Zen.Processing.Filter.Sharpen.EDF(z_stack, processingsetting)
return EDFimage
Code: Select all
img=AcquireWithEDF(10,12)
img.Save('d:\\EDF\\provaEDF.jpg')
-
- Posts: 180
- Joined: Wed May 20, 2020 10:10 am
Re: Acquire EDF image
Dear Danilo Lussana,
yes, you can do it by building up a ZStack image step by step and then call EDF-function.
Sorry for leading you in the direction of Zen blue but there is a separate part within the forum for "ZEN Core Specific Topics" ...
yes, you can do it by building up a ZStack image step by step and then call EDF-function.
Sorry for leading you in the direction of Zen blue but there is a separate part within the forum for "ZEN Core Specific Topics" ...