Hi Darshan,<br><br>Thanks so much for the fix. I guess I shouldn't rely on methods that change spacing to actually change spacing; I forgot that I have to do everything through a pipeline.<br><br>Mark<br><br><div class="gmail_quote">
On Wed, Oct 13, 2010 at 11:44 AM, Darshan Pai <span dir="ltr"><<a href="mailto:darshanpai@gmail.com">darshanpai@gmail.com</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin: 0pt 0pt 0pt 0.8ex; border-left: 1px solid rgb(204, 204, 204); padding-left: 1ex;">
I had some problem like this before . To circumvent that I just used vtkImageChangeInformation and changed the spacing manually . <br>That solved the spacing problem temporarily but I am not aware of any particular fix <br>
<br>Regards<br>Darshan<br><br><div class="gmail_quote"><div><div></div><div class="h5">On Wed, Oct 13, 2010 at 1:53 PM, Mark Roden <span dir="ltr"><<a href="mailto:mmroden@gmail.com" target="_blank">mmroden@gmail.com</a>></span> wrote:<br>
</div></div><blockquote class="gmail_quote" style="margin: 0pt 0pt 0pt 0.8ex; border-left: 1px solid rgb(204, 204, 204); padding-left: 1ex;"><div><div></div><div class="h5">
Hi all,<br><br>I have a medical image dataset that has a z spacing of 3.0 pixels (1.17 in the x and y dimensions). I'm using Java wrapping vtk and gdcm on 64 bit windows 7.<br><br>I load the image using vtkGDCMImageReader and the IPPSorter, and in the end, do this to set the proper z spacing:<br>
<br> double[] spacing = new double[3];<br> spacing = gdcmReader.GetOutput().GetSpacing();<br> spacing[2] = sorter.GetZSpacing();<br> imageData = gdcmReader.GetOutput();<br> imageData.SetSpacing(spacing);<br>
<br>Then I try to load three views on the data with vtkImageViewer2. The following functions reset the z spacing to be 1.0:<br><br>vtkImageViewer2 imageViewer = new vtkImageViewer2();<br>imageViewer.SetInput(imageData); //resets z spacing to 1.0<br>
imageData.SetSpacing(spacing); //attempt to fix<br><br>imageViewer.SetSlice((imageViewer.GetSliceMax() + imageViewer.GetSliceMin()) / 2); //resets z spacing to 1.0<br>
imageData.SetSpacing(spacing); //attempt to fix<br><br>//navigation slider on display<br>slider = new JSlider();<br>slider.setOrientation(JSlider.VERTICAL);<br>slider.setMinimum(imageViewer.GetSliceMin());//resets<br>slider.setMaximum(imageViewer.GetSliceMax());//resets<br>
imageViewer.GetInput().SetSpacing(spacing);//attempt to fix<br><br>Even with all those attempts to fix, the XZ and YZ orientations still display the image as if the z spacing is 1.0, instead of 3.0.<br><br>What's going on? Why is vtkImageViewer2 changing ANYTHING to do with the original image, rather than just straight up displaying what it's told to display?<br>
<br>Thanks,<br><font color="#888888">Mark<br><br><br>
</font><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><br>
</blockquote></div><br>