[vtkusers] vtkImageAccumulate parameters

Leila Baghdadi baghdadi at sickkids.ca
Thu May 8 11:52:35 EDT 2003


Hey matei

I think what you want to do is creating a 1D histogram for that

you need to
acc = vtkImageAccumulate()
acc.SetInput(your input)
acc.SetComponentSpacing(1.0,1.0,1.0)  # only 1st value matters
acc.SetComponentOrigin(0.0,0.0,0.0)   # only 1st value matters
acc.SetComponentExtent(0,255,0,0,0,0) # output is 1D histogram


and you must remember to call 
accOutput = acc.GetOutput()
# update the data
accOutput.SetUpdateExtent(0,255,0,0,0,0)
accOutput.Update()
everytime you make some change on your input and need to create a new 
histogram.


Hope this Help


Leila

P.s I had the same problem a couple of days ago and got help from one of 
vtk masters(guess who!!)



On Thu, 8 May 2003, Matei MANCAS wrote:

> Hello all
> 
> I have a problem with vtkImageAccumulate : the man pages are not very clear.
> 
> I have a vtkImageData with the following extent : (0,255,0,255,0,29) with only grey levels on 8 bytes and I would want to get, for each of the 29 slices, the histogram on 256 bins. 
> 
> Could someone tell me what parameters I have to use for SetComponentSpacing(), SetComponentOrigin() and SetComponentExtent() methods?
> 
> Many thanks,
> 
> 
> Matei MANCAS
> 
> 
> 
> 




More information about the vtkusers mailing list