Group Abstract Group Abstract

Message Boards Message Boards

How to import an image sequence

GROUPS:
Hello, 

Just a simple question: How can I import a sequence of images, lets say a DICOM sequence that I have in a folder. I tried differend options in Import command but it did not work.

Thanks.
POSTED BY: Soroush HP
Answer
1 year ago
Is there anything special about DICOM sequence or we can just assume we have a folder of images with let's say .jpg files?
POSTED BY: Vitaliy Kaurov
Answer
1 year ago
No, nothing special. Lets say it is a folder with JPEG images named as IMG_001, IMG_002, ...
POSTED BY: Soroush HP
Answer
1 year ago
SetDirectory["/Library/Application Support/Apple/iChat Icons/Planets"];
names = FileNames[]
Output:
{"Earth (Americas).gif", "Earth and Moon.gif", "Earth (Australasia).gif", "Earth (Clouds).gif", "Extrasolar Giant.gif", "Jupiter.gif", "Mars.gif", "Mercury.gif", "Neptune.gif", "Pluto and Charon.gif", "Saturn.gif", "Uranus.gif", "Venus.gif"}
Now just use import:
Import /@ names

POSTED BY: Vitaliy Kaurov
Answer
1 year ago
Thank you very much Vitaliy,
Since I want to use the image swquence for feature tracking, is there any way I can import them in an order, for example by their names: 001, 002, 003 ,...?
POSTED BY: Soroush HP
Answer
1 year ago
If it is numerical or alphabetical order - it will just happen automatically:
The list of files returned by FileNames is sorted in the order generated by the function Sort.  ~ Documentation
But you can do any sort of string-processing to sort out filenames list any any way you want. 
POSTED BY: Vitaliy Kaurov
Answer
1 year ago
You are right! Thanks
POSTED BY: Soroush HP
Answer
1 year ago