[vtkusers] How to create a surface from two-dimensional array

Андрей Глухов realandron at gmail.com
Tue Mar 16 16:31:48 EDT 2010


---------- Пересланное сообщение ----------
От кого: Андрей Глухов <realandron at gmail.com>
Дата: 17 марта 2010 г. 0:26
Тема: How to create a surface from two-dimensional array of points and their
values?
Кому: vtkusers <vtkusers at vtk.org>


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/73ea2b9f/attachment.htm>


More information about the vtkusers mailing list