<div dir="ltr">Hi all,<br><br>I have a pipeline like this, every time I call this function the memory increases ~10MB. How can I fix this?<br><br>I have a imgData already instantiated like this<br><br>vtkSmartPointer<vtkImageData>img=<br>
vtkSmartPointer<vtkImageData>::New();<br><br>vtkSmartPointer<vtkXMLImageReader>rd=<br> vtkSmartPointer<vtkXMLImageReader>::New();<br>rd->SetFilename("filename");<br>rd->Update();<br>
<br>img=rd->GetOutput();<br><br><br>//Now I repeat this function several times<br><br> vtkSmartPointer<vtkImageShiftScale>scaler=<br> vtkSmartPointer<vtkImageShiftScale>::New();<br> scaler->SetInput(img);<b><span style="color:rgb(255,0,0)">//is this correct way of doing?</span></b><br>
<br> scaler->SetScale(0.5);//Multiply<br> scaler->SetOutputScalarTypeToDouble();<br><br> //scaler->ReleaseDataFlagOn();//Tried with this too<br> scaler->Update(); <br><br> img=scaler->GetOutput();<b><span style="color:rgb(255,0,0)">//is this correct way of doing?</span></b><br>
<br>I am beginner in C++, so I am expecting some silly mistakes.<br><br><br>Thanks<br>--<br>Jothy<br></div>