<HTML>
<HEAD>
<TITLE>Detecting success/failure of a polydataalgorithm (vtkContourFilter)</TITLE>
</HEAD>
<BODY>
<FONT FACE="Calibri, Verdana, Helvetica, Arial"><SPAN STYLE='font-size:11pt'>Hi All,<BR>
I have setup a pipeline to generate contours. This works fine unless the value specified is constant across some cells as described<BR>
in this previous post:<BR>
<a href="http://www.nabble.com/Contouring-through-constant-value-areas-of-dataset-tt19338704.html#a19338704">http://www.nabble.com/Contouring-through-constant-value-areas-of-dataset-tt19338704.html#a19338704</a><BR>
<BR>
The result is no output. What I&#8217;d like to do is detect when the contour operation produces no output and reconnect the pipeline with a threshold filter with the contour value set as the limits of the threshold like so:<BR>
<BR>
{<BR>
...<BR>
contour.SetNumberOfContours(1);<BR>
contour.SetValue(scalarIndex, isoValue);<BR>
contour.SetInputArrayToProcess(0, 0, 0, originalData.GetAssociationTypeAsString(0), filterScalar);<BR>
<BR>
//force an update<BR>
contour.Update();<BR>
<BR>
vtkAlgorithmOutput outputPort = contour.GetOutputPort();<BR>
<BR>
&nbsp;&nbsp;&nbsp;//attempt to check if output is empty<BR>
&nbsp;&nbsp;&nbsp;&nbsp;if(contour.GetOutput() == null) //&lt;==Always evaluates to true!!!!!!!!<BR>
&nbsp;&nbsp;&nbsp;{ <BR>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;threshold.SetInputConnection(cell2PointData.GetOutputPort());<BR>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;threshold.SetInputArrayToProcess(0, 0, 0, originalData.GetAssociationTypeAsString(0), filterScalar);<BR>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;threshold.ThresholdBetween(isoValue, isoValue);<BR>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;outputPort = threshold.GetOutputPort();<BR>
&nbsp;&nbsp;&nbsp;}<BR>
&nbsp;return outputPort;<BR>
}<BR>
<BR>
The problem is that the output of the contour is always &#8220;null&#8221; so I always get the output of the threshold filter which is not what I want.<BR>
<BR>
Any ideas on how to query the contour filter&#8217;s output to see if it is empty?<BR>
Thanks in advance.<BR>
Gerrick<BR>
<BR>
&nbsp;&nbsp;</SPAN></FONT>
</BODY>
</HTML>