Questions tagged [dm-script]
A scripting-language used within the DigitalMicrograph software.
298
questions
1
vote
1
answer
30
views
Pixel-wise operations - ImageCallFunctionAtPositions
There are new script functions in GMS 3.4.x for pixel-wise operations. Can someone give short examples on how to utilize these functions?
void ImageCallFunctionAtPositions( BasicImage src, BasicImage ...
1
vote
1
answer
25
views
Concerning extracting the size info of the image
I am trying to extract the dimension size info of the image with GetSize() and Get3DSize() as follows:
try { 2DData.Get3DSize (sizeX, sizeY, sizeZ); }
catch { 2DData.GetSize (sizeX, sizeY); Break; }
...
1
vote
2
answers
33
views
Any dialog window in DM that will not block the whole program?
I would like to know whether there is a kind of pup-up dialog that will not block the whole program. In the following simplified example, the standard deviation of a test image is calculated and then ...
0
votes
0
answers
19
views
Tackling Disconnection Problem in Gatan Digital Micrograph - Any Suggestions and Solutions?
My apologies that my post is to seek for suggestions/solutions but not particularly on the scripts problem itself. Unfortunately i am not sure where else i can ask this question.
Here it goes for the ...
1
vote
1
answer
25
views
Assigning hotkeys to DigitalMicrograph functions and scripts?
In GMS2, there was an area to easily assign hotkeys to certain built-in functions (eg. Save As..., Rotate). It seems that was removed in GMS3. Is it possible to script a hotkey for those items and any ...
1
vote
1
answer
34
views
how to live update box field in DM
I would like a create a box with the field being update by another function (a loop in my example).
Each time value changes, the display should change.
My first attempt create a box which displays ...
2
votes
1
answer
47
views
how to get the length scale, length unit, energy scale and energy unit from a EELS map data by DM script
I want to get length scale, length unit, energy scale, and energy unit from an EELS map data by DM script
source.ImageGetDimensionCalibration(0, sOrig, sScale, sUnit, 0)
source....
1
vote
1
answer
40
views
Is there a function for reading file location from a file open in DM
Is there a function for reading "file location" from an image open in DM?
Under ImageInfo/Image/Info, at the bottom of the window, I can read the path under "File location".
Can I ...
2
votes
1
answer
59
views
Is it possible to speed up scripts using multi-threading?
I have to perform CPU intensive analysis on data in DigitalMicrographs's DM-script language.
I noticed that only a single CPU core maxes out during processing. Is there a way to achieve better ...
1
vote
2
answers
55
views
How to rotate Annotations when converting HDF5 files to dm3?
I am working on converting Velox file (HDF5) to .dm3 file using Tore Niermann's plugin (gms_plugin_hdf5) to read string. Annotations on HDF5 file also need to transfer to .dm3 file. HDF5 file maybe ...
3
votes
1
answer
49
views
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 ...
2
votes
2
answers
142
views
How to convert a .dm3 file (with annotation and scale bar) to .jpg/jpeg image?
I wonder how to convert a dm3 file into .jpg/jpeg images? there is test annotation and scale bar on the image. I setup a script but it always show that "the format cannot contain the data to be ...
1
vote
1
answer
46
views
Convert EELS map to line scan data but DM 3.0 still recognize it as a map
I wrote a script to convert the EELS map to EELS line scan data, and it works well with DM 2.0. I can deal with it as directly collected EELS line scan data with DM2.0. But it does not work with DM 3....
1
vote
1
answer
27
views
How to enable entry from the checkbox DLGIdentifier?
In the previous question's answer, I showed how to enable the entry while changing checkbox state. This time, I want to create multiple entries which are controlled by the corresponding checkbox.
For ...
1
vote
1
answer
39
views
How to fill a line in 2D image along a given radius with the data in a given line image?
I want to fill a 2D image along its polar radius, the data are stored in a image where each row or column corresponds to the radius in target image. How can I fill the target image efficiently? Such ...
1
vote
1
answer
50
views
How to disable the entry box while the checkbox is not selected
Here is the script of a checkbox and an entry box in a dialog. I am wondering how to disable the entry while the checkbox is not selected.
class TestUI : UIFrame {
number true, false
TestUI(...
1
vote
1
answer
62
views
How to display one image on top of another?
I want to add a watermark on a dm3 image and be able to specify the size and position of the watermark
image front := GetFrontImage()
ImageDocument imageDoc = GetFrontImageDocument()
ImageDisplay ...
1
vote
1
answer
105
views
Is there file size limit for the imported .dat file?
I meet a problem for the large stacked images of several GB. Actually, I can directly open a stacked image (dm4 format) of 9GB (1000x1000x1000), but if I want to rotate it using volumn operation such ...
1
vote
2
answers
94
views
How to create a 3D image in which each planes are assigned to a single image without iteration
Due to the dm-script is not allowed to do simple math in different dimension. I am curious if there are any functions to create a 3D image in which all the planes are assigned to a single image ...
1
vote
2
answers
75
views
How to fitting EELS background for two window
The dm-script provide the function to fitting the exponential background, such as:
image src := GetFrontImage()
number bEs = 340 // eV
number bEe = 390 // eV
image signal := ...
1
vote
1
answer
83
views
How to get an image from a long string data in dm-script
I would like to get an image data from a string data array.
The below script runs well but speed is low.
(The actual length of the string data is much longer than in the example below.)
I guess pixel ...
1
vote
1
answer
38
views
Adjusting image contrast in FIB/SEM image - without affecting the text bar at the bottom of the image
FIB/SEM images have a text bar at the bottom of the image.
When imported into GMS, any contrast, gamma, .. adjustment also affects the text bar.
Is it possible to break up the image and have the data ...
2
votes
1
answer
90
views
How to take number from concrete row surrounded by text in TIFF file (if viewed in notepad) and use it in scripting in Digital Micrograph?
Update#2 link to TIFF file (needed row is 135) https://drive.google.com/file/d/1g3e3xenm5b-awQwpvfZyhfXIqSVGGw2t/view
(Updated#1)
Dear stackoverflow users,
first of all I need to mention that I am ...
1
vote
2
answers
78
views
How to exclude certain images from autosave in Gatan Digital Micrograph (GMS) in DM-script
I am trying to mimic the autosave function in GMS v3 so that I can use in version 1 and 2. I would like to first acknowledge that the main bulk of the script originates from Dr Bernhard Schaffer's &...
3
votes
1
answer
70
views
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)
...
0
votes
2
answers
2k
views
Fix "Fatal Python error: Py_Initialize: can't initialize sys standard streams"
I have two python environments with different versions running in parallel. When I execute a python script (test2.py) from one python environment in the other python environment, I get the following ...
1
vote
1
answer
58
views
Any function in DMS3.0 or later that runs in the background and allow user interaction (like FloatingModelessDialog)
In DMS3.42 or later, I am wondering if we have a function that the user is allowed to select an image to operate. Basically, the function needs to run in the background and allows user interaction, ...
1
vote
2
answers
73
views
How to add a scalebar without displaying the image in dm-script
How do I add annotations, in particular a scalebar, to an image without showing the image?
I have an application that records images. I want to add a scalebar to every recoreded image. But the users ...
1
vote
1
answer
130
views
How to add text annotations with python in dm-script
How do I add a text annotation with python in dm-script (Edit ... in Version 3.4.0)?
I want to add some text to images by using python in the GMS python environment. Therefore I want to use text ...
0
votes
1
answer
49
views
Add ROI to 1D image (intensity plot etc.)
Try to add ROI of determined position to 1D image (intensity plot, or line scan proflie). It does not work, could not find the function by google, is there correct codes?
number d0, d1
image spc:=...
2
votes
1
answer
113
views
How to manipulate pixel values via image expression?
Recently I am writing a script to manipulate the pixel values in an image. The idea is to set the pixels that fall into the given range to a specific value. Instead of using the command "for"...
1
vote
1
answer
79
views
How to add annotation information in each frame of a stack image?
I know how to add the arrows in a single image displayed front, but now I need to add the arrow annotations on each frame of a image stack to indicate the contrast change position and show them using ...
2
votes
2
answers
122
views
How to use dm script to realize the "save display as" function?
It is easy to save the false color image to BMP or JPG by using "save display as" function in menu. But it fails to save a image stack as the seperated images with the displaying color. &...
1
vote
1
answer
49
views
Best way to append text to file in dm-script
What is the best way to append line(s) to a file?
Currently I am using the following script:
/**
* Append the `line` to the file given at the `path`.
*
* @param path
* The absolute or ...
-1
votes
1
answer
70
views
Picker Tool for 4D data (2D x 2D)
Does there exist a (free) solution for extracting 2D slices from a 4D dataset? I'm thinking of something like the EELS SI Picker tool, or the DM-script one in Dave Mitchell's SITools package. I can ...
1
vote
1
answer
26
views
How to solve "No match for =( TagGroup, RealNumber )" error for UiFrame::getConfiguration()
I have a UIFrame with a getConfiguration() function which returns a TagGroup. But when compiling the script (with the TEM attatched) I get the error No match for =( TagGroup, RealNumber ) telling me ...
0
votes
1
answer
97
views
how to find peak positions (local maxima)
For the local maxima, could we set up some rule for the offset to make the curve only keep the plots we think they are peaks?
image FilterLocalMaxima1D( image spectrumIn, number range )
{
image ...
1
vote
2
answers
54
views
How to set starting and ending point for line projection in DM script
I am trying to draw line projection for an image . The line 4 in the code below sy/2 represents the length of projection (here is the half image range). But how to set the starting point or ending ...
1
vote
1
answer
54
views
How to create a blocking dialog with more than two buttons in dm-script
How do I create a dialog that has more than two custom buttons instead of the "Ok" and "Cancel" buttons that blocks the script?
One can create a dialog with two custom buttons in ...
-1
votes
1
answer
124
views
How do I open .dmp files created by DigitalMicrograph?
How do I open the .dmp files in %ProgramData%/Gatan/Logs that DigitalMicrograph creates on a crash?
Whenever I close DigitalMicrograph after executing my own currently developing program, ...
0
votes
1
answer
34
views
Is there a SetImagingOpticsMode() function?
I use the Py_Microscope class of dm-script to control my microscope. This class provides a CanGetImagingOpticsMode(), a GetImagingOpticsModes() and a GetImagingOpticsMode() function. But I also need ...
2
votes
1
answer
57
views
How to find out what arguments DM functions should take?
Through trial and error, I have found that the GetPixel function takes two arguments, one for X and one for Y, even if used on a 1D image. On a 1D image, the second index must be set to zero.
image ...
1
vote
2
answers
88
views
Adaptive Fourier Filter
Main question
Have someone already created a free adaptive Fourier filter for Digital Micrograph (or alternatively ImageJ)?
About the adaptive Fourier filter
I want to use some effective filtering ...
1
vote
1
answer
39
views
how to assign 1D spectra to imagestack
any idea why this does not work?
DM::Image im2D = DM::RealImage("2D", 4, 2048);
DM::Image im3D= DM::RealImage("3D", 4, 2048, 9, 9);
PlugIn::ImageDataLocker im2D_LLl(im2D, PlugIn::...
1
vote
2
answers
93
views
How do I travel through TagGroups in python dm-script
How do I use unknown structures of TagGroups in dm-script in python?
TagGroups are widely used in DigitalMicrograph. But how do I travel through them in python? How do I get all available tag names?
...
2
votes
1
answer
68
views
How to set an ImageDocument to be not dirty in dm-script
How do I set an ImageDocument not to be dirty anymore in python dm-script without saving?
I have the python code posted below which can be represented by the following dm-script code.
String ...
1
vote
1
answer
50
views
Fast Cumulative Sum?
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 ...
3
votes
1
answer
40
views
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?
1
vote
1
answer
51
views
Reading in multiple STEM signals into multiple datacubes
I've written a through focus STEM acquisition script that reads in an image using the DSAcquire function, where I specify the signal to be read in with DSAcquireData(img, signalindex, etc.).
The nice ...
1
vote
2
answers
54
views
How to scroll a TextBox down automatically in dm-script
How do I scroll down a dialog TextBox automatically when updating the text?
Consider the following example dialog (code below).
This contains a TextBox. As soon as the text changes, the textbox will ...