imageDatastore容积图像

3视图(30天)
我想使用 imageDatastore 命令准备训练集训练一个体积卷积神经网络的语义分割模型。我跟着下面的指示在MATLAB的网页,我的代码提供了多层Tif文件代表输入图像和标签输入图像(地面真理)。
然而,似乎imageDatastore只读取一个层(片)和无法处理的容积图像。有人知道我们应该如何使用此命令的容积图像分割任务吗?或我们如何准备训练集训练一个体积sementic细分模式如Unet 3 d ( //www.tianjin-qmedu.com/help/vision/ref/unet3dlayers.html )?提前感谢。
2的评论
备忘录雷莫
备忘录雷莫 2023年2月6日
编辑:备忘录雷莫 2023年2月6日
亲爱的已经,
谢谢你的回复。
气管无名动脉瘘管的转换图像到卷文件使用MATLAB代码使用imwrite命令“追加”写方式。我这个文件命名为“Train_Vol”。
然后我试着使用下面的代码来训练我的模型:
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
Train_imds = blockedImage (Train_Tif_Dir);
一会= (“L”、“电信”);
labelIDs = (255 0);
一会,Train_pxds = pixelLabelDatastore (Train_LebelsDir labelIDs);
Train_ds =结合(Train_imds Train_pxds);
网= trainNetwork (Train_ds lgraph)
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
lgraph模型架构,Train_LebelsDir是我气管无名动脉瘘管的存储容量的目录文件,其中包含标签为每个培训Train_Vol tif文件中的图片。

登录置评。

接受的答案

阿施施Uthama
阿施施Uthama 2023年2月7日
移动:阿施施Uthama 2023年2月8日
blockedImage不能转换片体积块的不幸!blockedImage是有用的,当你想要一个“单元”分解成多个逻辑个亚单元(我。一个文件成许多构成块)。所以它不适合您的工作流此刻(特别是,因为它看起来像你的“单位”的数据很容易装入内存)。
这有帮助吗?
你将取代构造函数的第一个参数imageDatastore pixellabelDatastore和文件的列表,他们应该匹配保证图片和标签是正确配对!。
%图像数据
我= uint8(魔法(10));
imwrite (im,“vol.tif”)
imwrite (im,“vol.tif”,“写模式”,“添加”)
imd = imageDatastore ([“vol.tif”),“ReadFcn”,@tiffreadVolume);
v =阅读(imd);
大小(v)
% ans =
% 10 10 2
%的标签数据
标签= im > 50;
imwrite(标签,“labels.tif”)
imwrite(标签,“labels.tif”,“写模式”,“添加”)
摩门教的= pixelLabelDatastore ([“labels.tif”]、[“bg”,“成品”0]、[1],“ReadFcn”,@tiffreadVolume);
%结合数据,其中一个读取了数据,标签设置:
cd =结合(imd,摩门教);
d =阅读(cds)
% d{1}将形象,d{2}将相应的标签。
2的评论
备忘录雷莫
备忘录雷莫 2023年2月11日
编辑:备忘录雷莫 2023年2月11日
亲爱的 @Ashish Uthama
当我想使用这种方法训练模型,得到以下错误。我不明白什么是失踪。你知道我可以检查误差源吗?
错误使用trainNetwork
无效的或删除对象。
错误在UNet_Mine_V2_CW21_001RICA_TissueNice(第916行)
网= trainNetwork (Train_ds lgraph,选项)
引起的由:
错误使用索引
无效的或删除对象。

登录置评。

答案(1)

对于车辆
对于车辆 2023年2月6日
嗨,备忘录,
blockedImage 对象(在图像处理工具箱)文档中提到卷图片:
blockedImage对象是由离散的块。使用了图像时图像或体积太大,以适应到内存中。屏蔽图片,您可以执行处理而不会耗尽内存。
有一个关联的数据存储可以使用 blockedImage 被称为 blockedImageDatastore
这里是一个列表的例子使用 blockedImageDatastore : //www.tianjin-qmedu.com/help/images/examples.html?category=large-image-files
我希望这可以帮助!
对于车辆
4评论
备忘录雷莫
备忘录雷莫 2023年2月6日
我试着给你提到的ReadFcn。不幸的是,它不工作。它只读取一个片整个体积。
- - - - - - - - - - - - - - - - - - - - - - - - - - - - -
Train_imds = imageDatastore (Tissue_HL_Tif_Dir);
Train_imds。ReadFcn = @tiffreadVolume;
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
“Tissue_HL_Tif_Dir”体积tiff文件的位置。

登录置评。

社区寻宝

找到宝藏在MATLAB中央,发现社区如何帮助你!

开始狩猎!