diff --git a/Modules/DICOMQI/autoload/IO/mitkDICOMQIIOMimeTypes.cpp b/Modules/DICOMQI/autoload/IO/mitkDICOMQIIOMimeTypes.cpp index c940129ca4..e85d8710fb 100644 --- a/Modules/DICOMQI/autoload/IO/mitkDICOMQIIOMimeTypes.cpp +++ b/Modules/DICOMQI/autoload/IO/mitkDICOMQIIOMimeTypes.cpp @@ -1,132 +1,132 @@ /*=================================================================== 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 "mitkDICOMQIIOMimeTypes.h" #include "mitkIOMimeTypes.h" #include #include #include #include #include namespace mitk { std::vector MitkDICOMQIIOMimeTypes::Get() { std::vector mimeTypes; // order matters here (descending rank for mime types) mimeTypes.push_back(DICOMQI_MIMETYPE().Clone()); return mimeTypes; } // Mime Types MitkDICOMQIIOMimeTypes::MitkDICOMQIMimeType::MitkDICOMQIMimeType() : CustomMimeType(DICOMQI_MIMETYPE_NAME()) { this->AddExtension("dcm"); this->SetCategory(IOMimeTypes::CATEGORY_IMAGES()); - this->SetComment("DICOM SEG"); + this->SetComment("DICOM QI"); } bool MitkDICOMQIIOMimeTypes::MitkDICOMQIMimeType::AppliesTo(const std::string &path) const { std::ifstream myfile; myfile.open (path, std::ios::binary); // myfile.seekg (128); char *buffer = new char [128]; myfile.read (buffer,128); myfile.read (buffer,4); if (std::string(buffer).compare("DICM")!=0) { delete[] buffer; return false; } delete[] buffer; bool canRead(CustomMimeType::AppliesTo(path)); // fix for bug 18572 // Currently this function is called for writing as well as reading, in that case // the image information can of course not be read // This is a bug, this function should only be called for reading. if (!itksys::SystemTools::FileExists(path.c_str())) { return canRead; } // end fix for bug 18572 DcmFileFormat dcmFileFormat; OFCondition status = dcmFileFormat.loadFile(path.c_str()); if (status.bad()) { canRead = false; } if (!canRead) { return canRead; } OFString modality; OFString sopClassUID; if (dcmFileFormat.getDataset()->findAndGetOFString(DCM_Modality, modality).good() && dcmFileFormat.getDataset()->findAndGetOFString(DCM_SOPClassUID, sopClassUID).good()) { if (modality.compare("SEG") == 0) {//atm we could read SegmentationStorage files. Other storage classes with "SEG" modality, e.g. SurfaceSegmentationStorage (1.2.840.10008.5.1.4.1.1.66.5), are not supported yet. if (sopClassUID.compare("1.2.840.10008.5.1.4.1.1.66.4") == 0) { canRead = true; } else { canRead = false; } } else { canRead = false; } } return canRead; } MitkDICOMQIIOMimeTypes::MitkDICOMQIMimeType *MitkDICOMQIIOMimeTypes::MitkDICOMQIMimeType::Clone() const { return new MitkDICOMQIMimeType(*this); } MitkDICOMQIIOMimeTypes::MitkDICOMQIMimeType MitkDICOMQIIOMimeTypes::DICOMQI_MIMETYPE() { return MitkDICOMQIMimeType(); } // Names std::string MitkDICOMQIIOMimeTypes::DICOMQI_MIMETYPE_NAME() { // create a unique and sensible name for this mime type - static std::string name = IOMimeTypes::DEFAULT_BASE_NAME() + ".image.dicom.seg"; + static std::string name = IOMimeTypes::DEFAULT_BASE_NAME() + ".image.dicom.qi"; return name; } } diff --git a/Modules/DICOMQI/autoload/IO/mitkDICOMQIIOMimeTypes.h b/Modules/DICOMQI/autoload/IO/mitkDICOMQIIOMimeTypes.h index 625cedd88e..472acd98ef 100644 --- a/Modules/DICOMQI/autoload/IO/mitkDICOMQIIOMimeTypes.h +++ b/Modules/DICOMQI/autoload/IO/mitkDICOMQIIOMimeTypes.h @@ -1,53 +1,53 @@ /*=================================================================== 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 MITKDICOMQIIOMIMETYPES_H #define MITKDICOMQIIOMIMETYPES_H #include "mitkCustomMimeType.h" #include namespace mitk { - /// Provides the custom mime types for dicom segmentation objects loaded with DCMQI + /// Provides the custom mime types for dicom qi objects loaded with DCMQI class MitkDICOMQIIOMimeTypes { public: - /** Mime type that parses dicom files to determine whether they are dicom segmentation objects. + /** Mime type that parses dicom files to determine whether they are dicom qi objects. */ class MitkDICOMQIMimeType : public CustomMimeType { public: MitkDICOMQIMimeType(); bool AppliesTo(const std::string &path) const override; MitkDICOMQIMimeType *Clone() const override; }; static MitkDICOMQIMimeType DICOMQI_MIMETYPE(); static std::string DICOMQI_MIMETYPE_NAME(); // Get all Mime Types static std::vector Get(); private: // purposely not implemented MitkDICOMQIIOMimeTypes(); MitkDICOMQIIOMimeTypes(const MitkDICOMQIIOMimeTypes &); }; } #endif // MITKDICOMQIIOMIMETYPES_H