18 #include <itkGDCMImageIO.h> 19 #include <itksys/SystemTools.hxx> 21 #include <dcmtk/dcmdata/dcfilefo.h> 22 #include <dcmtk/dcmdata/dcdeftag.h> 28 std::vector<CustomMimeType *> mimeTypes;
46 myfile.open(path, std::ios::binary);
48 char *buffer =
new char[128];
49 myfile.read(buffer, 128);
50 myfile.read(buffer, 4);
51 if (std::string(buffer).
compare(
"DICM") != 0)
64 if (!itksys::SystemTools::FileExists(path.c_str()))
69 DcmFileFormat dcmFileFormat;
70 OFCondition status = dcmFileFormat.loadFile(path.c_str());
83 if (dcmFileFormat.getDataset()->findAndGetOFString(DCM_Modality, modality).good())
85 if (modality.compare(
"RWV") == 0)
bool AppliesTo(const std::string &path) const override
Checks if the MimeType can handle file at the given location.
DataCollection - Class to facilitate loading/accessing structured data.
virtual bool AppliesTo(const std::string &path) const
Checks if the MimeType can handle file at the given location.
MitkDICOMPMMimeType * Clone() const override
void SetComment(const std::string &comment)
static std::vector< CustomMimeType * > Get()
static std::string DICOMPM_MIMETYPE_NAME()
The CustomMimeType class represents a custom mime-type which may be registered as a service object...
static std::string CATEGORY_IMAGES()
static std::string DEFAULT_BASE_NAME()
bool compare(std::pair< double, int > i, std::pair< double, int > j)
void AddExtension(const std::string &extension)
void SetCategory(const std::string &category)
static MitkDICOMPMMimeType DICOMPM_MIMETYPE()