{"id":69827,"date":"2026-11-14T21:52:28","date_gmt":"2026-11-14T13:52:28","guid":{"rendered":"https:\/\/www.biocloudservice.com\/wordpress\/?p=69827"},"modified":"2026-11-14T21:52:28","modified_gmt":"2026-11-14T13:52:28","slug":"spagcn-histology-pixel-axes-distance-controls","status":"publish","type":"post","link":"https:\/\/www.biocloudservice.com\/wordpress\/spagcn-histology-pixel-axes-distance-controls\/","title":{"rendered":"SpaGCN \u52a0\u4e86\u7ec4\u7ec7\u56fe\u4ee5\u540e\uff0c\u600e\u6837\u68c0\u67e5\u6a21\u578b\u628a\u8fb9\u754c\u753b\u5728\u4e86\u6b63\u786e\u7684\u65b9\u5411\uff1f"},"content":{"rendered":"<div class=\"ysx-method-guide\" style=\"max-width:820px;min-width:0;margin:0 auto;color:#26374a;line-height:1.86;overflow-wrap:anywhere\">\n<p>\u5982\u679c\u4e24\u679a\u6355\u83b7\u70b9\u53ea\u9694\u4e00\u4e2a\u683c\u5b50\uff0c\u4f46\u4e2d\u95f4\u6b63\u597d\u8de8\u8fc7\u6e05\u6670\u7684\u7ec4\u7ec7\u5206\u754c\uff0c\u5b83\u4eec\u8be5\u4e0d\u8be5\u5bf9\u5f7c\u6b64\u7684\u8868\u8fbe\u5224\u65ad\u4ea7\u751f\u540c\u6837\u5f3a\u7684\u5f71\u54cd\uff1fSpaGCN \u53ef\u4ee5\u628a\u67d3\u8272\u56fe\u50cf\u7684\u4fe1\u606f\u7eb3\u5165\u7a7a\u95f4\u8ddd\u79bb\uff0c\u518d\u7528\u56fe\u5377\u79ef\u8bc6\u522b\u7a7a\u95f4\u57df\u3002\u8fd9\u4e00\u505a\u6cd5\u4e5f\u5e26\u6765\u4e00\u4e2a\u5177\u4f53\u7684\u6392\u9519\u95ee\u9898\u3002\u5982\u679c\u70b9\u4f4d\u4ece\u7167\u7247\u91cc\u53d6\u9519\u4e86\u989c\u8272\uff0c\u6a21\u578b\u4ecd\u80fd\u7ed9\u51fa\u5b8c\u6574\u7684\u5206\u7fa4\u56fe\uff0c\u8fde\u6982\u7387\u548c\u4e5f\u53ef\u80fd\u6b63\u5e38\u3002\u6211\u4eec\u9020\u4e86\u4e00\u5f20\u53ea\u6709\u5de6\u53f3\u4e24\u79cd\u989c\u8272\u7684\u5c0f\u56fe\uff0c\u4fdd\u6301\u8868\u8fbe\u548c\u9635\u5217\u56fa\u5b9a\uff0c\u53ea\u4ea4\u6362\u53d6\u8272\u7684\u884c\u5217\uff0c\u89c2\u5bdf\u54ea\u91cc\u5148\u51fa\u73b0\u53ef\u6d4b\u7684\u53d8\u5316\u3002<a style=\"color:#355d8a;text-decoration:underline;text-underline-offset:2px\" href=\"https:\/\/www.nature.com\/articles\/s41592-021-01255-8\">SpaGCN \u539f\u59cb\u7814\u7a76<\/a><\/p>\n<h2 style=\"font-size:1.38em;line-height:1.5;margin:1.55em 0 .55em;color:#182d43\">\u4e00\u679a\u70b9\u6709\u4e24\u5957\u5750\u6807\uff0c\u5148\u753b\u51fa\u53d6\u8272\u7a97\u53e3<\/h2>\n<p>\u9635\u5217\u5750\u6807\u7528\u4e8e\u8ba1\u7b97\u7a7a\u95f4\u70b9\u4e4b\u95f4\u7684\u4f4d\u7f6e\u5173\u7cfb\uff0c\u7167\u7247\u7684\u50cf\u7d20\u884c\u5217\u7528\u4e8e\u5b9a\u4f4d\u7ec4\u7ec7\u56fe\u4e0a\u7684\u8272\u5757\u3002\u7167\u7247\u82e5\u7f29\u653e\u3001\u88c1\u8fb9\u6216\u65cb\u8f6c\uff0c\u540e\u4e00\u5957\u6570\u503c\u4f1a\u8ddf\u7740\u53d8\u5316\u3002\u8f93\u5165\u65f6\u8fd8\u8981\u6ce8\u610f\u6570\u7ec4\u7684\u7b2c\u4e00\u7ef4\u662f\u884c\uff0c\u7b2c\u4e8c\u7ef4\u662f\u5217\u3002SpaGCN \u5f53\u524d\u8fd9\u6bb5\u53d6\u8272\u4ee3\u7801\u7528\u540d\u4e3a x_pixel \u7684\u53c2\u6570\u7d22\u5f15\u56fe\u50cf\u7b2c\u4e00\u7ef4\uff0c\u540d\u4e3a y_pixel \u7684\u53c2\u6570\u7d22\u5f15\u7b2c\u4e8c\u7ef4\u3002\u82e5\u539f\u8868\u6807\u9898\u5199\u7684\u662f\u753b\u56fe\u8f6f\u4ef6\u7684\u6a2a\u8f74\u548c\u7eb5\u8f74\uff0c\u5e94\u5148\u8f6c\u6362\u5230\u6570\u7ec4\u884c\u5217\uff0c\u518d\u4f20\u5165\u51fd\u6570\u3002\u628a\u6bcf\u4e2a\u70b9\u7684\u4e24\u4e2a\u6570\u90fd\u9650\u5236\u5728\u56fe\u50cf\u5bbd\u9ad8\u4e4b\u5185\uff0c\u53ea\u80fd\u8bf4\u660e\u7d22\u5f15\u6ca1\u6709\u8d8a\u754c\u3002<a style=\"color:#355d8a;text-decoration:underline;text-underline-offset:2px\" href=\"https:\/\/github.com\/jianhuupenn\/SpaGCN\/blob\/master\/SpaGCN_package\/SpaGCN\/calculate_adj.py\">\u4f5c\u8005\u7684\u53d6\u8272\u548c\u8ddd\u79bb\u8ba1\u7b97\u5b9e\u73b0<\/a><\/p>\n<p>\u4e00\u4e2a\u76f4\u63a5\u7684\u68c0\u67e5\u662f\u9009\u4e09\u4e2a\u4e92\u4e0d\u5bf9\u79f0\u7684\u4f4d\u7f6e\uff0c\u4f8b\u5982\u7f3a\u53e3\u5185\u4fa7\u3001\u6df1\u67d3\u5c0f\u7076\u548c\u5927\u7247\u6d45\u67d3\u533a\u57df\u3002\u628a\u539f\u7167\u7247\u4e0a\u7684\u53d6\u8272\u7a97\u53e3\u653e\u5927\uff0c\u518d\u5c06\u7a0b\u5e8f\u4ece\u7a97\u53e3\u63d0\u53d6\u7684\u5e73\u5747\u989c\u8272\u753b\u5728\u540c\u4e00\u4e2a\u4f4d\u7f6e\u3002\u82e5\u6df1\u67d3\u5c0f\u7076\u7684\u53d6\u6837\u843d\u5230\u6d45\u67d3\u533a\uff0c\u5373\u4f7f\u6574\u5f20\u70b9\u4f4d\u6563\u70b9\u56fe\u770b\u4e0a\u53bb\u8f6e\u5ed3\u5bf9\u9f50\uff0c\u4e5f\u503c\u5f97\u56de\u67e5\u7f29\u653e\u56e0\u5b50\u548c\u8f74\u987a\u5e8f\u3002\u7a97\u53e3\u8fc7\u5927\u65f6\uff0c\u4e00\u679a\u4f4d\u4e8e\u7ec6\u7a84\u7ec4\u7ec7\u5c42\u5185\u7684\u70b9\u53ef\u80fd\u5e73\u5747\u8fdb\u4e24\u4fa7\u7ec4\u7ec7\uff0c\u7a97\u53e3\u8fc7\u5c0f\u65f6\u5219\u66f4\u5bb9\u6613\u88ab\u4e2a\u522b\u6df1\u67d3\u50cf\u7d20\u6216\u566a\u70b9\u5f71\u54cd\u3002\u8bb0\u5f55\u539f\u59cb\u7167\u7247\u5c3a\u5bf8\u548c\u7a97\u53e3\u5927\u5c0f\uff0c\u5e76\u8ba9\u590d\u6838\u4eba\u5458\u80fd\u591f\u4ece\u70b9\u4f4d\u7f16\u53f7\u56de\u5230\u539f\u7167\u7247\u3002<\/p>\n<h2 style=\"font-size:1.38em;line-height:1.5;margin:1.55em 0 .55em;color:#182d43\">\u56fe\u4e2d\u7684\u8ddd\u79bb\u662f\u600e\u6837\u6539\u53d8\u90bb\u5c45\u5f71\u54cd\u7684<\/h2>\n<p>\u4e0d\u5f15\u5165\u56fe\u50cf\u65f6\uff0c\u51fd\u6570\u6839\u636e\u7ed9\u5b9a\u7684\u4e24\u4e2a\u5e73\u9762\u5750\u6807\u8ba1\u7b97\u8ddd\u79bb\u3002\u542f\u7528\u56fe\u50cf\u65f6\uff0c\u4f1a\u7ed9\u6bcf\u4e2a\u70b9\u63d0\u53d6\u9644\u8fd1\u989c\u8272\uff0c\u5bf9\u901a\u9053\u6309\u53d8\u5f02\u7a0b\u5ea6\u52a0\u6743\uff0c\u518d\u628a\u7ed3\u679c\u6807\u51c6\u5316\u6210\u4e00\u4e2a\u9644\u52a0\u7ef4\u5ea6\u3002\u5e73\u9762\u4f4d\u7f6e\u76f8\u540c\u7684\u6bd4\u8f83\u903b\u8f91\u7531\u6b64\u7eb3\u5165\u4e86\u989c\u8272\u5dee\u5f02\u3002\u6784\u9020\u8ddd\u79bb\u77e9\u9635\u540e\uff0cSpaGCN \u7684\u8bad\u7ec3\u51fd\u6570\u8fd8\u4f1a\u4f9d\u8ddd\u79bb\u4e0e\u5c3a\u5ea6\u53c2\u6570\u8ba1\u7b97\u8870\u51cf\u6743\u91cd\u3002\u56e0\u6b64\u201c\u56fe\u4e0a\u4e24\u70b9\u8ddd\u79bb\u589e\u5927\u201d\u548c\u201c\u8bad\u7ec3\u65f6\u4e24\u70b9\u4e92\u76f8\u5f71\u54cd\u51cf\u5f31\u201d\u662f\u5148\u540e\u4e24\u4e2a\u6b65\u9aa4\uff0c\u4e0d\u80fd\u628a\u524d\u4e00\u6b65\u7684\u8ddd\u79bb\u503c\u76f4\u63a5\u6284\u6210\u540e\u4e00\u6b65\u7684\u90bb\u63a5\u6743\u91cd\u3002\u8272\u5dee\u3001\u53d6\u8272\u7a97\u53e3\u4ee5\u53ca\u8870\u51cf\u5c3a\u5ea6\u8981\u5206\u522b\u8bb0\u5165\u53c2\u6570\u8868\u3002<a style=\"color:#355d8a;text-decoration:underline;text-underline-offset:2px\" href=\"https:\/\/github.com\/jianhuupenn\/SpaGCN\/blob\/master\/SpaGCN_package\/SpaGCN\/SpaGCN.py\">SpaGCN \u8bad\u7ec3\u5165\u53e3\u53ca\u8ddd\u79bb\u53d8\u6362<\/a><\/p>\n<p>\u53cd\u67e5\u67d0\u6761\u8fb9\u6bd4\u5149\u770b\u6574\u5f20\u805a\u7c7b\u56fe\u66f4\u5bb9\u6613\u53d1\u89c9\u95ee\u9898\u3002\u53ef\u4ee5\u9009\u53d6\u4e00\u5bf9\u6a2a\u8de8\u5019\u9009\u8fb9\u754c\u7684\u90bb\u70b9\uff0c\u518d\u9009\u4e00\u5bf9\u4f4d\u4e8e\u8fb9\u754c\u540c\u4e00\u4fa7\u3001\u5e73\u9762\u95f4\u8ddd\u76f8\u540c\u7684\u90bb\u70b9\u3002\u5206\u522b\u8f93\u51fa\u7eaf\u5750\u6807\u8ddd\u79bb\u3001\u52a0\u989c\u8272\u540e\u7684\u8ddd\u79bb\u4ee5\u53ca\u8fdb\u5165\u8bad\u7ec3\u7684\u6743\u91cd\u3002\u5982\u679c\u8de8\u8fb9\u754c\u7684\u4e00\u5bf9\u5e94\u8be5\u53d7\u8272\u5dee\u5f71\u54cd\uff0c\u4f46\u8ba1\u7b97\u503c\u5b8c\u5168\u6ca1\u6709\u53d8\u5316\uff0c\u540c\u65f6\u53e6\u4e00\u65b9\u5411\u7684\u4e00\u5bf9\u53d8\u5316\u5f88\u5927\uff0c\u5c31\u5e94\u56de\u770b\u7a0b\u5e8f\u5b9e\u9645\u4f7f\u7528\u7684\u50cf\u7d20\u4f4d\u7f6e\u3002\u8fd9\u6837\u7684\u5bf9\u7167\u65e0\u9700\u9884\u5148\u77e5\u9053\u6574\u5f20\u7ec4\u7ec7\u91cc\u5e94\u5f53\u5206\u51e0\u7c7b\uff0c\u4e5f\u4e0d\u4f9d\u8d56\u805a\u7c7b\u6807\u7b7e\u7684\u6570\u5b57\u7f16\u53f7\u3002<\/p>\n<div class=\"guide-table\" style=\"max-width:100%;overflow-x:auto;margin:18px 0\">\n<table style=\"display:table;width:100%;max-width:100%;min-width:0;table-layout:fixed;border-collapse:collapse;font-size:.92em;line-height:1.6\">\n<thead>\n<tr>\n<th scope=\"col\" style=\"white-space:normal;overflow-wrap:anywhere;word-break:normal;background:#eef6ff;color:#1e293b;vertical-align:top;text-align:left;padding:6px;border:1px solid #c4cfdb\">\u6a21\u62df\u8f93\u5165<\/th>\n<th scope=\"col\" style=\"white-space:normal;overflow-wrap:anywhere;word-break:normal;background:#eef6ff;color:#1e293b;vertical-align:top;text-align:right;padding:6px;border:1px solid #c4cfdb\">\u6a2a\u8de8\u5de6\u53f3\u8fb9\u754c\u7684\u8ddd\u79bb<\/th>\n<th scope=\"col\" style=\"white-space:normal;overflow-wrap:anywhere;word-break:normal;background:#eef6ff;color:#1e293b;vertical-align:top;text-align:right;padding:6px;border:1px solid #c4cfdb\">\u5de6\u4fa7\u5185\u90e8\u4e0a\u4e0b\u90bb\u70b9\u7684\u8ddd\u79bb<\/th>\n<\/tr>\n<\/thead>\n<tbody>\n<tr>\n<td style=\"white-space:normal;overflow-wrap:anywhere;word-break:normal;padding:6px;vertical-align:top;border:1px solid #c4cfdb\">\u53ea\u7528\u9635\u5217\u5750\u6807<\/td>\n<td style=\"white-space:normal;overflow-wrap:anywhere;word-break:normal;padding:6px;vertical-align:top;border:1px solid #c4cfdb;text-align:right\">1.000<\/td>\n<td style=\"white-space:normal;overflow-wrap:anywhere;word-break:normal;padding:6px;vertical-align:top;border:1px solid #c4cfdb;text-align:right\">1.000<\/td>\n<\/tr>\n<tr>\n<td style=\"white-space:normal;overflow-wrap:anywhere;word-break:normal;padding:6px;vertical-align:top;border:1px solid #c4cfdb\">\u6b63\u786e\u63d0\u53d6\u5de6\u53f3\u4e24\u4fa7\u7684\u989c\u8272<\/td>\n<td style=\"white-space:normal;overflow-wrap:anywhere;word-break:normal;padding:6px;vertical-align:top;border:1px solid #c4cfdb;text-align:right\">3.559<\/td>\n<td style=\"white-space:normal;overflow-wrap:anywhere;word-break:normal;padding:6px;vertical-align:top;border:1px solid #c4cfdb;text-align:right\">1.000<\/td>\n<\/tr>\n<tr>\n<td style=\"white-space:normal;overflow-wrap:anywhere;word-break:normal;padding:6px;vertical-align:top;border:1px solid #c4cfdb\">\u5c06\u53d6\u8272\u7684\u884c\u5217\u4ea4\u6362<\/td>\n<td style=\"white-space:normal;overflow-wrap:anywhere;word-break:normal;padding:6px;vertical-align:top;border:1px solid #c4cfdb;text-align:right\">1.000<\/td>\n<td style=\"white-space:normal;overflow-wrap:anywhere;word-break:normal;padding:6px;vertical-align:top;border:1px solid #c4cfdb;text-align:right\">3.559<\/td>\n<\/tr>\n<\/tbody>\n<\/table>\n<\/div>\n<figure class=\"guide-figure\" style=\"margin:24px 0 28px\"><img loading=\"lazy\" decoding=\"async\" src=\"\/wordpress\/wp-content\/uploads\/2026\/11\/spagcn-histology-pixel-axes-distance-controls-guide.png\" alt=\"\u54ea\u4e00\u5bf9\u90bb\u70b9\u88ab\u62c9\u8fdc\u4e86\u3002\u53cc\u8272\u7ec4\u7ec7\u56fe\u5b9e\u8dd1\uff5c\u56fa\u5b9a\u8868\u8fbe\u4e0e\u5750\u6807\uff0c\u53ea\u4ea4\u6362\u56fe\u50cf\u53d6\u8272\u8f74\u3002\u4ec5\u4f4d\u7f6e\uff0c\u6a2a\u5411 1\uff0c\u7eb5\u5411 1\uff0c\u4e24\u5bf9\u76f8\u90bb\u70b9\u7684\u5e73\u9762\u95f4\u8ddd\u76f8\u540c\u3002\u6b63\u786e\u53d6\u8272\uff0c\u6a2a\u5411 3.559\uff0c\u7eb5\u5411 1\uff0c\u8de8\u8fc7\u5de6\u53f3\u67d3\u8272\u8fb9\u754c\u7684\u70b9\u5bf9\u8ddd\u79bb\u589e\u5927\u3002\u4ea4\u6362\u884c\u5217\uff0c\u6a2a\u5411 1\uff0c\u7eb5\u5411 3.559\uff0c\u8f74\u4ea4\u6362\u540e\u5750\u6807\u4ecd\u5408\u6cd5\uff0c\u8fb9\u754c\u8f6c\u4e86\u65b9\u5411\u3002\" width=\"1200\" height=\"840\" style=\"display:block;width:100%;height:auto;border-radius:10px\"><figcaption style=\"font-size:14px;line-height:1.6;margin:9px 2px 0;color:#475569\">\u53cc\u8272\u7ec4\u7ec7\u56fe\u5b9e\u8dd1\uff5c\u56fa\u5b9a\u8868\u8fbe\u4e0e\u5750\u6807\uff0c\u53ea\u4ea4\u6362\u56fe\u50cf\u53d6\u8272\u8f74\u3002<\/figcaption><\/figure>\n<h2 style=\"font-size:1.38em;line-height:1.5;margin:1.55em 0 .55em;color:#182d43\">\u5b9e\u8dd1\u7ecf\u9a8c\uff5c\u884c\u5217\u90fd\u5408\u6cd5\uff0c\u7ec4\u7ec7\u8fb9\u754c\u4ecd\u53ef\u8f6c\u4e5d\u5341\u5ea6<\/h2>\n<p>\u6211\u4eec\u5728 Python \u73af\u5883\u5b89\u88c5 SpaGCN 1.2.7\uff0c\u4f7f\u7528 CPU\uff0c\u5efa\u7acb\u516d\u884c\u516d\u5217\u7684\u65b9\u683c\u548c\u4e00\u5f20\u516d\u5341\u4e58\u516d\u5341\u50cf\u7d20\u7684\u4e09\u901a\u9053\u56fe\u3002\u5de6\u53f3\u534a\u56fe\u5404\u6709\u56fa\u5b9a\u989c\u8272\uff0c\u6a21\u62df\u8868\u8fbe\u542b\u5341\u516b\u4e2a\u57fa\u56e0\u3001\u4e24\u79cd\u5df2\u77e5\u72b6\u6001\uff0c\u5404\u6709\u516d\u4e2a\u504f\u597d\u8868\u8fbe\u7684\u57fa\u56e0\u3002\u4e24\u7ec4\u8fb9\u754c\u76f8\u540c\uff0c\u4fbf\u4e8e\u68c0\u67e5\u7a0b\u5e8f\u80fd\u5426\u5229\u7528\u6709\u5229\u7684\u56fe\u50cf\u4fe1\u606f\u3002\u6211\u4eec\u56fa\u5b9a\u8868\u8fbe\u3001\u968f\u673a\u79cd\u5b50\u548c\u5168\u90e8\u9635\u5217\u5750\u6807\uff0c\u5206\u522b\u7528\u7eaf\u4f4d\u7f6e\u3001\u6b63\u786e\u53d6\u8272\u3001\u53d6\u8272\u884c\u5217\u4ea4\u6362\u4e09\u79cd\u8ddd\u79bb\u8bad\u7ec3\u6a21\u578b\u3002\u521d\u59cb\u5316\u9009\u62e9\u4e24\u7c7b\u7684\u5747\u503c\u805a\u7c7b\uff0c\u4f7f\u7528\u4e94\u4e2a\u4e3b\u6210\u5206\uff0c\u76f8\u540c\u7684\u8ddd\u79bb\u8870\u51cf\u5c3a\u5ea6\u548c\u516d\u5341\u8f6e\u8bad\u7ec3\u4e0a\u9650\uff0c\u63d0\u524d\u505c\u6b62\u7531\u8f6f\u4ef6\u6309\u6807\u7b7e\u53d8\u5316\u51b3\u5b9a\u3002<\/p>\n<p>\u6cbf\u771f\u5b9e\u8fb9\u754c\u9009\u62e9\u7684\u4e00\u5bf9\u76f8\u90bb\u70b9\uff0c\u5728\u7eaf\u4f4d\u7f6e\u77e9\u9635\u4e2d\u8ddd\u79bb\u4e3a\u4e00\uff0c\u52a0\u5165\u6b63\u786e\u989c\u8272\u540e\u589e\u81f3\u7ea6 3.559\u3002\u540c\u4fa7\u4e0a\u4e0b\u90bb\u70b9\u7684\u8ddd\u79bb\u4fdd\u6301\u4e3a\u4e00\u3002\u628a\u4e24\u4e2a\u53d6\u8272\u8f74\u4ea4\u6362\uff0c\u4e24\u4e2a\u6570\u5c31\u5bf9\u8c03\u4e86\u3002\u6211\u4eec\u8fd8\u6bd4\u8f83\u4e86\u9884\u6d4b\u6807\u7b7e\u4e0e\u6a21\u62df\u771f\u503c\u7684\u8c03\u6574\u5170\u5fb7\u6307\u6570\uff0c\u7eaf\u4f4d\u7f6e\u7ea6\u4e3a 0.889\uff0c\u6b63\u786e\u53d6\u8272\u4e3a\u4e00\uff0c\u4ea4\u6362\u53d6\u8272\u53c8\u7ea6\u4e3a 0.889\u3002\u8fd9\u4e2a\u4f8b\u5b50\u6709\u610f\u8ba9\u989c\u8272\u4e0e\u751f\u7269\u72b6\u6001\u8fb9\u754c\u4e00\u81f4\uff0c\u56e0\u6b64\u5b83\u80fd\u9a8c\u8bc1\u8f74\u987a\u5e8f\u548c\u8ddd\u79bb\u6784\u9020\uff0c\u65e0\u6cd5\u4f30\u8ba1\u771f\u5b9e\u5207\u7247\u5f15\u5165\u67d3\u8272\u540e\u7684\u5e73\u5747\u6536\u76ca\u3002\u4e09\u79cd\u8bad\u7ec3\u8f93\u51fa\u7684\u6bcf\u70b9\u7c7b\u522b\u5206\u503c\u52a0\u548c\u90fd\u7ea6\u4e3a\u4e00\uff0c\u5355\u67e5\u8fd9\u4e2a\u6027\u8d28\u5b8c\u5168\u53d1\u73b0\u4e0d\u4e86\u5750\u6807\u9519\u4f4d\u3002<\/p>\n<pre style=\"max-width:100%;box-sizing:border-box;overflow-x:auto;margin:18px 0;padding:14px 16px;background:#f3f6fa;color:#1a293c;border:1px solid #d8e1ea;border-radius:8px;line-height:1.55;white-space:pre;overflow-wrap:normal;word-break:normal\"><code class=\"language-python\">import numpy as np\r\n\r\n# D \u662f\u5b9e\u9645\u5c06\u8981\u4ea4\u7ed9 model.train \u7684\u8ddd\u79bb\u77e9\u9635\uff0cspot_ids \u662f\u8be5\u77e9\u9635\u7684\u70b9\u4f4d\u987a\u5e8f\r\nassert D.shape == (len(spot_ids), len(spot_ids))\r\nassert np.isfinite(D).all()\r\nassert np.allclose(D, D.T) and np.allclose(np.diag(D), 0)\r\nprint(D[14, 15], D[14, 20])  # \u672c\u4f8b\u9884\u5148\u9009\u5b9a\u7684\u8de8\u754c\u4e0e\u5185\u90e8\u90bb\u70b9\r\n<\/code><\/pre>\n<p>\u6700\u540e\u6362\u4e0a\u4e00\u5f20\u5b8c\u5168\u5747\u5300\u7684\u7070\u8272\u56fe\uff0c\u4fdd\u7559\u76f8\u540c\u7684\u53d6\u8272\u53c2\u6570\u3002\u8fd9\u6b21\u6784\u56fe\u8fd4\u56de\u7684\u4e09\u5341\u516d\u4e58\u4e09\u5341\u516d\u4e2a\u8ddd\u79bb\u5168\u90e8\u4e3a\u975e\u6709\u9650\u503c\uff0c\u8fd0\u884c\u65f6\u51fa\u73b0\u9664\u6cd5\u8b66\u544a\u3002\u539f\u56e0\u53ef\u4ee5\u4ece\u8fd9\u4e2a\u7248\u672c\u7684\u5b9e\u73b0\u8ffd\u5230\u901a\u9053\u65b9\u5dee\u548c\u989c\u8272\u6807\u51c6\u5316\u3002\u5728\u771f\u5b9e\u5207\u7247\u4e2d\uff0c\u82e5\u5750\u6807\u6216\u88c1\u526a\u6709\u8bef\uff0c\u6240\u6709\u7a97\u53e3\u6070\u597d\u90fd\u53d6\u5230\u540c\u4e00\u7247\u80cc\u666f\uff0c\u5c31\u6709\u53ef\u80fd\u9047\u5230\u76f8\u4f3c\u75c7\u72b6\u3002\u9047\u5230\u8fd9\u79cd\u8f93\u51fa\uff0c\u5e94\u5148\u770b\u53d6\u8272\u503c\u7684\u5206\u5e03\u5e76\u68c0\u67e5\u539f\u56fe\uff0c\u518d\u51b3\u5b9a\u662f\u5426\u6709\u8db3\u591f\u989c\u8272\u4fe1\u606f\u53c2\u4e0e\u8ba1\u7b97\u3002\u628a\u6240\u6709\u975e\u6709\u9650\u503c\u4e00\u6982\u8865\u6210\u96f6\uff0c\u4f1a\u628a\u539f\u672c\u65e0\u6cd5\u8ba1\u7b97\u7684\u70b9\u5bf9\u5199\u6210\u975e\u5e38\u63a5\u8fd1\uff0c\u5f71\u54cd\u540e\u7eed\u90bb\u57df\u3002<\/p>\n<h2 style=\"font-size:1.38em;line-height:1.5;margin:1.55em 0 .55em;color:#182d43\">\u600e\u6837\u7ed9\u7ec4\u7ec7\u8fb9\u754c\u7559\u4e0b\u53ef\u590d\u67e5\u7684\u8bc1\u636e<\/h2>\n<p>\u4ece\u4e00\u5f20\u4ee3\u8868\u6027\u5207\u7247\u9009\u53d6\u67d3\u8272\u8fb9\u754c\u6e05\u695a\u4f46\u8868\u8fbe\u5bf9\u6bd4\u5f31\u7684\u533a\u57df\uff0c\u518d\u9009\u8868\u8fbe\u6807\u8bb0\u660e\u663e\u4f46\u67d3\u8272\u5dee\u5f02\u5c0f\u7684\u533a\u57df\u3002\u5206\u522b\u5bf9\u6bd4\u5173\u95ed\u56fe\u50cf\u3001\u542f\u7528\u56fe\u50cf\u65f6\u7684\u7ed3\u679c\uff0c\u4fdd\u5b58\u539f\u59cb\u6807\u8bb0\u5206\u5e03\u3001\u50cf\u7d20\u53d6\u6837\u7a97\u53e3\u548c\u51e0\u4e2a\u5173\u952e\u70b9\u5bf9\u7684\u8ddd\u79bb\u3002\u82e5\u67d0\u4e2a\u533a\u57df\u53ea\u5728\u542f\u7528\u56fe\u50cf\u540e\u51fa\u73b0\uff0c\u5148\u9648\u8ff0\u8fd9\u4e00\u4f9d\u8d56\uff0c\u518d\u67e5\u770b\u72ec\u7acb\u5207\u7247\u6216\u5176\u4ed6\u6807\u8bb0\u80fd\u5426\u652f\u6301\u3002\u7ed9\u771f\u5b9e\u6837\u672c\u52a0\u4e0a\u7684\u7ec4\u7ec7\u540d\u5b57\u9700\u8981\u72ec\u7acb\u8bc1\u636e\uff0c\u793a\u4f8b\u91cc\u4eba\u4e3a\u8bbe\u5b9a\u7684\u53cc\u8272\u771f\u503c\u65e0\u6cd5\u4ee3\u66ff\u75c5\u7406\u5224\u8bfb\u3002<\/p>\n<p class=\"guide-end\" style=\"margin-top:1.6em;padding-top:1.0em;border-top:1px solid #d7e0e9\">\u591a\u5207\u7247\u9879\u76ee\u53ef\u5148\u5728\u4e00\u5f20\u7247\u4e0a\u786e\u8ba4\u50cf\u7d20\u8f74\u3001\u53d6\u8272\u7a97\u53e3\u548c\u8ddd\u79bb\u5206\u5e03\uff0c\u518d\u7528\u540c\u4e00\u5957\u68c0\u67e5\u6279\u91cf\u8fd0\u884c\u3002\u6709\u96c6\u4e2d\u8fd0\u884c\u6216\u4fdd\u5b58\u4e2d\u95f4\u77e9\u9635\u7684\u9700\u6c42\u65f6\uff0c\u53ef\u4e86\u89e3<a data-ysx-event=\"contact_click\" style=\"color:#355d8a;text-decoration:underline;text-underline-offset:2px\" href=\"https:\/\/www.biocloudservice.com\/wordpress\/compute-services\/shared-research-workspace\/\">\u4e91\u751f\u4fe1\u7684\u751f\u7269\u4fe1\u606f\u5206\u6790\u670d\u52a1\u5668<\/a>\u3002<\/p>\n<\/div>\n","protected":false},"excerpt":{"rendered":"<p>\u7528\u4e09\u79cd\u8f93\u5165\u8bad\u7ec3 SpaGCN\uff0c\u6838\u5bf9\u5e73\u9762\u5750\u6807\u3001\u56fe\u50cf\u50cf\u7d20\u4e0e\u53d6\u8272\u65b9\u5411\uff0c\u5e76\u590d\u73b0\u7eaf\u8272\u56fe\u50cf\u4ea7\u751f\u975e\u6709\u9650\u8ddd\u79bb\u7684\u60c5\u51b5\u3002<\/p>\n","protected":false},"author":1,"featured_media":69826,"comment_status":"closed","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"_jetpack_newsletter_access":"","_jetpack_dont_email_post_to_subs":false,"_jetpack_newsletter_tier_id":0,"_jetpack_memberships_contains_paywalled_content":false,"_jetpack_feature_clip_id":0,"_jetpack_memberships_contains_paid_content":false,"footnotes":"","jetpack_post_was_ever_published":false},"categories":[49,72],"tags":[909,910,379],"class_list":["post-69827","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-software","category-transcriptomics","tag-spagcn","tag-910","tag-379"],"jetpack_sharing_enabled":true,"jetpack_featured_media_url":"https:\/\/i0.wp.com\/www.biocloudservice.com\/wordpress\/wp-content\/uploads\/2026\/11\/spagcn-histology-pixel-axes-distance-controls-guide.png?fit=1200%2C840&ssl=1","_links":{"self":[{"href":"https:\/\/www.biocloudservice.com\/wordpress\/wp-json\/wp\/v2\/posts\/69827","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.biocloudservice.com\/wordpress\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.biocloudservice.com\/wordpress\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.biocloudservice.com\/wordpress\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/www.biocloudservice.com\/wordpress\/wp-json\/wp\/v2\/comments?post=69827"}],"version-history":[{"count":1,"href":"https:\/\/www.biocloudservice.com\/wordpress\/wp-json\/wp\/v2\/posts\/69827\/revisions"}],"predecessor-version":[{"id":69828,"href":"https:\/\/www.biocloudservice.com\/wordpress\/wp-json\/wp\/v2\/posts\/69827\/revisions\/69828"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/www.biocloudservice.com\/wordpress\/wp-json\/wp\/v2\/media\/69826"}],"wp:attachment":[{"href":"https:\/\/www.biocloudservice.com\/wordpress\/wp-json\/wp\/v2\/media?parent=69827"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.biocloudservice.com\/wordpress\/wp-json\/wp\/v2\/categories?post=69827"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.biocloudservice.com\/wordpress\/wp-json\/wp\/v2\/tags?post=69827"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}