add / apply custom databar to image in DigitalMicrograph GMS3

懵懂的女人 提交于 2019-12-08 06:56:39

问题


I have an image that I want to apply a custom databar to via a script in DigitalMicrograph 3.21.1374.0. I would also like to apply a custom layout (separate question here: Apply Custom Layout to Image in DigitalMicrograph GMS3).

The procedure that I currently do by hand is:

  1. Right click on the image
  2. Hover on layout (in context menu)
  3. Left click "Add Databar"
  4. Select the custom databar in dialog that pops up (the one I want is called "CheckDataBar")
  5. Click OK

This works flawlessly - except that I would like to run a script to do it (so I can loop all the open images and apply the databar).

Here is the code that I have so far to do just one image:

//main - get front image and apply custom databar
image Img := GetFrontImage()
imageDisplay imgDisplay = Img.ImageGetImageDisplay(0)

ApplyDataBar(imgDisplay)//this only adds the scale bar not the custom databar that i would like

I have tried ApplyDataBar(imgDisplay, CheckDataBar) but that does not work.

Any ideas?


回答1:


ApplyDatabar() is an old command from earlier GMS versions and will only add the scalemarker.

However, this answer to your other question ( applying layouts ) can also be used to apply the databar, provided the databar is part of the layout.

So, you have to create a layout which contains the custom databar first. Then you apply the layout to the imageDocument not the imageDisplay.



来源:https://stackoverflow.com/questions/50819924/add-apply-custom-databar-to-image-in-digitalmicrograph-gms3

标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!