I am reading RT DOSE using python&#39;s dicom library. Creating a vtkDataArray out of it and the resulting vtkImageData as well.<div><br></div><div>Now this RT DOSE has a resolution 150x100 with pixel spacing of 2.5 where as the targeted CT image is 512x512 with Pixel spacing 1.2461. How will vtk automatically take care of spacing?<br>
<div><br><br><div class="gmail_quote">On Tue, Oct 9, 2012 at 4:44 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">
VTK will automatically take care of the spacing of the image data. How<br>
are you reading the RT dose?<br>
<div class="im"><br>
On Tue, Oct 9, 2012 at 12:11 PM, abhishek &lt;<a href="mailto:abhishek@meddiff.com">abhishek@meddiff.com</a>&gt; wrote:<br>
&gt; But that will only result in changing location of structure. What about<br>
&gt; difference in size?<br>
&gt;<br>
</div><div><div class="h5">&gt; On Tue, Oct 9, 2012 at 4:35 PM, Jothy [via VTK] &lt;[hidden email]&gt; wrote:<br>
&gt;&gt;<br>
&gt;&gt; VTKImageData&#39;s first pixel is on the lower left bottom, while the<br>
&gt;&gt; DICOM&#39;s first pixel is on the top left.<br>
&gt;&gt;<br>
&gt;&gt; Why can&#39;t you use vtkDICOMImageReader?<br>
&gt;&gt;<br>
&gt;&gt;<br>
&gt;&gt;<br>
&gt;&gt; On Tue, Oct 9, 2012 at 12:02 PM, Abhishek Gupta &lt;[hidden email]&gt; wrote:<br>
&gt;&gt;<br>
&gt;&gt; &gt; I am using python&#39;s VTK wrapper. Python&#39;s dicom library to read dicoms<br>
&gt;&gt; &gt; and<br>
&gt;&gt; &gt; wxPython to display images.<br>
&gt;&gt; &gt; Here&#39;s the code that I am using:<br>
&gt;&gt; &gt; ****************************************************<br>
&gt;&gt; &gt; dataArray = vtk.vtkUnsignedIntArray()<br>
&gt;&gt; &gt; for pixel in grid.flat:<br>
&gt;&gt; &gt;     dataArray.InsertNextValue(pixel)<br>
&gt;&gt; &gt;<br>
&gt;&gt; &gt; imageDataArray = vtk.vtkImageData()<br>
&gt;&gt; &gt; imageDataArray.SetDimensions(no. of rows, no. of columns,1)<br>
&gt;&gt; &gt; imageDataArray.SetSpacing(2.5,2.5,1)<br>
&gt;&gt; &gt; imageDataArray.GetPointData().SetScalars(dataArray)<br>
&gt;&gt; &gt; imageDataArray.Update()<br>
&gt;&gt; &gt;<br>
&gt;&gt; &gt; contours = vtk.vtkContourFilter()<br>
&gt;&gt; &gt; contours.SetInput(imageDataArray)<br>
&gt;&gt; &gt; contours.GenerateValues(1, level,level)<br>
&gt;&gt; &gt; contours.Update()<br>
&gt;&gt; &gt; ****************************************************************<br>
&gt;&gt; &gt;<br>
&gt;&gt; &gt;<br>
&gt;&gt; &gt;<br>
&gt;&gt; &gt;<br>
&gt;&gt; &gt; On Tue, Oct 9, 2012 at 4:27 PM, Jothybasu Selvaraj &lt;[hidden email]&gt;<br>
&gt;&gt; &gt; wrote:<br>
&gt;&gt; &gt;&gt;<br>
&gt;&gt; &gt;&gt; If you are dealing with DICOM objects in vtk, make sure you are using<br>
&gt;&gt; &gt;&gt; &quot;FileLowerLeftOn&quot; in the vtk readers.<br>
&gt;&gt; &gt;&gt;<br>
&gt;&gt; &gt;&gt; Are you using vtkImageViewer2 for viewing the images?<br>
&gt;&gt; &gt;&gt;<br>
&gt;&gt; &gt;&gt;<br>
&gt;&gt; &gt;&gt;<br>
&gt;&gt; &gt;&gt; On Tue, Oct 9, 2012 at 11:48 AM, abhishek &lt;[hidden email]&gt; wrote:<br>
&gt;&gt; &gt;&gt; &gt; Hello Jothy,<br>
&gt;&gt; &gt;&gt; &gt;<br>
&gt;&gt; &gt;&gt; &gt; Red color structure is at the correct location, which is what I wish<br>
&gt;&gt; &gt;&gt; &gt; to<br>
&gt;&gt; &gt;&gt; &gt; achieve. The structure generated by my code is displayed in blue<br>
&gt;&gt; &gt;&gt; &gt; color.<br>
&gt;&gt; &gt;&gt; &gt;<br>
&gt;&gt; &gt;&gt; &gt; Regards,<br>
&gt;&gt; &gt;&gt; &gt; Abhishek Gupta<br>
&gt;&gt; &gt;&gt; &gt;<br>
&gt;&gt; &gt;&gt; &gt; -----Original Message-----<br>
&gt;&gt; &gt;&gt; &gt; From: Jothybasu Selvaraj [mailto:[hidden email]]<br>
&gt;&gt;<br>
&gt;&gt; &gt;&gt; &gt; Sent: Tuesday, October 09, 2012 2:44 PM<br>
&gt;&gt; &gt;&gt; &gt; To: abhishek<br>
&gt;&gt; &gt;&gt; &gt; Subject: Re: [vtkusers] How to resample RT Dose Grid pixel data with<br>
&gt;&gt; &gt;&gt; &gt; respect<br>
&gt;&gt; &gt;&gt; &gt; to a CT image?<br>
&gt;&gt; &gt;&gt; &gt;<br>
&gt;&gt; &gt;&gt; &gt; As far as I understand, even if you don&#39;t resample your dose grid<br>
&gt;&gt; &gt;&gt; &gt; still<br>
&gt;&gt; &gt;&gt; &gt; it<br>
&gt;&gt; &gt;&gt; &gt; should be overlaid properly (unless both have different frame of<br>
&gt;&gt; &gt;&gt; &gt; reference).<br>
&gt;&gt; &gt;&gt; &gt;<br>
&gt;&gt; &gt;&gt; &gt; Could you send apicture of of you get?<br>
&gt;&gt; &gt;&gt; &gt;<br>
&gt;&gt; &gt;&gt; &gt; If required you could resample your dose grid using vtkImageResample<br>
&gt;&gt; &gt;&gt; &gt; and<br>
&gt;&gt; &gt;&gt; &gt; don&#39;t forget to update the image attributes using<br>
&gt;&gt; &gt;&gt; &gt; vtkImageChnageInformation!<br>
&gt;&gt; &gt;&gt; &gt;<br>
&gt;&gt; &gt;&gt; &gt; Jothy<br>
&gt;&gt; &gt;&gt; &gt;<br>
&gt;&gt; &gt;&gt; &gt;<br>
&gt;&gt; &gt;&gt; &gt;<br>
&gt;&gt; &gt;&gt; &gt; On Tue, Oct 9, 2012 at 7:30 AM, abhishek &lt;[hidden email]&gt; wrote:<br>
&gt;&gt;<br>
&gt;&gt; &gt;&gt; &gt;&gt; Dear Users,<br>
&gt;&gt; &gt;&gt; &gt;&gt;<br>
&gt;&gt; &gt;&gt; &gt;&gt; I want to draw ISODOSE contours on a CT Image. To generate ISODOSE<br>
&gt;&gt; &gt;&gt; &gt;&gt; contours, I am using vtkContourFilter class.<br>
&gt;&gt; &gt;&gt; &gt;&gt; I am using RT DOSE Grid&#39;s pixel data to create vtkImageData and<br>
&gt;&gt; &gt;&gt; &gt;&gt; giving<br>
&gt;&gt; &gt;&gt; &gt;&gt; the resulting vtkImage as input to vtkContourFilter.<br>
&gt;&gt; &gt;&gt; &gt;&gt;<br>
&gt;&gt; &gt;&gt; &gt;&gt; My problem is that, the RT DOSE Grid&#39;s and CT image&#39;s pixel spacing<br>
&gt;&gt; &gt;&gt; &gt;&gt; and image patient position(IPP) are different. This result&#39;s in<br>
&gt;&gt; &gt;&gt; &gt;&gt; generation of wrong contour points.<br>
&gt;&gt; &gt;&gt; &gt;&gt;<br>
&gt;&gt; &gt;&gt; &gt;&gt; For reference IPP and Pixel spacing for CT and RT DOSE grid are:<br>
&gt;&gt; &gt;&gt; &gt;&gt; CT:    [-329.6, -319, -241.3], [1.2461, 1.2461]<br>
&gt;&gt; &gt;&gt; &gt;&gt; Dose: [-185.1, -180, -546.3], [2.5, 2.5]<br>
&gt;&gt; &gt;&gt; &gt;&gt;<br>
&gt;&gt; &gt;&gt; &gt;&gt; I have two questions here:<br>
&gt;&gt; &gt;&gt; &gt;&gt; 1. I am certainly sure that I will have to some how resample dose&#39;s<br>
&gt;&gt; &gt;&gt; &gt;&gt; pixel data to map on to CT image. How can I do this?<br>
&gt;&gt; &gt;&gt; &gt;&gt;<br>
&gt;&gt; &gt;&gt; &gt;&gt; 2. Will vtkImageResample class be useful? If yes, then how can I use<br>
&gt;&gt; &gt;&gt; &gt;&gt; this class. If no, then what other options do I have?<br>
&gt;&gt; &gt;&gt; &gt;&gt;<br>
&gt;&gt; &gt;&gt; &gt;&gt; Regards<br>
&gt;&gt; &gt;&gt; &gt;&gt; Abhishek.<br>
&gt;&gt; &gt;&gt; &gt;&gt;<br>
&gt;&gt; &gt;&gt; &gt;&gt;<br>
&gt;&gt; &gt;&gt; &gt;&gt;<br>
&gt;&gt; &gt;&gt; &gt;&gt; --<br>
&gt;&gt; &gt;&gt; &gt;&gt; View this message in context:<br>
&gt;&gt; &gt;&gt; &gt;&gt;<br>
&gt;&gt; &gt;&gt; &gt;&gt; <a href="http://vtk.1045678.n5.nabble.com/How-to-resample-RT-Dose-Grid-pixel-da" target="_blank">http://vtk.1045678.n5.nabble.com/How-to-resample-RT-Dose-Grid-pixel-da</a><br>
&gt;&gt; &gt;&gt; &gt;&gt; ta-with-respect-to-a-CT-image-tp5716546.html<br>
&gt;&gt;<br>
&gt;&gt; &gt;&gt; &gt;&gt; Sent from the VTK - Users mailing list archive at Nabble.com.<br>
&gt;&gt; &gt;&gt; &gt;&gt; _______________________________________________<br>
&gt;&gt; &gt;&gt; &gt;&gt; Powered by <a href="http://www.kitware.com" target="_blank">www.kitware.com</a><br>
&gt;&gt; &gt;&gt; &gt;&gt;<br>
&gt;&gt; &gt;&gt; &gt;&gt; Visit other Kitware open-source projects at<br>
&gt;&gt; &gt;&gt; &gt;&gt; <a href="http://www.kitware.com/opensource/opensource.html" target="_blank">http://www.kitware.com/opensource/opensource.html</a><br>
&gt;&gt; &gt;&gt; &gt;&gt;<br>
&gt;&gt; &gt;&gt; &gt;&gt; Please keep messages on-topic and check the VTK FAQ at:<br>
&gt;&gt; &gt;&gt; &gt;&gt; <a href="http://www.vtk.org/Wiki/VTK_FAQ" target="_blank">http://www.vtk.org/Wiki/VTK_FAQ</a><br>
&gt;&gt; &gt;&gt; &gt;&gt;<br>
&gt;&gt; &gt;&gt; &gt;&gt; Follow this link to subscribe/unsubscribe:<br>
&gt;&gt; &gt;&gt; &gt;&gt; <a href="http://www.vtk.org/mailman/listinfo/vtkusers" target="_blank">http://www.vtk.org/mailman/listinfo/vtkusers</a><br>
&gt;&gt; &gt;&gt; &gt;<br>
&gt;&gt; &gt;&gt; &gt;<br>
&gt;&gt; &gt;&gt; &gt;<br>
&gt;&gt; &gt;&gt; &gt; --<br>
&gt;&gt; &gt;&gt; &gt; Jothybasu Selvaraj<br>
&gt;&gt; &gt;&gt; &gt; PhD Student<br>
&gt;&gt; &gt;&gt; &gt; University of Liverpool<br>
&gt;&gt; &gt;&gt; &gt; UK<br>
&gt;&gt; &gt;&gt;<br>
&gt;&gt; &gt;&gt;<br>
&gt;&gt; &gt;&gt;<br>
&gt;&gt; &gt;&gt; --<br>
&gt;&gt; &gt;&gt; Jothybasu Selvaraj<br>
&gt;&gt; &gt;&gt; PhD Student<br>
&gt;&gt; &gt;&gt; University of Liverpool<br>
&gt;&gt; &gt;&gt; UK<br>
&gt;&gt; &gt;<br>
&gt;&gt; &gt;<br>
&gt;&gt;<br>
&gt;&gt;<br>
&gt;&gt; --<br>
&gt;&gt; Jothybasu Selvaraj<br>
&gt;&gt; PhD Student<br>
&gt;&gt; University of Liverpool<br>
&gt;&gt; UK<br>
&gt;&gt; _______________________________________________<br>
&gt;&gt; Powered by <a href="http://www.kitware.com" target="_blank">www.kitware.com</a><br>
&gt;&gt;<br>
&gt;&gt; Visit other Kitware open-source projects at<br>
&gt;&gt; <a href="http://www.kitware.com/opensource/opensource.html" target="_blank">http://www.kitware.com/opensource/opensource.html</a><br>
&gt;&gt;<br>
&gt;&gt; Please keep messages on-topic and check the VTK FAQ at:<br>
&gt;&gt; <a href="http://www.vtk.org/Wiki/VTK_FAQ" target="_blank">http://www.vtk.org/Wiki/VTK_FAQ</a><br>
&gt;&gt;<br>
&gt;&gt; Follow this link to subscribe/unsubscribe:<br>
&gt;&gt; <a href="http://www.vtk.org/mailman/listinfo/vtkusers" target="_blank">http://www.vtk.org/mailman/listinfo/vtkusers</a><br>
&gt;&gt;<br>
&gt;&gt;<br>
&gt;&gt; ________________________________<br>
&gt;&gt; If you reply to this email, your message will be added to the discussion<br>
&gt;&gt; below:<br>
&gt;&gt;<br>
&gt;&gt; <a href="http://vtk.1045678.n5.nabble.com/How-to-resample-RT-Dose-Grid-pixel-data-with-respect-to-a-CT-image-tp5716546p5716551.html" target="_blank">http://vtk.1045678.n5.nabble.com/How-to-resample-RT-Dose-Grid-pixel-data-with-respect-to-a-CT-image-tp5716546p5716551.html</a><br>

&gt;&gt; To unsubscribe from How to resample RT Dose Grid pixel data with respect<br>
&gt;&gt; to a CT image?, click here.<br>
&gt;&gt; NAML<br>
&gt;<br>
&gt;<br>
&gt;<br>
</div></div>&gt; ________________________________<br>
&gt; View this message in context: Re: How to resample RT Dose Grid pixel data<br>
<div class="im HOEnZb">&gt; with respect to a CT image?<br>
&gt;<br>
</div><div class="HOEnZb"><div class="h5">&gt; Sent from the VTK - Users mailing list archive at Nabble.com.<br>
&gt;<br>
&gt; _______________________________________________<br>
&gt; Powered by <a href="http://www.kitware.com" target="_blank">www.kitware.com</a><br>
&gt;<br>
&gt; Visit other Kitware open-source projects at<br>
&gt; <a href="http://www.kitware.com/opensource/opensource.html" target="_blank">http://www.kitware.com/opensource/opensource.html</a><br>
&gt;<br>
&gt; Please keep messages on-topic and check the VTK FAQ at:<br>
&gt; <a href="http://www.vtk.org/Wiki/VTK_FAQ" target="_blank">http://www.vtk.org/Wiki/VTK_FAQ</a><br>
&gt;<br>
&gt; Follow this link to subscribe/unsubscribe:<br>
&gt; <a href="http://www.vtk.org/mailman/listinfo/vtkusers" target="_blank">http://www.vtk.org/mailman/listinfo/vtkusers</a><br>
&gt;<br>
<br>
<br>
<br>
--<br>
Jothybasu Selvaraj<br>
PhD Student<br>
University of Liverpool<br>
UK<br>
</div></div></blockquote></div><br></div></div>