Hi,<br>I don&#39;t know about streaming and GDCM, but one workaround to your problem would:<br>- Instanciate one GDCM reader per file : so that you can visualize each file with appropriate rendering pipeline<br>- Instanciate a vtkImageAppend with inputs being readers outputs. eg:<br>
<br>     ### loop over the gdcm readers<br>     for reader in gdcmReadersList:<br>         imageAppend.AddInputConnection( reader.GetOutputPort( ) )<br><br>     ### update imageAppend<br>    imageAppend.Update( )<br><br>It implies that your readers&#39; list is correctly sorted before you append them, but it seems that it is your case (by reading your code).<br>
<br>HTH<br><br>Jerome<br><br><br><div class="gmail_quote">2010/1/29 Lic. José M. Rodriguez Bacallao <span dir="ltr">&lt;<a href="mailto:jmrbcu@gmail.com">jmrbcu@gmail.com</a>&gt;</span><br><blockquote class="gmail_quote" style="border-left: 1px solid rgb(204, 204, 204); margin: 0pt 0pt 0pt 0.8ex; padding-left: 1ex;">
no one?<br>
<div><div></div><div class="h5"><br>
On 1/28/10, Lic. José M. Rodriguez Bacallao &lt;<a href="mailto:jmrbcu@gmail.com">jmrbcu@gmail.com</a>&gt; wrote:<br>
&gt; well, digging around I have found vtkImageDataStreamer but it seems<br>
&gt; that doesn&#39;t work with vtkGDCMImageReader. Does vtkGDCMImageReader<br>
&gt; support streaming? How to do streaming with vtk and gdcm readers?<br>
&gt;<br>
&gt; this is a testing code, what is wrong here:<br>
&gt;<br>
&gt; import vtk, vtkgdcm<br>
&gt; from imagis.dicom.utils.series_scanner import SeriesScanner<br>
&gt; from imagis.dicom.utils.series_sorters import IPPSorter<br>
&gt; from imagis.vtk.utils import to_vtk_string_array<br>
&gt;<br>
&gt; scanner = SeriesScanner()<br>
&gt; scanner.scan(&#39;/home/jmrbcu/temp/dicom/BRAIN&#39;)<br>
&gt; files = scanner.series[0].files<br>
&gt;<br>
&gt; sorter = IPPSorter()<br>
&gt; sorted_files = sorter.sort(files)<br>
&gt;<br>
&gt; reader = vtkgdcm.vtkGDCMImageReader()<br>
&gt; reader.SetFileNames(to_vtk_string_array(sorted_files))<br>
&gt; reader.UpdateInformation()<br>
&gt;<br>
&gt; imageStreamer = vtk.vtkImageDataStreamer()<br>
&gt; imageStreamer.SetInputConnection(reader.GetOutputPort())<br>
&gt; imageStreamer.SetNumberOfStreamDivisions(8)<br>
&gt; imageStreamer.UpdateInformation()<br>
&gt; imageStreamer.GetExtentTranslator().SetSplitModeToBlock()<br>
&gt;<br>
&gt; color_mapper = vtkgdcm.vtkImageMapToWindowLevelColors2()<br>
&gt; color_mapper.SetInputConnection(imageStreamer.GetOutputPort())<br>
&gt;<br>
&gt; actor = vtk.vtkImageActor()<br>
&gt; actor.SetInput(color_mapper.GetOutput())<br>
&gt;<br>
&gt; renderer = vtk.vtkRenderer()<br>
&gt; renderer.AddActor(actor)<br>
&gt;<br>
&gt; rwi = vtk.vtkRenderWindowInteractor()<br>
&gt; rw = vtk.vtkRenderWindow()<br>
&gt; rwi.SetRenderWindow(rw)<br>
&gt;<br>
&gt; rw.AddRenderer(renderer)<br>
&gt; rw.Render()<br>
&gt;<br>
&gt; rwi.Initialize()<br>
&gt; rwi.Start()<br>
&gt;<br>
&gt; PS: changing the reader from the vtkGDCMImageReader to this it seems to<br>
&gt; work.<br>
&gt;<br>
&gt; reader = vtk.vtkImageReader()<br>
&gt; reader.SetDataByteOrderToLittleEndian()<br>
&gt; reader.SetDataExtent(0, 63, 0, 63, 1, 93)<br>
&gt; reader.SetDataSpacing(3.2, 3.2, 1.5)<br>
&gt; reader.SetFilePrefix(&quot;/home/jmrbcu/installs/development/c/vtk/5.4.2/VTKData/Data/headsq/quarter&quot;)<br>
&gt; reader.SetDataMask(0x7fff)<br>
&gt;<br>
&gt; On 1/28/10, Lic. José M. Rodriguez Bacallao &lt;<a href="mailto:jmrbcu@gmail.com">jmrbcu@gmail.com</a>&gt; wrote:<br>
&gt;&gt; hi folks, right now I am using vtkGDCMImageReader to read series of<br>
&gt;&gt; images, until now, everything is ok but one small problem (I think<br>
&gt;&gt; this is an small problem). When I try to read a serie of images, the<br>
&gt;&gt; reader load all of my images at one time and, if the serie is a big<br>
&gt;&gt; one, it may take time to load, then I show the images using vtk. The<br>
&gt;&gt; problem I am facing is that I need to show images even if the complete<br>
&gt;&gt; serie is not completly loaded at that time(this is a user<br>
&gt;&gt; requirement), I need to show the images already loaded by the reader,<br>
&gt;&gt; something like a streamed reader that if has loaded one image, the<br>
&gt;&gt; display it and continue loading the rest. Is this posible?<br>
&gt;&gt;<br>
&gt;&gt; PS: sorry for my english.<br>
&gt;&gt;<br>
&gt;&gt; --<br>
&gt;&gt; Lic. José M. Rodriguez Bacallao<br>
&gt;&gt; Centro de Biofisica Medica<br>
&gt;&gt; -----------------------------------------------------------------<br>
&gt;&gt; Todos somos muy ignorantes, lo que ocurre es que no todos ignoramos lo<br>
&gt;&gt; mismo.<br>
&gt;&gt;<br>
&gt;&gt; Recuerda: El arca de Noe fue construida por aficionados, el titanic<br>
&gt;&gt; por profesionales<br>
&gt;&gt; -----------------------------------------------------------------<br>
&gt;&gt;<br>
&gt;<br>
&gt;<br>
&gt; --<br>
&gt; Lic. José M. Rodriguez Bacallao<br>
&gt; Centro de Biofisica Medica<br>
&gt; -----------------------------------------------------------------<br>
&gt; Todos somos muy ignorantes, lo que ocurre es que no todos ignoramos lo<br>
&gt; mismo.<br>
&gt;<br>
&gt; Recuerda: El arca de Noe fue construida por aficionados, el titanic<br>
&gt; por profesionales<br>
&gt; -----------------------------------------------------------------<br>
&gt;<br>
<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 <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 VTK FAQ at: <a href="http://www.vtk.org/Wiki/VTK_FAQ" target="_blank">http://www.vtk.org/Wiki/VTK_FAQ</a><br>
<br>
Follow this link to subscribe/unsubscribe:<br>
<a href="http://www.vtk.org/mailman/listinfo/vtkusers" target="_blank">http://www.vtk.org/mailman/listinfo/vtkusers</a><br>
</div></div></blockquote></div><br>