如何更改线轮廓的约束? [英] How can I change the constraint of line profile?

查看:160
本文介绍了如何更改线轮廓的约束?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

是否有可能通过脚本功能更改LinePlot显示中切片的约束?

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.

我在DM脚本文档中找不到此类命令.如何通过脚本执行此类操作?

I have not found such commands in the DM-script documentation. How can I do such a thing by script?

推荐答案

"LinePlotDisplays"部分中可能描述了您要查找的命令:

The commands you seek are possibly described in the section on "LinePlotDisplays":

一个简单的例子是:

image spectrum := RealImage( "Test", 4, 512 )
spectrum = icol * sin( icol/iwidth * 10 * Pi() ) 
spectrum.ShowImage()

imageDisplay disp = spectrum.ImageGetImageDisplay(0)
disp.LinePlotImageDisplaySetDoAutoSurvey( 0, 0 )            // Switch auto-survey off!
disp.LinePlotImageDisplaySetContrastLimits( -50, 100 )      // Set limits (uncalibrated)
disp.LinePlotImageDisplaySetDisplayedChannels( 100, 200 )   // Set X-range in display (uncalibrated)


但是,如果您指的是图例上的右键菜单中的设置,即


However, if you are referring to the settings one gets from the right-click menu on the legend, i.e.

那么,恐怕,我对您没有任何帮助.

then, I'm afraid, I don't have any help for you.

在当前DigitalMicrograph中似乎没有脚本访问此功能.

但是,您可以通过脚本命令相对于彼此移动和缩放" LinePlot的各个切片. 帮助文档中实际上有一个示例脚本,我只是在此处复制粘贴:

You can, however, "shift and scale" individual slices of a LinePlot with respect to each other by script commands. There is actually an example script in the help documentation, which I'm just copy-pasting here:

number deltaX = 10
number deltaY = 20

number kLinePlotType = 3
image spec := GetFrontImage()
if ( !spec.ImageIsValid() ) Throw( "Invalid image" )
if ( 0 == spec.ImageCountImageDisplays() ) Throw( "No Image Display" )

imageDisplay disp = spec.ImageGetImageDisplay(0)
if ( kLinePlotType != disp.ImageDisplayGetDisplayType() ) Throw( "Not a LinePlot." )

number nSlices = disp.LinePlotImageDisplayCountSlices()

// get current reference slice index and its ID
number refSlice_idx = disp.LinePlotImageDisplayGetSlice()
object slice_ref = disp.ImageDisplayGetSliceIDByIndex( refSlice_idx )

for ( number i = 1; i < nSlices; i++ )
{
    object slice_src = disp.ImageDisplayGetSliceIDByIndex( i )
    number int_offset, int_scale
    number pos_offset, pos_scale

    // get current transform factors between slice and reference slice
    disp.LinePlotImageDisplayGetImageToGroupTransform( slice_src, slice_ref, int_offset, int_scale, pos_offset, pos_scale )
    pos_offset = ( i / nSlices ) * deltaX
    int_offset = ( i / nSlices ) * deltaY

    // set new transform factors between slice and reference slice
    disp.LinePlotImageDisplaySetImageToGroupTransform( slice_src, slice_ref, int_offset, int_scale, pos_offset, pos_scale )
}

这篇关于如何更改线轮廓的约束?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆