Hello,
I am currently using MITK and it is working well. We currently allow the
user to create individual ROI's which are vtkpolydata but to display them in
our MITK project we append all of them together and then add them to a
single mitk::Surface. I want to be able to change the individual color of
each ROI. In order to do this I was hoping to be able to change the color
of each vtkpolydata before it is appended to the rest of the polydata's. Is
this possible? Do you know of any way to change the color of the individual
vtkpolydata's?
Here is the code that appends all of them together into a single
mitk::Surface.
int numberOfROIs = surface->GetSizeOfPolyDataSeries();
if ( numberOfROIs > 1 )
{
// append all the polydata info from 1,2,3,...n all to the 0'th index
vtkSmartPointer<vtkAppendPolyData> appendFilter =
vtkSmartPointer<vtkAppendPolyData>::New();
for(int nROIcnt=1;nROIcnt<numberOfROIs;++nROIcnt)
{
vtkPolyData* pindex = surface->GetVtkPolyData(nROIcnt);
if(pindex)
{
// Here is where I want to change the color for each polydata
pindex->SetColorForPolyData();//this would be the function to do what I want
appendFilter->AddInputConnection(pindex->GetProducerPort());
}
}
appendFilter->Update();
vtkSmartPointer<vtkCleanPolyData> cleanFilter =
vtkSmartPointer<vtkCleanPolyData>::New();
cleanFilter->SetInputConnection(appendFilter->GetOutputPort());
cleanFilter->Update();
surface->SetVtkPolyData(cleanFilter->GetOutput(),0);
surface->SetRequestedRegionToLargestPossibleRegion();
}
Thank you,
Miranda Jacobson
------------------------------------------------------------------------------
This SF email is sponsosred by:
Try Windows Azure free for 90 days Click Here
http://p.sf.net/sfu/sfd2d-msazure
_______________________________________________
mitk-users mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/mitk-users