Hi,<br>I don'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' 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"><<a href="mailto:jmrbcu@gmail.com">jmrbcu@gmail.com</a>></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 <<a href="mailto:jmrbcu@gmail.com">jmrbcu@gmail.com</a>> wrote:<br>
> well, digging around I have found vtkImageDataStreamer but it seems<br>
> that doesn't work with vtkGDCMImageReader. Does vtkGDCMImageReader<br>
> support streaming? How to do streaming with vtk and gdcm readers?<br>
><br>
> this is a testing code, what is wrong here:<br>
><br>
> import vtk, vtkgdcm<br>
> from imagis.dicom.utils.series_scanner import SeriesScanner<br>
> from imagis.dicom.utils.series_sorters import IPPSorter<br>
> from imagis.vtk.utils import to_vtk_string_array<br>
><br>
> scanner = SeriesScanner()<br>
> scanner.scan('/home/jmrbcu/temp/dicom/BRAIN')<br>
> files = scanner.series[0].files<br>
><br>
> sorter = IPPSorter()<br>
> sorted_files = sorter.sort(files)<br>
><br>
> reader = vtkgdcm.vtkGDCMImageReader()<br>
> reader.SetFileNames(to_vtk_string_array(sorted_files))<br>
> reader.UpdateInformation()<br>
><br>
> imageStreamer = vtk.vtkImageDataStreamer()<br>
> imageStreamer.SetInputConnection(reader.GetOutputPort())<br>
> imageStreamer.SetNumberOfStreamDivisions(8)<br>
> imageStreamer.UpdateInformation()<br>
> imageStreamer.GetExtentTranslator().SetSplitModeToBlock()<br>
><br>
> color_mapper = vtkgdcm.vtkImageMapToWindowLevelColors2()<br>
> color_mapper.SetInputConnection(imageStreamer.GetOutputPort())<br>
><br>
> actor = vtk.vtkImageActor()<br>
> actor.SetInput(color_mapper.GetOutput())<br>
><br>
> renderer = vtk.vtkRenderer()<br>
> renderer.AddActor(actor)<br>
><br>
> rwi = vtk.vtkRenderWindowInteractor()<br>
> rw = vtk.vtkRenderWindow()<br>
> rwi.SetRenderWindow(rw)<br>
><br>
> rw.AddRenderer(renderer)<br>
> rw.Render()<br>
><br>
> rwi.Initialize()<br>
> rwi.Start()<br>
><br>
> PS: changing the reader from the vtkGDCMImageReader to this it seems to<br>
> work.<br>
><br>
> reader = vtk.vtkImageReader()<br>
> reader.SetDataByteOrderToLittleEndian()<br>
> reader.SetDataExtent(0, 63, 0, 63, 1, 93)<br>
> reader.SetDataSpacing(3.2, 3.2, 1.5)<br>
> reader.SetFilePrefix("/home/jmrbcu/installs/development/c/vtk/5.4.2/VTKData/Data/headsq/quarter")<br>
> reader.SetDataMask(0x7fff)<br>
><br>
> On 1/28/10, Lic. José M. Rodriguez Bacallao <<a href="mailto:jmrbcu@gmail.com">jmrbcu@gmail.com</a>> wrote:<br>
>> hi folks, right now I am using vtkGDCMImageReader to read series of<br>
>> images, until now, everything is ok but one small problem (I think<br>
>> this is an small problem). When I try to read a serie of images, the<br>
>> reader load all of my images at one time and, if the serie is a big<br>
>> one, it may take time to load, then I show the images using vtk. The<br>
>> problem I am facing is that I need to show images even if the complete<br>
>> serie is not completly loaded at that time(this is a user<br>
>> requirement), I need to show the images already loaded by the reader,<br>
>> something like a streamed reader that if has loaded one image, the<br>
>> display it and continue loading the rest. Is this posible?<br>
>><br>
>> PS: sorry for my english.<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<br>
>> mismo.<br>
>><br>
>> Recuerda: El arca de Noe fue construida por aficionados, el titanic<br>
>> por profesionales<br>
>> -----------------------------------------------------------------<br>
>><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<br>
> mismo.<br>
><br>
> Recuerda: El arca de Noe fue construida por aficionados, el titanic<br>
> por profesionales<br>
> -----------------------------------------------------------------<br>
><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>