<html><body><div style="color:#000; background-color:#fff; font-family:tahoma, new york, times, serif;font-size:10pt"><div style="font-family: tahoma, 'new york', times, serif; font-size: 10pt;"><span>Hello all,</span></div><div style="font-family: tahoma, 'new york', times, serif; font-size: 13px; color: rgb(0, 0, 0); background-color: transparent; font-style: normal;"><span><br></span></div><div style="font-family: tahoma, 'new york', times, serif; font-size: 13px; color: rgb(0, 0, 0); background-color: transparent; font-style: normal;"><span>I still have the same problems.</span></div><div style="font-family: tahoma, 'new york', times, serif; font-size: 13px; color: rgb(0, 0, 0); background-color: transparent; font-style: normal;"><span><br></span></div><div style="font-family: tahoma, 'new york', times, serif; font-size: 13px; color: rgb(0, 0, 0); background-color: transparent; font-style: normal;"><span>What is the deal with vtk GetOutput(),
 GetOutputPort() etc.?</span></div><div style="font-family: tahoma, 'new york', times, serif; font-size: 13px; color: rgb(0, 0, 0); background-color: transparent; font-style: normal;"><span>How long does the generator object of this GetOutput() live? Can it be dumped right after obtaining GetOutput(). How can it be dumped?&nbsp;</span></div><div style="font-family: tahoma, 'new york', times, serif; font-size: 13px; color: rgb(0, 0, 0); background-color: transparent; font-style: normal;"><span>How long does the GetOutput()-object, e.g. an image, live? How can it make it be collected by the garbage collection?</span></div><div style="font-family: tahoma, 'new york', times, serif; font-size: 13px; color: rgb(0, 0, 0); background-color: transparent; font-style: normal;"><span><br></span></div><div style="font-family: tahoma, 'new york', times, serif; font-size: 13px; color: rgb(0, 0, 0); background-color: transparent; font-style: normal;"><span>I am
 generating a large amount of images which have to get dumped correctly. Please advice me what to do. I think this advices are also helpful for later generations of VTK-wrapper users.</span></div><div style="font-family: tahoma, 'new york', times, serif; font-size: 13px; color: rgb(0, 0, 0); background-color: transparent; font-style: normal;"><span><br></span></div><div style="font-family: tahoma, 'new york', times, serif; font-size: 13px; color: rgb(0, 0, 0); background-color: transparent; font-style: normal;"><span>I have also problems generating only a plain image with a certain value. What I am currently doing is:</span></div><div style="font-family: tahoma, 'new york', times, serif; font-size: 13px; color: rgb(0, 0, 0); background-color: transparent; font-style: normal;"><span><br></span></div><div style="background-color: transparent;"><span><font size="2"><div style="background-color: transparent;">def
 generate_scalar_value_filled_3d_vtkImageData(spacing, origin, extent, scalar_type, scalar_value):</div><div style="background-color: transparent;">&nbsp; &nbsp; import vtk</div><div style="background-color: transparent;"><br></div><div style="background-color: transparent;">&nbsp; &nbsp; image = vtk.vtkImageData()</div><div style="background-color: transparent;">&nbsp; &nbsp; image.SetExtent([0, 0, 0, 0, 0, 0])</div><div style="background-color: transparent;">&nbsp; &nbsp; image.SetOrigin(origin)</div><div style="background-color: transparent;">&nbsp; &nbsp; image.SetSpacing(spacing)</div><div style="background-color: transparent;">&nbsp; &nbsp; image.SetScalarType(scalar_type)</div><div style="background-color: transparent;">&nbsp; &nbsp; image.AllocateScalars()</div><div style="background-color: transparent;"><br></div><div style="background-color: transparent;">&nbsp; &nbsp; padder = vtk.vtkImageConstantPad()</div><div style="background-color:
 transparent;">&nbsp; &nbsp; padder.SetOutputWholeExtent(extent)</div><div style="background-color: transparent;">&nbsp; &nbsp; padder.SetConstant(scalar_value)</div><div style="background-color: transparent;">&nbsp; &nbsp; padder.SetInput(image)</div><div style="background-color: transparent;">&nbsp; &nbsp; padder.Update()</div><div style="background-color: transparent;"><br></div><div style="background-color: transparent;">&nbsp; &nbsp; out = padder.GetOutput()</div><div style="background-color: transparent;">&nbsp; &nbsp; # image.ReleaseData()</div><div style="background-color: transparent;"><br></div><div style="background-color: transparent;">&nbsp; &nbsp; return out</div><div style="background-color: transparent;"><br></div><div style="background-color: transparent; color: rgb(0, 0, 0); font-size: 13px; font-family: tahoma, 'new york', times, serif; font-style: normal;">Whenever I call ReleaseData on the image my output is somewhat influenced. I
 cannot explain in which way. Can somebody explain me all the underlying structure and ideas? I am getting more and more confused from minute to minute.</div></font></span></div><div style="font-family: tahoma, 'new york', times, serif; font-size: 13px; color: rgb(0, 0, 0); background-color: transparent; font-style: normal;"><span><br></span></div><div style="font-family: tahoma, 'new york', times, serif; font-size: 13px; color: rgb(0, 0, 0); background-color: transparent; font-style: normal;"><span>Thanks in advance.</span></div><div style="font-family: tahoma, 'new york', times, serif; font-size: 13px; color: rgb(0, 0, 0); background-color: transparent; font-style: normal;"><span><br></span></div><div style="font-family: tahoma, 'new york', times, serif; font-size: 13px; color: rgb(0, 0, 0); background-color: transparent; font-style: normal;"><span>Best,</span></div><div style="font-family: tahoma, 'new york', times, serif; font-size: 13px; color:
 rgb(0, 0, 0); background-color: transparent; font-style: normal;"><span>Willi</span></div><div style="font-family: tahoma, 'new york', times, serif; font-size: 13px; color: rgb(0, 0, 0); background-color: transparent; font-style: normal;"><span><br></span></div><div style="font-family: tahoma, 'new york', times, serif; font-size: 10pt;"><br><blockquote style="border-left: 2px solid rgb(16, 16, 255); margin-left: 5px; margin-top: 5px; padding-left: 5px;">  <div style="font-family: tahoma, 'new york', times, serif; font-size: 10pt;"> <div style="font-family: 'times new roman', 'new york', times, serif; font-size: 12pt;"> <div dir="ltr"> <font size="2" face="Arial"> <hr size="1">  <b><span style="font-weight:bold;">Von:</span></b> Willi Huber &lt;surfersparadise85-vtk@yahoo.com&gt;<br> <b><span style="font-weight: bold;">An:</span></b> "vtkusers@vtk.org" &lt;vtkusers@vtk.org&gt; <br> <b><span style="font-weight: bold;">Gesendet:</span></b> 20:30 Montag,
 11.Februar 2013<br> <b><span style="font-weight: bold;">Betreff:</span></b> [vtkusers] How to dump images correctly in Python<br> </font> </div> <br><div id="yiv1821443743"><div><div style="color: rgb(0, 0, 0); background-color: rgb(255, 255, 255); font-family: tahoma, 'new york', times, serif; font-size: 10pt;"><div>Hello all,</div><div><br></div><div style="color: rgb(0, 0, 0); font-size: 13px; font-family: tahoma, 'new york', times, serif; background-color: transparent; font-style: normal;">I am having serious space problems. With my program I constantly generate images and I thought the internal garbage collector of python takes care but it doesn't seem so whenever I give an image to an other filter.</div><div style="color: rgb(0, 0, 0); font-size: 13px; font-family: tahoma, 'new york', times, serif; background-color: transparent; font-style: normal;">Now I am trying to delete all the unnecessary images by my own. Is there a common way to do this? I
 am using ReleaseData(). Is there a way to see what references a certain object?</div><div style="color: rgb(0, 0, 0); font-size: 13px; font-family: tahoma, 'new york', times, serif; background-color: transparent; font-style: normal;"><br></div><div style="color: rgb(0, 0, 0); font-size: 13px; font-family: tahoma, 'new york', times, serif; background-color: transparent; font-style: normal;">How is a image in vtk gernerated by a filter? Is it always a new image whenever I call GetOutput() or still the same all the time?</div><div style="color: rgb(0, 0, 0); font-size: 13px; font-family: tahoma, 'new york', times, serif; background-color: transparent; font-style: normal;"><br></div><div style="color: rgb(0, 0, 0); font-size: 13px; font-family: tahoma, 'new york', times, serif; background-color: transparent; font-style: normal;">Best,</div><div style="color: rgb(0, 0, 0); font-size: 13px; font-family: tahoma, 'new york', times, serif; background-color:
 transparent; font-style: normal;">Willi</div></div></div></div><br>_______________________________________________<br>Powered by www.kitware.com<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>Follow this link to subscribe/unsubscribe:<br><a href="http://www.vtk.org/mailman/listinfo/vtkusers" target="_blank">http://www.vtk.org/mailman/listinfo/vtkusers</a><br><br><br> </div> </div> </blockquote></div>   </div></body></html>