Pytorch项目,肺癌检测项目之四

安装图像处理 的两个包 simpleITK 和 ipyvolume

安装缓存相关的两个包 diskcache 和 cassandra-driver

import gzip

from diskcache import FanoutCache, Disk

from cassandra.cqltypes import BytesType

from diskcache import FanoutCache,Disk,core

from diskcache.core import io

from io import BytesIO

from diskcache.core import MODE_BINARY

from util.logconf import logging

log+ logging.getLogger(name)

log.setLevel(logging.INFO)

import matplotlib

matplotlib.use('nbagg')

import numpy as np

import matplotlib.pyplot as plt

from codel.dsets import Ct ,LunaDataset

clim = (-1000.0,300)

def findPositiveSamples(start_ndx=0,limit=100):

ds = LinaDataset()

positiveSample_list = []

for sample_tup in ds.candidateInfo_list:

if sample_tup.isNodule_bool:

#print(len(positiveSanple_list),sample_tup)

if len(positiveSample_list)>=linit:

break

return positiveSample_list

def showCandidate(series_uid,batch_ndx=None, **kwargs):

ds = LunaDataset(series_uid=series_uid,**kwargs)

pos_list = [i for i, x in enumerate(ds.candidateInfo_list) if x.isNodule_bool]

if batch_ndx is None:

if pos_list:

batch_ndx = pos_list[0]

else:

print("Warning: no positive samples found : using frist negative sample.")

batch_ndx = 0

cd = Ct(series_uid)

cd_t,pos_t,series_uid,center_irc = ds[batch_ndx]

ct_a = ct_t[0].numpy()

#图像的设置问题,设置图片的大小

fig = plt.figure(figsize=(30,50))

#设置切片位置

group_list = [[9,11,13],[15,16,17],[19,21,23]]

add_subplot(3,4,,9) 写在三行四列第九个位置

subplot = fig.add_subplot(len(grooup_list)+2,3,1)

sub.set_title('index {}'.format(int(center_irc[0])),fontsize=30)

for label in (subplot.get_xticklabels()+ subplot.get_yticklabels()):

label.set_fontsize(20)

plt.imshow(ct.hu_a[int(center_irc[0])],clim=clim,cmap='gray')

for row index_list in enumerate(group_list):

for col,index in enumerate(index_list):

subplot=fig.add_subplot(len(group_list)+2,3,row*3+clo+7)

subplot.set_title('sicle {}'.format(index),fontsize=30)

for label in (subplot.get_xticklabels() + subplot.get_vticklabels()):

label.set_fontsize(20)

plt.imshow(ct_a[index],clim=clim,cmap='gary')

print(series_uid,batch_ndx,bool(pos_t[0]),pos_list)

总结:

(1)肺部肿瘤检测项目介绍

(2)了解CT数据,定制方案

(3)下载项目中使用的数据集

(4)对数据集进行处理

(5)如何可视化CT数据

问题挑战和思考调研

(1)缓存部分去掉加载数据集需要多长时间

(2)网站grand-challenge网站上还有木有以CT数据作为数据源的项目

(3)了解下除了CT图像数据,还有什么3D图像

相关推荐
山海青风1 天前
11 Prompt 工程进阶:Few-shot 与 Chain-of-Thought
人工智能·prompt
爱看科技1 天前
AI/AR智能眼镜步入全球破圈增长期,五大科技大厂入局加剧生态市场角逐
人工智能·科技·ar
人有一心1 天前
深度学习里的树模型TabNet
人工智能·深度学习
Kyln.Wu1 天前
【python实用小脚本-211】[硬件互联] 桌面壁纸×Python梦幻联动|用10行代码实现“开机盲盒”自动化改造实录(建议收藏)
开发语言·python·自动化
强盛小灵通专卖员1 天前
边缘计算设备NPU的加速原理
人工智能·深度学习·边缘计算·sci·中文核心·小论文
moz与京1 天前
【面试向】边缘计算基础介绍
人工智能·边缘计算
ShiMetaPi1 天前
【ShiMetaPi】基于BM1684X的智能工业视觉边缘计算盒子解决方案
人工智能·边缘计算·bm1684x
强盛小灵通专卖员1 天前
RK3576边缘计算设备部署YOLOv11
人工智能·深度学习·yolo·边缘计算·sci·rk3576·小论文
Ms_Big1 天前
ppliteseg改rknn,部署在嵌入式板,加速模型
人工智能·python·深度学习
说私域1 天前
基于开源AI智能名片链动2+1模式S2B2C商城小程序的移动互联网人气氛围营造机制研究
人工智能·小程序·开源