Hi,<br>You should be more precise about your problem. I guess you missed a resample-&gt;Update() before setting the input of colorMap, but not for sure. <br><br>Jerome<br><br><div class="gmail_quote">2009/12/2 Karl <span dir="ltr">&lt;<a href="mailto:bulkmailaddress@gmail.com">bulkmailaddress@gmail.com</a>&gt;</span><br>
<blockquote class="gmail_quote" style="border-left: 1px solid rgb(204, 204, 204); margin: 0pt 0pt 0pt 0.8ex; padding-left: 1ex;">Hi,<br>
<br>
I am attempting unsuccessfully to use vtkImageResample to change the spacing<br>
of an image.<br>
I have a 3D volume that is being resliced with a vtkImagePlaneWidget.  I am<br>
then requesting the slice.<br>
The code works fine until I add this filter, can anyone tell me what I am<br>
doing wrong.<br>
<br>
Thanks<br>
KB<br>
<br>
Code before filter is added (executes with no problem):<br>
_________________________________________<br>
vtkSmartPointer&lt;vtkImageData&gt; ImageSliceInfo::GetSliceData(QString<br>
sliceName)<br>
{<br>
        // use vtkImageMapToColors to map to 8-bit for output<br>
        vtkImageMapToColors* colorMap = vtkImageMapToColors::New();<br>
        colorMap-&gt;PassAlphaToOutputOff();<br>
        colorMap-&gt;SetActiveComponent(0);<br>
        colorMap-&gt;SetOutputFormatToLuminance();<br>
        colorMap-&gt;SetInput(planeWidget-&gt;GetResliceOutput());<br>
        colorMap-&gt;SetLookupTable(planeWidget-&gt;GetLookupTable());<br>
<br>
        vtkSmartPointer&lt;vtkImageData&gt; slice = colorMap-&gt;GetOutput();<br>
<br>
        colorMap-&gt;Delete();<br>
        return slice;<br>
}<br>
<br>
<br>
<br>
Code after filter is added:<br>
__________________________________________<br>
vtkSmartPointer&lt;vtkImageData&gt; ImageSliceInfo::GetSliceData()<br>
{<br>
        // resample to isotropic spacing<br>
        vtkImageResample* resample = vtkImageResample::New();<br>
        resample-&gt;SetInput(planeWidget-&gt;GetResliceOutput());<br>
        resample-&gt;SetDimensionality(2);<br>
        resample-&gt;SetAxisOutputSpacing(0,1);<br>
        resample-&gt;SetAxisOutputSpacing(1,1);<br>
<br>
        // use vtkImageMapToColors to map to 8-bit for output<br>
        vtkImageMapToColors* colorMap = vtkImageMapToColors::New();<br>
        colorMap-&gt;PassAlphaToOutputOff();<br>
        colorMap-&gt;SetActiveComponent(0);<br>
        colorMap-&gt;SetOutputFormatToLuminance();<br>
        colorMap-&gt;SetInput(resample-&gt;GetOutput());<br>
        colorMap-&gt;SetLookupTable(planeWidget-&gt;GetLookupTable());<br>
<br>
        vtkSmartPointer&lt;vtkImageData&gt; slice = colorMap-&gt;GetOutput();<br>
<br>
        resample-&gt;Delete();<br>
        colorMap-&gt;Delete();<br>
        return slice;<br>
}<br>
<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>
</blockquote></div><br>