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

 Akzeptierte Antwort

Thomas
Thomas am 26 Apr. 2012

0 Stimmen

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..

Weitere Antworten (1)

Joy King
Joy King am 27 Jul. 2012
Bearbeitet: Walter Roberson am 21 Dez. 2012

6 Stimmen

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 Kommentare

venkat
venkat am 23 Sep. 2016
thanks a lot
junyong hong
junyong hong am 12 Mär. 2020
sweet

Melden Sie sich an, um zu kommentieren.

Kategorien

Mehr zu DICOM Format finden Sie in Hilfe-Center und File Exchange

Gefragt:

am 26 Apr. 2012

Kommentiert:

am 12 Mär. 2020

Community Treasure Hunt

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

Start Hunting!

Translated by