Info

この質問は閉じられています。 編集または回答するには再度開いてください。

why not moving??

2 ビュー (過去 30 日間)
Stelios Fanourakis
Stelios Fanourakis 2018 年 5 月 1 日
閉鎖済み: MATLAB Answer Bot 2021 年 8 月 20 日
I had a series of files named S0009, S0010, etc and turned them dicom images with dicomwrite, renaming them to test1.dcm, test2,dcm etc.. Now I want to transfer all test1,2,3.dcm files to another subfolder. I use this, although I get no error, still they are not moving.
destinationFolder = 'C:\Echo Images\Stelios\FDB.dcm\TeSt';
if ~exist(destinationFolder,'dir')
mkdir(destinationFolder);
end
dir 'C:\Echo Images\Stelios\FDB.dcm'
listing = dir('.dcm');
[m n z] = size(listing);
for indx=3:m
listing(indx).name
A = dicomread(strcat( 'C:\Echo Images\Stelios\FDB.dcm\' , listing(indx).name));
imshow(A);
I3 = imcrop(A, [200.5 59.75 591 480]);
%A = imresize(A, [360, 280]);
W = dicomwrite(I3, strcat('C:\Echo Images\Stelios\FDB.dcm\test', int2str(indx-2) , '.dcm'));
fullfileName = fullfile(destinationFolder,W)
dicomwrite(W,fullfileName)
end

回答 (1 件)

Walter Roberson
Walter Roberson 2018 年 5 月 1 日
The return value from dicomwrite is a strut of status information. You try to use the strut to build a file name and then do a second dicomwrite of just the status information which is not valid data to write.
What is the intent of having the two dicomwrite?

この質問は閉じられています。

Community Treasure Hunt

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

Start Hunting!

Translated by