[vtkusers] How to create a surface from two-dimensional array of points and their values?
Андрей Глухов
realandron at gmail.com
Tue Mar 16 16:26:12 EDT 2010
I need to impose meaning on the distribution of DICOM image as a link
http://www.cvmbs.colostate.edu/erhs/XRT/Images/TRILOGY/IMRT/IMRT.NasalTumor.DoseDistribution.jpg
int Height = DicomReader.GetHeight();
int Width = DicomReader.GetWidth();
vtkFloatArray cellData = new vtkFloatArray();
cellData.SetNumberOfTuples(Height * Width);
for (int i = 0; i < Height; i++)
{
for (int j = 0; j < Width; j++)
{
cellData.InsertNextValue(i * Height + j + 1);
}
}
vtkPoints points = new vtkPoints();
vtkCellArray vertices = new vtkCellArray();
for (int i = 0; i < Height; i++)
{
for (int j = 0; j < Width; j++)
{
points.InsertNextPoint(i, j, 1);//Add point
vertices.InsertNextCell(i * Height + j);
}
}
vtkPolyData pd = new vtkPolyData();
pd.SetPoints(points);
pd.SetVerts(vertices);
pd.GetPointData().SetScalars(cellData);
I do not know where to set the values for vtkContourFilter or I did wrong to
do?
--
С Уважением,
Андрей.
Best regards, Andrew
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://www.vtk.org/pipermail/vtkusers/attachments/20100317/d87987f1/attachment-0001.htm>
More information about the vtkusers
mailing list