dm-script

Can one get a list of fonts available for text annotations in DM scripting?

允我心安 提交于 2021-02-11 07:25:28
问题 One can create text annotations on image displays via the function NewTextAnnotation and then change the font via the method ComponentSetFontFaceName. However to do so successfully, one must provide the full name of the desired font as a string and one must already know that it is available on the current system. If one specifies an unavailable font, some default font seems to be chosen and no exception or error message is posted. Is there any way to get a list of available fonts within a DM

How to convert DM-script files (*.s) into a plugin file (*.gtk)

混江龙づ霸主 提交于 2021-01-29 02:26:46
问题 I have written some DM-script files ( .s), and thus I would like to convert (compile?) them into plugin files ( .gtk). In this case, should I prepare some kind of compiler and Gatan Software Development Kit (SDK) package, or others? If there is a good way, please teach the procedure in detail. I will be really grateful, if you share some wisdom to create *.gtk files. 回答1: .GTK files are not compiled - you will not gain any speed benefit of having them in a .gtk (or .gt1, .gt2 ) file. They are

How to getting acquired frames at full speed ? - Image Event Listener does not seem to be executing after every event

邮差的信 提交于 2021-01-28 21:52:04
问题 My goal is to read out 1 pixel from the GIF camera in VIEW mode (live acquisition) and save it to a file every time the data is updated. The camera is ostensibly updating every 0.0001 seconds, because this is the minimum acquisition time Digital Micrograph lets me select in VIEW mode for this camera. I can attach an Image Event Listener to the live image of the camera, with the message map ( messagemap = "data_changed:MyFunctiontoExecute" ), and MyFunctiontoExecute is being successfully ran,

How to enable-disable an element in dialog object - DLGEnabled

房东的猫 提交于 2021-01-28 12:13:06
问题 Why is the following script not disabling the push button, as it is supposed to do? class ElementEnableTest : UIFrame { void Action( object self ) { self.LookUpElement("StopButton").DLGEnabled(0); result( "button clicked\n" ); }; ElementEnableTest( object self ) { TagGroup tgDialog = DLGCreateDialog( "" ); TagGroup tgButton = DLGCreatePushButton("stop","Action"); tgButton.DLGIdentifier("StopButton"); tgDialog.DLGAddElement( tgButton); self.init( tgDialog ); self.Display( "test" ); }; }; alloc

DM Script to import a 2D image in text (CSV) format

纵然是瞬间 提交于 2021-01-28 09:20:42
问题 Using the built-in "Import Data..." functionality we can import a properly formatted text file (like CSV and/or tab-delimited) as an image. It is rather straight forward to write a script to do so. However, my scripting approach is not efficient - which requires me to loop through each raw (use the "StreamReadTextLine" function) so it takes a while to get a 512x512 image imported. Is there a better way or an "undocumented" script function that I can tap in? 回答1: DigitalMicrograph offers an

Fastest way to see which pixel has changed when using a listener

大兔子大兔子 提交于 2021-01-28 08:54:00
问题 I am trying to get EDS spectra on every scanned pixel using STEM. I am using the EDSStartAcquisition( 2048, 10,fexposure*2, 1) command and I have attached the following simple listener object into the shown 1D spectrum image: string messagemap = "data_value_changed:MyImageAction" Class MyListenerClass1 { String event_desc; MyListenerClass1(Object self); //Result("\n"); ~MyListenerClass1(Object self);// Result("\n"); Void MyImageAction(Object self, Number e_fl, Image Img) { ImageGetEventMap()

Fast Cumulative Sum?

强颜欢笑 提交于 2021-01-28 06:09:47
问题 The menu command "Volume > Projection > Project Along Z" is really fast as compared to scripting (even with intrinsic variables). Cumulative sum (projection) of a 3D image volume of 512x512x200 in z-direction takes <0.5 sec. as compared to >8 sec. by using script. Is there a direct access this script function other than using ChooseMenuItem()? Script example showing the difference: // create an image of 512x512x200, assign random numbers image img := exprsize(512, 512, 200, random()); img

how to import tif calibration into DM

那年仲夏 提交于 2020-06-28 09:18:18
问题 We need to treat the SEM images from FEI and Zeiss tools in DigitalMicrograph. They are stored as tif. DigitalMicrograph can read 2D tif but images appear uncalibrated in X,Y directions. Is there any import plugIn that transfers the calibration information ? Alternatively, I can imagine that the calibration can be red directly from a stream. Has anyone a clear idea about the offset where such numbers are stored in a stream of tif? I am not very familiar with organization of tif and I know

DM-Script: Extract TagGroups of variable/unknown structure

拟墨画扇 提交于 2020-05-17 03:26:09
问题 My task seemed to be really easy: Use the TagGroup and extract the tree structure and the data of an unknown structure into the result log. So I want to get the name and the value and all the names and values of the children to be displayed in the results. How do I do this? I have the following (example) Tag structure: The documentation writes about the TagGroup and also contains one example using TagGroupGetTagType() . The returned value can then be used to find the structure. I wrote and

Has deployment of dialog graphics changed in GMS3?

放肆的年华 提交于 2020-05-16 02:22:13
问题 I make extensive use of graphic elements in DM dialogs, mainly for visual feedback. Although I have used these successfully in GMS1 and GMS2, I have not yet gotten these to behave correctly in GMS3. I wonder whether I am deploying them incorrectly. The example script below illustrates my two main problems, a mismatch between the size of the graphic element and its associated bit map, and a strange contrast mapping (to black) for bit map values of 240 or RGB(240, 240, 240): class