<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
<HTML><HEAD>
<META http-equiv=Content-Type content="text/html; charset=gb2312">
<META content="MSHTML 6.00.2800.1400" name=GENERATOR>
<STYLE></STYLE>
</HEAD>
<BODY style="COLOR: #0000ff; FONT-FAMILY: Comic Sans MS" bgColor=#ffffff><LABEL
id=HbSession SessionId="2511801361"></LABEL>
<DIV><FONT size=2>Hi All,</FONT></DIV>
<DIV><FONT size=2>I am trying to display a 3D volume. I read it first using
vtkImageReader and give it to vtkPolyDataMapper. But it gives me an error
saying that input of vtkPolyDataMapper has to be a vtkPolyData. </FONT></DIV>
<DIV><FONT size=2>Also in the Following piece of code I get an
error:</FONT></DIV>
<DIV><FONT size=2></FONT> </DIV>
<DIV><FONT size=2>vtkImageReader *reader1 =
vtkImageReader::New();<BR>
reader1->SetDataByteOrderToLittleEndian();<BR>
reader1->SetDataExtent(0, 511, 0, 511, 0, 88);<BR>
reader1->SetDataSpacing(0.5859375,0.5859375,2);<BR>
reader1->SetFileDimensionality(3);<BR>
reader1->SetDataScalarTypeToUnsignedShort();<BR>
reader1->SetFileName("Z:/Registration/Adults/Patients/6740/images/CT6740.img");<BR>
reader1->Update();<BR> <BR>vtkThreshold *thresh =
vtkThreshold::New();<BR> thresh->SetInput( (vtkDataSet
*)reader1->GetOutput() );<BR>
thresh->ThresholdByUpper(1350);<BR>
thresh->AllScalarsOn();</FONT></DIV>
<DIV><FONT size=2></FONT> </DIV>
<DIV><FONT size=2>//COnvert from vtkUnstructured grid output of threshold to
vtkPOlyData<BR>vtkUnstructuredGridToPolyDataFilter *pfilter =
vtkUnstructuredGridToPolyDataFilter::New();<BR>
pfilter->SetInput( thresh->GetOutput() );</FONT></DIV>
<DIV><FONT size=2></FONT> </DIV>
<DIV><FONT size=2>//Displays the thresholded image:<BR>vtkPolyDataMapper *mapper
= vtkPolyDataMapper::New();<BR> mapper->SetInput(
pfilter->GetOutput() );<BR>vtkActor *actor =
vtkActor::New();<BR> actor->SetMapper(mapper);
<BR>vtkRenderer *ren1 = vtkRenderer::New();</FONT></DIV>
<DIV><FONT size=2></FONT> </DIV>
<DIV><FONT size=2>ren1->AddActor(actor);<BR>ren1->SetBackground(.2, .3,
.5);<BR>ren1->SetViewport(0.0, 0.0, 0.5,
1.0);<BR>renWin->AddRenderer(ren1);</FONT></DIV>
<DIV><FONT size=2></FONT> </DIV>
<DIV><FONT size=2>For vtkUnstructered grid I get an error saying :invalid
conversion from vtkObject* at the following line:</FONT></DIV>
<DIV><FONT size=2>vtkUnstructuredGridToPolyDataFilter *pfilter =
vtkUnstructuredGridToPolyDataFilter::New();<BR></DIV></FONT>
<DIV><FONT face="Comic Sans MS" color=#0000ff size=2>Could anyone please help me
?</FONT></DIV>
<DIV><FONT size=2>Thank You,</FONT></DIV>
<DIV><FONT size=2>Pallavi</FONT></DIV>
<DIV><FONT face="Comic Sans MS" color=#0000ff size=2></FONT> </DIV>
<DIV><FONT face="Comic Sans MS" color=#0000ff
size=2>-------------------------------------------------------------------<BR>Pallavi
Joshi<BR></FONT></DIV>
<P></P></BODY></HTML>