估计阅读时长: 2 分钟

imports "clustering" from "MLkit";

require(graphics2D);

multishapes = read.csv("./multishapes.csv");
[x, y] = list(multishapes[, "x"], multishapes[, "y"]);
print(multishapes, max.print = 13);

# detect object shapes
objects = graphics2D::pointVector(multishapes[, "x"], multishapes[, "y"]) |> dbscan_objects();
objects[objects == "-1"] = "noise";
objects = ifelse(objects == "noise", objects, `object_${objects}`);

# show object detection result
bitmap(file = "./object_detection.png") {
    plot(multishapes[, "x"], multishapes[, "y"], 
        class     = objects, 
        grid.fill = "white",
        padding   = "padding: 125px 300px 200px 200px;",
        colorSet  = "paper"
    );
}
谢桂纲
Latest posts by 谢桂纲 (see all)

Attachments

No responses yet

Leave a Reply

Your email address will not be published. Required fields are marked *

博客文章
April 2024
S M T W T F S
 123456
78910111213
14151617181920
21222324252627
282930  
  1. 空间Spot结果在下载到的mzkit文件夹中有示例吗?我试了试,不是10X结果中的tissue_positions_list.csv(软件选择此文件,直接error);在默认结果中也没找到类似的文件;