Matlab Code to remove sensitive items in a DICOM data


Matlab Code to remove sensitive items in a dicom data

geshi={'*.dcm','Dicom image (*.dcm)';...
       '*.bmp','Bitmap image (*.bmp)';...
       '*.jpg','JPEG image (*.jpg)';...
       '*.*','All Files (*.*)'};
[FileName FilePath]=uigetfile(geshi,'Load files','*.dcm','MultiSelect','on');
if ~isequal([FileName,FilePath],[0,0]);
    FileFullName=strcat(FilePath,FileName);
    if  ~ischar(FileFullName)
        FileFullName=FileFullName([2:end 1])';
    end
else
    return;
end
n=length(FileFullName);
foldername='dicom10';
mkdir(foldername);
for i=1:n
    X=dicomread(FileFullName{i});
    metadata=dicominfo(FileFullName{i});
    metadata.PatientName.FamilyName='XXX';
    metadata.InstitutionName='XXX';
    metadata.InstitutionalDepartmentName='XXX';
    dicomwrite(X, [foldername '/' FileName{i}], metadata, 'CreateMode', 'copy');
end



Next article

Comment 评论



Share 分享

New Users 最新加入

  • refrain

  • 鑫鑫

  • :)

New comments 最新评论

test123: aasdas Details Apr 13 16:39
admin: Thanks! Details Apr 09 11:46
admin: Google map api Details Apr 09 11:46
lqj12: cooooooooool Details Apr 08 21:34
Yunhan Huang: 这个功能是如何实现的? Details Apr 08 13:23