<div dir="ltr">I can't see counterparts of <span style="color:rgb(68, 68, 68);font-family:arial, sans-serif;font-size:13px;background-color:rgb(255, 255, 255)">SetDimensions(), </span><span style="color:rgb(68, 68, 68);font-family:arial, sans-serif;font-size:13px;background-color:rgb(255, 255, 255)">SetSpacing(), </span><span style="color:rgb(68, 68, 68);font-family:arial, sans-serif;font-size:13px;background-color:rgb(255, 255, 255)">SetOrigin</span><span style="font-size:13px;color:rgb(68, 68, 68);font-family:arial, sans-serif;background-color:rgb(255, 255, 255)"> </span>etc in vtkImageChangeInformation. <br>
<br>-- they are as SetOutputSpacing.....origin...extent....<br><br><br>Jothy<br><br><br><br><div class="gmail_quote">On Mon, Oct 31, 2011 at 3:00 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;"><div>Considering a hypothetical scenario:</div><div><br></div><div>//Step 1: Load Data: 256*256*256 volume</div><div>// set various parameters</div>
<div><div style="color:rgb(68, 68, 68);font-family:arial, sans-serif;font-size:13px;background-color:rgb(255, 255, 255)">
imageData->SetDimensions(width, height, depth);</div><div style="color:rgb(68, 68, 68);font-family:arial, sans-serif;font-size:13px;background-color:rgb(255, 255, 255)">imageData->SetNumberOfScalarComponents(1);</div>
<div style="color:rgb(68, 68, 68);font-family:arial, sans-serif;font-size:13px;background-color:rgb(255, 255, 255)">imageData->SetScalarTypeToUnsignedShort();</div><div style="color:rgb(68, 68, 68);font-family:arial, sans-serif;font-size:13px;background-color:rgb(255, 255, 255)">
imageData->SetSpacing(spacingX, spacingY, spacingZ);</div><div style="color:rgb(68, 68, 68);font-family:arial, sans-serif;font-size:13px;background-color:rgb(255, 255, 255)">imageData->SetOrigin(originX, originY, originZ);</div>
</div><div style="color:rgb(68, 68, 68);font-family:arial, sans-serif;font-size:13px;background-color:rgb(255, 255, 255)">// Visualize it. Get Happy.</div><div><br></div><div>// Now try loading another dataset of different size</div>
<div>//Step 2: Load Data: 512*512*512 volume</div><div><br></div><div>// I can't see counterparts of <span style="color:rgb(68, 68, 68);font-family:arial, sans-serif;font-size:13px;background-color:rgb(255, 255, 255)">SetDimensions(), </span><span style="color:rgb(68, 68, 68);font-family:arial, sans-serif;font-size:13px;background-color:rgb(255, 255, 255)">SetSpacing(), </span><span style="color:rgb(68, 68, 68);font-family:arial, sans-serif;font-size:13px;background-color:rgb(255, 255, 255)">SetOrigin</span><span style="font-size:13px;color:rgb(68, 68, 68);font-family:arial, sans-serif;background-color:rgb(255, 255, 255)"> </span>etc in vtkImageChangeInformation. </div>
<div>// What next?</div><div><br></div><div><br></div><div>- Divya</div><div><br><div class="gmail_quote">On Mon, Oct 31, 2011 at 2:46 PM, Divya Rathore <span dir="ltr"><<a href="mailto:divyarathore@gmail.com" target="_blank">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">Thanks, Jothy.<div>I will check if this does what I intend to get done.</div><div><br></div><div>best regards,</div><div>
Divya</div><div><div></div><div><div><br><div>
<br><br><div class="gmail_quote">On Mon, Oct 31, 2011 at 2:36 PM, Jothybasu Selvaraj <span dir="ltr"><<a href="mailto:jothybasu@gmail.com" target="_blank">jothybasu@gmail.com</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
<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"><div><div></div><div>On Mon, Oct 31, 2011 at 2:32 PM, Divya Rathore <span dir="ltr"><<a href="mailto:divyarathore@gmail.com" target="_blank">divyarathore@gmail.com</a>></span> wrote:<br>
</div></div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div><div></div><div>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></div></div>_______________________________________________<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><font color="#888888"><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>
</font></div>
</blockquote></div><br></div></div>
</div></div></blockquote></div><br></div>
</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>