Questions tagged [dm-script]

A scripting-language used within the DigitalMicrograph software.

DigitalMicrograph is a commercial software on the Windows platform created and sold by Gatan Inc..
The software is widely used in electron microscopy but provides general image and data processing routines for up to 5-dimensional data.

The software contains its own scripting programming language focused on image analysis, which is generally referred to as "DigitalMicgrograph scripting" or "DM scripting".

The tag indicates questions involving this scripting language.

Additional information as well as an unrestricted basic version of the software (including the scripting language) can be found on the Gatan webpage.

341 questions
3
votes
1 answer

DM script to calculate area under a curve with given ROI

I want to calculate the area under a curve with giving ROI, like the attached picture, I want to get the area under the green curve from 13 to 30, could we reach this function by DM scripting? Never done similar things before, any suggestions…
together
  • 413
  • 2
  • 11
3
votes
1 answer

How to shift the column in a SI image

In order to perform drift correction in a SI image as shown in the following figure: I write the code : number max_shift=5 image src := GetFrontImage() number sx, sy, sz src.Get3DSize(sx, sy, sz) result("sx: "+sx+"\n") result("sy:…
Renfong
  • 153
  • 6
3
votes
1 answer

Copying an XY calibration from a 2D image to a 3D image

How can I copy the 2D axes calibration of an image, to a 3D dataset of the same size, except that has an additional depth dimension?
TomNorway
  • 2,584
  • 1
  • 19
  • 26
3
votes
2 answers

How do I rotate a 3D spectrum-Image in Digital Micrograph by scripting?

I want to find the equivalent of the rotate(image, degree) script command to rotate around the x or y axis (I only need 90º rotations). I know I can do it using the tool menu but it would be much faster if I could find a command or a function to do…
3
votes
2 answers

Multiply a STEM datacube by an image

I would like to multiply the intensity of a EELS datacube with the thickness map. I tried with simple math command but I only obtain the result for the first slice. I think that the calculation is as simple as doing Result(x,y,E) = SI(x,y,E) *…
3
votes
2 answers

Can we get the image that is not in front by DM script?

I have questions regarding dealing with multiple images of a series: When we are coding, we can get the front image by image front:=GetFrontImage(). Can I also get the image that is not in front? For example, if there are total 20 images, can I…
together
  • 413
  • 2
  • 11
2
votes
1 answer

How to use the top right corner of an annotation as the positioning anchor

Hi, all: I'd like to add one annotation in the image and use the top right corner as the positioning anchor. Currently, I know how to use the top left corner. But I tried different commands and failed to use top right corner. Does anyone know how to…
ChenZX
  • 293
  • 4
2
votes
1 answer

What does CountImages() actually do?

The command CountImages() has unexpected behaviors. I found it can return a number > 0 even if there is no image in sight anywhere. I have also noticed that it can count all displayed images twice. Sometimes, it does what it seems to suggest at…
E Voelkl
  • 259
  • 1
  • 6
2
votes
1 answer

What's the difference between DLGTableLayOut(2, 1, 0) and DLGLayout(DLGCreateTableLayout(2, 1, 0))

all: In the DM manual, I saw there are two ways to define layout, DLGTableLayOut(2, 1, 0) and DLGLayout(DLGCreateTableLayout(2, 1, 0)). I tried them, and seems the same. Is there any difference? Regards Chen ZX
ChenZX
  • 293
  • 4
2
votes
1 answer

What's the difference between DLGAnchor and DLGSide

all: I found that there are two method to align the widgets, DLGAnchor and DLGAlign. It seems the function of these two are the same. Could anyone give an example about the usage difference? Regards Chen ZX
ChenZX
  • 293
  • 4
2
votes
1 answer

The user mode of DM is not updated after changing the global tag group

Hi, all: I'd like to change the user mode at Help->User Mode from Regular to Power user by using script (see below). After running the script, the global tag group has changed, but the tick at Help->User Mode doesn't change. It seems that the tag…
ChenZX
  • 293
  • 4
2
votes
2 answers

Dual type of return value

all: I'd like to construct a function. The type of return value may have two possibilities: number or string. At first, I thought I can use the overloading function (see the code). But this function must have different type of input. So the belowing…
ChenZX
  • 293
  • 4
2
votes
1 answer

Opening ImageDocument from Files

In my script, I saved an ImageDocument to my local drive as a Gatan file. I've used the command ImageDocumentGetCurrentFile() to get that file's path. Now I'm trying to load that file back into my DM workspace using OpenFileForReadAndWrite() with…
2
votes
2 answers

Separating and combining ImageDisplay layers

Is it possible in DM-script to take an ImageDisplay containing multiple layers and separate those layers into different image windows? And conversely, is it possible to overlay separate displays to form one multi-layer display through script? My…
2
votes
1 answer

which slice of a multi-slice lineplot is selected?

Given a multi-slice lineplot, one of the slices can be selected by clicking it in the legend with the mouse. From the scripting side, there is a command to imgdsp.ImageDisplaySetSliceSelected(). But I can't find a command that lets me determine…
E Voelkl
  • 259
  • 1
  • 6
1
2 3
22 23