Borrar filtros
Borrar filtros

How to solve the error?

4 visualizaciones (últimos 30 días)
Darsana P M
Darsana P M el 8 de Mzo. de 2018
Comentada: Darsana P M el 9 de Mzo. de 2018
clc;
clear all;
close all;
I = dicomread('C:\Users\Click Me\Desktop\NIELIT\images output\try.dcm');
info = dicominfo('C:\Users\Click Me\Desktop\NIELIT\images output\try.dcm');
imshow(I,'DisplayRange',[]);
II = imread('rice.png');
info.PatientID = 'rice';
L = dicomwrite(I,'rice.dcm',info);
I was trying to insert rice.png image into dicom file. But I got this error:
Error using dicom_open_msg (line 31)
Could not open "rice.dcm" for writing
Error in dicomwrite>write_stream (line 659)
file = dicom_open_msg(file, 'w');
Error in dicomwrite>encodeAndWriteAttrs (line 324)
msg = write_stream(destination, data_stream);
Error in dicomwrite>write_message (line 281)
encodeAndWriteAttrs(attrs, options, filename);
Error in dicomwrite (line 208)
[status, options] = write_message(X, filename, map, metadata,
options);
Error in truuu (line 10)
L = dicomwrite(I,'rice.dcm',info);
How to solve this? How to insert a png image into a dicom file?

Respuesta aceptada

Jan
Jan el 8 de Mzo. de 2018
Editada: Jan el 8 de Mzo. de 2018
Could not open "rice.dcm" for writing
This can mean, that the file is write-protected or you do not have the permissions to write in this folder. Check this either in the file explorer of the operating system or by the fileattrib command.
This tries to create the file in the current folder:
dicomwrite(I,'rice.dcm',info)
Better define the folder to write to explicitly. fullfile might be useful here.
  1 comentario
Darsana P M
Darsana P M el 9 de Mzo. de 2018
ok sir. Thanks a lot.

Iniciar sesión para comentar.

Más respuestas (0)

Categorías

Más información sobre DICOM Format en Help Center y File Exchange.

Etiquetas

Community Treasure Hunt

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

Start Hunting!

Translated by