Hi all,

I want to use the LabeledImageLookupTable class to show a labeled  
image in different colors, but I am not able to transform it into a  
LookupTableProperty.

The problem is that LookupTableProperty needs a LookupTable as  
initialization. I have tried to dynamic_cast my labeledImageLUT to  
LookupTable like that:

// set colors for the segments
   mitk::LabeledImageLookupTable* lut = mitk::LabeledImageLookupTable::New();
   std::cout << "LUT created" << std::endl;
   lut->SetColorForLabel(1, 1.0, 0.0, 0.0, 1.0 );
   lut->SetColorForLabel(2, 0.0, 1.0, 0.0, 1.0 );
   lut->SetColorForLabel(3, 0.0, 0.0, 1.0, 1.0 );
   lut->SetColorForLabel(4, 0.7, 0.7, 1.0, 1.0 );
   std::cout << "Colors set" << std::endl;
   for (int i=5;i<256;i++)
     {
        lut->SetColorForLabel(i, 1.0, 0.5, 0.5, 1.0);
        std::cout << i << std::endl;
        }
   std::cout << "Creating LUTProperty" << std::endl;

   mitk::LookupTableProperty* lutProp =  
mitk::LookupTableProperty::New(dynamic_cast<mitk::LookupTable*>(lut));

   newNode->SetProperty ( "LookupTable", lutProp );

But I get an runtime exception at the line:

lut->SetColorForLabel(1, 1.0, 0.0, 0.0, 1.0 );

I guess it has to do with the fact that "lut" is not created as  
"Pointer" but with "*".

Could somebody please suggest how I can use the  
LabeledImageLookupTable correctly?
Thanks for your help in advance.
Best regards,
Xabier

-- 
Xabier Artaechevarria
Cancer Imaging Laboratory
Centre for Applied Medical Research
www.cima.es






----------------------------------------------------------------
Este mensaje ha sido enviado desde https://webmail.unav.es


-------------------------------------------------------------------------
Check out the new SourceForge.net Marketplace.
It's the best place to buy or sell services for
just about anything Open Source.
http://sourceforge.net/services/buy/index.php
_______________________________________________
mitk-users mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/mitk-users

Reply via email to