How to change settings in Ima for GETTEXTFILE

  • 25 June 2022
  • 1 reply



I am  trying to calculate multimode fiber coupling efficiency by using Geometric Image Analysis through GETTEXTFILE, and I want to do this for different fields and wavelengths. I am trying to change field# and wavelength# by MODIFYSETTINGS, but looks like these two parameters are not allowed to be changed. Following is the list of parameters that MODIFYSETTINGS provides:



I wonder if anyone knows how to make the changes so I can do this calculation using ZPL.





Best answer by David.Nguyen 27 June 2022, 10:55

View original

1 reply

Userlevel 6
Badge +2

Hi Jizuo,


As you have noted, the field and wave numbers don’t seem to be editable with MODIFYSETTINGS in ZPL. One solution, if you want to keep using ZPL, is to manually create multiple CFG files prior to running the macro. Each CFG file would have a field and wave number that is identified in its name, and whenever you run an analysis, you start by specifying the CFG file you require with:

OPENANALYSISWINDOW type, settingsfilename


For example, you could have a CFG file syntax like so:



And so, for field 1, and wavelength 1, your CFG file is called: MyCFGFile_1_1.CFG, and for field 1, and wavelength 2, it is: MyCFGFile_1_2.CFG, ...etc.

Then, when you call OPENANALYSISWINDOW, you specified which CFG file to use, therefore, which field and wavenumber:



It does require you to create those CFG files manually once before though.

Otherwise, I think you have to use the ZOSAPI until it gets implemented (if ever) in ZPL. In the ZOSAPI, the field and wave numbers are already implemented:

And so, you can access those directly with:

# Open Geometric Image Analysis
MyIma = TheSystem.Analyses.New_GeometricImageAnalysis()

# Retrieve settings
MyImaSettings = MyIma.GetSettings()

# Modify field number to field 2

# Apply settings and run analysis


I hope this helps. Take care,