How to run 'dicomanon' on all '.dcm' files in a directory (including all subfolders)?

조회 수: 3 (최근 30일)
Peter Rush
Peter Rush 2019년 7월 29일
답변: Rik 2019년 7월 29일
Hi,
I'm new to Matlab and coding in general. I need to remove the patient information from a large number of dicom files. I need to write a script that finds all the dicom files in a given directory (including all subfolders) and applies to 'dicomanon' function to them.
The root directory contains 14 separate folders for different batches of scans, and each of those 14 folders contains two subfolders (one subfolder containing DTI scans and the other for T1 scans).
I've got a backup copy of the folder so I'd like to anonymise the files without changing the names or the strcuture of the file hierarchy. Any advice on how I might do this would be much appreciated.
Thanks!

답변 (1개)

Rik
Rik 2019년 7월 29일
Use the dir function to generate a full file list and then loop through them.
list=dir('C:\path\**\*.dcm');

카테고리

Help CenterFile Exchange에서 DICOM Format에 대해 자세히 알아보기

태그

제품


릴리스

R2018b

Community Treasure Hunt

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

Start Hunting!

Translated by