dm-script

Master of threads under DigitalMicrograph

三世轮回 提交于 2019-12-11 01:44:16
问题 I have created two threads in DigitalMicrograph and they are executed as soon as the script is executed. I want something different. Let's imagine two buttons for the threads (start and stop thread). How can I add code to activate the threads only when I push buttons ? It would be very helpful if you had a code exemple for me. 回答1: There are a couple of things to consider: You can not allocate new objects from within the UIframe object. (To be more precise: From a method invoked by a UI

How to detect when a live DigiScan image has finished acquiring a complete frame with an event handler?

心已入冬 提交于 2019-12-11 00:58:51
问题 I am looking to take snapshots of a live DigiScan image. However, I want to do so only when a complete (or nearly so) frame has been acquired! Attaching an event handler to a live DigiScan image does not work, as the image 'changes' with each line acquired serially. I am hoping to monitor just the last few pixels of the live image and only capture an image when those change. Is this possible? 回答1: Your suggestion is exactly what I did: Using the data_changed event as a trigger, and in the

How can one synchronize an external application with a DigitalMicrograph script?

◇◆丶佛笑我妖孽 提交于 2019-12-09 04:37:30
This question has been inspired by the question 'Call script from command line' . How can one write a script which acts on 'trigger events' in an application other than DigitalMicrograph? i.e. some script functionality should be triggered by an external application. The scripting language does not offer many 'external' interfaces in its current state. It is possible to call out to an external process with the command LaunchExternalProcess and wait for the process to complete, but there is no straight-forward way for an external process to call in , i.e. to start a script-action within

Scripting Support For Image Filtering in DigitalMicrograph

纵饮孤独 提交于 2019-12-08 07:17:03
问题 We can access a configured image filter with these functions: Image IFMApplyFilter( Image& unfiltered, String filtername ) void IFMApplyFilterInPlace( Image& unfiltered, String filtername ) Image IFMApplyFilterToSeries( Image& unfiltered, String filtername ) void IFMApplyFilterToSeriesInPlace( Image& unfiltered, String filtername ) Is there a way to configure an image filter directly by scripting? For example, I would like to create a filter by combining default filters such as "Hanning

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: Right click on the image Hover on layout (in context menu) Left click "Add Databar" Select the custom databar in dialog that pops up (the one I want is called "CheckDataBar") Click OK This works flawlessly - except that I

add / apply custom databar to image in DigitalMicrograph GMS3

被刻印的时光 ゝ 提交于 2019-12-07 16:21:25
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: Right click on the image Hover on layout (in context menu) Left click "Add Databar" Select the custom databar in dialog that pops up (the one I want is called "CheckDataBar") 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

Scripting Support For Image Filtering in DigitalMicrograph

强颜欢笑 提交于 2019-12-07 00:12:36
We can access a configured image filter with these functions: Image IFMApplyFilter( Image& unfiltered, String filtername ) void IFMApplyFilterInPlace( Image& unfiltered, String filtername ) Image IFMApplyFilterToSeries( Image& unfiltered, String filtername ) void IFMApplyFilterToSeriesInPlace( Image& unfiltered, String filtername ) Is there a way to configure an image filter directly by scripting? For example, I would like to create a filter by combining default filters such as "Hanning Window" and "Combined Filter", and changing filtering parameters "Window Strength", "Outer Radius (Nyquist)"

Creating an image of difference of adjacent pixels with digitalmicrograph (DM) script

半腔热情 提交于 2019-12-06 22:25:12
The following digitalmicrograph function tries to create an image by taking difference of neighboring pixel in a sub-row of a row of the image. The first pixel is replaced with a mean of the difference result of the sub-row thus created. E.g. If the input image is 8 pixels wide and 1 rows tall and the sub-row size is 4 - In_img = {8,9,2,4,9,8,7,5} Then the output image will be - Out_img = {mean(8,9,2,4)=5.75,9-8=1,2-9=-7,4-2=2,mean(9,8,7,5)=7.25,8-9=-1,7-8=-1,5-7=-2} When I run this script, the first pixel of the first row is correct but rest of the pixels are incorrect. When I set the loop

How to arbitrarily extract a specific subset of images from a dataset?

江枫思渺然 提交于 2019-12-02 14:09:50
问题 Recently I'm planning to manipulate a stack of images and the goal is to extract a specific subset of slices from there, for example only even or odd or arbitrary indexes, and then save them into another dataset. In DM, there are a number of helpful functions in the Volume menu but unfortunately, they cannot really fullfill what I want to do. I am just wondering whether this idea can be realized via scripting. Many thanks for your help in advance. 回答1: There are two ways you can go about it,

How could I open more than one image with a single dialog in Digital Micrograph script?

拟墨画扇 提交于 2019-12-02 09:08:07
问题 I am writing in DigialMicrograph scripting. I want a script to open more than one image in a single dialog, a multi-select image dialog, similar to when you go to any Windows open dialog, select several images and press Ok. I think that this is possible but I haven't found a way to do it. I want to introduce this specific code in my script, to avoid image-opening prior to running the script. I know the function OpenDialog but this only allows opening of a single image. Could anybody show me