How to convert a medical image file into .png image format?

6 vues (au cours des 30 derniers jours)
varun rao
varun rao le 2 Jan 2016
Commenté : Image Analyst le 13 Fév 2020
The file given here Medical Image File has a format *.gz, it is a compressd file. After unzipping I found some file without extension. It has given in the link that the file has properties mentioned below.
  • DICOM
  • Implicit Little (raw)
  • CR
  • MONOCHROME1
  • 440x440
  • [10, 16 | 9], PR=0
  • Fuji photo film Co.
  • 9000
Please let me know If there is anyway to convert it into .png format.

Réponses (2)

Image Analyst
Image Analyst le 2 Jan 2016
Modifié(e) : Image Analyst le 12 Fév 2020
% Read existing image.
theImage = dicomread(existingFullFileName);
% Get the base file name
[folder, baseFileName, ext] = fileparts(existingFullFileName);
% Create a new PNG name for it.
fullFileName = fullfile(folder, [baseFileName, '.png']);
% Save it to disk
imwrite(theImage, fullFileName);

Ahmad Alenezi
Ahmad Alenezi le 11 Fév 2020
HI there
what does this means :
[folder, baseFileName, ext] = fileparts(existingFullFileName);
i am receiving error because of it.
thanks
Ahmad
  3 commentaires
Ahmad Alenezi
Ahmad Alenezi le 12 Fév 2020
Hi there
Sorry for my unclear question.
can you please show how can i use this code if i want to convert my dicom file to png ?. My file name is (chest.dcm).
Image Analyst
Image Analyst le 13 Fév 2020
My code did that. Here it is again:
% Read existing image.
theImage = dicomread(existingFullFileName);
% Get the base file name
[folder, baseFileName, ext] = fileparts(existingFullFileName);
% Create a new PNG name for it, this time with a png extension.
fullFileName = fullfile(folder, [baseFileName, '.png']);
% Save it to disk in png format.
imwrite(theImage, fullFileName);

Connectez-vous pour commenter.

Catégories

En savoir plus sur Convert Image Type dans Help Center et File Exchange

Community Treasure Hunt

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

Start Hunting!

Translated by