Hi Kerstin,

a lookup table for an image containing only zero values does not make sense to 
me as there are no values to map. 

Regards,
Thomas

>>-----Original Message-----
>>From: Kerstin Hammernik [mailto:[email protected]]
>>Sent: Mittwoch, 23. April 2014 17:01
>>To: Kilgus, Thomas; MITK
>>Subject: Re: [mitk-users] Apply Lookuptable to Seeds Image
>>
>>Hi Thomas,
>>
>>if I use a MITK image initialized with zeros, the applied lookup table does 
>>not
>>work either. If the initial MITK image contains other values such as
>>foreground and background seeds, the applied lookup table works fine.
>>
>>Regards,
>>Kerstin
>>
>>On 04/03/2014 03:50 PM, Kilgus, Thomas wrote:
>>> 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/mitkImageVt
>>>
>>kMapper2DLookupTableTest.cpp;h=3bce38e660a5c391c055f0940e08b1d732f
>>87b3
>>> 4;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


------------------------------------------------------------------------------
Start Your Social Network Today - Download eXo Platform
Build your Enterprise Intranet with eXo Platform Software
Java Based Open Source Intranet - Social, Extensible, Cloud Ready
Get Started Now And Turn Your Intranet Into A Collaboration Platform
http://p.sf.net/sfu/ExoPlatform
_______________________________________________
mitk-users mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/mitk-users

Reply via email to