Thanks very much for the hint from Dr. Wegner, and the mitkSeedsInteractor
is indeed what I need.
Now I have a new problem. I am trying to set up a lookuptable for the seed
image so that it can be better visualized.
But somehow my lookuptable SetProperty command has no effect at all, and the
value is always "n/a" as shown in the "Properties" window.
My code is as follows:
m_SeedImageNode = mitk::DataTreeNode::New();
m_SeedImageNode->GetPropertyList()->SetProperty("name",
mitk::StringProperty::New("Seed Image"));
m_SeedImageNode->SetData( m_SeedImage );
m_SeedImageNode->SetProperty("layer", mitk::IntProperty::New(1));
m_SeedImageNode->SetProperty("opacity", mitk::FloatProperty::New(0.5));
mitk::LabeledImageLookupTable::Pointer lut =
mitk::LabeledImageLookupTable::New();
for ( unsigned char i = 0; i < 253; i++ )
{
lut->SetColorForLabel( i, 0.0, 0.0, 0.0, 0.0 );
}
lut->SetColorForLabel(254, 0.0, 1.0, 0.0, 1.0 );
lut->SetColorForLabel(255, 0.7, 0.7, 1.0, 1.0 );
mitk::LookupTableProperty::Pointer lutProp =
mitk::LookupTableProperty::New( lut.GetPointer() );
m_SeedImageNode->SetProperty ( "LookupTable", lutProp );
Could someone pls tell me what's wrong with above code?
Or is there a requirement that the "m_SeedImage" must be of unsigned char
type for the lookuptable to work?
Thanks in advance!
Sincerely,
Xiao
On Sun, Aug 24, 2008 at 9:52 AM, Wegner Ingmar
<[EMAIL PROTECTED]>wrote:
> Hi Xiao,
> please see the mitkSeedsInteractor which does exactly what you are looking
> for.
> http://www.mitk.org/documentation/doxygen/classmitk_1_1SeedsInteractor.html
>
> We are sorry for the inclomplete documentation on the interactors as well
> as other classes but we are working on it.
>
> Please see mitkStatemachine.xml and look for seedsinteraction for the
> necessary events (I'm currently not at work and can't connect). I remember
> something like Strg+Left Mousebutton for the foreground brush and Strg +
> right Mousebutton for the background brush. Note, that the interactor works
> on an image.
>
> Best Regards,
> Ingmar
>
> ________________________________
>
> Von: [EMAIL PROTECTED] im Auftrag von Xiao Han
> Gesendet: Fr 08/22/08 23:40
> An: [email protected]
> Betreff: [mitk-users] Help with ContourInteractor or sth alike
>
>
> Dear MITK Developers,
>
> I would like to create a graph-cut based interactive segmentation using
> MITK.
> Currently, I can use the PointSetInteractor to add foreground and
> background seeds.
> But adding the seeds through mouse-clicking is quite slow.
> Thus, I would like to be able to add seeds through something like
> paint-brushes.
>
> Unfortunately, there doesn't seem to exist a "ContourSetInteractor" or sth
> similar in MITK right now that allows me to
> do paint-brushes or mouse-strokes. I tried to start with the
> "ContourInteractor" but the program always crashes
> (for example, I replaced the PointSetInteractor in the QMITKRegionGrowing
> with ContourInteractor, and the program first complains that the
> StateMachine for ContourInteractor is not initialized, and then it crashes
> whenever I shift-click the mouse).
>
> I would appreciate it very much if someone can offer me some suggestions
> about how to design such a "paint-brush" interactor.
> Or is there any code in MITK I should look as examples?
>
> Thanks very much!
>
> Xiao
>
>
>
>
-------------------------------------------------------------------------
This SF.Net email is sponsored by the Moblin Your Move Developer's challenge
Build the coolest Linux based applications with Moblin SDK & win great prizes
Grand prize is a trip for two to an Open Source event anywhere in the world
http://moblin-contest.org/redirect.php?banner_id=100&url=/
_______________________________________________
mitk-users mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/mitk-users