[vtkusers] VTK4.2 CD

Kate Kerekes kerekes at fastmail.fm
Mon Oct 4 22:38:39 EDT 2004


I am reading data from an IDE disk.  Here is a sample timing tcl code that I
wrote to test it:

###############################
#!/bin/sh
load vtkCommonTCL.dll
load vtkFilteringTCL.dll
load vtkGraphicsTCL.dll
load vtkIOTCL.dll
load vtkImagingTCL.dll
load vtkRenderingTCL.dll
load vtkHybridTCL.dll
source Interactor.tcl
source bindings-rw.tcl
source bindings-iw.tcl
source bindings.tcl
source setget.tcl

console show
set time1 [clock clicks -milliseconds]
vtkImageReader2 reader
[reader GetOutput] ReleaseDataFlagOn
	reader SetDataExtent 0 511 0 511 0 511 
	reader SetDataScalarTypeToShort
	reader SetDataByteOrderToLittleEndian
	reader SetFilePrefix "C:\\mouse512\\"
	reader SetFilePattern "%s%.4d.slice"

reader Update
set time2 [clock clicks -milliseconds]
puts "time=[expr ($time2*1.0-$time1*1.0)/1000] seconds"
###########################

using this time code it takes 42 seconds to load my data.  The only
difference I see in my tcl code and Mathieu's c code is that he is reading a
.img file that is 512x512x512 while I am reading a series of slices.  Would
that make any difference in time?  Also there is the obvious difference of
tcl code versus c code, but it can't be that much slower.

I tried to run Mathieu's C++ code, but got bogged down in Visual Studio
.NET.  I haven't worked with it for awhile and just installed it on this
machine and I can't get all of my libraries and include files set up
correctly.

kate

-----Original Message-----
From: Sean McInerney [mailto:seanm at nmr.mgh.harvard.edu] 
Sent: Monday, October 04, 2004 4:05 PM
To: Mathieu Malaterre
Cc: Kate Kerekes; vtkusers at vtk.org
Subject: Re: [vtkusers] VTK4.2 CD

Kate,

   Are you reading your data from a slow storage device like a CD, Zip 
drive, or a USB hard disk? Since there are no big computational 
bottlenecks for your read, I am guessing that your storage device is the 
culprit. Reading ~268Mb of data will take a perceptible amount of time 
even with fast IDE or SCSI disks ... but not more than a few seconds ... 
*displaying* these data is another story! You'll need a fast machine to 
contour or volume render these data with any degree of interactivity.

   You could try profiling your code (you'll need to compile VTK for 
profiling as well). If you don't know how to do this, don't worry ... 
given Mathieu's results, I doubt that your problem is CPU bound.

-Sean

Mathieu Malaterre wrote:
> Kate,
> 
>  > Are there any other known problems with the version of vtk on the cd?
> 
> No absolutely not. Why are you saying
> 
> 'I am also having'
>       ^^^^
> 
> What does it have to do with an installation problem ?
> 
> As a side note, I ran on my linux box this c++ code(*), the reading of a 
> 512x512x512 unsigned short image took less than 3s:
> 
> ./bench  1.19s user 1.77s system 101% cpu 2.923 total
> 
> Using VTK compiled in *debug* mode with no optimization using gcc 3.3
> 
> HTH
> Mathieu
> 
> (*)
> #include "vtkImageNoiseSource.h"
> #include "vtkImageReader2.h"
> #include "vtkImageWriter.h"
> #include "vtkImageData.h"
> #include "vtkImageCast.h"
> 
> void gen()
> {
>   vtkImageNoiseSource *noise = vtkImageNoiseSource::New();
>   noise->SetWholeExtent(0,511,0,511,0,511);
>   noise->SetMinimum(0.0);
>   noise->SetMaximum(1.0);
>   noise->ReleaseDataFlagOff();
>   noise->Update();
> 
>   noise->GetOutput()->Print( cout );
> 
>   vtkImageCast *cast = vtkImageCast::New();
>   cast->SetInput( noise->GetOutput() );
>   cast->SetOutputScalarTypeToUnsignedShort ();
> 
>   vtkImageWriter *writer = vtkImageWriter::New();
>   //writer->SetInput( noise->GetOutput () );
>   writer->SetInput( cast->GetOutput () );
>   writer->SetFileDimensionality (3);
>   writer->SetFileName( "bench.img" );
>   writer->Write();
> 
>   noise->Delete();
>   cast->Delete();
>   writer->Delete();
> 
> }
> 
> int main()
> {
>   //gen();
> 
>   vtkImageReader2 *reader = vtkImageReader2::New();
>   reader->SetDataExtent (0, 511, 0, 511, 0, 511 );
>   reader->SetDataScalarTypeToUnsignedShort();
>   reader->SetDataByteOrderToLittleEndian();
>   reader->SetFileName( "bench.img" );
>   reader->Update();
> 
>   reader->GetOutput()->Print ( cout );
> 
>   reader->Delete();
> 
>   return 0;
> }
> 
> 
> 
> Kate Kerekes wrote:
> 
>> Are there any other known problems with the version of vtk on the cd?  I
>> installed the binary version from the cd thinking that this would be the
>> most stable version for windows.
>>
>> I am also having problems with the vtkImageReader2 and the time it 
>> takes to
>> read a file.  Would upgrading to the newest version of vtk fix this 
>> problem?
>>
>> Thanks,
>> Kate Kerekes
>>
>> -----Original Message-----
>> From: vtkusers-bounces at vtk.org [mailto:vtkusers-bounces at vtk.org] On 
>> Behalf
>> Of Mathieu Malaterre
>> Sent: Monday, October 04, 2004 9:21 AM
>> To: Weiguang Guan
>> Cc: vtkusers at vtk.org
>> Subject: Re: [vtkusers] VTK4.2 CD
>>
>> Weiguang,
>>
>>     This is a known problem in VTK 4.2.3 could you please update your
>> VTK version using the one from (latest VTK 4.2.x is 4.2.6):
>>
>> http://vtk.org/get-software.php#release
>>
>> This will fix your problem
>>
>> Thanks
>> Mathieu
>>
>>
>> Weiguang Guan wrote:
>>
>>> Hi,
>>>
>>> We bought vtk books (user guide and visualization toolkit) a few months
>>> ago. Recently I was trying to install it on both linux and windows from
>>> the CD that comes with the books. The version is 4.2. After cmake, the
>>> generated Makefile doesn't include three classes 
>>> (vtkPushImageFilterSample
>>> vtkPushImageReader vtkPushPipeline) for libHybrid.a. Building it on 
>>> windows has the same problem. Does anyone know how this could happen?
>>>
>>> Weiguang
>>>
>>
>>
>>
>>
>> _______________________________________________
>> This is the private VTK discussion list. Please keep messages 
>> on-topic. Check the FAQ at:
>> <http://public.kitware.com/cgi-bin/vtkfaq>
>> Follow this link to subscribe/unsubscribe:
>> http://www.vtk.org/mailman/listinfo/vtkusers
>>
>>
> 
> 
> 
> _______________________________________________
> This is the private VTK discussion list. Please keep messages on-topic. 
> Check the FAQ at: <http://public.kitware.com/cgi-bin/vtkfaq>
> Follow this link to subscribe/unsubscribe:
> http://www.vtk.org/mailman/listinfo/vtkusers
> 




More information about the vtkusers mailing list