how can i convert dicom images to jpg format?? i have a list of dicom images and i want to convert these images to jpg

 채택된 답변

Thomas
Thomas 2012년 4월 26일

0 개 추천

You could use a software like power-dicom
or use a free software like dicom2 to convert to bmp, png or raw
http://www.barre.nom.fr/medical/dicom2/ and then to jpg or just use the bmp/png in matlab directly..

추가 답변 (1개)

Joy King
Joy King 2012년 7월 27일
편집: Walter Roberson 2012년 12월 21일

6 개 추천

clc;
close all;
clear all;
% Open an image.
[filename,pathname]=uigetfile('*','open');
% whether you open an image.
if isequal(filename,0)
disp('User selected Cancel.')
else
disp(['User selected ', fullfile(pathname, filename), '.'])
end
full_file = fullfile(pathname,filename);
Dic_data = dicomread(full_file);
figure; imshow(Dic_data, 'DisplayRange', []);
% the name for your image after convertion.
if isempty(strfind(full_file, '.dic'))
new_name = strcat(full_file, '.jpg');
else
[pathname, name, ext] = fileparts(full_file);
name = strcat(name, '.jpg');
new_name = fullfile(pathname, name);
end
% save the image as .jpg format.
if isa(Dic_data, 'int16')
imwrite(Dic_data,new_name,'jpg','Bitdepth',16,'Mode','lossless');
elseif isa(Dic_data, 'uint8')
imwrite(Dic_data,new_name,'jpg','Mode','lossless');
end

댓글 수: 2

venkat
venkat 2016년 9월 23일
thanks a lot
junyong hong
junyong hong 2020년 3월 12일
sweet

댓글을 달려면 로그인하십시오.

카테고리

도움말 센터File Exchange에서 DICOM Format에 대해 자세히 알아보기

질문:

2012년 4월 26일

댓글:

2020년 3월 12일

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by