<DIV><FONT color=#0000ff> hi all<BR> I am using vtkImageViewer2 to show arrows which generated by glyph class, and use vtkImageViewer2's GetRender()->addActor. But my </FONT></DIV>
<DIV><FONT color=#0000ff>programe always tells error "ERROR: In D:\VTK\VTK5.10.1</FONT></DIV>
<DIV><FONT color=#0000ff>\Filtering\vtkDemandDrivenPipeline.cxx, line 727<BR>vtkStreamingDemandDrivenPipeline (02C6E798): Input port 0 of algorithm </FONT></DIV>
<DIV><FONT color=#0000ff>vtkImageMapToWindowLevelColors(02C98638) has 0 connections but is not optional." . </FONT></DIV>
<DIV><FONT color=#0000ff>SO I hope get the helps from all of you, and thans to you for the advises in advance.</FONT></DIV><FONT color=#0000ff>
<DIV><BR> the main code is given as following:</DIV>
<DIV></FONT> </DIV>
<DIV><FONT color=#0000ff>vtkSmartPointer<vtkImageViewer2> m_pImageViewer;<BR>m_pImageViewer=vtkSmartPointer<vtkImageViewer2>::New();</FONT></DIV>
<DIV><FONT color=#0000ff>vtkSmartPointer<vtkGlyph3D> glyphFilter = vtkSmartPointer<vtkGlyph3D>::New();<BR> glyphFilter->SetSourceConnection(arrowSource-</FONT></DIV>
<DIV><FONT color=#0000ff>>GetOutputPort());<BR> glyphFilter->OrientOn(); <BR> glyphFilter->SetVectorModeToUseVector();<BR> glyphFilter->SetScaleModeToScaleByScalar(); <BR> glyphFilter->SetColorModeToColorByScalar(); <BR> glyphFilter->SetScaleFactor(5); </FONT></DIV>
<DIV><FONT color=#0000ff>glyphFilter->SetInputConnection(maskP->GetOutputPort());</FONT></DIV>
<DIV><FONT color=#0000ff>vtkSmartPointer<vtkImageSliceMapper> imageMapper = </FONT></DIV>
<DIV><FONT color=#0000ff>vtkSmartPointer<vtkImageSliceMapper>::New();<BR>imageMapper->SetInputConnection(vtkImporter->GetOutput()->GetProducerPort());</FONT></DIV>
<DIV><FONT color=#0000ff>vtkSmartPointer<vtkLookupTable> Lut=vtkSmartPointer<vtkLookupTable>::New();<BR> Lut->SetTableRange(-20,20);//(lo,hi);//(0,60);// </FONT></DIV>
<DIV><FONT color=#0000ff> Lut->SetHueRange(0,1);<BR> Lut->SetSaturationRange(1,1);<BR> Lut->SetValueRange(1,1); //////////<BR> Lut->SetAlpha(1); <BR> Lut->SetValueRange(-20,60);<BR> Lut->SetNumberOfTableValues(25600);<BR> Lut->SetRange(-20,60);<BR> Lut->SetVectorMode(vtkScalarsToColors::MAGNITUDE);<BR> Lut->Build(); </FONT></DIV>
<DIV><FONT color=#0000ff>vtkSmartPointer<vtkPolyDataMapper2D> vectorMapper = </FONT></DIV>
<DIV><FONT color=#0000ff>vtkSmartPointer<vtkPolyDataMapper2D>::New();<BR> vectorMapper->SetInputConnection(glyphFilter-</FONT></DIV>
<DIV><FONT color=#0000ff>>GetOutputPort());<BR> vectorMapper->SetScalarRange(-20,20);//(lo,hi);<BR> vectorMapper->ScalarVisibilityOn(); <BR> vectorMapper->SetLookupTable(Lut);<BR> vectorMapper->SetScalarModeToUsePointFieldData();<BR> vectorMapper->ColorByArrayComponent("ColorValue",3);<BR> vectorMapper->SetColorModeToMapScalars();</FONT></DIV>
<DIV><FONT color=#0000ff>vectorMapper->UseLookupTableScalarRangeOn(); <BR> vectorMapper->ScalarVisibilityOn();</FONT></DIV>
<DIV><FONT color=#0000ff> vtkSmartPointer<vtkActor2D> vectorActor = </FONT></DIV>
<DIV><FONT color=#0000ff>vtkSmartPointer<vtkActor2D>::New();<BR> vectorActor->SetMapper(vectorMapper);</FONT></DIV>
<DIV><FONT color=#0000ff>m_pImageViewer->GetRenderer()->AddActor(vectorActor); </FONT></DIV>