diff --git a/Modules/DICOMReader/files.cmake b/Modules/DICOMReader/files.cmake index 4c2aee0fef..d92bbc61ce 100644 --- a/Modules/DICOMReader/files.cmake +++ b/Modules/DICOMReader/files.cmake @@ -1,30 +1,32 @@ set(H_FILES mitkDICOMFileReader.h mitkDICOMImageFrameInfo.h mitkDICOMImageBlockDescriptor.h mitkDICOMGDCMImageFrameInfo.h mitkDICOMITKSeriesGDCMReader.h mitkDICOMDatasetSorter.h mitkDICOMFilenameSorter.h mitkDICOMEnums.h mitkDICOMTagBasedSorter.h mitkDICOMSortCriterion.h mitkDICOMSortByTag.h mitkEquiDistantBlocksSorter.h + mitkClassicDICOMSeriesReader.h ) set(CPP_FILES mitkDICOMFileReader.cpp mitkDICOMImageBlockDescriptor.cpp mitkDICOMITKSeriesGDCMReader.cpp mitkDICOMDatasetSorter.cpp mitkDICOMFilenameSorter.cpp mitkDICOMTagBasedSorter.cpp mitkDICOMGDCMImageFrameInfo.cpp mitkDICOMImageFrameInfo.cpp mitkDICOMSortCriterion.cpp mitkDICOMSortByTag.cpp mitkITKDICOMSeriesReaderHelper.cpp mitkEquiDistantBlocksSorter.cpp mitkGantryTiltInformation.cpp + mitkClassicDICOMSeriesReader.cpp ) diff --git a/Modules/DICOMReader/mitkClassicDICOMSeriesReader.cpp b/Modules/DICOMReader/mitkClassicDICOMSeriesReader.cpp new file mode 100644 index 0000000000..11c5d64281 --- /dev/null +++ b/Modules/DICOMReader/mitkClassicDICOMSeriesReader.cpp @@ -0,0 +1,79 @@ +/*=================================================================== + +The Medical Imaging Interaction Toolkit (MITK) + +Copyright (c) German Cancer Research Center, +Division of Medical and Biological Informatics. +All rights reserved. + +This software is distributed WITHOUT ANY WARRANTY; without +even the implied warranty of MERCHANTABILITY or FITNESS FOR +A PARTICULAR PURPOSE. + +See LICENSE.txt or http://www.mitk.org for details. + +===================================================================*/ + +#include "mitkClassicDICOMSeriesReader.h" + +#include "mitkDICOMTagBasedSorter.h" +#include "mitkDICOMSortByTag.h" + + +mitk::ClassicDICOMSeriesReader +::ClassicDICOMSeriesReader() +:DICOMITKSeriesGDCMReader() +{ + mitk::DICOMTagBasedSorter::Pointer tagSorter = mitk::DICOMTagBasedSorter::New(); + + // all the things that split by tag in mitk::DicomSeriesReader + tagSorter->AddDistinguishingTag( std::make_pair(0x0028, 0x0010) ); // Number of Rows + tagSorter->AddDistinguishingTag( std::make_pair(0x0028, 0x0011) ); // Number of Columns + tagSorter->AddDistinguishingTag( std::make_pair(0x0028, 0x0030) ); // Pixel Spacing + tagSorter->AddDistinguishingTag( std::make_pair(0x0018, 0x1164) ); // Imager Pixel Spacing + tagSorter->AddDistinguishingTag( std::make_pair(0x0020, 0x0037) ); // Image Orientation (Patient) + tagSorter->AddDistinguishingTag( std::make_pair(0x0020, 0x000e) ); // Series Instance UID + tagSorter->AddDistinguishingTag( std::make_pair(0x0018, 0x0050) ); // Slice Thickness + tagSorter->AddDistinguishingTag( std::make_pair(0x0028, 0x0008) ); // Number of Frames + tagSorter->AddDistinguishingTag( std::make_pair(0x0020, 0x0052) ); // Frame of Reference UID + + // a sorter... + // TODO ugly syntax, improve.. + mitk::DICOMSortCriterion::ConstPointer sorting = + mitk::DICOMSortByTag::New( std::make_pair(0x0020, 0x0013), // instance number + mitk::DICOMSortByTag::New( std::make_pair(0x0020, 0x0012), // aqcuisition number + mitk::DICOMSortByTag::New( std::make_pair(0x0008, 0x0032), // aqcuisition time + mitk::DICOMSortByTag::New( std::make_pair(0x0018, 0x1060), // trigger time + mitk::DICOMSortByTag::New( std::make_pair(0x0008, 0x0018) // SOP instance UID (last resort, not really meaningful but decides clearly) + ).GetPointer() + ).GetPointer() + ).GetPointer() + ).GetPointer() + ).GetPointer(); + tagSorter->SetSortCriterion( sorting ); + + // define above sorting for this class + this->AddSortingElement( tagSorter ); +} + +mitk::ClassicDICOMSeriesReader +::ClassicDICOMSeriesReader(const ClassicDICOMSeriesReader& other ) +:DICOMITKSeriesGDCMReader(other) +{ +} + +mitk::ClassicDICOMSeriesReader +::~ClassicDICOMSeriesReader() +{ +} + +mitk::ClassicDICOMSeriesReader& +mitk::ClassicDICOMSeriesReader +::operator=(const ClassicDICOMSeriesReader& other) +{ + if (this != &other) + { + DICOMITKSeriesGDCMReader::operator=(other); + } + return *this; +} diff --git a/Modules/DICOMReader/mitkClassicDICOMSeriesReader.h b/Modules/DICOMReader/mitkClassicDICOMSeriesReader.h new file mode 100644 index 0000000000..b6011dda63 --- /dev/null +++ b/Modules/DICOMReader/mitkClassicDICOMSeriesReader.h @@ -0,0 +1,50 @@ +/*=================================================================== + +The Medical Imaging Interaction Toolkit (MITK) + +Copyright (c) German Cancer Research Center, +Division of Medical and Biological Informatics. +All rights reserved. + +This software is distributed WITHOUT ANY WARRANTY; without +even the implied warranty of MERCHANTABILITY or FITNESS FOR +A PARTICULAR PURPOSE. + +See LICENSE.txt or http://www.mitk.org for details. + +===================================================================*/ + +#ifndef mitkClassicDICOMSeriesReader_h +#define mitkClassicDICOMSeriesReader_h + +#include "mitkDICOMITKSeriesGDCMReader.h" + +#include "DICOMReaderExports.h" + +namespace mitk +{ + +/* + \brief Sorting and grouping like mitk::DicomSeriesReader until 2013. +*/ +class DICOMReader_EXPORT ClassicDICOMSeriesReader : public DICOMITKSeriesGDCMReader +{ + public: + + mitkClassMacro( ClassicDICOMSeriesReader, DICOMITKSeriesGDCMReader ); + mitkCloneMacro( ClassicDICOMSeriesReader ); + itkNewMacro( ClassicDICOMSeriesReader ); + + protected: + + ClassicDICOMSeriesReader(); + virtual ~ClassicDICOMSeriesReader(); + + ClassicDICOMSeriesReader(const ClassicDICOMSeriesReader& other); + ClassicDICOMSeriesReader& operator=(const ClassicDICOMSeriesReader& other); +}; + +} + +#endif +