[vtkusers] vtkImageAccumulate using volume too slow
Michael Knopke
Michael.Knopke at gmx.de
Tue Feb 24 11:01:42 EST 2009
Hello,
I'm looking for a fast way to build a histogram that represents the voxel
distribution in an volume (e.g. 512,512,900).
It's 1 component scalar data (ct slices) represented as unsigned short
(shifted).
When using vtkImageAccumulate the following approach works fine when using
2D images (e.g. one slice):
double get_range[2];
double range;
mySlice->GetOutput()->GetScalarRange(get_range); // e.g. vtkImageData
with extent (0,511,0,511,0,1);
range = get_range[1] - get_range[0];
int numbins=range/2;
vtkImageAccumulate *histo = vtkImageAccumulate::New();
histo->SetInput(ResliceInstance->GetOutput());
//histo->SetInput(SourceObject->GetImageData());
histo->SetComponentSpacing((get_range[1]/numbins),1,1);
histo->SetComponentExtent(0,numbins,0,0,0,0);
histo->SetComponentOrigin(0,0,0);
... then drawing it vtk vtkImageCanvasSource2D or vtkXYPlotActor (like
in vtkHistogramWidget.tcl)
But this represents only the histogram over one slice. However if I use the
whole volume, the histogram is not drawn correctly and computation with
vtkImageAccumulate uses alot of memory and is very slow.
Is there a better way to do this kind of task?
Regards
Michael
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://www.vtk.org/pipermail/vtkusers/attachments/20090224/44cbc2be/attachment.htm>
More information about the vtkusers
mailing list