Mercurial > hg > orthanc-stone
comparison Applications/Samples/SingleFrameApplication.h @ 101:af312ce4fe59 wasm
support of 3D swapping of the normal
author | Sebastien Jodogne <s.jodogne@gmail.com> |
---|---|
date | Wed, 31 May 2017 10:35:20 +0200 |
parents | 166a555becbf |
children | fcec0ab44054 |
comparison
equal
deleted
inserted
replaced
100:166a555becbf | 101:af312ce4fe59 |
---|---|
150 #if 1 | 150 #if 1 |
151 widget_->SetSlice(source_->GetSlice(slice_).GetGeometry()); | 151 widget_->SetSlice(source_->GetSlice(slice_).GetGeometry()); |
152 #else | 152 #else |
153 // TEST for scene extents - Rotate the axes | 153 // TEST for scene extents - Rotate the axes |
154 double a = 15.0 / 180.0 * M_PI; | 154 double a = 15.0 / 180.0 * M_PI; |
155 | 155 |
156 #if 1 | |
156 Vector x; GeometryToolbox::AssignVector(x, cos(a), sin(a), 0); | 157 Vector x; GeometryToolbox::AssignVector(x, cos(a), sin(a), 0); |
157 Vector y; GeometryToolbox::AssignVector(y, -sin(a), cos(a), 0); | 158 Vector y; GeometryToolbox::AssignVector(y, -sin(a), cos(a), 0); |
159 #else | |
160 // Flip the normal | |
161 Vector x; GeometryToolbox::AssignVector(x, cos(a), sin(a), 0); | |
162 Vector y; GeometryToolbox::AssignVector(y, sin(a), -cos(a), 0); | |
163 #endif | |
164 | |
158 SliceGeometry s(source_->GetSlice(slice_).GetGeometry().GetOrigin(), x, y); | 165 SliceGeometry s(source_->GetSlice(slice_).GetGeometry().GetOrigin(), x, y); |
166 GeometryToolbox::Print(s.GetAxisX()); | |
167 GeometryToolbox::Print(s.GetAxisY()); | |
168 GeometryToolbox::Print(s.GetNormal()); | |
159 widget_->SetSlice(s); | 169 widget_->SetSlice(s); |
160 #endif | 170 #endif |
161 } | 171 } |
162 } | 172 } |
163 | 173 |
239 std::string instance = parameters["instance"].as<std::string>(); | 249 std::string instance = parameters["instance"].as<std::string>(); |
240 int frame = parameters["frame"].as<unsigned int>(); | 250 int frame = parameters["frame"].as<unsigned int>(); |
241 | 251 |
242 std::auto_ptr<LayerWidget> widget(new LayerWidget); | 252 std::auto_ptr<LayerWidget> widget(new LayerWidget); |
243 | 253 |
244 #if 1 | 254 #if 0 |
245 std::auto_ptr<OrthancFrameLayerSource> layer | 255 std::auto_ptr<OrthancFrameLayerSource> layer |
246 (new OrthancFrameLayerSource(context.GetWebService())); | 256 (new OrthancFrameLayerSource(context.GetWebService())); |
247 //layer->SetImageQuality(SliceImageQuality_Jpeg50); | 257 //layer->SetImageQuality(SliceImageQuality_Jpeg50); |
248 layer->LoadInstance(instance, frame); | 258 layer->LoadInstance(instance, frame); |
249 //layer->LoadSeries("6f1b492a-e181e200-44e51840-ef8db55e-af529ab6"); | 259 //layer->LoadSeries("6f1b492a-e181e200-44e51840-ef8db55e-af529ab6"); |
265 // Extent of the CT layer: (-35.068 -20.368) => (34.932 49.632) | 275 // Extent of the CT layer: (-35.068 -20.368) => (34.932 49.632) |
266 std::auto_ptr<OrthancFrameLayerSource> ct; | 276 std::auto_ptr<OrthancFrameLayerSource> ct; |
267 ct.reset(new OrthancFrameLayerSource(context.GetWebService())); | 277 ct.reset(new OrthancFrameLayerSource(context.GetWebService())); |
268 //ct->LoadInstance("c804a1a2-142545c9-33b32fe2-3df4cec0-a2bea6d6", 0); | 278 //ct->LoadInstance("c804a1a2-142545c9-33b32fe2-3df4cec0-a2bea6d6", 0); |
269 //ct->LoadInstance("4bd4304f-47478948-71b24af2-51f4f1bc-275b6c1b", 0); // BAD SLICE | 279 //ct->LoadInstance("4bd4304f-47478948-71b24af2-51f4f1bc-275b6c1b", 0); // BAD SLICE |
270 ct->SetImageQuality(SliceImageQuality_Jpeg50); | 280 //ct->SetImageQuality(SliceImageQuality_Jpeg50); |
271 ct->LoadSeries("dd069910-4f090474-7d2bba07-e5c10783-f9e4fb1d"); | 281 ct->LoadSeries("dd069910-4f090474-7d2bba07-e5c10783-f9e4fb1d"); |
272 | 282 |
273 ct->Register(*this); | 283 ct->Register(*this); |
274 widget->AddLayer(ct.release()); | 284 widget->AddLayer(ct.release()); |
275 | 285 |