mirror of
https://gitlab.ethz.ch/gfattori/glocalize.git
synced 2026-05-05 22:54:24 +02:00
143 lines
3.3 KiB
C++
143 lines
3.3 KiB
C++
#ifndef _GPATIENTLOADER_H_
|
|
#define _GPATIENTLOADER_H_
|
|
|
|
#include <qobject.h>
|
|
#include <qstring.h>
|
|
#include "gPatientRTGeneralInfos.h"
|
|
//#include "wrkDirParser.h"
|
|
#include <qmainwindow.h>
|
|
#include <qdir.h>
|
|
#include <qthread.h>
|
|
#include <vtkSmartPointer.h>
|
|
#include <vtkImageData.h>
|
|
#include "dicomUtils.h"
|
|
|
|
|
|
/*_________________________________________________________-
|
|
|
|
Patient loader for gLocalize.
|
|
no wrkDir behaviour. just load data
|
|
____________________________________________________________*/
|
|
|
|
|
|
#include "connectITKVTK.h"
|
|
//#include "itkAnalyzeImageIO.h"
|
|
#include "itkChangeInformationImageFilter.h"
|
|
#include "itkImage.h"
|
|
#include "itkImage.h"
|
|
#include "itkImageFileWriter.h"
|
|
#include "itkOrientImageFilter.h"
|
|
#include "itkPermuteAxesImageFilter.h"
|
|
#include "itkRescaleIntensityImageFilter.h"
|
|
#include "itkImageSeriesReader.h"
|
|
#include "itkGDCMImageIO.h"
|
|
#include "itkGDCMSeriesFileNames.h"
|
|
#include "gdcmIPPSorter.h"
|
|
|
|
|
|
#ifndef TPATIENTORIENTATION
|
|
#define TPATIENTORIENTATION
|
|
typedef enum {
|
|
NOTDEFINED=0,
|
|
SUPINE = 1,
|
|
PRONE =2
|
|
} t_patientOrientation;
|
|
#endif
|
|
|
|
#ifndef PARSERVARIABLES
|
|
#define PARSERVARIABLES
|
|
enum patientErrors {
|
|
NOERRORS,
|
|
PARSER_FOLDER_NOTEXISTING,
|
|
PARSER_FOLDER_EMPTY,
|
|
PARSER_RTPLAN_NOTUNIQUE,
|
|
PARSER_RTPLAN_MISSING,
|
|
PARSER_RTSTRUCT_NOTUNIQUE,
|
|
PARSER_RTSTRUCT_MISSING,
|
|
PARSER_CT_FILES_MISSING,
|
|
PARSER_CT_FAILED_SORTING,
|
|
POPULATE_INCONSISTENT_DATASET,
|
|
POPULATE_NOTEXISTING,
|
|
CLEAR_FOLDER_NOTEXISTING
|
|
};
|
|
|
|
|
|
enum patientParseOption{
|
|
NOCLEAN,
|
|
CLEAN
|
|
};
|
|
enum patientCleanMode{
|
|
JUSTCLEAR,
|
|
ISLOADINGCHECK
|
|
};
|
|
#endif
|
|
|
|
#ifndef _T_REFERENCE_
|
|
#define _T_REFERENCE_
|
|
typedef enum{
|
|
DCMREF=0,
|
|
RTREF=1,
|
|
GOTSREF=2
|
|
}t_reference;
|
|
|
|
#endif
|
|
|
|
typedef itk::Image<short,3> myImageType;
|
|
|
|
|
|
class gLoadPatient : public QObject{
|
|
Q_OBJECT
|
|
public:
|
|
gLoadPatient();
|
|
|
|
public slots:
|
|
void load(QString p_loadDir);
|
|
void changeRef(int selectedRef);
|
|
|
|
private:
|
|
QString loadDir;
|
|
gPatientRTGeneralInfos* patientInfos;
|
|
void loadDICOM(std::vector<std::string> CTfilenames);
|
|
void connectToVTK();
|
|
void actualizeOut();
|
|
void parse(QString p_loadDir);
|
|
t_patientOrientation m_patientOrientation;
|
|
vtkSmartPointer <vtkImageData> vol3D;
|
|
|
|
myImageType::Pointer myImage;
|
|
itk::ImageSeriesReader<myImageType>::Pointer rDICOM;
|
|
itk::GDCMImageIO::Pointer iGDCMimage ;
|
|
itk::GDCMSeriesFileNames::Pointer myDICOMseries;
|
|
myImageType::DirectionType imageDir;
|
|
myImageType::PointType origin;
|
|
myImageType::SizeType sizeOfImage;
|
|
myImageType::PointType trueOffset;
|
|
myImageType::PointType trueOffset_rot;
|
|
myImageType::PointType trueOffset_rot_prev;
|
|
myImageType::DirectionType directionToWCS;
|
|
|
|
bool initialized;
|
|
|
|
vtkSmartPointer<vtkImageImport> out;
|
|
itk::VTKImageExport <myImageType>::Pointer in;
|
|
|
|
RTPlan * readRT;
|
|
double* m_rtIsocenter;
|
|
bool virtualIso;
|
|
t_reference m_reference;
|
|
|
|
signals:
|
|
void folderIsEmpty();
|
|
void statusInfo(QString msg);
|
|
void parse_result(int result, gPatientRTGeneralInfos* patientInfos);
|
|
void loadFail(QString msg);
|
|
void loadEnd(vtkImageData* vol);
|
|
void loadedRTIso(double *iso);
|
|
void loadedVolBBox(double* bbox, double* spacing, int* dimension);
|
|
void referenceChange(double dx, double dy, double dz);
|
|
void virtualIsoTested(bool virtualIso);
|
|
|
|
};
|
|
|
|
#endif
|