Hi,

I noticed that the lookup table is applied, if at least one value in the 
itkImage is set to 254 and 255 before the seeds image is initialized. I 
tried to initialize it with zeros only.

Furthermore, I have to set the table range of the vtkLookupTable between 
[0, 256] and not [0, 255] as expected. Otherwise, 254 and 255 are 
coloured the same (green, defined for 255).

Do you have any idea for this behaviour? Why is the lookup table 
ignored, if the seeds image is initialized with zeros?

Thanks in advance,
Kerstin

On 03/31/2014 10:08 AM, Kerstin Hammernik wrote:
> 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::LOOKUPTABLE_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

Reply via email to