Issue with writing DICOM images to a folder ('Could not open folder for writing' error)
Show older comments
I have a script to apply a manual segmentation to a set of DICOM images in a for loop. I want to write the segmentation for each image to a specific (initially empty) folder.
baseFileName = sprintf('%s_%d.dcm', cnt);
fullFileName = fullfile(pwd, 'Project_Segmentations', baseFileName);
dicomwrite(segmentation, fullFileName);
The error message I'm getting is:
Error using dicom_open_msg (line 31)
Could not open "Project\DICOMs_Project\_" for writing
Error in dicomwrite>write_stream (line 660)
file = dicom_open_msg(file, 'w');
Error in dicomwrite>encodeAndWriteAttrs (line 325)
msg = write_stream(destination, data_stream);
Error in dicomwrite>write_message (line 282)
encodeAndWriteAttrs(attrs, options, filename, specificCharacterSet);
Error in dicomwrite (line 208)
[status, options] = write_message(X, filename, map, metadata, options);
Error in ManualSegmentationFull (line 80)
dicomwrite(segmentation, fullFileName);
Thanks in advance for any advice you may have!
Accepted Answer
More Answers (0)
Categories
Find more on DICOM Format in Help Center and File Exchange
Products
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!