Hola José!<br>I usually read a dicom serie from a directory this way with (the wonderful) WrapITK:<br><br>def load_serie(serie_dir,image_type):<br> import itk<br> reader = itk.ImageSeriesReader[image_type].New()<br>
gdcmIO = itk.GDCMImageIO.New()<br> reader.SetImageIO(gdcmIO.GetPointer())<br> namesGenerator = itk.GDCMSeriesFileNames.New()<br> namesGenerator.SetDirectory(serie_dir)<br> reader.SetFileNames(namesGenerator.GetInputFileNames())<br>
return itk.output(reader)<br><br>As far as I know you have to know the image_type (SS3,US3...) BEFORE reading the files, but maybe someone else knows a better way! (in this case plz let me know too :) )<br><br>HTH<br>
<br>Mario<br><br><div class="gmail_quote">On Tue, Jun 16, 2009 at 10:39 PM, Lic. José M. Rodriguez Bacallao <span dir="ltr"><<a href="mailto:jmrbcu@gmail.com">jmrbcu@gmail.com</a>></span> wrote:<br><blockquote class="gmail_quote" style="border-left: 1px solid rgb(204, 204, 204); margin: 0pt 0pt 0pt 0.8ex; padding-left: 1ex;">
hi folks, I am new to vtk and itk and I begining to love all the<br>
goodies of itk, right now, I'm triying to develop a dicom viewer with<br>
itk, vtk and python (my preferred language) so, I have a couple of<br>
questions to make.<br>
<br>
1- How about the quality of wrappers (WrapITK vs standard)<br>
2- How about memory consumption and load times of the wrappers.<br>
3- I need to read several DICOM files, from various modalities, how do<br>
I read all of them if I need to now the image type first, for example:<br>
<br>
import itk<br>
image_type = itk.Image[itk.SS, 2]<br>
file_name = 'IM66,dcm' #this is a CT image<br>
reader = itk.ImageFileReader[image_type].New()<br>
reader.SetFileName( file_name )<br>
reader.Update()<br>
<br>
what if I need to read a RGB dicom image?<br>
<br>
PS: sorry for my english, it's not so good.<br>
<br>
--<br>
Lic. José M. Rodriguez Bacallao<br>
Centro de Biofisica Medica<br>
-----------------------------------------------------------------<br>
Todos somos muy ignorantes, lo que ocurre es que no todos ignoramos lo mismo.<br>
<br>
Recuerda: El arca de Noe fue construida por aficionados, el titanic<br>
por profesionales<br>
-----------------------------------------------------------------<br>
_____________________________________<br>
Powered by <a href="http://www.kitware.com" target="_blank">www.kitware.com</a><br>
<br>
Visit other Kitware open-source projects at<br>
<a href="http://www.kitware.com/opensource/opensource.html" target="_blank">http://www.kitware.com/opensource/opensource.html</a><br>
<br>
Please keep messages on-topic and check the ITK FAQ at: <a href="http://www.itk.org/Wiki/ITK_FAQ" target="_blank">http://www.itk.org/Wiki/ITK_FAQ</a><br>
<br>
Follow this link to subscribe/unsubscribe:<br>
<a href="http://www.itk.org/mailman/listinfo/insight-users" target="_blank">http://www.itk.org/mailman/listinfo/insight-users</a><br>
</blockquote></div><br>