Advertisement

图像处理_DICOM医学图像处理

阅读量:

本实验的目标是采用最大灰度投影技术(MIP),即在临床应用中最为常见的血管成像方法,在三维数据处理中沿Z轴进行投影。

实验提示:将每层DICOM图像对应位置像素点依次比较取最大

实验平台:matlab

实验变量:输入:一组DICOM文件;输出z轴投影图

实验代码:

复制代码
 clear all

    
 clc
    
 close all
    
 file_path =  'E:\data\'; % 图像文件夹路径  
    
 img_path_list = dir(strcat(file_path,'*.dcm'));%获取该文件夹中所有dcm格式的图像  
    
 img_num = length(img_path_list);%获取图像总数量  
    
 imagemax = img_path_list(1).name;% 图像名
    
 imagemax =dicomread(strcat(file_path,imagemax)); 
    
 %%dcm变成灰度图
    
 for w=1:400
    
     for u=1:400
    
     tmp=double(imagemax(w,u));
    
     imagemax(w,u)=uint8(255*(tmp-17)/2407);
    
     end
    
 end
    
 %%比较
    
     for j = 1:img_num %逐一读取图像  
    
         image_name = img_path_list(j).name;% 图像名
    
         image =dicomread(strcat(file_path,image_name));
    
         for c=1:400
    
             for d=1:400
    
                 tem=double(image(c,d));
    
                 image(c,d)=uint8(255*(tem-17)/2407);
    
             end
    
         end
    
         for m=1:400
    
             for n=1:400
    
                 imagemax(m,n)=max(image(m,n),imagemax(m,n));
    
             end
    
         end
    
     end  
    
 imshow(imagemax,[]);
    
    
    
    
    AI写代码

实验截图:

全部评论 (0)

还没有任何评论哟~