[vtkusers] How to resample RT Dose Grid pixel data with respect to a CT image?

Abhishek Gupta abhishek at meddiff.com
Tue Oct 9 07:24:07 EDT 2012


I am reading RT DOSE using python's dicom library. Creating a vtkDataArray
out of it and the resulting vtkImageData as well.

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?


On Tue, Oct 9, 2012 at 4:44 PM, Jothybasu Selvaraj <jothybasu at gmail.com>wrote:

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


More information about the vtkusers mailing list