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>