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图像

相关推荐
孟陬2 分钟前
另一个角度看 OpenClaw 分析 package.json 依赖看 2026 年包最新趋势
人工智能·ai编程
minstbe7 分钟前
IC设计私有化AI助手实战:基于Docker+OpenCode+Ollama的数字前端综合增强方案(基础版)
前端·人工智能·docker
qq_380651337 分钟前
xu#True
python
DeepModel9 分钟前
【概率分布】均匀分布的原理、推导与Python实现
python·算法·概率论
沪漂阿龙12 分钟前
从“火星文”到语义理解:破解NLP中的OOV未登录词难题
人工智能·自然语言处理
wmfglpz8813 分钟前
Django全栈开发入门:构建一个博客系统
jvm·数据库·python
ASD123asfadxv13 分钟前
倒残差移动块与滑动窗口注意力改进YOLOv26局部感知与全局建模双重突破
人工智能·yolo·目标跟踪
商业咨询信息14 分钟前
中之网科技江苏有限公司:四核驱动数字营销,构筑GEO优化+短视频运营+宣传片拍摄+网站建设全链路服务生态
人工智能·新媒体运营
咚咚王者14 分钟前
人工智能之语言领域 自然语言处理 第十二章 Transformer架构
人工智能·自然语言处理·transformer