Filter löschen
Filter löschen

How to solve the error?

4 Ansichten (letzte 30 Tage)
Darsana P M
Darsana P M am 8 Mär. 2018
Kommentiert: Darsana P M am 9 Mär. 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?

Akzeptierte Antwort

Jan
Jan am 8 Mär. 2018
Bearbeitet: Jan am 8 Mär. 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.

Weitere Antworten (0)

Kategorien

Mehr zu DICOM Format finden Sie in Help Center und File Exchange

Tags

Community Treasure Hunt

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

Start Hunting!

Translated by