Apply Region Filter on Images with no Scale Info
-
- Posts: 16
- Joined: Mon May 25, 2020 9:53 am
Apply Region Filter on Images with no Scale Info
Hi,
When retrieving subimages from a ZenImage container the scaling is lost. We would like to apply region filters based on the feature size in mikrometers. The image analysis settings are applied automatic and since binning and objective may vary I wonder if there is a way to change the numbers of pixels in the region filter automatically? We currently use ZenCore 3.1.
Best regards
Fredrik Olsson
When retrieving subimages from a ZenImage container the scaling is lost. We would like to apply region filters based on the feature size in mikrometers. The image analysis settings are applied automatic and since binning and objective may vary I wonder if there is a way to change the numbers of pixels in the region filter automatically? We currently use ZenCore 3.1.
Best regards
Fredrik Olsson
-
- Posts: 180
- Joined: Wed May 20, 2020 10:10 am
Re: Apply Region Filter on Images with no Scale Info
Hello Fredrik Olsson,
something like
for each individual subimage.
I hope this solves your problem.
maybe a workaround is to read the scaling (X,Y,Z) of the ZenImage and applying the scaling to the subimages.the scaling is lost
something like
Code: Select all
imageSub.Scaling.X = imageMain.Scaling.X
imageSub.Scaling.Y = imageMain.Scaling.Y
imageSub.Scaling.Z = imageMain.Scaling.Z
I hope this solves your problem.
-
- Posts: 16
- Joined: Mon May 25, 2020 9:53 am
Re: Apply Region Filter on Images with no Scale Info
Yes it works.
However, the unit becomes somehow nm instead of µm. The magnitude of different feature dimensions seems ok although now in nm, but one need to consider the shift in units when setting up the ias and the region filter. For instance, if 2 µm is the target for minimum Bound Height one need to fill in 2000 instead of 2.
BR
Fredrik Olsson
However, the unit becomes somehow nm instead of µm. The magnitude of different feature dimensions seems ok although now in nm, but one need to consider the shift in units when setting up the ias and the region filter. For instance, if 2 µm is the target for minimum Bound Height one need to fill in 2000 instead of 2.
BR
Fredrik Olsson
-
- Posts: 180
- Joined: Wed May 20, 2020 10:10 am
Re: Apply Region Filter on Images with no Scale Info
Hello Fredrik Olsson,
thanks for your reply!
The problem will be discussed internally and I will try to get a fix for that!
thanks for your reply!
The problem will be discussed internally and I will try to get a fix for that!
-
- Posts: 180
- Joined: Wed May 20, 2020 10:10 am
Re: Apply Region Filter on Images with no Scale Info
Hello Fredrik Olsson,
meanwhile there is an open bug concerning your problems with scaling.
We will fix this by including the ScalingUnits (X,Y,Z) in the macro interface.
As we could not reproduce your case easily it would be interesting for us to get a code snippet showing the problem!
Thank you!
meanwhile there is an open bug concerning your problems with scaling.
We will fix this by including the ScalingUnits (X,Y,Z) in the macro interface.
As we could not reproduce your case easily it would be interesting for us to get a code snippet showing the problem!
Thank you!
-
- Posts: 16
- Joined: Mon May 25, 2020 9:53 am
Re: Apply Region Filter on Images with no Scale Info
Hi,
I have used something like:
for item in self.posList:
xPos = item.X
yPos = item.Y
Zen.Devices.Stage.MoveTo(xPos, yPos)
if imageCollection:
if Count == 0:
try:
Zen.Acquisition.AutoExposure()
except:
sys.exit('Autoexposure failed')
first = Zen.Acquisition.AcquireImage()
first.Name = sampleName + '_' + str(Count)
first.Save(destFolder + '\\' + first.Name + '.czi')
container = ZenImage()
container.AddSubImage(first,0,0,Count)
else:
image = Zen.Acquisition.AcquireImage()
image.Name = sampleName + '_' + str(Count)
container.AddSubImage(image,0,0,Count)
##and later...
imageFirst = Zen.Application.LoadImage(destfolder + ‘\\’ sample_data.getSample_ID() + ‘_0.czi’)
images = Zen.Application.LoadImage(destfolder + ‘\\’ sample_data.getSample_ID() + ‘.czi’)
for nr in range(1,NrOfImages + 1):
image = images.CreateSubImage('Z('+str(nr)+')')
image.Name = sample_data.getSample_ID() + '_' + str(nr) + '.czi'
image.Scaling.X = imageFirst.Scaling.X
image.Scaling.Y = imageFirst.Scaling.Y
--------------------------------------------------------------------
and so on...
BR
Fredrik Olsson
I have used something like:
for item in self.posList:
xPos = item.X
yPos = item.Y
Zen.Devices.Stage.MoveTo(xPos, yPos)
if imageCollection:
if Count == 0:
try:
Zen.Acquisition.AutoExposure()
except:
sys.exit('Autoexposure failed')
first = Zen.Acquisition.AcquireImage()
first.Name = sampleName + '_' + str(Count)
first.Save(destFolder + '\\' + first.Name + '.czi')
container = ZenImage()
container.AddSubImage(first,0,0,Count)
else:
image = Zen.Acquisition.AcquireImage()
image.Name = sampleName + '_' + str(Count)
container.AddSubImage(image,0,0,Count)
##and later...
imageFirst = Zen.Application.LoadImage(destfolder + ‘\\’ sample_data.getSample_ID() + ‘_0.czi’)
images = Zen.Application.LoadImage(destfolder + ‘\\’ sample_data.getSample_ID() + ‘.czi’)
for nr in range(1,NrOfImages + 1):
image = images.CreateSubImage('Z('+str(nr)+')')
image.Name = sample_data.getSample_ID() + '_' + str(nr) + '.czi'
image.Scaling.X = imageFirst.Scaling.X
image.Scaling.Y = imageFirst.Scaling.Y
--------------------------------------------------------------------
and so on...
BR
Fredrik Olsson
-
- Posts: 180
- Joined: Wed May 20, 2020 10:10 am
Re: Apply Region Filter on Images with no Scale Info
Thank you Fredrik Olsson!
I will come back on the scaling-problem when there is a solution available.
I will come back on the scaling-problem when there is a solution available.
-
- Posts: 180
- Joined: Wed May 20, 2020 10:10 am
Re: Apply Region Filter on Images with no Scale Info
Hello all,
the next version Zen Core 3.4 allows to transfere the scaling from one image to another
e.g.:
imageNew.Scaling = imageOriginal.Scaling
the next version Zen Core 3.4 allows to transfere the scaling from one image to another
e.g.:
imageNew.Scaling = imageOriginal.Scaling
-
- Posts: 2
- Joined: Wed Oct 04, 2023 5:29 am
Re: Apply Region Filter on Images with no Scale Info
This scaling factor can be obtained from the image's metadata or by calibrating the system using known standards. Once you have the pixel dimensions, you can manually adjust the area filter settings in ZenCore to match your desired feature size.