MATLAB Answers

how to convert dicom image to jpg

52 views (last 30 days)
Usama Javed
Usama Javed on 26 Apr 2012
Commented: junyong hong on 12 Mar 2020
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

Accepted Answer

Thomas on 26 Apr 2012
You could use a software like power-dicom
or use a free software like dicom2 to convert to bmp, png or raw and then to jpg or just use the bmp/png in matlab directly..

More Answers (1)

Joy King
Joy King on 27 Jul 2012
Edited: Walter Roberson on 21 Dec 2012
close all;
clear all;
% Open an image.
% whether you open an image.
if isequal(filename,0)
disp('User selected Cancel.')
disp(['User selected ', fullfile(pathname, filename), '.'])
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');
[pathname, name, ext] = fileparts(full_file);
name = strcat(name, '.jpg');
new_name = fullfile(pathname, name);
% save the image as .jpg format.
if isa(Dic_data, 'int16')
elseif isa(Dic_data, 'uint8')

Community Treasure Hunt

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

Start Hunting!