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_list0

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 = dsbatch_ndx

ct_a = ct_t0.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_irc0)),fontsize=30)

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

label.set_fontsize(20)

plt.imshow(ct.hu_aint(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_aindex,clim=clim,cmap='gary')

print(series_uid,batch_ndx,bool(pos_t0),pos_list)

总结:

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

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

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

(4)对数据集进行处理

(5)如何可视化CT数据

问题挑战和思考调研

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

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

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

相关推荐
IT_陈寒3 分钟前
Vue这个坑我跳了两次,原来问题出在这
前端·人工智能·后端
weiwei228449 分钟前
神经网络模型导出及开放标准格式ONNX
pytorch·onnx
新新技术迷29 分钟前
Node给AI接口做SSE代理与鉴权
人工智能
ServBay1 小时前
9 个 Python 第三方库推荐,不用 AI 都好像多出一个团队
后端·python
用户8356290780511 小时前
如何使用 Python 添加和管理 Excel 批注(完整示例)
后端·python
redreamSo1 小时前
大模型是不是到顶了?瓶颈到底在哪
人工智能·openai
用户8356290780511 小时前
使用 Python 管理 Excel 工作表:创建、复制、删除与重命名
后端·python
Oo9201 小时前
Tool Use 背后的技术逻辑
人工智能
姗姗来迟了1 小时前
Vue3封装AI流式对话组件踩坑实录
人工智能
码上天下2 小时前
用Pinia管理AI多会话状态
人工智能