[vtkusers] How to create a surface from two-dimensional array of points and their values?
Andrej Gluhov
realandron at gmail.com
Tue Mar 16 16:45:58 EDT 2010
I need to impose meaning on the distribution of DICOM image as a
http://www.cvmbs.colostate.edu/erhs/XRT/Images/TRILOGY/IMRT/IMRT.NasalTumor.DoseDistribution.jpg
link
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?
Sebastian Gatzka wrote:
>
> Beside setting a Lookup-Table you also need the appropriate range for the
> mapper.
>
> ->SetScalarRange(…)
>
>
>
> Can you give us some code?
>
>
>
> Von: vtkusers-bounces at vtk.org [mailto:vtkusers-bounces at vtk.org] Im Auftrag
> von ?????? ??????
> Gesendet: Dienstag, 16. März 2010 12:38
> An: vtkusers
> Betreff: [vtkusers] How to create a surface from two-dimensional array of
> points and their values?
>
>
>
> I have a 2D array of points and a table of values for each point of the
> same size. How can I obtain the distribution of values in the form of 2D
> surface? I tried to set the color for each point through vtkLookupTable,
> but I did not get a shaded surface.
>
> --
> С Уважением,
> Андрей.
> Best regards, Andrew
>
>
> _______________________________________________
> Powered by www.kitware.com
>
> Visit other Kitware open-source projects at
> http://www.kitware.com/opensource/opensource.html
>
> Please keep messages on-topic and check the VTK FAQ at:
> http://www.vtk.org/Wiki/VTK_FAQ
>
> Follow this link to subscribe/unsubscribe:
> http://www.vtk.org/mailman/listinfo/vtkusers
>
>
--
View this message in context: http://old.nabble.com/How-to-create-a-surface-from-two-dimensional-array-of-points-and-their-values--tp27916440p27924276.html
Sent from the VTK - Users mailing list archive at Nabble.com.
More information about the vtkusers
mailing list