Mathematica Stack Exchange is a question and answer site for users of Mathematica. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

This question already has an answer here:

I'm extremely new to Mathematica. I want to import 201 .dcm (DICOM) files into Mathematica 9. Is there a way to do this which doesn't require my doing it an image at a time?

My ultimate need to is to then create a 3D image from these files.

Can anyone help?


share|improve this question

marked as duplicate by Yves Klett, ciao, Kuba, Michael E2, m_goldberg Mar 28 '14 at 13:02

This question has been asked before and already has an answer. If those answers do not fully address your question, please ask a new question.

Quite simple:

files = FileNames["somePath/*.dicom"];
imgs = Map[Import, files];

Where Filenames finds all files in some path and Map applies the function Import to every list item in the second parameter.

If you want a progress indicator (probably a good idea for 200 images), you can do this:

files = FileNames["somePath/*.dicom"];
imgs = Monitor[Table[Import[files[[i]]], {i, Length[files]}], 
share|improve this answer
Thank you, that seems to work – Palaeoanth Mar 28 '14 at 6:56

Not the answer you're looking for? Browse other questions tagged or ask your own question.