How to solve the error?

3 ビュー (過去 30 日間)
Darsana P M
Darsana P M 2018 年 3 月 8 日
コメント済み: Darsana P M 2018 年 3 月 9 日
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?

採用された回答

Jan
Jan 2018 年 3 月 8 日
編集済み: Jan 2018 年 3 月 8 日
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 件のコメント
Darsana P M
Darsana P M 2018 年 3 月 9 日
ok sir. Thanks a lot.

サインインしてコメントする。

その他の回答 (0 件)

カテゴリ

Help Center および File ExchangeDICOM Format についてさらに検索

タグ

Community Treasure Hunt

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

Start Hunting!

Translated by