从数据表构建图片,然后对其应用 jsl 过滤器你好,
我经常使用 X/Y/公制数据表,这些数据表与图像类似,我想在其上应用 JMP 过滤器(“去斑”、“减少噪音”... 我对 Julia Kong 的演讲非常感兴趣:“使用 JMP® 图像分析功能提取皮肤病变特征”),然后转换回数据表。 将数据转换为图片后使用这种过滤器似乎比执行一些棘手的矩阵计算更容易。
喜欢:

例如,为了获得带有降噪 jsl 滤波器的右下角集群高级像素,假设孤立的像素是噪声并且必须进行过滤

但我不明白如何从我的数据创建 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 过滤器伟大的! 感谢您的帮助!
回复:从数据表构建图片,然后对其应用 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);
使用“帮助 > 脚本索引”来阐明代码的工作原理。
