Tiles Mod Gaps and Contrast Difference

In this subforum specific Topics concerning ZEN Core, e.g workbenches, are discussed
Post Reply
Ali Yağız Şahin
Posts: 3
Joined: Fri Mar 17, 2023 10:33 am

Tiles Mod Gaps and Contrast Difference

Post by Ali Yağız Şahin »

Hi,

When use tiles, we see gap on the edges of the picture.The gap dimensions change when fine adjustment with the camera.
In addition, there is a contrast difference in each square images after the process completed. I need to do shading correction. So what is the best tool for this?

Is there a solutions for these issues.
Julien Toquant
Posts: 23
Joined: Fri May 29, 2020 1:54 pm

Re: Tiles Mod Gaps and Contrast Difference

Post by Julien Toquant »

Hi,

After stitching your image, the gaps on image edges are indeed produced by misalignment between the camera and the scanning stage. You can crop your stitched image in order to remove these gaps.
In order to do so, you can use the IP function "create image subset" in the image processing workbench in ZEN Core.

The shading issue can be compensated by shading correction (IP Function "shading correction").
You can do an automatic correction or a correction using a reference image.

The reference image must be acquired on an "empty" field of view (FOV).
You can also use this empty FOV to generate a shading correction for a given objective, which will be applied to each acquisition. This camera parameter can be found under "extended camera parameter" tool (post processing).
For transmitted light, one usually removes the sample to obtain the empty FOV.
For reflected light, one usually uses a clean mirror or de-focus the sample.
For fluorescence, one usually uses homogeneous reference slides (auto-fluorescent polymer).

Finally, you can use the following code in ZEN Core OAD, which does calculate a shading reference out of tile image and which is used for stitching and to correct shading:

Code: Select all

# read from input
image = Zen.Application.ActiveWorkbench.GetDefaultInputValue()
imagename = image.NameWithoutExtension
# calculate shading reference from tile image
out = Zen.Processing.Adjust.ShadingReferenceFromTileImage(image, False, False, True, 1, True, 100, False)
# Low pass of the shading reference
out2 = Zen.Processing.Filter.Smooth.Lowpass(out,10,301,301,1,0,False)
# stitch primary input image with low pass of calculated shading reference image + fusing
# stitch setting must have been done via ZEN Blue (for ex. with fuse option and using correction from reference image) and exported accordingly to the line code below
stitchsetting1 = Zen.Processing.Transformation.Settings.StitchingSetting("c:\\Temp\\stitch1.czips")
out3 = Zen.Processing.Transformation.Geometric.Stitching(image,out2,stitchsetting1)
# save processed image
out3.Save('C:\\Temp\\' + imagename + '_processed.czi')
out3.Close()
strMessage = 'Processed image saved under C:\\Temp\\'
Zen.Application.Pause(strMessage)
The code makes use of a stitching setting (named "stitch1") made under ZEN blue and exported into "C:\temp" folder, which is also the folder where you will find the processed image.
Ali Yağız Şahin
Posts: 3
Joined: Fri Mar 17, 2023 10:33 am

Re: Tiles Mod Gaps and Contrast Difference

Post by Ali Yağız Şahin »

Hi Julien Toquant,

Thank you for your feedback. I will apply what you mentioned. But I wish there was no gaps :)

Best regards,
Ali Yağız ŞAHİN
Julien Toquant
Posts: 23
Joined: Fri May 29, 2020 1:54 pm

Re: Tiles Mod Gaps and Contrast Difference

Post by Julien Toquant »

Hi,

Well, if you align the camera with the stage "perfectly", the gaps can be heavily reduced, almost to the point that they're not visible anymore (especially when you have high number of tiles).
There are some rotatable camera adapters to facilitate the alignment.
But if you look pixel precise, there will always be misalignment (less than a pixel is impossible since pixels discretize the reality). That is a physical limit.
Wilaim Jack
Posts: 2
Joined: Fri Dec 01, 2023 9:19 pm

Re: Tiles Mod Gaps and Contrast Difference

Post by Wilaim Jack »

It sounds like you are dealing with issues related to tiling, alignment, and shading correction in your images. To address these concerns, you may need a combination of tools to achieve the desired results. Here are some suggestions:

Tiling and Alignment:
Adobe Photoshop:

Use the "Align" and "Distribute" options to ensure proper alignment of tiles.
Check for any spacing issues and use the "Snap" feature to align tiles precisely.
ImageJ/FIJI:

ImageJ and its distribution FIJI are powerful open-source tools for image analysis.
Plugins like "Grid/Collection Stitching" can help with tiling and alignment.
Shading Correction:
Adobe Photoshop:

Utilize the "Curves" adjustment layer to correct shading issues.
Dodge and Burn tools can also be used for local adjustments.
ImageJ/FIJI:

Plugins like "Shading Correction" can help correct uneven illumination.
MATLAB or Python with OpenCV or scikit-image:

For more advanced users, programming languages like MATLAB or Python, along with image processing libraries like OpenCV or scikit-image, offer extensive control over image correction processes.
Overall Recommendations:
Batch Processing:

If you have a large number of images, consider using tools that support batch processing to streamline the workflow.
Calibration:

Ensure that your camera and imaging setup are calibrated to reduce variations in illumination and color.
Professional Imaging Software:

Consider specialized imaging software designed for scientific or professional use, as they often have advanced features for calibration and correction.
Consult Experts:

If your images are crucial and the issues persist, consider consulting with imaging experts or professionals who can provide tailored solutions.
Remember to keep backups of your original images before making extensive modifications, and always test your workflow on a small subset of data before applying changes to the entire dataset to avoid unintended consequences.
Post Reply