dm-script

Has deployment of dialog graphics changed in GMS3?

与世无争的帅哥 提交于 2020-05-16 02:20:26
问题 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

TagGroupGetTagType returns wrong type

此生再无相见时 提交于 2020-05-15 21:22:35
问题 Basically this is the specific question for my older question which I just can't solve. I was given an example image for my development. This image contains a (I guess representative) TagGrop that displays the information about how the image is created. My problem is, that TagGroupGetTagType() of the elements of this TagGroup returns 3 for elements that are TagGroups itself. But TagGroups have the type 0 (confirmed by myself and @BmyGuest in the linked question). The following image shows the

TagGroupGetTagType returns wrong type

依然范特西╮ 提交于 2020-05-15 21:22:31
问题 Basically this is the specific question for my older question which I just can't solve. I was given an example image for my development. This image contains a (I guess representative) TagGrop that displays the information about how the image is created. My problem is, that TagGroupGetTagType() of the elements of this TagGroup returns 3 for elements that are TagGroups itself. But TagGroups have the type 0 (confirmed by myself and @BmyGuest in the linked question). The following image shows the

To create an object (of some class) in a listener

◇◆丶佛笑我妖孽 提交于 2020-01-25 19:19:42
问题 I'm creating a script and have troubles. Is it possible to create an object (of some class) from within a listener? I tried it but I get an error: ``class not found''. I want to do something like: class ONE { class_ONE_code } class TWO { object o = alloc(ONE) } I need this to create a new listener when I execute another listener. 回答1: What you wish to do is certainly possible. Most likely you have a syntax error in your code. For example, your implementation of class TWO is invalid since a

how to select a opened image with DLGCreateImagePopup in created dialog

蹲街弑〆低调 提交于 2020-01-05 04:37:15
问题 I creat a dialog with DLGCreateImagePopup to select a opened image. But after I select the image, I cannot do anything for that image. How to get the image ID or name of the selected image? 回答1: If you want to do it as a posed dialog (i.e. get the image after clicking the OK button), you could do it as follows: Class CMyDLG : UIframe { TagGroup DLG,DLGItems,imgPop object Init(object self) { DLG = DLGCreateDialog("Test",DLGItems) imgPop = DLGCreateImagePopup() DLGItems.DLGAddElement( imgPop )

How to convert ASCII array (image) to a single string

天涯浪子 提交于 2019-12-24 06:37:58
问题 My metadata is stored in a 8 bit unsigned dataset in a HDF5 file. After importing to DM, it become a 2D image of 1*length dimension. Each "pixel" stores the ASCII value of the corresponding value to the character. For further processing, I have to convert the ASCII array to a single string, and further to TagGroup. Here is the stupid method (pixel by pixel) I currently do: String Img2Str (image img){ Number dim1, dim2 img.getsize(dim1,dim2) string out = "" for (number i=0; i<dim1*dim2; i++)

How can I change the constraint of line profile?

两盒软妹~` 提交于 2019-12-24 05:53:32
问题 Is there any possibility to change the constraints of slices in a LinePlot display by script function? In order to detach all lines I want, I currenlty have to click each line one-by-one and select the option from the menu. I have not found such commands in the DM-script documentation. How can I do such a thing by script? 回答1: The commands you seek are possibly described in the section on "LinePlotDisplays": A quick example is: image spectrum := RealImage( "Test", 4, 512 ) spectrum = icol *

How do I extract a spectrum from a 3D spectrum-image

本小妞迷上赌 提交于 2019-12-24 02:23:49
问题 In DigitalMicrograph I have a 3D data cube of size [X x Y x Z] and I would like to extract a single spectrum at position X/Y. I know I can address the sub-volume by two opposing corners (x1/y1/z1) and (x2/y2/z2). But when I do this in the script below, I only get a LinePlot display with a single value. What am I doing wrong ? number px = 5 number py = 3 image SIblock := GetFrontImage() number sx, sy, sz Get3DSize( SIblock, sx, sy, sz ) image spec = SIblock[ px, py, 0, px+1, py+1, sz ]

Apply Custom Layout to Image in DigitalMicrograph GMS3

生来就可爱ヽ(ⅴ<●) 提交于 2019-12-23 03:09:27
问题 I have an image in DigitalMicrograph GMS3 (v 3.21.1374.0) which i have applied a custom databar to (trying to learn how to do this via script here: add / apply custom databar to image in DigitalMicrograph GMS3) I have a custom layout that I can add manually by doing the following: Right click on the image Hover on layout (in context menu) Left click "Apply Layout..." Select the custom layout in dialog that pops up (the one I want is called "CheckLayout") Click OK How do I do this with a

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

陌路散爱 提交于 2019-12-23 02:19:24
问题 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,