[ITK] Can python sitk.ReadImage read a list of images?

Oren oren.a4 at gmail.com
Fri Jul 14 03:11:57 EDT 2017


Hello,
I do not understand if sitk.ReadImage can read a list of images or not? I
did not manage to find an example showing how to list of images should be
imputed to the function.
But in the function documentations it say:

ReadImage(*VectorString fileNames*, itk::simple::PixelIDValueEnum
outputPixelType) -> Image
ReadImage(std::string const & filename, itk::simple::PixelIDValueEnum
outputPixelType) -> Image



ReadImage is a procedural interface to the ImageSeriesReader class
which is convenient for most image reading tasks.


Note that when *reading a series of images* that have meta-data
associated with them (e.g. a DICOM series) the resulting image will
have an empty meta-data dictionary. It is possible to programmatically
add a meta-data dictionary to the compounded image by reading in one
or more images from the series using the ImageFileReader class,
analyzing the meta-dictionary associated with each of those images and
creating one that is relevant for the compounded image.



So it seems from the documentations that it is possible. Can someone show
me a simple example.

I also posted the question in stackoverflow in case anyone else will ask it
in the future:

https://stackoverflow.com/questions/45096861/can-python-sitk-readimage-read-a-list-series-of-images

Thanks.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://public.kitware.com/pipermail/community/attachments/20170714/5e511ecf/attachment.html>


More information about the Community mailing list