MCPcopy Create free account
hub / github.com/MITK/MITK / Update

Method Update

Plugins/org.mitk.gui.qt.pixelvalue/src/internal/QmitkPixelValueView.cpp:107–221  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

105}
106
107void QmitkPixelValueView::Update()
108{
109 const auto position = m_SliceNavigationListener.GetCurrentSelectedPosition();
110 const auto timePoint = m_SliceNavigationListener.GetCurrentSelectedTimePoint();
111
112 auto isImage = mitk::TNodePredicateDataType<mitk::Image>::New();
113 auto isSegmentation = mitk::NodePredicateDataType::New("MultiLabelSegmentation");
114
115 auto predicate = mitk::NodePredicateAnd::New();
116 predicate->AddPredicate(mitk::NodePredicateNot::New(isSegmentation));
117 predicate->AddPredicate(isImage);
118
119 auto nodes = GetDataStorage()->GetSubset(predicate);
120
121 if (nodes.IsNull())
122 {
123 this->Clear();
124 return;
125 }
126
127 mitk::Image::Pointer image;
128 mitk::DataNode::Pointer topParentNode;
129
130 int component = 0;
131
132 auto node = mitk::FindTopmostVisibleNode(nodes, position, timePoint, nullptr);
133
134 if (node.IsNull())
135 {
136 this->Clear();
137 return;
138 }
139
140 bool isBinary = false;
141 node->GetBoolProperty("binary", isBinary);
142
143 if (isBinary)
144 {
145 auto parentNodes = GetDataStorage()->GetSources(node, nullptr, true);
146
147 if (!parentNodes->empty())
148 topParentNode = FindTopmostVisibleNode(nodes, position, timePoint, nullptr);
149
150 if (topParentNode.IsNotNull())
151 {
152 image = dynamic_cast<mitk::Image*>(topParentNode->GetData());
153 topParentNode->GetIntProperty("Image.Displayed Component", component);
154 }
155 else
156 {
157 image = dynamic_cast<mitk::Image*>(node->GetData());
158 node->GetIntProperty("Image.Displayed Component", component);
159 }
160 }
161 else
162 {
163 image = dynamic_cast<mitk::Image*>(node->GetData());
164 node->GetIntProperty("Image.Displayed Component", component);

Callers 8

CreateQtPartControlMethod · 0.95
NodeChangedMethod · 0.95
OnAddNewPropertyMethod · 0.45
StartButtonClickedMethod · 0.45

Calls 15

ClearMethod · 0.95
UpdateCoordsMethod · 0.95
GetSubsetMethod · 0.80
GetSourcesMethod · 0.80
IsNotNullMethod · 0.80
GetGeometryMethod · 0.80
GetChannelDescriptorMethod · 0.80
NewFunction · 0.50
GetDataStorageFunction · 0.50

Tested by

no test coverage detected