<div dir="ltr"><div>Nigel,</div>I don't see anything wrong in your script. Do you mind sharing your data so that I can debug this?</div><br><div class="gmail_quote"><div dir="ltr">On Fri, Aug 7, 2015 at 7:48 AM Nigel Mcfarlane <<a href="mailto:Nigel.Mcfarlane@beds.ac.uk">Nigel.Mcfarlane@beds.ac.uk</a>> wrote:<br></div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">





<div lang="EN-GB" link="blue" vlink="purple">
<div>
<p class="MsoNormal"><span style="font-size:11.0pt;font-family:"Calibri",sans-serif;color:#1f497d">Dear Dan,<u></u><u></u></span></p>
<p class="MsoNormal"><span style="font-size:11.0pt;font-family:"Calibri",sans-serif;color:#1f497d">I’m sorry, but I was too hasty in declaring that my problem was fixed – removing my AddScalars filter did not help after all, and neither
 did replacing it with vtkPolyDataNormals.  I have now stripped down the code to its simplest configuration.  The resulting scene has isosurfaces which are mispositioned and broken in a manner consistent with the images being read with the wrong dimensions. 
 Furthermore, if the readers are not manually updated, the program crashes.<u></u><u></u></span></p>
<p class="MsoNormal"><span style="font-size:11.0pt;font-family:"Calibri",sans-serif;color:#1f497d"><u></u> <u></u></span></p>
<p class="MsoNormal"><span style="font-size:11.0pt;font-family:"Calibri",sans-serif;color:#1f497d">There is also an error message:<u></u><u></u></span></p>
<p class="MsoNormal"><span style="font-size:11.0pt;font-family:"Calibri",sans-serif;color:#1f497d">ERROR: In C:\VTK\VTK-6.2.0\Common\ExecutionModel\vtkStreamingDemandDrivenPipeline.cxx, line 857<u></u><u></u></span></p>
<p class="MsoNormal"><span style="font-size:11.0pt;font-family:"Calibri",sans-serif;color:#1f497d">vtkCompositeDataPipeline (0132A818): The update extent specified in the information for output port 0 on algorithm vtkMetaImageReader(01321E58)
 is 0 67 0 72 0 9, which is outside the whole extent 0 69 0 58 0 10.<u></u><u></u></span></p>
<p class="MsoNormal"><span style="font-size:11.0pt;font-family:"Calibri",sans-serif;color:#1f497d"><u></u> <u></u></span></p>
<p class="MsoNormal"><span style="font-size:11.0pt;font-family:"Calibri",sans-serif;color:#1f497d">The results are ok if only one image is fed to appendPD.  If I update the dmcubes[i] manually, the results are also ok.<u></u><u></u></span></p>
<p class="MsoNormal"><span style="font-size:11.0pt;font-family:"Calibri",sans-serif;color:#1f497d"><u></u> <u></u></span></p>
<p class="MsoNormal"><span style="font-size:11.0pt;font-family:"Calibri",sans-serif;color:#1f497d">It looks as if the base of the pipeline only remembers one set of extents, which it then demands incorrectly from all the inputs. 
 Have I missed anything important in the code below?<u></u><u></u></span></p>
<p class="MsoNormal"><span style="font-size:11.0pt;font-family:"Calibri",sans-serif;color:#1f497d"><u></u> <u></u></span></p>
<p class="MsoNormal" style="text-autospace:none"><span style="font-size:9.5pt;font-family:Consolas;color:black;background:white"> 
</span><span style="font-size:9.5pt;font-family:Consolas;color:green;background:white">// Set filenames</span><span style="font-size:9.5pt;font-family:Consolas;color:black;background:white"><u></u><u></u></span></p>
<p class="MsoNormal" style="text-autospace:none"><span style="font-size:9.5pt;font-family:Consolas;color:black;background:white"> 
</span><i><span style="font-size:9.5pt;font-family:Consolas;color:#216f85;background:white">std</span></i><span style="font-size:9.5pt;font-family:Consolas;color:black;background:white">::</span><i><span style="font-size:9.5pt;font-family:Consolas;color:#216f85;background:white">string</span></i><span style="font-size:9.5pt;font-family:Consolas;color:black;background:white">
</span><span style="font-size:9.5pt;font-family:Consolas;color:navy;background:white">dirname</span><span style="font-size:9.5pt;font-family:Consolas;color:black;background:white">
 = </span><span style="font-size:9.5pt;font-family:Consolas;color:#6f008a;background:white">CHICVIS</span><span style="font-size:9.5pt;font-family:Consolas;color:#a31515;background:white">"/ForthLungCropped20150703"</span><span style="font-size:9.5pt;font-family:Consolas;color:black;background:white">;<u></u><u></u></span></p>
<p class="MsoNormal" style="text-autospace:none"><span style="font-size:9.5pt;font-family:Consolas;color:black;background:white"> 
</span><i><span style="font-size:9.5pt;font-family:Consolas;color:#216f85;background:white">std</span></i><span style="font-size:9.5pt;font-family:Consolas;color:black;background:white">::</span><i><span style="font-size:9.5pt;font-family:Consolas;color:#216f85;background:white">string</span></i><span style="font-size:9.5pt;font-family:Consolas;color:black;background:white">
</span><span style="font-size:9.5pt;font-family:Consolas;color:navy;background:white">fname</span><span style="font-size:9.5pt;font-family:Consolas;color:black;background:white">[3];<u></u><u></u></span></p>
<p class="MsoNormal" style="text-autospace:none"><span style="font-size:9.5pt;font-family:Consolas;color:black;background:white"> 
</span><span style="font-size:9.5pt;font-family:Consolas;color:navy;background:white">fname</span><span style="font-size:9.5pt;font-family:Consolas;color:black;background:white">[0]
 = </span><span style="font-size:9.5pt;font-family:Consolas;color:navy;background:white">dirname</span><span style="font-size:9.5pt;font-family:Consolas;color:black;background:white">
 + </span><span style="font-size:9.5pt;font-family:Consolas;color:#a31515;background:white">"/2505ct/Tumor1Big/lesion2505-1mm.mhd"</span><span style="font-size:9.5pt;font-family:Consolas;color:black;background:white">;<u></u><u></u></span></p>
<p class="MsoNormal" style="text-autospace:none"><span style="font-size:9.5pt;font-family:Consolas;color:black;background:white"> 
</span><span style="font-size:9.5pt;font-family:Consolas;color:navy;background:white">fname</span><span style="font-size:9.5pt;font-family:Consolas;color:black;background:white">[1]
 = </span><span style="font-size:9.5pt;font-family:Consolas;color:navy;background:white">dirname</span><span style="font-size:9.5pt;font-family:Consolas;color:black;background:white">
 + </span><span style="font-size:9.5pt;font-family:Consolas;color:#a31515;background:white">"/3108ct/Tumor1Big/lesion3108-1mm.mhd"</span><span style="font-size:9.5pt;font-family:Consolas;color:black;background:white">;<u></u><u></u></span></p>
<p class="MsoNormal" style="text-autospace:none"><span style="font-size:9.5pt;font-family:Consolas;color:black;background:white"> 
</span><span style="font-size:9.5pt;font-family:Consolas;color:navy;background:white">fname</span><span style="font-size:9.5pt;font-family:Consolas;color:black;background:white">[2]
 = </span><span style="font-size:9.5pt;font-family:Consolas;color:navy;background:white">dirname</span><span style="font-size:9.5pt;font-family:Consolas;color:black;background:white">
 + </span><span style="font-size:9.5pt;font-family:Consolas;color:#a31515;background:white">"/170957ct/Tumor1Big/lesion1709-1mm.mhd"</span><span style="font-size:9.5pt;font-family:Consolas;color:black;background:white">;<u></u><u></u></span></p>
<p class="MsoNormal" style="text-autospace:none"><span style="font-size:9.5pt;font-family:Consolas;color:black;background:white"><u></u> <u></u></span></p>
<p class="MsoNormal" style="text-autospace:none"><span style="font-size:9.5pt;font-family:Consolas;color:black;background:white"> 
</span><span style="font-size:9.5pt;font-family:Consolas;color:green;background:white">// Create array of image readers</span><span style="font-size:9.5pt;font-family:Consolas;color:black;background:white"><u></u><u></u></span></p>
<p class="MsoNormal" style="text-autospace:none"><span style="font-size:9.5pt;font-family:Consolas;color:black;background:white"> 
</span><span style="font-size:9.5pt;font-family:Consolas;color:#216f85;background:white">vtkMetaImageReader</span><span style="font-size:9.5pt;font-family:Consolas;color:black;background:white">
 **</span><span style="font-size:9.5pt;font-family:Consolas;color:navy;background:white">reader</span><span style="font-size:9.5pt;font-family:Consolas;color:black;background:white">;<u></u><u></u></span></p>
<p class="MsoNormal" style="text-autospace:none"><span style="font-size:9.5pt;font-family:Consolas;color:black;background:white"> 
</span><span style="font-size:9.5pt;font-family:Consolas;color:navy;background:white">reader</span><span style="font-size:9.5pt;font-family:Consolas;color:black;background:white">
 = </span><span style="font-size:9.5pt;font-family:Consolas;color:blue;background:white">new</span><span style="font-size:9.5pt;font-family:Consolas;color:black;background:white">
 (</span><span style="font-size:9.5pt;font-family:Consolas;color:#216f85;background:white">vtkMetaImageReader</span><span style="font-size:9.5pt;font-family:Consolas;color:black;background:white">
 *[3]);<u></u><u></u></span></p>
<p class="MsoNormal" style="text-autospace:none"><span style="font-size:9.5pt;font-family:Consolas;color:black;background:white"> 
</span><span style="font-size:9.5pt;font-family:Consolas;color:blue;background:white">for</span><span style="font-size:9.5pt;font-family:Consolas;color:black;background:white">
 (</span><span style="font-size:9.5pt;font-family:Consolas;color:blue;background:white">int</span><span style="font-size:9.5pt;font-family:Consolas;color:black;background:white">
</span><span style="font-size:9.5pt;font-family:Consolas;color:navy;background:white">i</span><span style="font-size:9.5pt;font-family:Consolas;color:black;background:white">
 = 0; </span><span style="font-size:9.5pt;font-family:Consolas;color:navy;background:white">i</span><span style="font-size:9.5pt;font-family:Consolas;color:black;background:white">
 < 3; </span><span style="font-size:9.5pt;font-family:Consolas;color:navy;background:white">i</span><span style="font-size:9.5pt;font-family:Consolas;color:black;background:white">++)<u></u><u></u></span></p>
<p class="MsoNormal" style="text-autospace:none"><span style="font-size:9.5pt;font-family:Consolas;color:black;background:white">   
</span><span style="font-size:9.5pt;font-family:Consolas;color:navy;background:white">reader</span><span style="font-size:9.5pt;font-family:Consolas;color:black;background:white">[</span><span style="font-size:9.5pt;font-family:Consolas;color:navy;background:white">i</span><span style="font-size:9.5pt;font-family:Consolas;color:black;background:white">]
 = </span><span style="font-size:9.5pt;font-family:Consolas;color:#216f85;background:white">vtkMetaImageReader</span><span style="font-size:9.5pt;font-family:Consolas;color:black;background:white">::</span><span style="font-size:9.5pt;font-family:Consolas;color:#880000;background:white">New</span><span style="font-size:9.5pt;font-family:Consolas;color:black;background:white">();<u></u><u></u></span></p>
<p class="MsoNormal" style="text-autospace:none"><span style="font-size:9.5pt;font-family:Consolas;color:black;background:white"><u></u> <u></u></span></p>
<p class="MsoNormal" style="text-autospace:none"><span style="font-size:9.5pt;font-family:Consolas;color:black;background:white"> 
</span><span style="font-size:9.5pt;font-family:Consolas;color:blue;background:white">for</span><span style="font-size:9.5pt;font-family:Consolas;color:black;background:white">
 (</span><span style="font-size:9.5pt;font-family:Consolas;color:blue;background:white">int</span><span style="font-size:9.5pt;font-family:Consolas;color:black;background:white">
</span><span style="font-size:9.5pt;font-family:Consolas;color:navy;background:white">i</span><span style="font-size:9.5pt;font-family:Consolas;color:black;background:white">
 = 0; </span><span style="font-size:9.5pt;font-family:Consolas;color:navy;background:white">i</span><span style="font-size:9.5pt;font-family:Consolas;color:black;background:white">
 < 3; </span><span style="font-size:9.5pt;font-family:Consolas;color:navy;background:white">i</span><span style="font-size:9.5pt;font-family:Consolas;color:black;background:white">++){<u></u><u></u></span></p>
<p class="MsoNormal" style="text-autospace:none"><span style="font-size:9.5pt;font-family:Consolas;color:black;background:white">   
</span><span style="font-size:9.5pt;font-family:Consolas;color:navy;background:white">reader</span><span style="font-size:9.5pt;font-family:Consolas;color:black;background:white">[</span><span style="font-size:9.5pt;font-family:Consolas;color:navy;background:white">i</span><span style="font-size:9.5pt;font-family:Consolas;color:black;background:white">]-></span><span style="font-size:9.5pt;font-family:Consolas;color:#880000;background:white">SetFileName</span><span style="font-size:9.5pt;font-family:Consolas;color:black;background:white">(</span><span style="font-size:9.5pt;font-family:Consolas;color:navy;background:white">fname</span><span style="font-size:9.5pt;font-family:Consolas;color:black;background:white">[</span><span style="font-size:9.5pt;font-family:Consolas;color:navy;background:white">i</span><span style="font-size:9.5pt;font-family:Consolas;color:black;background:white">].</span><i><span style="font-size:9.5pt;font-family:Consolas;color:#880000;background:white">c_str</span></i><span style="font-size:9.5pt;font-family:Consolas;color:black;background:white">());<u></u><u></u></span></p>
<p class="MsoNormal" style="text-autospace:none"><span style="font-size:9.5pt;font-family:Consolas;color:black;background:white">   
</span><span style="font-size:9.5pt;font-family:Consolas;color:navy;background:white">reader</span><span style="font-size:9.5pt;font-family:Consolas;color:black;background:white">[</span><span style="font-size:9.5pt;font-family:Consolas;color:navy;background:white">i</span><span style="font-size:9.5pt;font-family:Consolas;color:black;background:white">]-></span><span style="font-size:9.5pt;font-family:Consolas;color:#880000;background:white">Update</span><span style="font-size:9.5pt;font-family:Consolas;color:black;background:white">();<u></u><u></u></span></p>
<p class="MsoNormal" style="text-autospace:none"><span style="font-size:9.5pt;font-family:Consolas;color:black;background:white">  }<u></u><u></u></span></p>
<p class="MsoNormal" style="text-autospace:none"><span style="font-size:9.5pt;font-family:Consolas;color:black;background:white"><u></u> <u></u></span></p>
<p class="MsoNormal" style="text-autospace:none"><span style="font-size:9.5pt;font-family:Consolas;color:black;background:white"><u></u> <u></u></span></p>
<p class="MsoNormal" style="text-autospace:none"><span style="font-size:9.5pt;font-family:Consolas;color:black;background:white"> 
</span><span style="font-size:9.5pt;font-family:Consolas;color:green;background:white">// -----------------------</span><span style="font-size:9.5pt;font-family:Consolas;color:black;background:white"><u></u><u></u></span></p>
<p class="MsoNormal" style="text-autospace:none"><span style="font-size:9.5pt;font-family:Consolas;color:black;background:white"> 
</span><span style="font-size:9.5pt;font-family:Consolas;color:green;background:white">// Create the VTK pipeline</span><span style="font-size:9.5pt;font-family:Consolas;color:black;background:white"><u></u><u></u></span></p>
<p class="MsoNormal" style="text-autospace:none"><span style="font-size:9.5pt;font-family:Consolas;color:black;background:white"> 
</span><span style="font-size:9.5pt;font-family:Consolas;color:green;background:white">//</span><span style="font-size:9.5pt;font-family:Consolas;color:black;background:white"><u></u><u></u></span></p>
<p class="MsoNormal" style="text-autospace:none"><span style="font-size:9.5pt;font-family:Consolas;color:black;background:white"> 
</span><span style="font-size:9.5pt;font-family:Consolas;color:green;background:white">//  image0     image1      image2</span><span style="font-size:9.5pt;font-family:Consolas;color:black;background:white"><u></u><u></u></span></p>
<p class="MsoNormal" style="text-autospace:none"><span style="font-size:9.5pt;font-family:Consolas;color:black;background:white"> 
</span><span style="font-size:9.5pt;font-family:Consolas;color:green;background:white">// dmcubes0   dmcubes1    dmcubes2</span><span style="font-size:9.5pt;font-family:Consolas;color:black;background:white"><u></u><u></u></span></p>
<p class="MsoNormal" style="text-autospace:none"><span style="font-size:9.5pt;font-family:Consolas;color:black;background:white"> 
</span><span style="font-size:9.5pt;font-family:Consolas;color:green;background:white">//         \     |       /</span><span style="font-size:9.5pt;font-family:Consolas;color:black;background:white"><u></u><u></u></span></p>
<p class="MsoNormal" style="text-autospace:none"><span style="font-size:9.5pt;font-family:Consolas;color:black;background:white"> 
</span><span style="font-size:9.5pt;font-family:Consolas;color:green;background:white">//        vtkAppendPolyData</span><span style="font-size:9.5pt;font-family:Consolas;color:black;background:white"><u></u><u></u></span></p>
<p class="MsoNormal" style="text-autospace:none"><span style="font-size:9.5pt;font-family:Consolas;color:black;background:white"> 
</span><span style="font-size:9.5pt;font-family:Consolas;color:green;background:white">//          mapper/actor</span><span style="font-size:9.5pt;font-family:Consolas;color:black;background:white"><u></u><u></u></span></p>
<p class="MsoNormal" style="text-autospace:none"><span style="font-size:9.5pt;font-family:Consolas;color:black;background:white"> 
</span><span style="font-size:9.5pt;font-family:Consolas;color:green;background:white">//           renderer</span><span style="font-size:9.5pt;font-family:Consolas;color:black;background:white"><u></u><u></u></span></p>
<p class="MsoNormal" style="text-autospace:none"><span style="font-size:9.5pt;font-family:Consolas;color:black;background:white"> 
</span><span style="font-size:9.5pt;font-family:Consolas;color:green;background:white">// -----------------------</span><span style="font-size:9.5pt;font-family:Consolas;color:black;background:white"><u></u><u></u></span></p>
<p class="MsoNormal" style="text-autospace:none"><span style="font-size:9.5pt;font-family:Consolas;color:black;background:white"> 
</span><span style="font-size:9.5pt;font-family:Consolas;color:#216f85;background:white">vtkDiscreteMarchingCubes</span><span style="font-size:9.5pt;font-family:Consolas;color:black;background:white">
 **</span><span style="font-size:9.5pt;font-family:Consolas;color:navy;background:white">dmcubes</span><span style="font-size:9.5pt;font-family:Consolas;color:black;background:white">;<u></u><u></u></span></p>
<p class="MsoNormal" style="text-autospace:none"><span style="font-size:9.5pt;font-family:Consolas;color:black;background:white"> 
</span><span style="font-size:9.5pt;font-family:Consolas;color:navy;background:white">dmcubes</span><span style="font-size:9.5pt;font-family:Consolas;color:black;background:white">
 = </span><span style="font-size:9.5pt;font-family:Consolas;color:blue;background:white">new</span><span style="font-size:9.5pt;font-family:Consolas;color:black;background:white">
 (</span><span style="font-size:9.5pt;font-family:Consolas;color:#216f85;background:white">vtkDiscreteMarchingCubes</span><span style="font-size:9.5pt;font-family:Consolas;color:black;background:white">
 *[3]);<u></u><u></u></span></p>
<p class="MsoNormal" style="text-autospace:none"><span style="font-size:9.5pt;font-family:Consolas;color:black;background:white"> 
</span><span style="font-size:9.5pt;font-family:Consolas;color:blue;background:white">for</span><span style="font-size:9.5pt;font-family:Consolas;color:black;background:white">
 (</span><span style="font-size:9.5pt;font-family:Consolas;color:blue;background:white">int</span><span style="font-size:9.5pt;font-family:Consolas;color:black;background:white">
</span><span style="font-size:9.5pt;font-family:Consolas;color:navy;background:white">i</span><span style="font-size:9.5pt;font-family:Consolas;color:black;background:white">
 = 0; </span><span style="font-size:9.5pt;font-family:Consolas;color:navy;background:white">i</span><span style="font-size:9.5pt;font-family:Consolas;color:black;background:white">
 < 3; </span><span style="font-size:9.5pt;font-family:Consolas;color:navy;background:white">i</span><span style="font-size:9.5pt;font-family:Consolas;color:black;background:white">++){<u></u><u></u></span></p>
<p class="MsoNormal" style="text-autospace:none"><span style="font-size:9.5pt;font-family:Consolas;color:black;background:white">   
</span><span style="font-size:9.5pt;font-family:Consolas;color:navy;background:white">dmcubes</span><span style="font-size:9.5pt;font-family:Consolas;color:black;background:white">[</span><span style="font-size:9.5pt;font-family:Consolas;color:navy;background:white">i</span><span style="font-size:9.5pt;font-family:Consolas;color:black;background:white">]
 = </span><span style="font-size:9.5pt;font-family:Consolas;color:#216f85;background:white">vtkDiscreteMarchingCubes</span><span style="font-size:9.5pt;font-family:Consolas;color:black;background:white">::</span><span style="font-size:9.5pt;font-family:Consolas;color:#880000;background:white">New</span><span style="font-size:9.5pt;font-family:Consolas;color:black;background:white">();<u></u><u></u></span></p>
<p class="MsoNormal" style="text-autospace:none"><span style="font-size:9.5pt;font-family:Consolas;color:black;background:white">   
</span><span style="font-size:9.5pt;font-family:Consolas;color:navy;background:white">dmcubes</span><span style="font-size:9.5pt;font-family:Consolas;color:black;background:white">[</span><span style="font-size:9.5pt;font-family:Consolas;color:navy;background:white">i</span><span style="font-size:9.5pt;font-family:Consolas;color:black;background:white">]-></span><span style="font-size:9.5pt;font-family:Consolas;color:#880000;background:white">SetInputConnection</span><span style="font-size:9.5pt;font-family:Consolas;color:black;background:white">(</span><span style="font-size:9.5pt;font-family:Consolas;color:navy;background:white">reader</span><span style="font-size:9.5pt;font-family:Consolas;color:black;background:white">[</span><span style="font-size:9.5pt;font-family:Consolas;color:navy;background:white">i</span><span style="font-size:9.5pt;font-family:Consolas;color:black;background:white">]-></span><span style="font-size:9.5pt;font-family:Consolas;color:#880000;background:white">GetOutputPort</span><span style="font-size:9.5pt;font-family:Consolas;color:black;background:white">());<u></u><u></u></span></p>
<p class="MsoNormal" style="text-autospace:none"><span style="font-size:9.5pt;font-family:Consolas;color:black;background:white">   
</span><span style="font-size:9.5pt;font-family:Consolas;color:navy;background:white">dmcubes</span><span style="font-size:9.5pt;font-family:Consolas;color:black;background:white">[</span><span style="font-size:9.5pt;font-family:Consolas;color:navy;background:white">i</span><span style="font-size:9.5pt;font-family:Consolas;color:black;background:white">]-></span><span style="font-size:9.5pt;font-family:Consolas;color:#880000;background:white">SetNumberOfContours</span><span style="font-size:9.5pt;font-family:Consolas;color:black;background:white">(1);<u></u><u></u></span></p>
<p class="MsoNormal" style="text-autospace:none"><span style="font-size:9.5pt;font-family:Consolas;color:black;background:white">   
</span><span style="font-size:9.5pt;font-family:Consolas;color:navy;background:white">dmcubes</span><span style="font-size:9.5pt;font-family:Consolas;color:black;background:white">[</span><span style="font-size:9.5pt;font-family:Consolas;color:navy;background:white">i</span><span style="font-size:9.5pt;font-family:Consolas;color:black;background:white">]-></span><span style="font-size:9.5pt;font-family:Consolas;color:#880000;background:white">SetComputeGradients</span><span style="font-size:9.5pt;font-family:Consolas;color:black;background:white">(0);<u></u><u></u></span></p>
<p class="MsoNormal" style="text-autospace:none"><span style="font-size:9.5pt;font-family:Consolas;color:black;background:white">   
</span><span style="font-size:9.5pt;font-family:Consolas;color:navy;background:white">dmcubes</span><span style="font-size:9.5pt;font-family:Consolas;color:black;background:white">[</span><span style="font-size:9.5pt;font-family:Consolas;color:navy;background:white">i</span><span style="font-size:9.5pt;font-family:Consolas;color:black;background:white">]-></span><span style="font-size:9.5pt;font-family:Consolas;color:#880000;background:white">SetComputeScalars</span><span style="font-size:9.5pt;font-family:Consolas;color:black;background:white">(0);<u></u><u></u></span></p>
<p class="MsoNormal" style="text-autospace:none"><span style="font-size:9.5pt;font-family:Consolas;color:black;background:white">   
</span><span style="font-size:9.5pt;font-family:Consolas;color:navy;background:white">dmcubes</span><span style="font-size:9.5pt;font-family:Consolas;color:black;background:white">[</span><span style="font-size:9.5pt;font-family:Consolas;color:navy;background:white">i</span><span style="font-size:9.5pt;font-family:Consolas;color:black;background:white">]-></span><span style="font-size:9.5pt;font-family:Consolas;color:#880000;background:white">SetComputeNormals</span><span style="font-size:9.5pt;font-family:Consolas;color:black;background:white">(1);<u></u><u></u></span></p>
<p class="MsoNormal" style="text-autospace:none"><span style="font-size:9.5pt;font-family:Consolas;color:black;background:white">   
</span><span style="font-size:9.5pt;font-family:Consolas;color:navy;background:white">dmcubes</span><span style="font-size:9.5pt;font-family:Consolas;color:black;background:white">[</span><span style="font-size:9.5pt;font-family:Consolas;color:navy;background:white">i</span><span style="font-size:9.5pt;font-family:Consolas;color:black;background:white">]-></span><span style="font-size:9.5pt;font-family:Consolas;color:#880000;background:white">SetValue</span><span style="font-size:9.5pt;font-family:Consolas;color:black;background:white">(</span><span style="font-size:9.5pt;font-family:Consolas;color:navy;background:white">i</span><span style="font-size:9.5pt;font-family:Consolas;color:black;background:white">,
 255);<u></u><u></u></span></p>
<p class="MsoNormal" style="text-autospace:none"><span style="font-size:9.5pt;font-family:Consolas;color:black;background:white">  }<u></u><u></u></span></p>
<p class="MsoNormal" style="text-autospace:none"><span style="font-size:9.5pt;font-family:Consolas;color:black;background:white"><u></u> <u></u></span></p>
<p class="MsoNormal" style="text-autospace:none"><span style="font-size:9.5pt;font-family:Consolas;color:black;background:white"> 
</span><span style="font-size:9.5pt;font-family:Consolas;color:#216f85;background:white">vtkAppendPolyData</span><span style="font-size:9.5pt;font-family:Consolas;color:black;background:white">
 *</span><span style="font-size:9.5pt;font-family:Consolas;color:navy;background:white">appendPD</span><span style="font-size:9.5pt;font-family:Consolas;color:black;background:white">
 = </span><span style="font-size:9.5pt;font-family:Consolas;color:#216f85;background:white">vtkAppendPolyData</span><span style="font-size:9.5pt;font-family:Consolas;color:black;background:white">::</span><span style="font-size:9.5pt;font-family:Consolas;color:#880000;background:white">New</span><span style="font-size:9.5pt;font-family:Consolas;color:black;background:white">();<u></u><u></u></span></p>
<p class="MsoNormal" style="text-autospace:none"><span style="font-size:9.5pt;font-family:Consolas;color:black;background:white"> 
</span><span style="font-size:9.5pt;font-family:Consolas;color:blue;background:white">for</span><span style="font-size:9.5pt;font-family:Consolas;color:black;background:white">
 (</span><span style="font-size:9.5pt;font-family:Consolas;color:blue;background:white">int</span><span style="font-size:9.5pt;font-family:Consolas;color:black;background:white">
</span><span style="font-size:9.5pt;font-family:Consolas;color:navy;background:white">i</span><span style="font-size:9.5pt;font-family:Consolas;color:black;background:white">
 = 0; </span><span style="font-size:9.5pt;font-family:Consolas;color:navy;background:white">i</span><span style="font-size:9.5pt;font-family:Consolas;color:black;background:white">
 < 3; </span><span style="font-size:9.5pt;font-family:Consolas;color:navy;background:white">i</span><span style="font-size:9.5pt;font-family:Consolas;color:black;background:white">++)<u></u><u></u></span></p>
<p class="MsoNormal" style="text-autospace:none"><span style="font-size:9.5pt;font-family:Consolas;color:black;background:white">   
</span><span style="font-size:9.5pt;font-family:Consolas;color:navy;background:white">appendPD</span><span style="font-size:9.5pt;font-family:Consolas;color:black;background:white">-></span><span style="font-size:9.5pt;font-family:Consolas;color:#880000;background:white">AddInputConnection</span><span style="font-size:9.5pt;font-family:Consolas;color:black;background:white">(</span><span style="font-size:9.5pt;font-family:Consolas;color:navy;background:white">dmcubes</span><span style="font-size:9.5pt;font-family:Consolas;color:black;background:white">[</span><span style="font-size:9.5pt;font-family:Consolas;color:navy;background:white">i</span><span style="font-size:9.5pt;font-family:Consolas;color:black;background:white">]-></span><span style="font-size:9.5pt;font-family:Consolas;color:#880000;background:white">GetOutputPort</span><span style="font-size:9.5pt;font-family:Consolas;color:black;background:white">());<u></u><u></u></span></p>
<p class="MsoNormal" style="text-autospace:none"><span style="font-size:9.5pt;font-family:Consolas;color:black;background:white"><u></u> <u></u></span></p>
<p class="MsoNormal" style="text-autospace:none"><span style="font-size:9.5pt;font-family:Consolas;color:black;background:white"> 
</span><span style="font-size:9.5pt;font-family:Consolas;color:#216f85;background:white">vtkPolyDataMapper</span><span style="font-size:9.5pt;font-family:Consolas;color:black;background:white">
 *</span><span style="font-size:9.5pt;font-family:Consolas;color:navy;background:white">mapper</span><span style="font-size:9.5pt;font-family:Consolas;color:black;background:white">
 = </span><span style="font-size:9.5pt;font-family:Consolas;color:#216f85;background:white">vtkPolyDataMapper</span><span style="font-size:9.5pt;font-family:Consolas;color:black;background:white">::</span><span style="font-size:9.5pt;font-family:Consolas;color:#880000;background:white">New</span><span style="font-size:9.5pt;font-family:Consolas;color:black;background:white">();<u></u><u></u></span></p>
<p class="MsoNormal" style="text-autospace:none"><span style="font-size:9.5pt;font-family:Consolas;color:black;background:white"> 
</span><span style="font-size:9.5pt;font-family:Consolas;color:navy;background:white">mapper</span><span style="font-size:9.5pt;font-family:Consolas;color:black;background:white">
 = </span><span style="font-size:9.5pt;font-family:Consolas;color:#216f85;background:white">vtkPolyDataMapper</span><span style="font-size:9.5pt;font-family:Consolas;color:black;background:white">::</span><span style="font-size:9.5pt;font-family:Consolas;color:#880000;background:white">New</span><span style="font-size:9.5pt;font-family:Consolas;color:black;background:white">();<u></u><u></u></span></p>
<p class="MsoNormal" style="text-autospace:none"><span style="font-size:9.5pt;font-family:Consolas;color:black;background:white"> 
</span><span style="font-size:9.5pt;font-family:Consolas;color:navy;background:white">mapper</span><span style="font-size:9.5pt;font-family:Consolas;color:black;background:white">-></span><span style="font-size:9.5pt;font-family:Consolas;color:#880000;background:white">SetInputConnection</span><span style="font-size:9.5pt;font-family:Consolas;color:black;background:white">(</span><span style="font-size:9.5pt;font-family:Consolas;color:navy;background:white">appendPD</span><span style="font-size:9.5pt;font-family:Consolas;color:black;background:white">-></span><span style="font-size:9.5pt;font-family:Consolas;color:#880000;background:white">GetOutputPort</span><span style="font-size:9.5pt;font-family:Consolas;color:black;background:white">());<u></u><u></u></span></p>
<p class="MsoNormal" style="text-autospace:none"><span style="font-size:9.5pt;font-family:Consolas;color:black;background:white"><u></u> <u></u></span></p>
<p class="MsoNormal" style="text-autospace:none"><span style="font-size:9.5pt;font-family:Consolas;color:black;background:white"> 
</span><span style="font-size:9.5pt;font-family:Consolas;color:#216f85;background:white">vtkActor</span><span style="font-size:9.5pt;font-family:Consolas;color:black;background:white">
 *</span><span style="font-size:9.5pt;font-family:Consolas;color:navy;background:white">actor</span><span style="font-size:9.5pt;font-family:Consolas;color:black;background:white">
 = </span><span style="font-size:9.5pt;font-family:Consolas;color:#216f85;background:white">vtkActor</span><span style="font-size:9.5pt;font-family:Consolas;color:black;background:white">::</span><span style="font-size:9.5pt;font-family:Consolas;color:#880000;background:white">New</span><span style="font-size:9.5pt;font-family:Consolas;color:black;background:white">();<u></u><u></u></span></p>
<p class="MsoNormal" style="text-autospace:none"><span style="font-size:9.5pt;font-family:Consolas;color:black;background:white"> 
</span><span style="font-size:9.5pt;font-family:Consolas;color:navy;background:white">actor</span><span style="font-size:9.5pt;font-family:Consolas;color:black;background:white">-></span><span style="font-size:9.5pt;font-family:Consolas;color:#880000;background:white">SetMapper</span><span style="font-size:9.5pt;font-family:Consolas;color:black;background:white">(</span><span style="font-size:9.5pt;font-family:Consolas;color:navy;background:white">mapper</span><span style="font-size:9.5pt;font-family:Consolas;color:black;background:white">);<u></u><u></u></span></p>
<p class="MsoNormal" style="text-autospace:none"><span style="font-size:9.5pt;font-family:Consolas;color:black;background:white"><u></u> <u></u></span></p>
<p class="MsoNormal" style="text-autospace:none"><span style="font-size:9.5pt;font-family:Consolas;color:black;background:white"> 
</span><span style="font-size:9.5pt;font-family:Consolas;color:navy;background:white">Renderer</span><span style="font-size:9.5pt;font-family:Consolas;color:black;background:white">-></span><span style="font-size:9.5pt;font-family:Consolas;color:#880000;background:white">AddActor</span><span style="font-size:9.5pt;font-family:Consolas;color:black;background:white">(</span><span style="font-size:9.5pt;font-family:Consolas;color:navy;background:white">actor</span><span style="font-size:9.5pt;font-family:Consolas;color:black;background:white">);<u></u><u></u></span></p>
<p class="MsoNormal" style="text-autospace:none"><span style="font-size:9.5pt;font-family:Consolas;color:black;background:white"><u></u> <u></u></span></p>
<p class="MsoNormal" style="text-autospace:none"><span style="font-size:9.5pt;font-family:Consolas;color:black;background:white"> 
</span><span style="font-size:9.5pt;font-family:Consolas;color:green;background:white">// -------------------------------</span><span style="font-size:9.5pt;font-family:Consolas;color:black;background:white"><u></u><u></u></span></p>
<p class="MsoNormal" style="text-autospace:none"><span style="font-size:9.5pt;font-family:Consolas;color:black;background:white"> 
</span><span style="font-size:9.5pt;font-family:Consolas;color:green;background:white">// Reset the camera and initialize</span><span style="font-size:9.5pt;font-family:Consolas;color:black;background:white"><u></u><u></u></span></p>
<p class="MsoNormal" style="text-autospace:none"><span style="font-size:9.5pt;font-family:Consolas;color:black;background:white"> 
</span><span style="font-size:9.5pt;font-family:Consolas;color:green;background:white">// -------------------------------</span><span style="font-size:9.5pt;font-family:Consolas;color:black;background:white"><u></u><u></u></span></p>
<p class="MsoNormal" style="text-autospace:none"><span style="font-size:9.5pt;font-family:Consolas;color:black;background:white"> 
</span><span style="font-size:9.5pt;font-family:Consolas;color:navy;background:white">Renderer</span><span style="font-size:9.5pt;font-family:Consolas;color:black;background:white">-></span><span style="font-size:9.5pt;font-family:Consolas;color:#880000;background:white">ResetCamera</span><span style="font-size:9.5pt;font-family:Consolas;color:black;background:white">();<u></u><u></u></span></p>
<p class="MsoNormal" style="text-autospace:none"><span style="font-size:9.5pt;font-family:Consolas;color:black;background:white"> 
</span><span style="font-size:9.5pt;font-family:Consolas;color:navy;background:white">RWI</span><span style="font-size:9.5pt;font-family:Consolas;color:black;background:white">-></span><span style="font-size:9.5pt;font-family:Consolas;color:#880000;background:white">Initialize</span><span style="font-size:9.5pt;font-family:Consolas;color:black;background:white">();<u></u><u></u></span></p>
<p class="MsoNormal" style="text-autospace:none"><span style="font-size:9.5pt;font-family:Consolas;color:black;background:white"> 
</span><span style="font-size:9.5pt;font-family:Consolas;color:navy;background:white">RWI</span><span style="font-size:9.5pt;font-family:Consolas;color:black;background:white">-></span><span style="font-size:9.5pt;font-family:Consolas;color:#880000;background:white">Start</span><span style="font-size:9.5pt;font-family:Consolas;color:black;background:white">();<u></u><u></u></span></p>
<p class="MsoNormal"><span style="font-size:11.0pt;font-family:"Calibri",sans-serif;color:#1f497d"><u></u> <u></u></span></p>
<p class="MsoNormal"><span style="font-size:11.0pt;font-family:"Calibri",sans-serif;color:#1f497d"><u></u> <u></u></span></p>
<p class="MsoNormal"><span style="font-size:11.0pt;font-family:"Calibri",sans-serif;color:#1f497d"><u></u> <u></u></span></p>
<p class="MsoNormal"><span style="font-size:11.0pt;font-family:"Calibri",sans-serif;color:#1f497d">Thank you<u></u><u></u></span></p>
<p class="MsoNormal"><span style="font-size:11.0pt;font-family:"Calibri",sans-serif;color:#1f497d">Nigel McFarlane<u></u><u></u></span></p>
<p class="MsoNormal"><span style="font-size:11.0pt;font-family:"Calibri",sans-serif;color:#1f497d">University of Bedfordshire UK<u></u><u></u></span></p></div></div><div lang="EN-GB" link="blue" vlink="purple"><div>
<p class="MsoNormal"><span style="font-size:11.0pt;font-family:"Calibri",sans-serif;color:#1f497d"><u></u> <u></u></span></p>
<p class="MsoNormal"><span style="font-size:11.0pt;font-family:"Calibri",sans-serif;color:#1f497d"><u></u> <u></u></span></p>
<p class="MsoNormal"><span style="font-size:11.0pt;font-family:"Calibri",sans-serif;color:#1f497d"><u></u> <u></u></span></p>
<p class="MsoNormal"><span style="font-size:11.0pt;font-family:"Calibri",sans-serif;color:#1f497d"><u></u> <u></u></span></p>
<p class="MsoNormal"><b><span lang="EN-US" style="font-size:11.0pt;font-family:"Calibri",sans-serif">From:</span></b><span lang="EN-US" style="font-size:11.0pt;font-family:"Calibri",sans-serif"> Dan Lipsa [mailto:<a href="mailto:dan.lipsa@kitware.com" target="_blank">dan.lipsa@kitware.com</a>]
<br>
<b>Sent:</b> 06 August 2015 22:21<br>
<b>To:</b> Nigel Mcfarlane <<a href="mailto:Nigel.Mcfarlane@beds.ac.uk" target="_blank">Nigel.Mcfarlane@beds.ac.uk</a>>; <a href="mailto:vtkusers@vtk.org" target="_blank">vtkusers@vtk.org</a><br>
<b>Subject:</b> Re: [vtkusers] vtkAppendPolydata - wrong extents on multiple inputs<u></u><u></u></span></p>
<p class="MsoNormal"><u></u> <u></u></p>
</div></div><div lang="EN-GB" link="blue" vlink="purple"><div><div>
<p class="MsoNormal">> This request is propagated upstream and stops if a filter has its inputs older than its output. <u></u><u></u></p></div></div></div><div lang="EN-GB" link="blue" vlink="purple"><div><div>
<div>
<p class="MsoNormal">I meant downstream. It has to check all filters as their properties might change which will affect the final result.<u></u><u></u></p>
</div>
</div></div></div><div lang="EN-GB" link="blue" vlink="purple"><div>
<p class="MsoNormal"><u></u> <u></u></p>
<div>
<div>
<p class="MsoNormal">On Thu, Aug 6, 2015 at 5:12 PM Dan Lipsa <<a href="mailto:dan.lipsa@kitware.com" target="_blank">dan.lipsa@kitware.com</a>> wrote:<u></u><u></u></p>
</div>
<blockquote style="border:none;border-left:solid #cccccc 1.0pt;padding:0cm 0cm 0cm 6.0pt;margin-left:4.8pt;margin-right:0cm">
<div>
<div>
<p class="MsoNormal">Nigel,<u></u><u></u></p>
</div>
<p class="MsoNormal">The pipeline executive compares the modification time (<span style="font-size:10.0pt">vtkObject::GetMTime()</span>) for the output of a filter against each of its inputs. If any of the inputs is newer, the filter is updated. It may be that
 your filter does not update the time of its output properly. This request is propagated upstream and stops if a filter has its inputs older than its output. I would setup a breakpoint and look at the first update for your filters.<u></u><u></u></p>
</div>
<p class="MsoNormal"><u></u> <u></u></p>
<div>
<div>
<p class="MsoNormal">On Thu, Aug 6, 2015 at 9:20 AM Nigel Mcfarlane <<a href="mailto:Nigel.Mcfarlane@beds.ac.uk" target="_blank">Nigel.Mcfarlane@beds.ac.uk</a>> wrote:<u></u><u></u></p>
</div>
<blockquote style="border:none;border-left:solid #cccccc 1.0pt;padding:0cm 0cm 0cm 6.0pt;margin-left:4.8pt;margin-right:0cm">
<div>
<div>
<p class="MsoNormal">Dear vtkusers,<u></u><u></u></p>
<p class="MsoNormal"> <u></u><u></u></p>
<p class="MsoNormal">I am creating a visual pipe in vtk 6.2.0 and I am having problems connecting vtkAppendPolyData to multiple inputs which start from images of different dimensions.  The visual pipe
 converts a set of input images into isosurfaces, adds scalars for colour and transparency, then merges them into one polydata mesh so they can be depth sorted before rendering.  Its structure looks like this:<u></u><u></u></p>
<p class="MsoNormal"> <u></u><u></u></p>
<p class="MsoNormal" style="text-autospace:none">
<span style="font-size:9.5pt;font-family:Consolas;color:green;background:white">//</span><u></u><u></u></p>
<p class="MsoNormal" style="text-autospace:none">
<span style="font-size:9.5pt;font-family:Consolas;color:green;background:white">//     image1       image2       image3</span><u></u><u></u></p>
<p class="MsoNormal" style="text-autospace:none">
<span style="font-size:9.5pt;font-family:Consolas;color:green;background:white">//       |            |            |</span><u></u><u></u></p>
<p class="MsoNormal" style="text-autospace:none">
<span style="font-size:9.5pt;font-family:Consolas;color:green;background:white">//    DMCubes1     DMCubes2     DMCubes3</span><u></u><u></u></p>
<p class="MsoNormal" style="text-autospace:none">
<span style="font-size:9.5pt;font-family:Consolas;color:green;background:white">//       |            |            |</span><u></u><u></u></p>
<p class="MsoNormal" style="text-autospace:none">
<span style="font-size:9.5pt;font-family:Consolas;color:green;background:white">//  AddScalars1  AddScalars2  AddScalars3</span><u></u><u></u></p>
<p class="MsoNormal" style="text-autospace:none">
<span style="font-size:9.5pt;font-family:Consolas;color:green;background:white">//             \      |      /</span><u></u><u></u></p>
<p class="MsoNormal" style="text-autospace:none">
<span style="font-size:9.5pt;font-family:Consolas;color:green;background:white">//              \     |     /</span><u></u><u></u></p>
<p class="MsoNormal" style="text-autospace:none">
<span style="font-size:9.5pt;font-family:Consolas;color:green;background:white">//               \    |    /</span><u></u><u></u></p>
<p class="MsoNormal" style="text-autospace:none">
<span style="font-size:9.5pt;font-family:Consolas;color:green;background:white">//            vtkAppendPolyData</span><u></u><u></u></p>
<p class="MsoNormal" style="text-autospace:none">
<span style="font-size:9.5pt;font-family:Consolas;color:green;background:white">//                    |</span><u></u><u></u></p>
<p class="MsoNormal" style="text-autospace:none">
<span style="font-size:9.5pt;font-family:Consolas;color:green;background:white">//           vtkDepthSortPolyData</span><u></u><u></u></p>
<p class="MsoNormal" style="text-autospace:none">
<span style="font-size:9.5pt;font-family:Consolas;color:green;background:white">//                    |</span><u></u><u></u></p>
<p class="MsoNormal" style="text-autospace:none">
<span style="font-size:9.5pt;font-family:Consolas;color:green;background:white">//               Mapper/Actor</span><u></u><u></u></p>
<p class="MsoNormal" style="text-autospace:none">
<span style="font-size:9.5pt;font-family:Consolas;color:green;background:white">//                    |</span><u></u><u></u></p>
<p class="MsoNormal" style="text-autospace:none">
<span style="font-size:9.5pt;font-family:Consolas;color:green;background:white">//                 Renderer</span><u></u><u></u></p>
<p class="MsoNormal" style="text-autospace:none">
<span style="font-size:9.5pt;font-family:Consolas;color:green;background:white">//</span><u></u><u></u></p>
<p class="MsoNormal"> <u></u><u></u></p>
<p class="MsoNormal">The images are produced by vtkMetaImageReader, the “DMCubes” filters are vtkDiscreteMarchingCubes, and the”AddScalars” filters are my own code.<u></u><u></u></p>
<p class="MsoNormal"> <u></u><u></u></p>
<p class="MsoNormal">The problem is that this produces an image in which the dimensions/extents of two of the images have clearly been set incorrectly.  I don’t know much about the way the vtk pipeline
 works, but I suppose that an information request for the extents of the images travels up and back down the pipeline, so the extents get set to that of the last input, and then applied to all the inputs.  The problem disappears if the input branches are first
 independently updated by calling a manual Update() on each of the AddScalars filters, but it returns if one of the DMCubes filters is modified, which triggers another general update cycle.<u></u><u></u></p>
<p class="MsoNormal"> <u></u><u></u></p>
<p class="MsoNormal">Is there any way to set up this pipeline so that it does not require a manual update when the image inputs are modified? 
<u></u><u></u></p>
<p class="MsoNormal"> <u></u><u></u></p>
<p class="MsoNormal">Nigel McFarlane<u></u><u></u></p>
<p class="MsoNormal">University of Bedfordshire<u></u><u></u></p>
</div>
</div>
<p class="MsoNormal">_______________________________________________<br>
Powered by <a href="http://www.kitware.com" target="_blank">www.kitware.com</a><br>
<br>
Visit other Kitware open-source projects at <a href="http://www.kitware.com/opensource/opensource.html" target="_blank">
http://www.kitware.com/opensource/opensource.html</a><br>
<br>
Please keep messages on-topic and check the VTK FAQ at: <a href="http://www.vtk.org/Wiki/VTK_FAQ" target="_blank">
http://www.vtk.org/Wiki/VTK_FAQ</a><br>
<br>
Search the list archives at: <a href="http://markmail.org/search/?q=vtkusers" target="_blank">
http://markmail.org/search/?q=vtkusers</a><br>
<br>
Follow this link to subscribe/unsubscribe:<br>
<a href="http://public.kitware.com/mailman/listinfo/vtkusers" target="_blank">http://public.kitware.com/mailman/listinfo/vtkusers</a><u></u><u></u></p>
</blockquote>
</div>
</blockquote>
</div>
</div></div></blockquote></div>