From afe05ef1bd132c33331005349ca3f7f9dc24fa47 Mon Sep 17 00:00:00 2001 From: Tomas Oberhuber <tomas.oberhuber@fjfi.cvut.cz> Date: Mon, 3 Aug 2015 10:32:50 +0200 Subject: [PATCH] Refactoring code for the DICOM format support. --- src/core/CMakeLists.txt | 2 +- src/core/{io => images}/CMakeLists.txt | 29 +++-- .../DicomHeader.h => images/tnlDicomHeader.h} | 28 ++--- src/core/images/tnlDicomHeader_impl.h | 74 +++++++++++++ src/core/images/tnlDicomImageInfo.h | 103 ++++++++++++++++++ .../tnlDicomImageInfo_impl.h} | 42 +++++-- src/core/images/tnlDicomPatientInfo.h | 83 ++++++++++++++ src/core/images/tnlDicomPatientInfo_impl.h | 101 +++++++++++++++++ .../DicomSeries.h => images/tnlDicomSeries.h} | 19 ++-- .../tnlDicomSeriesInfo.h} | 32 +++++- .../tnlDicomSeriesInfo_impl.h} | 54 ++++++--- .../tnlDicomSeries_impl.h} | 62 +++++++---- src/core/{io => images}/tnlImage.h | 0 src/core/{io => images}/tnlJPEGImage.h | 6 +- src/core/{io => images}/tnlJPEGImage_impl.h | 2 +- src/core/{io => images}/tnlPGMImage.h | 6 +- src/core/{io => images}/tnlPGMImage_impl.h | 2 +- src/core/{io => images}/tnlPNGImage.h | 6 +- src/core/{io => images}/tnlPNGImage_impl.h | 2 +- src/core/{io => images}/tnlRegionOfInterest.h | 4 +- .../{io => images}/tnlRegionOfInterest_impl.h | 0 src/core/io/DicomHeader_impl.h | 54 --------- src/core/io/ImageInfoObj.h | 83 -------------- src/core/io/PatientInfoObj.h | 62 ----------- src/core/io/PatientInfoObj_impl.h | 80 -------------- tools/src/tnl-dicom-reader.cpp | 4 +- tools/src/tnl-image-converter.cpp | 8 +- 27 files changed, 559 insertions(+), 389 deletions(-) rename src/core/{io => images}/CMakeLists.txt (58%) rename src/core/{io/DicomHeader.h => images/tnlDicomHeader.h} (74%) create mode 100644 src/core/images/tnlDicomHeader_impl.h create mode 100644 src/core/images/tnlDicomImageInfo.h rename src/core/{io/ImageInfoObj_impl.h => images/tnlDicomImageInfo_impl.h} (57%) create mode 100644 src/core/images/tnlDicomPatientInfo.h create mode 100644 src/core/images/tnlDicomPatientInfo_impl.h rename src/core/{io/DicomSeries.h => images/tnlDicomSeries.h} (90%) rename src/core/{io/SeriesInfoObj.h => images/tnlDicomSeriesInfo.h} (57%) rename src/core/{io/SeriesInfoObj_impl.h => images/tnlDicomSeriesInfo_impl.h} (63%) rename src/core/{io/DicomSeries_impl.h => images/tnlDicomSeries_impl.h} (76%) rename src/core/{io => images}/tnlImage.h (100%) rename src/core/{io => images}/tnlJPEGImage.h (95%) rename src/core/{io => images}/tnlJPEGImage_impl.h (99%) rename src/core/{io => images}/tnlPGMImage.h (95%) rename src/core/{io => images}/tnlPGMImage_impl.h (99%) rename src/core/{io => images}/tnlPNGImage.h (95%) rename src/core/{io => images}/tnlPNGImage_impl.h (99%) rename src/core/{io => images}/tnlRegionOfInterest.h (95%) rename src/core/{io => images}/tnlRegionOfInterest_impl.h (100%) delete mode 100644 src/core/io/DicomHeader_impl.h delete mode 100644 src/core/io/ImageInfoObj.h delete mode 100644 src/core/io/PatientInfoObj.h delete mode 100644 src/core/io/PatientInfoObj_impl.h diff --git a/src/core/CMakeLists.txt b/src/core/CMakeLists.txt index 01cebbb81b..9429eb9f18 100755 --- a/src/core/CMakeLists.txt +++ b/src/core/CMakeLists.txt @@ -2,7 +2,7 @@ ADD_SUBDIRECTORY( arrays ) ADD_SUBDIRECTORY( containers ) ADD_SUBDIRECTORY( cuda ) ADD_SUBDIRECTORY( vectors ) -ADD_SUBDIRECTORY( io ) +ADD_SUBDIRECTORY( images ) set (headers tnlAssert.h tnlConstants.h diff --git a/src/core/io/CMakeLists.txt b/src/core/images/CMakeLists.txt similarity index 58% rename from src/core/io/CMakeLists.txt rename to src/core/images/CMakeLists.txt index 6fba7e5c57..e275db7907 100644 --- a/src/core/io/CMakeLists.txt +++ b/src/core/images/CMakeLists.txt @@ -1,19 +1,24 @@ -set( headers DicomHeader.h - ImageInfoObj.h - SeriesInfoObj.h - tnlJPEGImage.h - tnlPGMImage.h - tnlPNGImage.h - tnlRegionOfInterest.h - DicomSeries.h - PatientInfoObj.h +set( headers tnlDicomHeader.h + tnlDicomHeader_impl.h + tnlDicomImageInfo.h + tnlDicomImageInfo_impl.h + tnlDicomSeriesInfo.h + tnlDicomSeriesInfo_impl.h + tnlDicomSeries.h + tnlDicomSeries_impl.h + tnlDicomPatientInfo.h + tnlDicomPatientInfo_impl.h tnlImage.h + tnlJPEGImage.h tnlJPEGImage_impl.h + tnlPGMImage.h tnlPGMImage_impl.h - tnlPNGImage_impl.h + tnlPNGImage.h + tnlPNGImage_impl.h + tnlRegionOfInterest.h tnlRegionOfInterest_impl.h ) -SET( CURRENT_DIR ${CMAKE_SOURCE_DIR}/src/core/io ) +SET( CURRENT_DIR ${CMAKE_SOURCE_DIR}/src/core/images ) #### # DCMTK currently does not support shared libraries. When it does _impl.h files @@ -36,4 +41,4 @@ ELSE() ENDIF() -INSTALL( FILES ${headers} DESTINATION include/tnl-${tnlVersion}/core/io ) \ No newline at end of file +INSTALL( FILES ${headers} DESTINATION include/tnl-${tnlVersion}/core/images ) \ No newline at end of file diff --git a/src/core/io/DicomHeader.h b/src/core/images/tnlDicomHeader.h similarity index 74% rename from src/core/io/DicomHeader.h rename to src/core/images/tnlDicomHeader.h index e482a2729d..95996a4b05 100644 --- a/src/core/io/DicomHeader.h +++ b/src/core/images/tnlDicomHeader.h @@ -2,9 +2,11 @@ tnlDicomHeader.h - description ------------------- begin : Jul 19, 2015 - copyright : (C) 2015 by Jiri Kafka, - Tomas Oberhuber - email : tomas.oberhuber@fjfi.cvut.cz + copyright : (C) 2015 by Tomas Oberhuber et al. + + Tomas Oberhuber tomas.oberhuber@fjfi.cvut.cz + Jiri Kafka kafka9@seznam.cz + Pavel Neskudla ***************************************************************************/ /*************************************************************************** @@ -27,9 +29,9 @@ #include <dcmtk/dcmdata/dcdeftag.h> #endif -class SeriesInfoObj; -class PatientInfoObj; -class ImageInfoObj; +class tnlDicomSeriesInfo; +class tnlDicomPatientInfo; +class tnlDicomImageInfo; /*** * Class provides acces to the DICOM file header (contains complete @@ -48,21 +50,21 @@ class tnlDicomHeader inline DcmFileFormat &getFileFormat(); #endif - inline ImageInfoObj &getImageInfoObj(); + inline tnlDicomImageInfo &getImageInfo(); - inline PatientInfoObj &getPatientInfoObj(); + inline tnlDicomPatientInfo &getPatientInfo(); - inline SeriesInfoObj &getSeriesInfoObj(); + inline tnlDicomSeriesInfo &getSeriesInfo(); inline bool loadFromFile( const char* fileName ); protected: - ImageInfoObj *imageInfoObj; + tnlDicomImageInfo *imageInfoObj; - PatientInfoObj *patientInfoObj; + tnlDicomPatientInfo *patientInfoObj; - SeriesInfoObj *seriesInfoObj; + tnlDicomSeriesInfo *seriesInfoObj; #ifdef HAVE_DCMTK_H DcmFileFormat *fileFormat; @@ -71,6 +73,6 @@ class tnlDicomHeader bool isLoaded; }; -#include <core/io/DicomHeader_impl.h> +#include <core/images/tnlDicomHeader_impl.h> #endif // TNLDICOMHEADER_H diff --git a/src/core/images/tnlDicomHeader_impl.h b/src/core/images/tnlDicomHeader_impl.h new file mode 100644 index 0000000000..6475bbcd4b --- /dev/null +++ b/src/core/images/tnlDicomHeader_impl.h @@ -0,0 +1,74 @@ +/*************************************************************************** + tnlDicomHeader_impl.h - description + ------------------- + begin : Jul 19, 2015 + copyright : (C) 2015 by Tomas Oberhuber et al. + + Tomas Oberhuber tomas.oberhuber@fjfi.cvut.cz + Jiri Kafka kafka9@seznam.cz + Pavel Neskudla + ***************************************************************************/ + +/*************************************************************************** + * * + * This program is free software; you can redistribute it and/or modify * + * it under the terms of the GNU General Public License as published by * + * the Free Software Foundation; either version 2 of the License, or * + * (at your option) any later version. * + * * + ***************************************************************************/ + +#include <core/images/tnlDicomHeader.h> +#include <core/images/tnlDicomSeriesInfo.h> +#include <core/images/tnlDicomPatientInfo.h> +#include <core/images/tnlDicomImageInfo.h> + +inline tnlDicomHeader::tnlDicomHeader() +{ + fileFormat = new DcmFileFormat(); + isLoaded = false; + imageInfoObj = new tnlDicomImageInfo(*this); + patientInfoObj = new tnlDicomPatientInfo(*this); + seriesInfoObj = new tnlDicomSeriesInfo(*this); +} + +inline tnlDicomHeader::~tnlDicomHeader() +{ + delete imageInfoObj; + delete patientInfoObj; + delete seriesInfoObj; + delete fileFormat; +} + +inline bool tnlDicomHeader::loadFromFile(const char *fileName) +{ + OFCondition status = fileFormat->loadFile(fileName); + if(status.good()) + { + isLoaded = true; + return true; + } + isLoaded = false; + return false; +} + +inline DcmFileFormat &tnlDicomHeader::getFileFormat() +{ + return *fileFormat; +} + +inline tnlDicomImageInfo &tnlDicomHeader::getImageInfo() +{ + return *imageInfoObj; +} + +inline tnlDicomPatientInfo &tnlDicomHeader::getPatientInfo() +{ + return *patientInfoObj; +} + +inline tnlDicomSeriesInfo &tnlDicomHeader::getSeriesInfo() +{ + return *seriesInfoObj; +} + diff --git a/src/core/images/tnlDicomImageInfo.h b/src/core/images/tnlDicomImageInfo.h new file mode 100644 index 0000000000..feb0e91acf --- /dev/null +++ b/src/core/images/tnlDicomImageInfo.h @@ -0,0 +1,103 @@ +/*************************************************************************** + tnlDicomImageInfo.h - description + ------------------- + begin : Jul 19, 2015 + copyright : (C) 2015 by Tomas Oberhuber et al. + + Tomas Oberhuber tomas.oberhuber@fjfi.cvut.cz + Jiri Kafka kafka9@seznam.cz + Pavel Neskudla + ***************************************************************************/ + +/*************************************************************************** + * * + * This program is free software; you can redistribute it and/or modify * + * it under the terms of the GNU General Public License as published by * + * the Free Software Foundation; either version 2 of the License, or * + * (at your option) any later version. * + * * + ***************************************************************************/ + +#ifndef TNLDICOMIMAGEINFO_H +#define TNLDICOMIMAGEINFO_H + +#include <tnlConfig.h> + +#ifdef HAVE_DCMTK_H +#define HAVE_CONFIG_H +#include <dcmtk/dcmdata/dcfilefo.h> +#include <dcmtk/dcmdata/dcdeftag.h> +#endif + +class tnlDicomHeader; + +/***ImageInfoObj class stores selected informations about images. + (accesses information via DicomHeader class) + ***/ +struct ImagePositionToPatient + { + double x, y,z; + }; + +struct DirectionCosines + { + double x, y, z; + }; + +struct ImageOrientationToPatient + { + DirectionCosines row; + DirectionCosines column; + }; + +struct PixelSpacing + { + double x, y; + }; + +class tnlDicomImageInfo +{ + public: + + inline tnlDicomImageInfo( tnlDicomHeader &tnlDicomHeader); + + inline virtual ~tnlDicomImageInfo(); + + inline ImagePositionToPatient getImagePositionToPatient(); + + inline ImageOrientationToPatient getImageOrientationToPatient(); + + inline double getSliceThickness(); + + inline double getSliceLocation(); + + inline PixelSpacing getPixelSpacing(); + + inline int getNumberOfSlices(); + + private: + + tnlDicomHeader &dicomHeader; + + bool retrieveInfo(); + + bool isObjectRetrieved; + + double sliceLocation; + + double sliceThickness; + + ImagePositionToPatient imagePositionToPatient; + + ImageOrientationToPatient imageOrientationToPatient; + + PixelSpacing pixelSpacing; + + int numberOfSlices; + + int width, height, depth; +}; + +#include <core/images/tnlDicomImageInfo_impl.h> + +#endif // TNLDICOMIMAGEINFO_H diff --git a/src/core/io/ImageInfoObj_impl.h b/src/core/images/tnlDicomImageInfo_impl.h similarity index 57% rename from src/core/io/ImageInfoObj_impl.h rename to src/core/images/tnlDicomImageInfo_impl.h index 8b21de7e09..1b2059d46b 100644 --- a/src/core/io/ImageInfoObj_impl.h +++ b/src/core/images/tnlDicomImageInfo_impl.h @@ -1,18 +1,38 @@ -#include "ImageInfoObj.h" -#include "DicomHeader.h" +/*************************************************************************** + tnlDicomImageInfo_impl.h - description + ------------------- + begin : Jul 19, 2015 + copyright : (C) 2015 by Tomas Oberhuber et al. + + Tomas Oberhuber tomas.oberhuber@fjfi.cvut.cz + Jiri Kafka kafka9@seznam.cz + Pavel Neskudla + ***************************************************************************/ -inline ImageInfoObj::ImageInfoObj( tnlDicomHeader& dicomHeader ) +/*************************************************************************** + * * + * This program is free software; you can redistribute it and/or modify * + * it under the terms of the GNU General Public License as published by * + * the Free Software Foundation; either version 2 of the License, or * + * (at your option) any later version. * + * * + ***************************************************************************/ + +#include "tnlDicomImageInfo.h" +#include "tnlDicomHeader.h" + +inline tnlDicomImageInfo::tnlDicomImageInfo( tnlDicomHeader& dicomHeader ) : dicomHeader( dicomHeader ) { isObjectRetrieved = false; depth = 0; } -inline ImageInfoObj::~ImageInfoObj() +inline tnlDicomImageInfo::~tnlDicomImageInfo() { } -inline bool ImageInfoObj::retrieveInfo() +inline bool tnlDicomImageInfo::retrieveInfo() { dicomHeader.getFileFormat().getDataset()->findAndGetFloat64(DCM_ImagePositionPatient,imagePositionToPatient.x,0); @@ -40,42 +60,42 @@ inline bool ImageInfoObj::retrieveInfo() return 0; } -inline ImagePositionToPatient ImageInfoObj::getImagePositionToPatient() +inline ImagePositionToPatient tnlDicomImageInfo::getImagePositionToPatient() { if(!isObjectRetrieved) retrieveInfo(); return imagePositionToPatient; } -inline ImageOrientationToPatient ImageInfoObj::getImageOrientationToPatient() +inline ImageOrientationToPatient tnlDicomImageInfo::getImageOrientationToPatient() { if(!isObjectRetrieved) retrieveInfo(); return imageOrientationToPatient; } -inline double ImageInfoObj::getSliceThickness() +inline double tnlDicomImageInfo::getSliceThickness() { if(!isObjectRetrieved) retrieveInfo(); return sliceThickness; } -inline double ImageInfoObj::getSliceLocation() +inline double tnlDicomImageInfo::getSliceLocation() { if(!isObjectRetrieved) retrieveInfo(); return sliceLocation; } -inline PixelSpacing ImageInfoObj::getPixelSpacing() +inline PixelSpacing tnlDicomImageInfo::getPixelSpacing() { if(!isObjectRetrieved) retrieveInfo(); return pixelSpacing; } -inline int ImageInfoObj::getNumberOfSlices() +inline int tnlDicomImageInfo::getNumberOfSlices() { if(!isObjectRetrieved) retrieveInfo(); diff --git a/src/core/images/tnlDicomPatientInfo.h b/src/core/images/tnlDicomPatientInfo.h new file mode 100644 index 0000000000..1220d208f9 --- /dev/null +++ b/src/core/images/tnlDicomPatientInfo.h @@ -0,0 +1,83 @@ +/*************************************************************************** + tnlDicomPatientInfo.h - description + ------------------- + begin : Jul 19, 2015 + copyright : (C) 2015 by Tomas Oberhuber et al. + + Tomas Oberhuber tomas.oberhuber@fjfi.cvut.cz + Jiri Kafka kafka9@seznam.cz + Pavel Neskudla + ***************************************************************************/ + +/*************************************************************************** + * * + * This program is free software; you can redistribute it and/or modify * + * it under the terms of the GNU General Public License as published by * + * the Free Software Foundation; either version 2 of the License, or * + * (at your option) any later version. * + * * + ***************************************************************************/ + + +#ifndef TNLDICOMPATIENTINFO_H +#define TNLDICOMPATIENTINFO_H + +class tnlDicomHeader; + +#include <core/tnlString.h> +#include <tnlConfig.h> + +#ifdef HAVE_DCMTK_H +#define HAVE_CONFIG_H +#define HAVE_STD_STRING +#include <dcmtk/dcmdata/dcfilefo.h> +#include <dcmtk/dcmdata/dcdeftag.h> +#include <dcmtk/ofstd/ofstring.h> +#endif + +/*** + * PatientInfoObj class stores selected informations about patient. + * (accesses information via tnlDicomHeader class) + */ +class tnlDicomPatientInfo +{ + public: + + inline tnlDicomPatientInfo(tnlDicomHeader &atnlDicomHeader); + + inline virtual ~tnlDicomPatientInfo(); + + inline const tnlString& getName(); + + inline const tnlString& getSex(); + + inline const tnlString& getID(); + + inline const tnlString& getWeight(); + + inline const tnlString& getPosition(); + + inline const tnlString& getOrientation(); + + private: + + tnlDicomHeader &dicomHeader; + bool retrieveInfo(); + bool isObjectRetrieved; + + tnlString name; + + tnlString sex; + + tnlString ID; + + tnlString weight; + + tnlString patientPosition; + + tnlString patientOrientation; +}; + +#include <core/images/tnlDicomPatientInfo_impl.h> + +#endif // TNLDICOMPATIENTINFO_H diff --git a/src/core/images/tnlDicomPatientInfo_impl.h b/src/core/images/tnlDicomPatientInfo_impl.h new file mode 100644 index 0000000000..d2f3e4c809 --- /dev/null +++ b/src/core/images/tnlDicomPatientInfo_impl.h @@ -0,0 +1,101 @@ +/*************************************************************************** + tnlDicomPatientInfo_impl.h - description + ------------------- + begin : Jul 19, 2015 + copyright : (C) 2015 by Tomas Oberhuber et al. + + Tomas Oberhuber tomas.oberhuber@fjfi.cvut.cz + Jiri Kafka kafka9@seznam.cz + Pavel Neskudla + ***************************************************************************/ + +/*************************************************************************** + * * + * This program is free software; you can redistribute it and/or modify * + * it under the terms of the GNU General Public License as published by * + * the Free Software Foundation; either version 2 of the License, or * + * (at your option) any later version. * + * * + ***************************************************************************/ + + +#include "tnlDicomPatientInfo.h" +#include "tnlDicomHeader.h" + +#ifdef HAVE_DCMTK_H +#define HAVE_CONFIG_H +#define HAVE_STD_STRING +#include <dcmtk/ofstd/ofstring.h> +#endif + +inline tnlDicomPatientInfo::tnlDicomPatientInfo( tnlDicomHeader &dicomHeader ) +: dicomHeader( dicomHeader ) +{ + isObjectRetrieved = false; +} + +inline tnlDicomPatientInfo::~tnlDicomPatientInfo() +{ +} + +inline bool tnlDicomPatientInfo::retrieveInfo() +{ + OFString str; + dicomHeader.getFileFormat().getDataset()->findAndGetOFString(DCM_PatientName, str ); + this->name.setString( str.data() ); + dicomHeader.getFileFormat().getDataset()->findAndGetOFString(DCM_PatientSex, str ); + this->sex.setString( str.data() ); + dicomHeader.getFileFormat().getDataset()->findAndGetOFString(DCM_PatientID, str ); + this->ID.setString( str.data() ); + dicomHeader.getFileFormat().getDataset()->findAndGetOFString(DCM_PatientWeight, str ); + this->weight.setString( str.data() ); + dicomHeader.getFileFormat().getDataset()->findAndGetOFString(DCM_PatientPosition, str ); + this->patientPosition.setString( str.data() ); + dicomHeader.getFileFormat().getDataset()->findAndGetOFString(DCM_PatientOrientation, str ); + this->patientOrientation.setString( str.data() ); + + isObjectRetrieved = true; + return 0; +} + +inline const tnlString& tnlDicomPatientInfo::getName() +{ + if(!isObjectRetrieved) + retrieveInfo(); + return name; +} + +inline const tnlString& tnlDicomPatientInfo::getSex() +{ + if(!isObjectRetrieved) + retrieveInfo(); + return sex; +} + +inline const tnlString& tnlDicomPatientInfo::getID() +{ + if(!isObjectRetrieved) + retrieveInfo(); + return ID; +} + +inline const tnlString& tnlDicomPatientInfo::getWeight() +{ + if(!isObjectRetrieved) + retrieveInfo(); + return weight; +} + +inline const tnlString& tnlDicomPatientInfo::getPosition() +{ + if(!isObjectRetrieved) + retrieveInfo(); + return patientPosition; +} + +inline const tnlString& tnlDicomPatientInfo::getOrientation() +{ + if(!isObjectRetrieved) + retrieveInfo(); + return patientOrientation; +} diff --git a/src/core/io/DicomSeries.h b/src/core/images/tnlDicomSeries.h similarity index 90% rename from src/core/io/DicomSeries.h rename to src/core/images/tnlDicomSeries.h index a10545ac3f..fed6315636 100644 --- a/src/core/io/DicomSeries.h +++ b/src/core/images/tnlDicomSeries.h @@ -3,10 +3,11 @@ ------------------- begin : Jul 31, 2015 copyright : (C) 2015 by Tomas Oberhuber et al. - - Tomas Oberhuber tomas.oberhuber@fjfi.cvut.cz - Jiri Kafka kafka9@seznam.cz - + + Tomas Oberhuber tomas.oberhuber@fjfi.cvut.cz + Jiri Kafka kafka9@seznam.cz + Pavel Neskudla + ***************************************************************************/ /*************************************************************************** @@ -25,7 +26,7 @@ #include <core/tnlList.h> #include <core/tnlString.h> #include <core/param-types.h> -#include <core/io/DicomHeader.h> +#include <core/images/tnlDicomHeader.h> #include <tnlConfig.h> @@ -58,13 +59,13 @@ struct ImagesInfo * DICOM serie (searches the directory of the file). Call isDicomSeriesLoaded() * function to check if the load was successful. */ -class DicomSeries +class tnlDicomSeries { public: - inline DicomSeries( const char *filePath ); + inline tnlDicomSeries( const char *filePath ); - inline virtual ~DicomSeries(); + inline virtual ~tnlDicomSeries(); inline int getImagesCount(); @@ -115,6 +116,6 @@ class DicomSeries ImagesInfo imagesInfo; }; -#include <core/io/DicomSeries_impl.h> +#include <core/images/tnlDicomSeries_impl.h> #endif // TNLDICOMSERIES_H diff --git a/src/core/io/SeriesInfoObj.h b/src/core/images/tnlDicomSeriesInfo.h similarity index 57% rename from src/core/io/SeriesInfoObj.h rename to src/core/images/tnlDicomSeriesInfo.h index 02baab94ad..4b38abb56a 100644 --- a/src/core/io/SeriesInfoObj.h +++ b/src/core/images/tnlDicomSeriesInfo.h @@ -1,5 +1,25 @@ -#ifndef SERIESINFOOBJ_H -#define SERIESINFOOBJ_H +/*************************************************************************** + tnlDicomSeries.h - description + ------------------- + begin : Jul 19, 2015 + copyright : (C) 2015 by Tomas Oberhuber et al. + + Tomas Oberhuber tomas.oberhuber@fjfi.cvut.cz + Jiri Kafka kafka9@seznam.cz + Pavel Neskudla + ***************************************************************************/ + +/*************************************************************************** + * * + * This program is free software; you can redistribute it and/or modify * + * it under the terms of the GNU General Public License as published by * + * the Free Software Foundation; either version 2 of the License, or * + * (at your option) any later version. * + * * + ***************************************************************************/ + +#ifndef TNLDICOMSERIESINFO_H +#define TNLDICOMSERIESINFO_H #include <core/tnlString.h> #include <tnlConfig.h> @@ -17,13 +37,13 @@ class tnlDicomHeader; * SeriesInfoObj class stores selected informations about DICOM series. * (accesses information via tnlDicomHeader class) */ -class SeriesInfoObj +class tnlDicomSeriesInfo { public: - inline SeriesInfoObj( tnlDicomHeader &dicomHeader ); + inline tnlDicomSeriesInfo( tnlDicomHeader &dicomHeader ); - inline virtual ~SeriesInfoObj(); + inline virtual ~tnlDicomSeriesInfo(); inline const tnlString& getModality(); @@ -90,6 +110,6 @@ class SeriesInfoObj tnlString acquisitionTime; }; -#include <core/io/SeriesInfoObj_impl.h> +#include <core/images/tnlDicomSeriesInfo_impl.h> #endif // SERIESINFOOBJ_H diff --git a/src/core/io/SeriesInfoObj_impl.h b/src/core/images/tnlDicomSeriesInfo_impl.h similarity index 63% rename from src/core/io/SeriesInfoObj_impl.h rename to src/core/images/tnlDicomSeriesInfo_impl.h index e4138e0ed7..5d1b0910f5 100644 --- a/src/core/io/SeriesInfoObj_impl.h +++ b/src/core/images/tnlDicomSeriesInfo_impl.h @@ -1,18 +1,38 @@ -#include "SeriesInfoObj.h" -#include <core/io/DicomHeader.h> +/*************************************************************************** + tnlDicomSeriesInfo_impl.h - description + ------------------- + begin : Jul 19, 2015 + copyright : (C) 2015 by Tomas Oberhuber et al. + + Tomas Oberhuber tomas.oberhuber@fjfi.cvut.cz + Jiri Kafka kafka9@seznam.cz + Pavel Neskudla + ***************************************************************************/ + +/*************************************************************************** + * * + * This program is free software; you can redistribute it and/or modify * + * it under the terms of the GNU General Public License as published by * + * the Free Software Foundation; either version 2 of the License, or * + * (at your option) any later version. * + * * + ***************************************************************************/ + +#include <core/images/tnlDicomSeriesInfo.h> +#include <core/images/tnlDicomHeader.h> #include <stdio.h> -inline SeriesInfoObj::SeriesInfoObj( tnlDicomHeader &dicomHeader) +inline tnlDicomSeriesInfo::tnlDicomSeriesInfo( tnlDicomHeader &dicomHeader) : dicomHeader( dicomHeader ) { isObjectRetrieved = false; } -inline SeriesInfoObj::~SeriesInfoObj() +inline tnlDicomSeriesInfo::~tnlDicomSeriesInfo() { } -inline bool SeriesInfoObj::retrieveInfo() +inline bool tnlDicomSeriesInfo::retrieveInfo() { OFString str; dicomHeader.getFileFormat().getDataset()->findAndGetOFString( DCM_Modality, str ); @@ -73,84 +93,84 @@ inline bool SeriesInfoObj::retrieveInfo() return 0; } -inline const tnlString& SeriesInfoObj::getModality() +inline const tnlString& tnlDicomSeriesInfo::getModality() { if(!isObjectRetrieved) retrieveInfo(); return this->modality; } -inline const tnlString& SeriesInfoObj::getStudyInstanceUID() +inline const tnlString& tnlDicomSeriesInfo::getStudyInstanceUID() { if(!isObjectRetrieved) retrieveInfo(); return this->studyInstanceUID; } -inline const tnlString& SeriesInfoObj::getSeriesInstanceUID() +inline const tnlString& tnlDicomSeriesInfo::getSeriesInstanceUID() { if(!isObjectRetrieved) retrieveInfo(); return this->seriesInstanceUID; } -inline const tnlString& SeriesInfoObj::getSeriesNumber() +inline const tnlString& tnlDicomSeriesInfo::getSeriesNumber() { if(!isObjectRetrieved) retrieveInfo(); return this->seriesNumber; } -inline const tnlString& SeriesInfoObj::getSeriesDescription() +inline const tnlString& tnlDicomSeriesInfo::getSeriesDescription() { if(!isObjectRetrieved) retrieveInfo(); return this->seriesDescription; } -inline const tnlString& SeriesInfoObj::getSeriesDate() +inline const tnlString& tnlDicomSeriesInfo::getSeriesDate() { if(!isObjectRetrieved) retrieveInfo(); return this->seriesDate; } -inline const tnlString& SeriesInfoObj::getSeriesTime() +inline const tnlString& tnlDicomSeriesInfo::getSeriesTime() { if(!isObjectRetrieved) retrieveInfo(); return this->seriesTime; } -inline const tnlString& SeriesInfoObj::getPerformingPhysiciansName() +inline const tnlString& tnlDicomSeriesInfo::getPerformingPhysiciansName() { if(!isObjectRetrieved) retrieveInfo(); return this->performingPhysiciansName; } -inline const tnlString& SeriesInfoObj::getPerformingPhysicianIdentificationSequence() +inline const tnlString& tnlDicomSeriesInfo::getPerformingPhysicianIdentificationSequence() { if(!isObjectRetrieved) retrieveInfo(); return this->performingPhysicianIdentificationSequence; } -inline const tnlString& SeriesInfoObj::getOperatorsName() +inline const tnlString& tnlDicomSeriesInfo::getOperatorsName() { if(!isObjectRetrieved) retrieveInfo(); return this->operatorsName; } -inline const tnlString& SeriesInfoObj::getOperatorIdentificationSequence() +inline const tnlString& tnlDicomSeriesInfo::getOperatorIdentificationSequence() { if(!isObjectRetrieved) retrieveInfo(); return this->operatorIdentificationSequence; } -inline const tnlString& SeriesInfoObj::getAcquisitionTime() +inline const tnlString& tnlDicomSeriesInfo::getAcquisitionTime() { if(!isObjectRetrieved) retrieveInfo(); diff --git a/src/core/io/DicomSeries_impl.h b/src/core/images/tnlDicomSeries_impl.h similarity index 76% rename from src/core/io/DicomSeries_impl.h rename to src/core/images/tnlDicomSeries_impl.h index ca5a76a84f..c9eff56599 100644 --- a/src/core/io/DicomSeries_impl.h +++ b/src/core/images/tnlDicomSeries_impl.h @@ -1,5 +1,25 @@ -#include <core/io/DicomSeries.h> -#include <core/io/SeriesInfoObj.h> +/*************************************************************************** + tnlDicomSeries_impl.h - description + ------------------- + begin : Jul 19, 2015 + copyright : (C) 2015 by Tomas Oberhuber et al. + + Tomas Oberhuber tomas.oberhuber@fjfi.cvut.cz + Jiri Kafka kafka9@seznam.cz + Pavel Neskudla + ***************************************************************************/ + +/*************************************************************************** + * * + * This program is free software; you can redistribute it and/or modify * + * it under the terms of the GNU General Public License as published by * + * the Free Software Foundation; either version 2 of the License, or * + * (at your option) any later version. * + * * + ***************************************************************************/ + +#include <core/images/tnlDicomSeries.h> +#include <core/images/tnlDicomSeriesInfo.h> #include <dirent.h> @@ -23,7 +43,7 @@ int filter(const struct dirent *dire) return 1; } -inline DicomSeries::DicomSeries( const char* filePath) +inline tnlDicomSeries::tnlDicomSeries( const char* filePath) { fileList = new tnlList<tnlString *>(); dicomImage = 0; @@ -38,7 +58,7 @@ inline DicomSeries::DicomSeries( const char* filePath) isLoaded = true; } -inline DicomSeries::~DicomSeries() +inline tnlDicomSeries::~tnlDicomSeries() { fileList->DeepEraseAll(); delete fileList; @@ -58,7 +78,7 @@ inline DicomSeries::~DicomSeries() delete pixelData; } -inline bool DicomSeries::retrieveFileList( const char *filePath) +inline bool tnlDicomSeries::retrieveFileList( const char *filePath) { tnlString filePathString(filePath); tnlString suffix(filePath, filePathString.getLength() - 3); @@ -115,7 +135,7 @@ inline bool DicomSeries::retrieveFileList( const char *filePath) return true; } -inline bool DicomSeries::loadImage(char *filePath, int number) +inline bool tnlDicomSeries::loadImage(char *filePath, int number) { //load header tnlDicomHeader *header = new tnlDicomHeader(); @@ -127,8 +147,8 @@ inline bool DicomSeries::loadImage(char *filePath, int number) } //check series UID - const tnlString& seriesUID = dicomSeriesHeaders.operator [](0)->getSeriesInfoObj().getSeriesInstanceUID(); - if( seriesUID != header->getSeriesInfoObj().getSeriesInstanceUID() ) + const tnlString& seriesUID = dicomSeriesHeaders.operator [](0)->getSeriesInfo().getSeriesInstanceUID(); + if( seriesUID != header->getSeriesInfo().getSeriesInstanceUID() ) { return false; } @@ -253,7 +273,7 @@ inline bool DicomSeries::loadImage(char *filePath, int number) } -inline bool DicomSeries::loadDicomSeries( const char *filePath ) +inline bool tnlDicomSeries::loadDicomSeries( const char *filePath ) { //load list of files if(!retrieveFileList(filePath)) @@ -271,66 +291,66 @@ inline bool DicomSeries::loadDicomSeries( const char *filePath ) return true; } -inline int DicomSeries::getImagesCount() +inline int tnlDicomSeries::getImagesCount() { return imagesInfo.imagesCount; } -inline const Uint16 *DicomSeries::getData() +inline const Uint16 *tnlDicomSeries::getData() { return pixelData; } -inline int DicomSeries::getWidth() +inline int tnlDicomSeries::getWidth() { return imagesInfo.width; } -inline int DicomSeries::getHeight() +inline int tnlDicomSeries::getHeight() { return imagesInfo.height; } -inline int DicomSeries::getColorCount() +inline int tnlDicomSeries::getColorCount() { return imagesInfo.colorsCount; } -inline int DicomSeries::getBitsPerSampleCount() +inline int tnlDicomSeries::getBitsPerSampleCount() { return imagesInfo.bps; } -inline int DicomSeries::getMinColorValue() +inline int tnlDicomSeries::getMinColorValue() { return imagesInfo.minColorValue; } -inline WindowCenterWidth DicomSeries::getWindowDefaults() +inline WindowCenterWidth tnlDicomSeries::getWindowDefaults() { return imagesInfo.window; } -inline int DicomSeries::getMaxColorValue() +inline int tnlDicomSeries::getMaxColorValue() { return imagesInfo.maxColorValue; } -inline void DicomSeries::freeData() +inline void tnlDicomSeries::freeData() { if (pixelData) delete pixelData; pixelData = NULL; } -inline tnlDicomHeader &DicomSeries::getHeader(int image) +inline tnlDicomHeader &tnlDicomSeries::getHeader(int image) { //check user argument if((image > 0) | (image <= dicomSeriesHeaders.getSize())) return *dicomSeriesHeaders.getElement(image); } -inline bool DicomSeries::isDicomSeriesLoaded() +inline bool tnlDicomSeries::isDicomSeriesLoaded() { return isLoaded; } diff --git a/src/core/io/tnlImage.h b/src/core/images/tnlImage.h similarity index 100% rename from src/core/io/tnlImage.h rename to src/core/images/tnlImage.h diff --git a/src/core/io/tnlJPEGImage.h b/src/core/images/tnlJPEGImage.h similarity index 95% rename from src/core/io/tnlJPEGImage.h rename to src/core/images/tnlJPEGImage.h index 6f4aa354b4..de66653f30 100644 --- a/src/core/io/tnlJPEGImage.h +++ b/src/core/images/tnlJPEGImage.h @@ -25,8 +25,8 @@ #endif #include <core/tnlString.h> -#include <core/io/tnlImage.h> -#include <core/io/tnlRegionOfInterest.h> +#include <core/images/tnlImage.h> +#include <core/images/tnlRegionOfInterest.h> #ifdef HAVE_JPEG_H struct my_error_mgr @@ -90,7 +90,7 @@ class tnlJPEGImage : public tnlImage< Index > #endif }; -#include <core/io/tnlJPEGImage_impl.h> +#include <core/images/tnlJPEGImage_impl.h> #endif /* TNLJPEGIMAGE_H */ diff --git a/src/core/io/tnlJPEGImage_impl.h b/src/core/images/tnlJPEGImage_impl.h similarity index 99% rename from src/core/io/tnlJPEGImage_impl.h rename to src/core/images/tnlJPEGImage_impl.h index cc9452da4a..55a396b37f 100644 --- a/src/core/io/tnlJPEGImage_impl.h +++ b/src/core/images/tnlJPEGImage_impl.h @@ -18,7 +18,7 @@ #ifndef TNLJPEGIMAGE_IMPL_H #define TNLJPEGIMAGE_IMPL_H -#include <core/io/tnlJPEGImage.h> +#include <core/images/tnlJPEGImage.h> #include <setjmp.h> #ifdef HAVE_JPEG_H diff --git a/src/core/io/tnlPGMImage.h b/src/core/images/tnlPGMImage.h similarity index 95% rename from src/core/io/tnlPGMImage.h rename to src/core/images/tnlPGMImage.h index 13bf494be3..2481e3d21e 100644 --- a/src/core/io/tnlPGMImage.h +++ b/src/core/images/tnlPGMImage.h @@ -19,8 +19,8 @@ #define TNLPGMIMAGE_H #include <core/tnlString.h> -#include <core/io/tnlImage.h> -#include <core/io/tnlRegionOfInterest.h> +#include <core/images/tnlImage.h> +#include <core/images/tnlRegionOfInterest.h> template< typename Index = int > class tnlPGMImage : public tnlImage< Index > @@ -75,7 +75,7 @@ class tnlPGMImage : public tnlImage< Index > bool fileOpen; }; -#include <core/io/tnlPGMImage_impl.h> +#include <core/images/tnlPGMImage_impl.h> #endif /* TNLPGMIMAGE_H */ diff --git a/src/core/io/tnlPGMImage_impl.h b/src/core/images/tnlPGMImage_impl.h similarity index 99% rename from src/core/io/tnlPGMImage_impl.h rename to src/core/images/tnlPGMImage_impl.h index 962c9b3eec..23f3c011cb 100644 --- a/src/core/io/tnlPGMImage_impl.h +++ b/src/core/images/tnlPGMImage_impl.h @@ -19,7 +19,7 @@ #define TNLPGMIMAGE_IMPL_H #include <cstring> -#include <core/io/tnlPGMImage.h> +#include <core/images/tnlPGMImage.h> template< typename Index > tnlPGMImage< Index >:: diff --git a/src/core/io/tnlPNGImage.h b/src/core/images/tnlPNGImage.h similarity index 95% rename from src/core/io/tnlPNGImage.h rename to src/core/images/tnlPNGImage.h index b907655f2b..6967f08548 100644 --- a/src/core/io/tnlPNGImage.h +++ b/src/core/images/tnlPNGImage.h @@ -25,8 +25,8 @@ #endif #include <core/tnlString.h> -#include <core/io/tnlImage.h> -#include <core/io/tnlRegionOfInterest.h> +#include <core/images/tnlImage.h> +#include <core/images/tnlRegionOfInterest.h> template< typename Index = int > class tnlPNGImage : public tnlImage< Index > @@ -82,7 +82,7 @@ class tnlPNGImage : public tnlImage< Index > #endif }; -#include <core/io/tnlPNGImage_impl.h> +#include <core/images/tnlPNGImage_impl.h> #endif /* TNLPNGIMAGE_H */ diff --git a/src/core/io/tnlPNGImage_impl.h b/src/core/images/tnlPNGImage_impl.h similarity index 99% rename from src/core/io/tnlPNGImage_impl.h rename to src/core/images/tnlPNGImage_impl.h index 36c81c09ef..490c18ec87 100644 --- a/src/core/io/tnlPNGImage_impl.h +++ b/src/core/images/tnlPNGImage_impl.h @@ -18,7 +18,7 @@ #ifndef TNLPNGIMAGE_IMPL_H #define TNLPNGIMAGE_IMPL_H -#include <core/io/tnlPNGImage.h> +#include <core/images/tnlPNGImage.h> template< typename Index > tnlPNGImage< Index >:: diff --git a/src/core/io/tnlRegionOfInterest.h b/src/core/images/tnlRegionOfInterest.h similarity index 95% rename from src/core/io/tnlRegionOfInterest.h rename to src/core/images/tnlRegionOfInterest.h index 0c22f555d5..122c4d009e 100644 --- a/src/core/io/tnlRegionOfInterest.h +++ b/src/core/images/tnlRegionOfInterest.h @@ -20,7 +20,7 @@ #include <config/tnlParameterContainer.h> #include <mesh/tnlGrid.h> -#include <core/io/tnlImage.h> +#include <core/images/tnlImage.h> template< typename Index = int > @@ -54,7 +54,7 @@ class tnlRegionOfInterest Index top, bottom, left, right; }; -#include <core/io/tnlRegionOfInterest_impl.h> +#include <core/images/tnlRegionOfInterest_impl.h> #endif /* TNLREGIONOFINTEREST_H */ diff --git a/src/core/io/tnlRegionOfInterest_impl.h b/src/core/images/tnlRegionOfInterest_impl.h similarity index 100% rename from src/core/io/tnlRegionOfInterest_impl.h rename to src/core/images/tnlRegionOfInterest_impl.h diff --git a/src/core/io/DicomHeader_impl.h b/src/core/io/DicomHeader_impl.h deleted file mode 100644 index 09e8bec261..0000000000 --- a/src/core/io/DicomHeader_impl.h +++ /dev/null @@ -1,54 +0,0 @@ -#include <core/io/DicomHeader.h> -#include <core/io/SeriesInfoObj.h> -#include <core/io/PatientInfoObj.h> -#include <core/io/ImageInfoObj.h> - -inline tnlDicomHeader::tnlDicomHeader() -{ - fileFormat = new DcmFileFormat(); - isLoaded = false; - imageInfoObj = new ImageInfoObj(*this); - patientInfoObj = new PatientInfoObj(*this); - seriesInfoObj = new SeriesInfoObj(*this); -} - -inline tnlDicomHeader::~tnlDicomHeader() -{ - delete imageInfoObj; - delete patientInfoObj; - delete seriesInfoObj; - delete fileFormat; -} - -inline bool tnlDicomHeader::loadFromFile(const char *fileName) -{ - OFCondition status = fileFormat->loadFile(fileName); - if(status.good()) - { - isLoaded = true; - return true; - } - isLoaded = false; - return false; -} - -inline DcmFileFormat &tnlDicomHeader::getFileFormat() -{ - return *fileFormat; -} - -inline ImageInfoObj &tnlDicomHeader::getImageInfoObj() -{ - return *imageInfoObj; -} - -inline PatientInfoObj &tnlDicomHeader::getPatientInfoObj() -{ - return *patientInfoObj; -} - -inline SeriesInfoObj &tnlDicomHeader::getSeriesInfoObj() -{ - return *seriesInfoObj; -} - diff --git a/src/core/io/ImageInfoObj.h b/src/core/io/ImageInfoObj.h deleted file mode 100644 index e570c350cc..0000000000 --- a/src/core/io/ImageInfoObj.h +++ /dev/null @@ -1,83 +0,0 @@ -#ifndef IMAGEINFOOBJ_H -#define IMAGEINFOOBJ_H - -#include <tnlConfig.h> - -#ifdef HAVE_DCMTK_H -#define HAVE_CONFIG_H -#include <dcmtk/dcmdata/dcfilefo.h> -#include <dcmtk/dcmdata/dcdeftag.h> -#endif - -class tnlDicomHeader; - -/***ImageInfoObj class stores selected informations about images. - (accesses information via DicomHeader class) - ***/ -struct ImagePositionToPatient - { - double x, y,z; - }; - -struct DirectionCosines - { - double x, y, z; - }; - -struct ImageOrientationToPatient - { - DirectionCosines row; - DirectionCosines column; - }; - -struct PixelSpacing - { - double x, y; - }; - -class ImageInfoObj -{ - public: - - inline ImageInfoObj( tnlDicomHeader &tnlDicomHeader); - - inline virtual ~ImageInfoObj(); - - inline ImagePositionToPatient getImagePositionToPatient(); - - inline ImageOrientationToPatient getImageOrientationToPatient(); - - inline double getSliceThickness(); - - inline double getSliceLocation(); - - inline PixelSpacing getPixelSpacing(); - - inline int getNumberOfSlices(); - - private: - - tnlDicomHeader &dicomHeader; - - bool retrieveInfo(); - - bool isObjectRetrieved; - - double sliceLocation; - - double sliceThickness; - - ImagePositionToPatient imagePositionToPatient; - - ImageOrientationToPatient imageOrientationToPatient; - - PixelSpacing pixelSpacing; - - int numberOfSlices; - - int width, height, depth; -}; - -#include <core/io/ImageInfoObj_impl.h> - -#endif // IMAGEINFOOBJ_H diff --git a/src/core/io/PatientInfoObj.h b/src/core/io/PatientInfoObj.h deleted file mode 100644 index b14aa3f59b..0000000000 --- a/src/core/io/PatientInfoObj.h +++ /dev/null @@ -1,62 +0,0 @@ -#ifndef PATIENTINFOOBJ_H -#define PATIENTINFOOBJ_H - -class tnlDicomHeader; - -#include <core/tnlString.h> -#include <tnlConfig.h> - -#ifdef HAVE_DCMTK_H -#define HAVE_CONFIG_H -#define HAVE_STD_STRING -#include <dcmtk/dcmdata/dcfilefo.h> -#include <dcmtk/dcmdata/dcdeftag.h> -#include <dcmtk/ofstd/ofstring.h> -#endif - -/*** - * PatientInfoObj class stores selected informations about patient. - * (accesses information via tnlDicomHeader class) - */ -class PatientInfoObj -{ - public: - - inline PatientInfoObj(tnlDicomHeader &atnlDicomHeader); - - inline virtual ~PatientInfoObj(); - - inline const tnlString& getName(); - - inline const tnlString& getSex(); - - inline const tnlString& getID(); - - inline const tnlString& getWeight(); - - inline const tnlString& getPosition(); - - inline const tnlString& getOrientation(); - - private: - - tnlDicomHeader &dicomHeader; - bool retrieveInfo(); - bool isObjectRetrieved; - - tnlString name; - - tnlString sex; - - tnlString ID; - - tnlString weight; - - tnlString patientPosition; - - tnlString patientOrientation; -}; - -#include <core/io/PatientInfoObj_impl.h> - -#endif // PATIENTINFOOBJ_H diff --git a/src/core/io/PatientInfoObj_impl.h b/src/core/io/PatientInfoObj_impl.h deleted file mode 100644 index 50b1e7fb89..0000000000 --- a/src/core/io/PatientInfoObj_impl.h +++ /dev/null @@ -1,80 +0,0 @@ -#include "PatientInfoObj.h" -#include "DicomHeader.h" - -#ifdef HAVE_DCMTK_H -#define HAVE_CONFIG_H -#define HAVE_STD_STRING -#include <dcmtk/ofstd/ofstring.h> -#endif - -inline PatientInfoObj::PatientInfoObj( tnlDicomHeader &dicomHeader ) -: dicomHeader( dicomHeader ) -{ - isObjectRetrieved = false; -} - -inline PatientInfoObj::~PatientInfoObj() -{ -} - -inline bool PatientInfoObj::retrieveInfo() -{ - OFString str; - dicomHeader.getFileFormat().getDataset()->findAndGetOFString(DCM_PatientName, str ); - this->name.setString( str.data() ); - dicomHeader.getFileFormat().getDataset()->findAndGetOFString(DCM_PatientSex, str ); - this->sex.setString( str.data() ); - dicomHeader.getFileFormat().getDataset()->findAndGetOFString(DCM_PatientID, str ); - this->ID.setString( str.data() ); - dicomHeader.getFileFormat().getDataset()->findAndGetOFString(DCM_PatientWeight, str ); - this->weight.setString( str.data() ); - dicomHeader.getFileFormat().getDataset()->findAndGetOFString(DCM_PatientPosition, str ); - this->patientPosition.setString( str.data() ); - dicomHeader.getFileFormat().getDataset()->findAndGetOFString(DCM_PatientOrientation, str ); - this->patientOrientation.setString( str.data() ); - - isObjectRetrieved = true; - return 0; -} - -inline const tnlString& PatientInfoObj::getName() -{ - if(!isObjectRetrieved) - retrieveInfo(); - return name; -} - -inline const tnlString& PatientInfoObj::getSex() -{ - if(!isObjectRetrieved) - retrieveInfo(); - return sex; -} - -inline const tnlString& PatientInfoObj::getID() -{ - if(!isObjectRetrieved) - retrieveInfo(); - return ID; -} - -inline const tnlString& PatientInfoObj::getWeight() -{ - if(!isObjectRetrieved) - retrieveInfo(); - return weight; -} - -inline const tnlString& PatientInfoObj::getPosition() -{ - if(!isObjectRetrieved) - retrieveInfo(); - return patientPosition; -} - -inline const tnlString& PatientInfoObj::getOrientation() -{ - if(!isObjectRetrieved) - retrieveInfo(); - return patientOrientation; -} diff --git a/tools/src/tnl-dicom-reader.cpp b/tools/src/tnl-dicom-reader.cpp index 95c3852eec..60ef828424 100644 --- a/tools/src/tnl-dicom-reader.cpp +++ b/tools/src/tnl-dicom-reader.cpp @@ -18,7 +18,7 @@ #include <tnlConfig.h> #include <config/tnlConfigDescription.h> #include <config/tnlParameterContainer.h> -#include <core/io/DicomSeries.h> +#include <core/images/tnlDicomSeries.h> void setupConfig( tnlConfigDescription& config ) { @@ -47,7 +47,7 @@ bool processDicomSeries( const tnlParameterContainer& parameters ) for( int i = 0; i < dicomSeries.getSize(); i++ ) { const tnlString& series = dicomSeries[ i ]; - DicomSeries( series.getString() ); + tnlDicomSeries( series.getString() ); } } #endif diff --git a/tools/src/tnl-image-converter.cpp b/tools/src/tnl-image-converter.cpp index f4fd82eb5f..e48ef61810 100644 --- a/tools/src/tnl-image-converter.cpp +++ b/tools/src/tnl-image-converter.cpp @@ -19,10 +19,10 @@ #include <config/tnlParameterContainer.h> #include <core/mfilename.h> #include <mesh/tnlGrid.h> -#include <core/io/tnlPGMImage.h> -#include <core/io/tnlPNGImage.h> -#include <core/io/tnlJPEGImage.h> -#include <core/io/tnlRegionOfInterest.h> +#include <core/images/tnlPGMImage.h> +#include <core/images/tnlPNGImage.h> +#include <core/images/tnlJPEGImage.h> +#include <core/images/tnlRegionOfInterest.h> void configSetup( tnlConfigDescription& config ) { -- GitLab