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

List:       vtkusers
Subject:    [vtkusers] GetResliceOutput() problem with vtkImagePlaneWidget
From:       Mathieu Coursolle <mcoursolle () yahoo ! ca>
Date:       2004-08-31 14:41:53
Message-ID: 20040831144153.48969.qmail () web60205 ! mail ! yahoo ! com
[Download RAW message or body]

Hi,
I am using a vtkImagePlaneWidget to display a volume.
I want to display the content of the plane when an 
interraction occurs. 
However, the reslice image output is size is always
a power of 2, so my image is bigger than it should be, 
filling the extra size with zeros.
Is there a way to crop the image to the original size
if I don't know it?
Here is what I do:
 
vtkImageData* image = widget->GetResliceOutput();
 
vtkImageMapToRGBA* image_map = vtkImageMapToRGBA::New();      
    image_map->SetInput(image); 
    image_map->SetLookupTable(m_LookUpTable);



imageActor->SetInput(image_map->GetOutput());

m_Renderer->AddProp(imageActor);

 

Thanks a lot...

MAthieu




---------------------------------
Post your free ad now! Yahoo! Canada Personals

[Attachment #3 (text/html)]

<DIV>Hi,</DIV>
<DIV>I am using a vtkImagePlaneWidget to display a volume.</DIV>
<DIV>I want to display the content of the plane when an </DIV>
<DIV>interraction occurs. </DIV>
<DIV>However, the reslice image output is size is always</DIV>
<DIV>a power of 2, so my image is bigger than it should be, </DIV>
<DIV>filling the extra size with zeros.</DIV>
<DIV>Is there a way to crop the image to the original size</DIV>
<DIV>if I don't know it?</DIV>
<DIV>Here is what I do:</DIV>
<DIV>&nbsp;</DIV>
<DIV>vtkImageData* image = widget-&gt;GetResliceOutput();</DIV>
<DIV>&nbsp;</DIV>
<DIV><FONT size=2>vtkImageMapToRGBA* image_map = \
vtkImageMapToRGBA::New();&nbsp;</FONT><FONT size=2>&nbsp;&nbsp;&nbsp;&nbsp; \
</FONT></DIV> <DIV><FONT size=2>&nbsp;&nbsp;&nbsp; image_map-&gt;SetInput(image); \
</FONT></DIV> <DIV><FONT size=2>&nbsp;&nbsp;&nbsp; \
image_map-&gt;SetLookupTable(m_LookUpTable);</DIV> <DIV>
<P></P>
<P></FONT><FONT size=2>imageActor-&gt;SetInput(image_map-&gt;GetOutput());</FONT><FONT \
color=#008000 size=2></P></FONT><FONT size=2> \
<P>m_Renderer-&gt;AddProp(imageActor);</P> <P>&nbsp;</P>
<P>Thanks a lot...</P>
<P>MAthieu</P></FONT></DIV><p><br><hr size=1>Post your free ad now! <a \
href="http://ca.personals.yahoo.com/"><b>Yahoo! Canada Personals</b></a><br>



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

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