Hello Dimitris,

(1)    I think a segmentation does not need to be a child of another node. For 
example, in the Segmentation Views you have the option to select different 
image/segmentation pairs as long as their geometries match or the segmentation 
lies within the image and has matching voxel coordinates/sizes. If you want to 
guarantee to have a visible segmentation on top of different images you have to 
drag and drop the segmentation at the top of the Data Manager. If you want to 
do this in code, you can add/set the fixedLayer bool property to the 
segmentation node and set the layer property of the segmentation node to a high 
value.

(2)    There are opacity-related fixes In the current “releases/2018.04” branch 
(not available on GitHub, clone from 
https://phabricator.mitk.org/source/mitk.git instead), which may already help 
you out.

Regards,
Stefan

From: Dimitris Bounias [mailto:bounias.dimit...@gmail.com]
Sent: Saturday, March 9, 2019 6:57 PM
To: mitk-users@lists.sourceforge.net
Subject: [mitk-users] LabelSetImage, Segmentation and opacity

Hello,

We are a little bit new to MITK and we are trying to use it as a library, 
rather than as a framework. We just use it for image viewing and also use the 
(multilabel) segmentation tool.

We have managed to get it to basically work, but we have some questions about 
the segmentation tool if anybody can please help :) Here is some code (with 
try/catchs etc removed) that shows how we set up the segmentation's 
labelsetimage:

mitk::LabelSetImage::Pointer workingImage = mitk::LabelSetImage::New();
workingImage->Initialize(referenceImage);

mitk::DataNode::Pointer workingNode = mitk::DataNode::New();
workingNode->SetData(workingImage);
workingNode->SetName(segName.toStdString());

m_DataStorage->Add(workingNode, referenceNode);

toolManager->SetWorkingData(workingNode);
toolManager->SetReferenceData(referenceNode);

1. Does the segmentation actually have to be a "child" of one particular node 
(referenceNode)? Can't it be alone by itself? Because we want the same 
segmentation to show up on all co-registered images and the image that we use 
as reference might be unloaded at some point, but we want the segmentation to 
remain. We can add a blank image that never gets unloaded and hook the 
segmentation to that, but we are hoping there is a better way.

2. How do we change the opacity of the segmentation? Because the way we use for 
the images ( node->SetProperty("opacity", mitk::FloatProperty::New(VALUE)); ) 
doesn't work.

Thank you very much, looking forward to your responses. Also, if you are a 
developer of MITK I want to say congratulations on your very nice project,
Dimitris
_______________________________________________
mitk-users mailing list
mitk-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/mitk-users

Reply via email to