[vtkusers] grey values from CT scan

Mathieu Malaterre Mathieu.Malaterre at creatis.insa-lyon.fr
Mon Sep 15 03:44:11 EDT 2003


Viral,

	According to the doc:

http://www.vtk.org/doc/nightly/html/classvtkImageData.html#z340_0

  float vtkImageData::GetScalarComponentAsFloat  	(   	
		int   	  x,
		int  	  y,
		int  	  z,
		int  	  component
	)

So for accessing pixel (10, 20, 30) you should type:

GetScalarComponentAsFloat(10, 20, 30, 0)

HTH
mathieu
Ps: I assume your image doesn't have more than one component (such as a 
gradient image).


Viral Thakkar wrote:
> Dear Mathieu,
> Thanks. That is what I wanted. But can you please tell me code for C++. 
> what are the parameters for function 
> GetScalarComponentAsFloat(0?,0?,0?,0?) ?
> Thanks again
> Viral
> 
> */Mathieu Malaterre <Mathieu.Malaterre at creatis.insa-lyon.fr>/* wrote:
> 
>     Viral,
> 
>     Here is a python code:
> 
>     reader = vtkVolume16Reader()
>     ...
>     reader.Update()
>     print reader.GetOutput().GetScalarRange()
>     #print pixel value:
>     print reader.GetOutput().GetScalarComponentAsFloat(0,0,0,0)
> 
>     HTH
>     mathieu
>     Ps: I am not sure I understood what you meant by 'threshold value' ???
>     Therefore I translated it to scalar range...
> 
> 
>     Viral Thakkar wrote:
>      > Hi,
>      >
>      > I want to read the greyscale values of the pixels of CT scan. I
>     am using
>      > vtkVolume16Reader to read the CT scans. Can anyone help me
>     regarding how
>      > to get the threshold or greyscale values.
>      >
>      > Thanks
>      >
>      > Viral
> 
>     _______________________________________________
>     This is the private VTK discussion list.
>     Please keep messages on-topic. Check the FAQ at:
>     Fol low this link to subscribe/unsubscribe:
>     http://www.vtk.org/mailman/listinfo/vtkusers
> 
> ------------------------------------------------------------------------
> Do you Yahoo!?
> Yahoo! SiteBuilder 
> <http://us.rd.yahoo.com/evt=10469/*http://sitebuilder.yahoo.com> - Free, 
> easy-to-use web site design software


-- 
Mathieu Malaterre
CREATIS
28 Avenue du Doyen LEPINE
B.P. Lyon-Montchat
69394 Lyon Cedex 03
http://www.creatis.insa-lyon.fr/~malaterre/




More information about the vtkusers mailing list