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