[vtkusers] 3D .raw data density values

tony hakki tony2007vtk at yahoo.com
Tue Mar 6 13:28:30 EST 2007


hi;
thanks your reply, I found out a method and I am planing to use it. I found it itksoftwareguide 4.1.3 Accessing pixel data. 
it is like this:
ImageType::IndexType pixelIndex;
pixelIndex[0] = 27; // x position
pixelIndex[1] = 29; // y position
pixelIndex[2] = 37; // z position



ImageType::PixelType pixelValue = image->GetPixel( pixelIndex );
The SetPixel() method allows us to set the value of the pixel.
image->SetPixel( pixelIndex, pixelValue+1 );


thanks a lot
Tony


----- Original Message ----
From: Michael Knopke <Michael.Knopke at gmx.de>
To: vtkusers at vtk.org
Sent: Tuesday, March 6, 2007 2:43:56 PM
Subject: [vtkusers] 3D .raw data density values


Hi Tony,
I’m not sure if this is alright, so use with care J
 
If your dataset is vtkImageData (I guess so) then you can use:
 
vtkImageData->FindPoint(double x[3]); //where x is in worldspace coordinates
 
But this will only find the closest point belonging to your original dataset. So if you select a point in worldspace that has no direct association to a point in imagedata, the value is not correct.
Data in between needs to be interpolated. A way to get the interpolated point at a certain position is to use the vtkProbeFilter with your imagedata. But the output depends on what interpolation type you choose (linear/cubic..).
 
Please correct me If I’m wrong.
 
Regards
Michael
 
_______________________________________________
This is the private VTK discussion list. 
Please keep messages on-topic. Check the FAQ at: http://www.vtk.org/Wiki/VTK_FAQ
Follow this link to subscribe/unsubscribe:
http://www.vtk.org/mailman/listinfo/vtkusers


 
____________________________________________________________________________________
Looking for earth-friendly autos? 
Browse Top Cars by "Green Rating" at Yahoo! Autos' Green Center.
http://autos.yahoo.com/green_center/
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://www.vtk.org/pipermail/vtkusers/attachments/20070306/36e2a45d/attachment.htm>


More information about the vtkusers mailing list