Hi Andrew,<br><br>You're loading new data each loop, and never removing it. For starters, you could try adding a Delete call inside the loop after WriteImage:<br><br> Delete(rho_180x180x180_frame0010_subs01_total_raw)<br>
<br>Pat<br><br><br><div class="gmail_quote">On Tue, Jun 12, 2012 at 1:03 PM, Andrew Pearson <span dir="ltr"><<a href="mailto:andrew.j.pearson@gmail.com" target="_blank">andrew.j.pearson@gmail.com</a>></span> wrote:<br>
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">Hi all. I'm a newbie to both ParaView and Python scripting. I have a large number of *.raw files that I wish to load, visualize and save via a screenshot. To do this, I used the start/stop trace feature to produce a python script for one instance, edited the python script by adding a for loop, then ran it with pvbatch. The script produces the correct output, but it takes progressively longer on each iteration. To give you an idea, I started a batch of 200 files yesterday afternoon -- the first one took 10 seconds, but right now it's only on 180! I know that in Matlab, allocating and re-allocating progressively larger memory chunks in a loop can cause this behavior, but I don't see this happening here. Below is my script -- I appreciate any help anyone can give.<div>
<br></div><div><div>for count in range(1,204):</div><div> try: paraview.simple</div><div> except: from paraview.simple import *</div><div> paraview.simple._DisableFirstRenderCameraReset() </div><div><br></div><div> filename='/home/andy/Desktop/L2-1 Dicom/data8/rho_180x180x180_frame%04d_subs01_total.raw' % (count)</div>
<div> rho_180x180x180_frame0010_subs01_total_raw = ImageReader( FilePrefix=filename )</div><div><br></div><div> rho_180x180x180_frame0010_subs01_total_raw.DataExtent = [0, 179, 0, 179, 0, 179]</div><div> rho_180x180x180_frame0010_subs01_total_raw.DataScalarType = 'unsigned char'</div>
<div><br></div><div> RenderView1 = GetRenderView()</div><div> a1_ImageFile_PVLookupTable = GetLookupTableForArray( "ImageFile", 1, NanColor=[0.25, 0.0, 0.0], RGBPoints=[0.0, 0.23, 0.299, 0.754, 255.0, 0.706, 0.016, 0.15], VectorMode='Magnitude', ColorSpace='Diverging', ScalarRangeInitialized=1.0 )</div>
<div><br></div><div> a1_ImageFile_PiecewiseFunction = CreatePiecewiseFunction( Points=[0.0, 0.0, 0.5, 0.0, 255.0, 1.0, 0.5, 0.0] )</div><div><br></div><div> DataRepresentation1 = Show()</div><div> DataRepresentation1.EdgeColor = [0.0, 0.0, 0.5000076295109483]</div>
<div> DataRepresentation1.SelectionPointFieldDataArrayName = 'ImageFile'</div><div> DataRepresentation1.ScalarOpacityFunction = a1_ImageFile_PiecewiseFunction</div><div> DataRepresentation1.ColorArrayName = 'ImageFile'</div>
<div> DataRepresentation1.ScalarOpacityUnitDistance = 1.7320508075688779</div><div> DataRepresentation1.LookupTable = a1_ImageFile_PVLookupTable</div><div> DataRepresentation1.Representation = 'Volume'</div><div>
DataRepresentation1.ScaleFactor = 17.900000000000002</div><div><br></div><div> RenderView1.CameraViewUp = [-0.24428917240633777, 0.2192776215931415, 0.9445846308899386]</div><div> RenderView1.CameraPosition = [495.4123489395223, -304.665940440324, 285.97976015645276]</div>
<div> RenderView1.CameraClippingRange = [296.6155313125564, 980.96172641737]</div><div> RenderView1.CameraFocalPoint = [89.5, 89.50000000000001, 89.5]</div><div> RenderView1.CameraParallelScale = 155.0185472774145</div>
<div> RenderView1.CenterOfRotation = [89.5, 89.5, 89.5]</div><div><br></div><div> filename_out='/home/andy/Desktop/L2-1 Dicom/data8/frame_%04d.bmp' % (count)</div><div> WriteImage(filename_out)</div></div>
<br>_______________________________________________<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 ParaView Wiki at: <a href="http://paraview.org/Wiki/ParaView" target="_blank">http://paraview.org/Wiki/ParaView</a><br>
<br>
Follow this link to subscribe/unsubscribe:<br>
<a href="http://www.paraview.org/mailman/listinfo/paraview" target="_blank">http://www.paraview.org/mailman/listinfo/paraview</a><br>
<br></blockquote></div><br>