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

Method InitWidget

Modules/QtWidgetsExt/src/QmitkSliceWidget.cpp:126–177  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

124}
125
126void QmitkSliceWidget::InitWidget(mitk::AnatomicalPlane view)
127{
128 m_View = view;
129
130 mitk::SliceNavigationController *controller = m_RenderWindow->GetSliceNavigationController();
131
132 if (view == mitk::AnatomicalPlane::Axial)
133 {
134 controller->SetViewDirection(mitk::AnatomicalPlane::Axial);
135 }
136 else if (view == mitk::AnatomicalPlane::Coronal)
137 {
138 controller->SetViewDirection(mitk::AnatomicalPlane::Coronal);
139 }
140 // init sagittal view for all other cases ('original' is covered here as well)
141 else
142 {
143 controller->SetViewDirection(mitk::AnatomicalPlane::Sagittal);
144 }
145
146 if (m_SlicedGeometry.IsNull())
147 {
148 return;
149 }
150
151 mitk::BaseGeometry::Pointer geometry = static_cast<mitk::BaseGeometry *>(m_SlicedGeometry->Clone().GetPointer());
152
153 const mitk::BoundingBox::Pointer boundingbox = m_DataStorage->ComputeVisibleBoundingBox(GetRenderer(), nullptr);
154
155 if (boundingbox->GetPoints()->Size() > 0)
156 {
157 // let's see if we have data with a limited live-span ...
158 mitk::TimeBounds timebounds = m_DataStorage->ComputeTimeBounds(GetRenderer(), nullptr);
159
160 mitk::ProportionalTimeGeometry::Pointer timeGeometry = mitk::ProportionalTimeGeometry::New();
161 timeGeometry->Initialize(geometry, 1);
162
163 {
164 timeGeometry->SetFirstTimePoint(timebounds[0]);
165 timeGeometry->SetStepDuration(1.0);
166 }
167
168 if (timeGeometry->GetBoundingBoxInWorld()->GetDiagonalLength2() >= mitk::eps)
169 {
170 controller->SetInputWorldTimeGeometry(timeGeometry);
171 controller->Update();
172 }
173 }
174
175 GetRenderer()->GetCameraController()->Fit();
176 mitk::RenderingManager::GetInstance()->RequestUpdate(GetRenderer()->GetRenderWindow());
177}
178
179void QmitkSliceWidget::UpdateGL()
180{

Callers 1

SetDataMethod · 0.95

Calls 15

GetRendererFunction · 0.85
SetViewDirectionMethod · 0.80
GetPointerMethod · 0.80
ComputeTimeBoundsMethod · 0.80
GetDiagonalLength2Method · 0.80
NewFunction · 0.50
IsNullMethod · 0.45
CloneMethod · 0.45
SizeMethod · 0.45
InitializeMethod · 0.45

Tested by

no test coverage detected