[vtkusers] vtk and lot of dicom series

Mathieu Malaterre mathieu.malaterre at gmail.com
Fri Nov 13 03:40:10 EST 2009


On Thu, Nov 12, 2009 at 10:22 PM, Lic. José M. Rodriguez Bacallao
<jmrbcu at gmail.com> wrote:
> hi folks, I am using vtk to display dicom image series. I am using
> python and pyqt4 in linux. I have noticed that when I load for at
> least 5 series of 200 MR images each one, my application get VERY
> slow. I am using vtkGDCMImageReader and load every serie within a
> vtkImageData for example this way:
>
> reader = vtkgdcm.vtkGDCMImageReader()
> reader.SetFileNames(to_vtk_string_array(serie1))
> reader.Update()
>
> I repeat this step in a thread for every serie and when it is loaded I
> send a signal for display it with vtkImageViewer2 (could be an
> vtkImageColorViewer from gdcm too)
>
> why is that, which is the recommended way to load and display a lot of
> dicom image series?

Send us the C++ code you wrote to actually be able to say that
DICOM/GDCM was the bottleneck in your benchmark.

Using thread to read files makes no sense in most situation.

GDCM comes with some benchmark tools such as threadgdcm.cxx (build
gdcm with examples:ON). Or use vtkGDCMThreadedImageReader.h /
vtkGDCMThreadedImageReader2.h if you really think that your data
server is doing striping and you think you can speed up reading using
this fact.

You really have to define your problem: the time to load the file from
disk to memory cannot be compressed without hardware changes. The time
to actually parse the DICOM file is extremely fast, run the benchmark
multiple times to be convinced (GDCM does a lot of optimization for
reading DICOM containing images). The only thing you can cheat with is
disk caching. Check readahead on linux and FILE_FLAG_SEQUENTIAL on
Win32.

HTH
-- 
Mathieu



More information about the vtkusers mailing list