从数据表构建图片并对其应用过滤器你好
我经常处理与图像相似的X / Y / metric数据表,并希望在其上应用JMP过滤器(“去斑点”,“减少噪声”,... 我对Julia Gong的演示非常感兴趣:“使用JMP®图像分析功能提取皮肤病变特征”,然后转换回数据表。 将数据转换为图片后,使用这种过滤器似乎比执行一些棘手的矩阵计算要容易得多。
喜欢:

例如获得带有降噪功能的右下角群集

但是我不明白如何从我的数据创建JMP图像矩阵。
例如,如果我从带有X,Y和下面的指标并作为附件的表格开始

然后:
dt =current data table();
// the X,Y, metric matrix
mat = (:X << getvalues) || (:Y << getvalues) || (:metric << getvalues);
这两个命令都没有:
img = New Image( "r",{mat});也不是这个:
img << Set pixels ("r",{mat});...似乎可行。
如何将这张表转换成图像矩阵并对其应用JMP过滤器?
谢谢!
法兰克
图形脚本编写回复:从数据表构建图片,然后在其上应用jsl过滤器您将需要执行以下操作:
NamesDefaultToHere(1);
dt = Data table("data_table.jmp");
// The values of the metric need to be rescaled to [0, 1]
metric = Column(dt, 3) << getValues;
maxMetric = Max(metric);
minMetric = Min(metric);
metric = (metric - minMetric) :\</img> (maxMetric - minMetric);
// Column vector to hold the pixel values for the image
pixVals = J(NRow(metric), 1, .);
for (p=1, p<=NRow(pixVals), p++,
pixVals[p] = RGB Color(metric[p], metric[p], metric[p]);
);
// Reshape 'pixVals' to be a rectangular matrix (assumes 'X' and 'Y' both start at 1)
xMax = Max(Column(dt, "X") << getValues);
yMax = Max(Column(dt, "Y") << getValues);
pixVals = Shape(pixVals, xMax, yMax);
// Make an image, make it a bit bigger, and put it in a window
im = New Image();
im << setPixels( pixVals );
im << setSize({10*xMax, 8*yMax});
NewWindow("My Image", im);
使用“帮助>脚本编制索引”来阐明代码的工作方式。

回复:从数据表构建图片,然后在其上应用jsl过滤器大! 谢谢你的帮助!