78
79
GWaveformView* GView;
81
////////////////////GWaveform annotator delegate
82
class GWaveformAnnotatorDelegate: public GNC::GCS::IAnnotator
85
GWaveformAnnotatorDelegate(GWaveformView* gView, GNKVisualizator::WaveFormView* pView):GNC::GCS::IAnnotator(pView),
89
~GWaveformAnnotatorDelegate()
93
virtual std::string GetAnnotationValue(GNC::GCS::Contexto3D* c, const std::string& key)
95
if (key == "${SLICE.WL.FULLTEXT}") {
97
} else if (key == "${SLICE.IDX.FULLTEXT}") {
99
} else if (key == "${VIEW.COORDLABELS}") {
100
std::ostringstream os;
101
os << "25 mm/s, 10 mm/mV";
104
return GNC::GCS::IAnnotator::GetAnnotationValue(c, key);
110
GWaveformView* GView;
80
112
//esta clase sirve para las barras de herramientas de abajo
81
113
class GWaveformViewButtonBar:public wxAuiToolBar{
113
146
// Setup del manejador de widgets */
114
147
m_pManager = GNC::GCS::IEntorno::Instance()->NewWidgetsManager(View);
148
m_pManager->SetAnnotator(AnnotatorDelegate);
115
149
ViewInteractor2D->SetManager(m_pManager);
116
150
ViewInteractor2D->SetVID(0,false);
117
151
m_pManager->SetRendererActivo(ViewInteractor2D);
119
m_pManager->CrearWidgetAnotador(this);
121
153
WidgetRepresentation* pWidgetsRepresentation = WidgetRepresentation::New();
122
154
pWidgetsRepresentation->SetRenderer(ViewInteractor2D->FindPokedRenderer(0,0));
123
155
ViewInteractor2D->FindPokedRenderer(0,0)->AddViewProp(pWidgetsRepresentation);
329
361
void GWaveformView::OnShowHideCornerAnnotations(wxCommandEvent &)
331
m_pManager->MostrarOcultarAnotador();
363
m_pManager->ShowAnnotations(!m_pManager->IsShownAnnotations());
332
364
GNC::GCS::IEntorno::Instance()->GetControladorEventos()->ProcesarEvento(new GNC::GCS::Events::EventoRender(View));
336
std::string GWaveformView::GetDICOMTag(std::string tagId)
339
View->GetEstudio()->GetTagActiveImage(tagId,str);
344
std::string GWaveformView::GetTopLeftAnnotation(GNC::GCS::Contexto3D*)
346
if (!this->ViewImage2D->IsInstalledAndInitialized() || View == NULL)
349
std::ostringstream os;
352
tag = "0010|0010"; // Patient's Name
354
os << _Std("Patient: ") << GetDICOMTag(tag).c_str() << std::endl;
356
tag = "0010|0020"; // Patient's ID
358
os << _Std("Patient Id: ") << GetDICOMTag(tag).c_str();
363
std::string GWaveformView::GetTopRightAnnotation(GNC::GCS::Contexto3D*)
365
if (!this->ViewImage2D->IsInstalledAndInitialized() || View == NULL)
368
std::ostringstream os;
372
tag = "0010|0040"; // Patient's Sex
374
os << GetDICOMTag(tag).c_str() << " ";
376
tag = "0010|0030"; // Patient's BirthDate
377
str = GetDICOMTag(tag);
378
if (str.size() == 8) {
379
os << str.substr(6, 2).c_str() << "-";
380
os << str.substr(4, 2).c_str() << "-";
381
os << str.substr(0, 4).c_str() << " ";
384
tag = "0010|1010"; // Patient's Age
385
str = GetDICOMTag(tag);
387
os << str.c_str() << "Y" << std::endl;
390
tag = "0008|0060"; // Modalidad
391
os << _Std("Modality: ") << GetDICOMTag(tag).c_str() << std::endl;
393
tag = "0008|0021"; // Series Date
394
str = GetDICOMTag(tag);
395
if (str.size() == 8) {
396
os << str.substr(6, 2).c_str() << "-";
397
os << str.substr(4, 2).c_str() << "-";
398
os << str.substr(0, 4).c_str() << " ";
402
tag = "0008|103e"; // Series Description
403
str = GetDICOMTag(tag);
408
os << str.substr(0,18).c_str()<<"...";
415
std::string GWaveformView::GetBottomLeftAnnotation(GNC::GCS::Contexto3D*)
418
if (!this->ViewImage2D->IsInstalledAndInitialized() || View == NULL)
421
std::ostringstream os;
425
tag = "0008|0020"; // study Date
426
str = GetDICOMTag(tag);
427
if (str.size() == 8) {
428
os << str.substr(6, 2).c_str() << "-";
429
os << str.substr(4, 2).c_str() << "-";
430
os << str.substr(0, 4).c_str() << " ";
434
tag = "0008|1030"; // Study Description
435
str = GetDICOMTag(tag);
438
os << str.c_str()<<std::endl;
440
os << str.substr(0,18).c_str()<<"..."<<std::endl;
444
tag = "0008|0080"; // Nombre del centro, si viene el centro en el estudio se pone si no el d los tags estaticos
445
str = GetDICOMTag(tag);
446
if (str.size() == 6) {
447
os << str.substr(0, 2).c_str() << ":";
450
GNC::GCS::ConfigurationController::Instance()->readStringGeneral("/GinkgoCore/Estacion", "CentroNombre", tag);
453
os << tag.c_str() << std::endl;
458
wxString appName ( wxString::FromUTF8(GNC::GCS::IEntorno::Instance()->GetApplicationName().c_str()));
459
wxString madewith( wxString::Format(_("Made with %s"), appName.c_str()));
461
os << std::string(madewith.ToUTF8());
465
std::string GWaveformView::GetBottomRightAnnotation(GNC::GCS::Contexto3D*)
467
if (!this->ViewImage2D->IsInstalledAndInitialized() || View == NULL)
469
std::ostringstream os;
470
os << "25 mm/s, 10 mm/mV";
474
std::string GWaveformView::GetPatientPosition(GNC::GCS::Contexto3D*)
479
std::string GWaveformView::GetAnotacionPosicion(const GNC::GCS::Vector3D& /*wP*/, GNC::GCS::Contexto3D*)
486
368
void GWaveformView::OnFocus(wxChildFocusEvent &)