I cropped a few dicom images and placed test on the cropped images (test1.dcm, test2.dcm,....).
Now I want to grab them altogether and put them in a new folder. I am trying this with no luck. Any suggestion?
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')); file_to_move = fullfile(newdir,W) movefile(file_to_move,newdir) end

1 comentario

neda esmaeili
neda esmaeili el 27 de Abr. de 2022
i also wnt to move files of a folder to the other
for i = 5:6
BasePath = ['C:/Users/MacBook/Desktop/proposal/UMA-PROJECT/hospital/',num2str(i),'/'];
Lst = dir(fullfile(BasePath ,'*down'));
cd 'C:/Users/MacBook/Desktop/proposal/UMA-PROJECT/hospital/',num2str(i),'/';
movefile down 1
%movefile C:/Users/MacBook/Desktop/proposal/UMA-PROJECT/hospital/',num2str(i),'/','up 2
end
but it can't find floder of down.

Iniciar sesión para comentar.

 Respuesta aceptada

Ameer Hamza
Ameer Hamza el 30 de Abr. de 2018

0 votos

After all, files are created. Use
movefile('*.dcm', newdir);
to move all files together.

4 comentarios

Stelios Fanourakis
Stelios Fanourakis el 1 de Mayo de 2018
It doesn't work. Files are not moving.
Ameer Hamza
Ameer Hamza el 1 de Mayo de 2018
It seems that the files are not present in the current working directory. Try this
movefile('C:\Echo Images\Stelios\FDB.dcm\test*.dcm', newdir)
Stelios Fanourakis
Stelios Fanourakis el 1 de Mayo de 2018
The last line code worked. Thank you so much!!!
Ameer Hamza
Ameer Hamza el 1 de Mayo de 2018
You are welcome.

Iniciar sesión para comentar.

Más respuestas (0)

Categorías

Más información sobre DICOM Format en Centro de ayuda y File Exchange.

Preguntada:

el 30 de Abr. de 2018

Comentada:

el 27 de Abr. de 2022

Community Treasure Hunt

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

Start Hunting!

Translated by