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

相关推荐
同元软控3 分钟前
MWORKS EI:从数字空间到物理世界,面向具身智能产品的一体化研发环境
人工智能·机器学习
jay神6 分钟前
2026年YOLO还有哪些创新点可以做?
python·yolo·毕业设计·科研·课程设计·创新
VivienneLuo1 小时前
1. 联邦大模型微调综述 -《Federated Large Language Models...》
人工智能·语言模型·微调·联邦学习
漂流瓶jz6 小时前
【AI】大模型本地部署与量化:Ollama、transformers、llama.cpp实践
人工智能·llm·ai编程
飞哥数智坊7 小时前
AI时代,我们到底该学什么、用什么,为什么还没提效?
人工智能
飞哥数智坊7 小时前
GPT 做架构,国内模型写代码:这条 AI 开发路线能跑通吗?
人工智能·ai编程
AI_AGENT_DEV_AI8 小时前
AI 智能体的开发与上线
人工智能
VL——MOESR8 小时前
【具身智能】VLA论文阅读随笔
论文阅读·人工智能·机器学习·具身智能·vla
OCR_133716212758 小时前
从模板匹配到AI泛化识别:文本抽取如何重构护照阅读器落地生态
人工智能·重构
大唐荣华8 小时前
从OpenAI关停Sora看世界模型、AI视频与国内具身智能赛道路线分化
人工智能·openai·sora·内容生成