Hi Kerstin, I am not sure what the seeds image does, because I never worked with it. Your code regarding the lookup table property looks fine to me. I can't see any obvious mistake. Could you check if the lookup table works on a regular mitkImage? You can also compare your code to the code used in a rendering test: http://mitk.org/git/?p=MITK.git;a=blob;f=Core/Code/Testing/mitkImageVtkMapper2DLookupTableTest.cpp;h=3bce38e660a5c391c055f0940e08b1d732f87b34;hb=HEAD
Regards, Thomas >>-----Original Message----- >>From: Kerstin Hammernik [mailto:[email protected]] >>Sent: Montag, 31. März 2014 10:08 >>To: MITK >>Subject: [mitk-users] Apply Lookuptable to Seeds Image >> >>Hi, >> >>I use the mitk::SeedsInteractor which needs a seeds image to draw brush >>strokes. The seeds image is initialized by an itk volume (uchar). To >>distinguish >>between foreground (255) and background (254) seeds, I try to apply a >>lookup table: >> >> mitk::SeedsImage::Pointer seedsImage = mitk::SeedsImage::New(); >> seedsImage->InitializeByItk(itkImage.GetPointer()); >> seedsImage->SetVolume(itkImage->GetBufferPointer()); >> seedsImage->Update(); >> >> mitk::DataNode::Pointer interactionNode = mitk::DataNode::New(); >> interactionNode->SetData(seedsImage); >> m_DataStorage->Add(interactionNode); >> >> vtkSmartPointer<vtkLookupTable> vtkLut = >>vtkSmartPointer<vtkLookupTable>::New(); >> vtkLut->SetNumberOfTableValues(256); >> for(int i=0; i<=253; i++) >> vtkLut->SetTableValue(i, 0.0, 0.0, 0.0, 0.0); >> vtkLut->SetTableValue(254, 0.0, 0.0, 1.0, 0.6); >> vtkLut->SetTableValue(255, 0.0, 1.0, 0.0, 0.6); >> vtkLut->Build(); >> >> mitk::LookupTable::Pointer mitkLookupTable = mitk::LookupTable::New(); >> mitkLookupTable->SetVtkLookupTable(vtkLut); >> interactionNode->SetProperty("LookupTable", >>mitk::LookupTableProperty::New( mitkLookupTable )); >> interactionNode->SetProperty("Image Rendering.Mode", >>mitk::RenderingModeProperty::New(mitk::RenderingModeProperty::LOOK >>UPTABLE_COLOR)); >> >>mitk::GlobalInteraction::GetInstance()- >>>AddInteractor(mitk::SeedsInteractor::New("seedsinteractor", >>interactionNode)); >> >> >>However, foreground and background seeds are shown in red, i.e. the >>applied properties do not have any effect. I have already tried to set >>more properties for the vtkLut such as SetNumberOfColors(...) or >>SetTableRange(...), but it doesn't change anything. >> >>Do I miss something here? >> >>Thanks, >>Kerstin >> >>------------------------------------------------------------------------------ >>_______________________________________________ >>mitk-users mailing list >>[email protected] >>https://lists.sourceforge.net/lists/listinfo/mitk-users ------------------------------------------------------------------------------ _______________________________________________ mitk-users mailing list [email protected] https://lists.sourceforge.net/lists/listinfo/mitk-users
