Hi Miranda, the look-up table is a color table in which every color receives an scalar. Then, for exemple, if two vertices on your mesh should receive the same color, they are assigned with the same scalar, and the same color will be mapped to both.
If you have different polydatas, you can create a look-up table for each one of them, and they will have their own set of colors. Best regards, Thiago -- Thiago R. dos Santos, MSc.CompSc. Div. Medical & Biological Informatics (E130) http://www.dkfz.de German Cancer Research Center (DKFZ) Tel: (+49) 6221 42 3551 Im Neuenheimer Feld 280 Fax: (+49) 6221 42 2345 69120 Heidelberg - Germany eMail: [email protected] On Tue, 2012-04-03 at 09:43 +0200, Alfred Franz wrote: > > > -------- Original-Nachricht -------- > Betreff: > RE: [mitk-users] Changing color of > individual vtkpolydata in a > mitk::surface > Datum: > Mon, 26 Mar 2012 19:39:58 +0200 > Von: > Miranda Jacob > <[email protected]> > An: > Franz, Alfred > <[email protected]> > CC: > [email protected] > <[email protected]> > > > Hello, > > > > Thank you for the reply. Will a lookup table allow me to color each > individual polydata a different color?? So I set the lookup table for > each polydata?? Also I am not familiar with the scalars part of vtk. > The first thing the example says to do is set the scalars but I’m not > sure where they got the scalar from?? > > Here is what the example said > > > > In order to visualize scalars on a PolyData you need to: > > > > * Pass these scalar to the PolyData: > > polydata->GetPointData()->SetScalars(scalars); > > > > * Create a lookup table (vtkLookupTable) that maps each scalar to a > > particular color. > > > > * Create a mitk::LookupTable that wraps the vtkLookupTable. > > > > * In the DataNode that represents the surface, you must set the > > LookupTable property: > > node->SetProperty("LookupTable", mitkLookupTable); > > > > * Also in the node you must set the maximum and minimum of the scalars > > range: > > node->SetFloatProperty("ScalarsRangeMinimum", minimum); > > node->SetFloatProperty("ScalarsRangeMaximum", maximum); > > > > Now your scalar should be shown above the surface, with the respective > > color assigned by the lookup table. > > > > The code we use does not use scalars so I’m not sure how to > incorporate this into my code. > > > > > > > > From: Alfred Franz [mailto:[email protected]] > Sent: Monday, March 26, 2012 1:51 AM > To: Miranda Jacob > Cc: [email protected] > Subject: Re: [mitk-users] Changing color of individual vtkpolydata in > a mitk::surface > > > > > Hello Miranda, > > there have been a few more or less similar questions on the mailing > list before. Perhaps this answer might help you: > > http://sourceforge.net/mailarchive/forum.php?thread_name=1330946969.14497.11.camel%40mbi073.dkfz-heidelberg.de&forum_name=mitk-users > > Greets, > > Alfred > > Am 15.03.2012 22:57, schrieb Miranda Jacob: > > 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 > > > > ------------------------------------------------------------------------------ Better than sec? Nothing is better than sec when it comes to monitoring Big Data applications. Try Boundary one-second resolution app monitoring today. Free. http://p.sf.net/sfu/Boundary-dev2dev _______________________________________________ mitk-users mailing list [email protected] https://lists.sourceforge.net/lists/listinfo/mitk-users
