[prev in list] [next in list] [prev in thread] [next in thread] 

List:       vtkusers
Subject:    Re: [vtkusers] NULL check and reinitialize
From:       Jothybasu Selvaraj <jothybasu () gmail ! com>
Date:       2011-10-31 15:07:58
Message-ID: CAKuw5X3KymZx0ucfO=zuMOBkiihQEEOPjaSXPRtCk11j6RivuQ () mail ! gmail ! com
[Download RAW message or body]

[Attachment #2 (multipart/alternative)]


I can't see counterparts of SetDimensions(), SetSpacing(), SetOrigin etc
in vtkImageChangeInformation.

-- they are as SetOutputSpacing.....origin...extent....


Jothy



On Mon, Oct 31, 2011 at 3:00 PM, Divya Rathore <divyarathore@gmail.com>wrote:

> Considering a hypothetical scenario:
>
> //Step 1: Load Data: 256*256*256 volume
> // set various parameters
> imageData->SetDimensions(width, height, depth);
> imageData->SetNumberOfScalarComponents(1);
> imageData->SetScalarTypeToUnsignedShort();
> imageData->SetSpacing(spacingX, spacingY, spacingZ);
> imageData->SetOrigin(originX, originY, originZ);
> // Visualize it. Get Happy.
>
> // Now try loading another dataset of different size
> //Step 2: Load Data: 512*512*512 volume
>
> // I can't see counterparts of SetDimensions(), SetSpacing(), SetOrigin etc
> in vtkImageChangeInformation.
> // What next?
>
>
> - Divya
>
> On Mon, Oct 31, 2011 at 2:46 PM, Divya Rathore <divyarathore@gmail.com>wrote:
>
>> Thanks, Jothy.
>> I will check if this does what I intend to get done.
>>
>> best regards,
>> Divya
>>
>>
>>
>> On Mon, Oct 31, 2011 at 2:36 PM, Jothybasu Selvaraj <jothybasu@gmail.com>wrote:
>>
>>> May be you should use vtkImageChangeInformation(changer) and then
>>>
>>> this->imageData=changer->GetOutput().
>>>
>>>
>>> Jothy
>>>
>>> On Mon, Oct 31, 2011 at 2:32 PM, Divya Rathore <divyarathore@gmail.com>wrote:
>>>
>>>> Hi All,
>>>>
>>>> I have a vtkSmartPointer of vtkImageData:
>>>>
>>>> // declaration in header //
>>>> vtkSmartPointer<vtkImageData> imageData;
>>>>
>>>> // implementation in .cpp //
>>>> // get values from elsewhere and feed into this //
>>>> imageData->SetDimensions(width, height, depth);
>>>> imageData->SetNumberOfScalarComponents(1);
>>>> imageData->SetScalarTypeToUnsignedShort();
>>>> imageData->SetSpacing(spacingX, spacingY, spacingZ);
>>>> imageData->SetOrigin(originX, originY, originZ);
>>>>
>>>>
>>>> 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:
>>>>
>>>> imageData->Delete(); // WRONG! Its a smart pointer.
>>>>
>>>> what's the way to reinitialize the dimensions, spacing, origin etc
>>>> (emptying this pointer back to its initial state)?
>>>>
>>>>
>>>> best regards,
>>>> Divya
>>>>
>>>> _______________________________________________
>>>> Powered by www.kitware.com
>>>>
>>>> Visit other Kitware open-source projects at
>>>> http://www.kitware.com/opensource/opensource.html
>>>>
>>>> Please keep messages on-topic and check the VTK FAQ at:
>>>> http://www.vtk.org/Wiki/VTK_FAQ
>>>>
>>>> Follow this link to subscribe/unsubscribe:
>>>> http://www.vtk.org/mailman/listinfo/vtkusers
>>>>
>>>>
>>>
>>>
>>> --
>>> Jothybasu K Selvaraj
>>> PhD Student
>>> University of Liverpool
>>> Liverpool,UK
>>>
>>>
>>
>


-- 
Jothybasu K Selvaraj
PhD Student
University of Liverpool
Liverpool,UK

[Attachment #5 (text/html)]

<div dir="ltr">I can&#39;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">&lt;<a href="mailto:divyarathore@gmail.com">divyarathore@gmail.com</a>&gt;</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-&gt;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-&gt;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-&gt;SetScalarTypeToUnsignedShort();</div><div style="color:rgb(68, \
68, 68);font-family:arial, sans-serif;font-size:13px;background-color:rgb(255, 255, \
255)">


imageData-&gt;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-&gt;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&#39;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">&lt;<a href="mailto:divyarathore@gmail.com" \
target="_blank">divyarathore@gmail.com</a>&gt;</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">&lt;<a href="mailto:jothybasu@gmail.com" \
target="_blank">jothybasu@gmail.com</a>&gt;</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-&gt;imageData=changer-&gt;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">&lt;<a href="mailto:divyarathore@gmail.com" \
target="_blank">divyarathore@gmail.com</a>&gt;</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&lt;vtkImageData&gt; \
imageData;</div><div><br></div><div>// implementation in .cpp //</div>






<div>// get values from elsewhere and feed into this \
//</div><div><div>imageData-&gt;SetDimensions(width, height, \
depth);</div><div>imageData-&gt;SetNumberOfScalarComponents(1);</div><div>imageData-&gt;SetScalarTypeToUnsignedShort();</div>







<div>imageData-&gt;SetSpacing(spacingX, spacingY, \
spacingZ);</div><div>imageData-&gt;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&#39;t call:</div>






<div><br></div><div>imageData-&gt;Delete(); // WRONG! Its a smart \
pointer.</div><div><br></div><div>what&#39;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>



_______________________________________________
Powered by www.kitware.com

Visit other Kitware open-source projects at http://www.kitware.com/opensource/opensource.html

Please keep messages on-topic and check the VTK FAQ at: http://www.vtk.org/Wiki/VTK_FAQ

Follow this link to subscribe/unsubscribe:
http://www.vtk.org/mailman/listinfo/vtkusers


[prev in list] [next in list] [prev in thread] [next in thread] 

Configure | About | News | Add a list | Sponsored by KoreLogic