如何从3D光谱图像中提取光谱 [英] How do I extract a spectrum from a 3D spectrum-image

查看:221
本文介绍了如何从3D光谱图像中提取光谱的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

在DigitalMicrograph中,我有一个大小为[X x Y x Z]的3D数据立方体,我想在X / Y位置提取单个光谱。
我知道我可以通过两个相对的角(x1 / y1 / z1)和(x2 / y2 / z2)来寻址子体积。
但是当我在下面的脚本中执行此操作时,我只获得一个带有单个值的LinePlot显示。
我做错了什么?

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 ]

ShowImage( spec )


推荐答案

您的解决方案解决了卷的右侧部分,但是作为[1 x 1 x sz]图像。您可以旋转图像,但更好的解决方案是使用 slice1()命令直接访问1维子体积,如下面的修改过的脚本所示:

You solution addresses the right section of the volume but as a [1 x 1 x sz] image. You could rotate the image, but a better solution is to use the slice1() command which directly access a 1-dimensional subvolume as in the following modified script:

number px = 5
number py = 3
image SIblock := GetFrontImage()
number sx, sy, sz
Get3DSize( SIblock, sx, sy, sz )
image spec := Slice1( SIblock, px,py,0,  2,sz,1 )
image specCopy := ImageClone( spec )
ShowImage( specCopy )

该命令有7个参数:源图像(任何维度),起始体积坐标为x / y / z和描述采样的三元组:方向(0 = x 1 = y 2 = z),该方向的步数和步长。

The command has 7 parameters: the source image (any dimension), the starting coordinate of the volume as x/y/z and a triplet describing the sampling: The direction ( 0=x 1=y 2=z ), the number of steps in that direction and a stepsize.

请注意,我的脚本也使用图像规格:= 而不是图像规格= 。不同的是, = 复制值(并创建一个新图像),而:= 分配右手边。 spec 只是 SIblock 的相同内存空间的另一个名称。更改 spec 的值将更改 SIblock 的相应子卷。因此,我的脚本使用 ImageClone()命令创建另一个图像 specCopy ,以真正创建一个单独的提取图像。

Note that my script also used image spec := and not image spec =. The difference is, that = copies the values (and creates a new image) while := assigns the right-handside. spec is just another name for the identical memory space of SIblock. Changing the values of spec would change the according subvolume of SIblock. My script therefore creates another image specCopy with the command ImageClone() to really creat a separate 'extracted' image.

这篇关于如何从3D光谱图像中提取光谱的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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