[vtkusers] Dose mapping on a CT image

Jothybasu Selvaraj jothybasu at gmail.com
Thu Oct 11 05:42:23 EDT 2012


Have a look at this

http://www.vtk.org/Wiki/VTK/Examples/Cxx/VisualizationAlgorithms/FilledContours

I don't know anything about c#. But the concepts are same in vtk,
irrespective of the language you use.


On Thu, Oct 11, 2012 at 10:36 AM, Abhishek Gupta <abhishek at meddiff.com>wrote:

> But Jothy, I use C# .Net panels for all painting related stuff. Hence, I
> require to get points in an order using which i can generate a path to plot.
>
> Is there a way, I can do this?
>
> On Thu, Oct 11, 2012 at 3:01 PM, Jothybasu Selvaraj <jothybasu at gmail.com>wrote:
>
>> If you just want to draw a line from the output of vtkContourFilter, you
>> simply set the output of contourFilter to vtkPolyDataMapper.
>>
>>
>> On Wed, Oct 10, 2012 at 5:24 PM, Abhishek Gupta <abhishek at meddiff.com>wrote:
>>
>>> Hello Jothy,
>>>
>>> I am using following code to generate contours:
>>>
>>> ---------------------------------------------------------------------------------
>>>        //Set vktImage.
>>> vtkImageData* _vtkImage = vtkImageData::New();
>>>  _vtkImage->SetDimensions(dfData->cols,dfData->rows,1);
>>> double spacing[3] = { 2.5,2.5,1.0 }; // TODO: fix me
>>>  _vtkImage->SetSpacing(spacing);
>>> _vtkImage->GetPointData()->SetScalars(scalars);
>>>  /*double bounds[6];
>>> _vtkImage->GetBounds(bounds);*/
>>> _vtkImage->Update();
>>>  _vtkImage->Print(cerr);
>>>
>>> // Generate contours.
>>> vtkContourFilter* contour=vtkContourFilter::New();
>>>  contour->SetInput(_vtkImage);
>>> contour->GenerateValues(1,level,level);
>>>  contour->Update();
>>> contour->Print(cerr);
>>> contour->GetOutput()->GetPoints()->Print(cerr);
>>>  int numOfPoints=contour->GetOutput()->GetPoints()->GetNumberOfPoints();
>>> if(numOfPoints>0)
>>>  {
>>>  for(int i=0;i<numOfPoints;i++)
>>>  {
>>> dosePlotPoint p;//=new dosePlotPoint();
>>> p.x=contour->GetOutput()->GetPoints()->GetPoint(i)[0];
>>>  p.y=contour->GetOutput()->GetPoints()->GetPoint(i)[1];
>>> outPoints.push_back(p);
>>>  }
>>> }
>>>
>>> --------------------------------------------------------------------------------------------------
>>> I wish to obtain contour points in a manner that I can draw a path
>>> through those points.
>>>
>>> Regards,
>>> Abhishek Gupta.
>>>
>>> On Wed, Oct 10, 2012 at 7:29 PM, Jothybasu Selvaraj <jothybasu at gmail.com
>>> > wrote:
>>>
>>>> I don't know how you are obtaining the points form vtkContourFilter.
>>>> What exactly do you want to do?
>>>>
>>>> I think; vtkCOntourFilter can generate multiple contour lines depending
>>>> on the GenerateValues() parameters.
>>>>
>>>> On Wed, Oct 10, 2012 at 2:52 PM, abhishek <abhishek at meddiff.com> wrote:
>>>>
>>>>> Dear Jothy,
>>>>>
>>>>> I applied your suggestions in my code and spacing problem seems to be
>>>>> addressed. Now I have plotted a path over the points generated by contour
>>>>> filter. Please see the attached image.
>>>>>
>>>>> I saw the output of vtkContourFilter and it is returning points for
>>>>> vtkLines. How can I get only outline points?
>>>>>
>>>>> Regards,
>>>>> Abhishek.
>>>>>
>>>>> *Untitled.png* (79K) Download Attachment<http://vtk.1045678.n5.nabble.com/attachment/5716583/0/Untitled.png>
>>>>>
>>>>> ------------------------------
>>>>> View this message in context: Dose mapping on a CT image<http://vtk.1045678.n5.nabble.com/Dose-mapping-on-a-CT-image-tp5716583.html>
>>>>> Sent from the VTK - Users mailing list archive<http://vtk.1045678.n5.nabble.com/VTK-Users-f1224199.html>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
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://www.vtk.org/pipermail/vtkusers/attachments/20121011/fbe1bf5e/attachment.htm>


More information about the vtkusers mailing list