<div dir="ltr">May be you should use vtkImageChangeInformation(changer) and then<br><br>this->imageData=changer->GetOutput().<br><br><br>Jothy <br><br><div class="gmail_quote">On Mon, Oct 31, 2011 at 2:32 PM, Divya Rathore <span dir="ltr"><<a href="mailto:divyarathore@gmail.com">divyarathore@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,
<div><br></div><div>I have a vtkSmartPointer of vtkImageData:</div><div><br></div><div>// declaration in header //</div><div>vtkSmartPointer<vtkImageData> imageData;</div><div><br></div><div>// implementation in .cpp //</div>
<div>// get values from elsewhere and feed into this //</div><div><div>imageData->SetDimensions(width, height, depth);</div><div>imageData->SetNumberOfScalarComponents(1);</div><div>imageData->SetScalarTypeToUnsignedShort();</div>
<div>imageData->SetSpacing(spacingX, spacingY, spacingZ);</div><div>imageData->SetOrigin(originX, originY, originZ);</div></div><div><br></div><div><br></div><div>During the overall lifecycle of the application, I need to NULL check and feed values into imageData multiple times. It being a smart pointer, I can't call:</div>
<div><br></div><div>imageData->Delete(); // WRONG! Its a smart pointer.</div><div><br></div><div>what's the way to reinitialize the dimensions, spacing, origin etc (emptying this pointer back to its initial state)?</div>
<div><br></div><div><br></div><div>best regards,</div><div>Divya</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 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></blockquote></div><br><br clear="all"><br>-- <br><div dir="ltr">Jothybasu K Selvaraj<br>PhD Student<br>University of Liverpool<br>Liverpool,UK<br></div><br>
</div>