当前位置: 首页 > news >正文

hd 单细胞空间转录组学习路径 stardist

spatialdata

Tutorials — spatialdatahttps://spatialdata.scverse.org/en/latest/tutorials/notebooks/notebooks.html

先从10x segment教程学习

Nuclei Segmentation and Custom Binning of Visium HD Gene Expression Data - 10x Genomics

重要函数:

数组转换为图片   怎么把数字画成图 
from stardist.data import test_image_nuclei_2d
from stardist.plot import render_label
from csbdeep.utils import normalize
import matplotlib.pyplot as pltimg = test_image_nuclei_2d()plt.imshow(img, cmap="gray")import matplotlib.pyplot as pltplt.imshow(arr)      # RGB 数组即可显示
plt.axis('off')
plt.show()

import matplotlib.pyplot as plt
from skimage.color import label2rgb
overlay = label2rgb(labels, image=img, bg_label=0, alpha=0.3)
plt.imshow(overlay); plt.axis('off')

读取 png图片,
import numpy as np
import pandas as pd
from PIL import Image
from pathlib import Path
import matplotlib.pyplot as plt# 1. 读取图像与语义掩膜
img = np.array(Image.open("./images/img_001.png")) / 255.0
plt.imshow(img)

读取btf tiff文件

from tifffile import imread, imwrite
from csbdeep.utils import normalize
from stardist.models import StarDist2D
from shapely.geometry import Polygon, Point
from scipy import sparse
from matplotlib.colors import ListedColormap# 路径(示例)
dir_base = './binned_outputs/'
filename = 'Visium_HD_Mouse_Small_Intestine_tissue_image.btf'  # 或你的高分辨率 H&E .tif
img = imread(os.path.join(dir_base, filename))

http://www.dtcms.com/a/346966.html

相关文章:

  • 什么是AI宠物
  • ffmpeg 问答系列
  • 《三驾马车:MySQL、MongoDB、Redis对比与融合实战》
  • 可视化-模块1-HTML-01
  • UniAD
  • 电容反射特性
  • Linux netfilter工作原理详解
  • Spring Boot 整合网易163邮箱发送邮件实现找回密码功能
  • 数据库MVCC是什么
  • 每日算法题【链表】:链表的中间节点、返回倒数第k个节点、合并两个有序链表
  • Git checkout 与 Git reset 核心区别解析(分支与版本关联逻辑)
  • C语言初学者笔记【动态内存管理】
  • 在WSL2 Ubuntu中部署FastDFS服务的完整指南
  • Elasticsearch底层存储原理
  • Codeforces Round 1043 (Div. 3)(A-E)
  • 数据库优化提速(三)JSON数据类型在酒店管理系统搜索—仙盟创梦IDE
  • jetson ubuntu 打不开 firefox和chromium浏览器
  • 非线性规划学习笔记
  • SpringBootWeb入门
  • 力扣(全排列)
  • 生成模型 | 扩散模型损失函数公式推导
  • Go语言数据结构与算法-基础数据结构
  • 《WinRAR》 [7.12] [x64] 烈火版 下载
  • 数据结构的线性表:顺序表
  • piecewise jerk算法介绍
  • 2025年音乐创作大模型有哪些?国内国外模型汇总以及优点分析
  • 高阶数据结构---ST表
  • 同类软件对比(一):Visual Studio(IDE) VS Visual Studio Code
  • [CISCN2019 华北赛区 Day1 Web5]CyberPunk
  • MySQL存储过程入门