Fraxinus  2023.01.05-dev+develop.0da12
An IGT application
cxExportDataDialog.cpp
Go to the documentation of this file.
1 /*=========================================================================
2 This file is part of CustusX, an Image Guided Therapy Application.
3 
4 Copyright (c) SINTEF Department of Medical Technology.
5 All rights reserved.
6 
7 CustusX is released under a BSD 3-Clause license.
8 
9 See Lisence.txt (https://github.com/SINTEFMedtek/CustusX/blob/master/License.txt) for details.
10 =========================================================================*/
11 
12 #include "cxExportDataDialog.h"
13 
14 #include <cmath>
15 #include <QFileDialog>
16 #include <QPushButton>
17 #include <QVBoxLayout>
18 #include <QLabel>
19 #include <Qt>
20 #include <QCheckBox>
21 #include <QTimer>
22 #include <vtkImageData.h>
24 
25 #include "cxTypeConversions.h"
26 #include "cxData.h"
28 #include "cxImageAlgorithms.h"
29 #include "cxImage.h"
30 #include "cxPatientModelService.h"
31 
32 namespace cx
33 {
34 
35 ExportDataDialog::ExportDataDialog(PatientModelServicePtr patientModelService, QWidget* parent) :
36  QDialog(parent),
37  mPatientModelService(patientModelService)
38 {
39  this->setAttribute(Qt::WA_DeleteOnClose);
40 
41  QVBoxLayout* layout = new QVBoxLayout(this);
42  this->setWindowTitle("Export Patient Data");
43 
44  mNiftiFormatCheckBox = new QCheckBox("Use RAS NIfTI-1/ITK-Snap axis definition", this);
45  mNiftiFormatCheckBox->setToolTip(""
46  "Use RAS (X=Left->Right Y=Posterior->Anterior Z=Inferior->Superior), as in ITK-Snap.\n"
47  "This is different from LPS (DICOM).");
48  mNiftiFormatCheckBox->setChecked(true);
49  mNiftiFormatCheckBox->setEnabled(true);
50 
51  layout->addWidget(mNiftiFormatCheckBox);
52 
53  QHBoxLayout* buttons = new QHBoxLayout;
54  layout->addLayout(buttons);
55  mOkButton = new QPushButton("OK", this);
56  buttons->addStretch();
57  buttons->addWidget(mOkButton);
58  connect(mOkButton, SIGNAL(clicked()), this, SLOT(accept()));
59  connect(this, SIGNAL(accepted()), this, SLOT(acceptedSlot()));
60  mOkButton->setDefault(true);
61  mOkButton->setFocus();
62 
63 // report("Exporting data...");
64 }
65 
67 {
68 }
69 
70 PATIENT_COORDINATE_SYSTEM ExportDataDialog::getExternalSpace()
71 {
72  return mNiftiFormatCheckBox->isChecked() ? pcsRAS : pcsLPS;
73 }
74 
75 void ExportDataDialog::acceptedSlot()
76 {
77  mPatientModelService->exportPatient(this->getExternalSpace());
78 }
79 
80 }//namespace cx
pcsRAS
Right-Anterior-Superior, used by Slicer3D, ITK-Snap, nifti, MINC.
boost::shared_ptr< class PatientModelService > PatientModelServicePtr
pcsLPS
Left-Posterior-Superior, used internally by CustusX, also DICOM, ITK.
ExportDataDialog(PatientModelServicePtr patientModelService, QWidget *parent=NULL)
Namespace for all CustusX production code.