19 #include <itksys/SystemTools.hxx>
20 #include <itkNrrdImageIO.h>
21 #include <itkMetaDataDictionary.h>
22 #include <itkMetaDataObject.h>
30 std::vector<CustomMimeType*> mimeTypes;
47 std::string category =
"Diffusion Weighted Image";
64 if( ! itksys::SystemTools::FileExists( path.c_str() ) )
70 std::string ext = this->GetExtension( path );
71 ext = itksys::SystemTools::LowerCase( ext );
78 io->SetFileName(path);
81 io->ReadImageInformation();
83 itk::MetaDataDictionary imgMetaDictionary = io->GetMetaDataDictionary();
84 std::vector<std::string> imgMetaKeys = imgMetaDictionary.GetKeys();
85 std::vector<std::string>::const_iterator itKey = imgMetaKeys.begin();
86 std::string metaString;
88 for (; itKey != imgMetaKeys.end(); itKey ++)
90 itk::ExposeMetaData<std::string> (imgMetaDictionary, *itKey, metaString);
91 if (itKey->find(
"modality") != std::string::npos)
93 if (metaString.find(
"DWMRI") != std::string::npos)
101 catch(
const itk::ExceptionObject &e )
125 std::string category =
"Diffusion Weighted Image";
127 this->
SetComment(
"Diffusion Weighted Images");
142 if (!itksys::SystemTools::FileExists(path.c_str()))
148 std::string ext = this->GetExtension(path);
149 ext = itksys::SystemTools::LowerCase(ext);
153 if (ext ==
".nii" || ext ==
".nii.gz")
155 std::string base = itksys::SystemTools::GetFilenamePath(path) +
"/"
156 + this->GetFilenameWithoutExtension(path);
158 if (itksys::SystemTools::FileExists(std::string(base +
".bvec").c_str())
159 && itksys::SystemTools::FileExists(std::string(base +
".bval").c_str())
165 if (itksys::SystemTools::FileExists(std::string(base +
".bvecs").c_str())
166 && itksys::SystemTools::FileExists(std::string(base +
".bvals").c_str())
192 std::string category =
"Tensor Images";
193 mimeType.
SetComment(
"Diffusion Tensor Images");
203 std::string category =
"Q-Ball Images";
204 mimeType.
SetComment(
"Diffusion Q-Ball Images");
240 static std::string description =
"Diffusion Weighted Images";
246 static std::string description =
"Diffusion Weighted Images";
252 static std::string description =
"Diffusion Tensor Images";
258 static std::string description =
"Q-Ball Images";
itk::SmartPointer< Self > Pointer
static CustomMimeType QBI_MIMETYPE()
DiffusionImageNrrdMimeType()
static DiffusionImageNrrdMimeType DWI_NRRD_MIMETYPE()
static std::string DTI_MIMETYPE_DESCRIPTION()
DataCollection - Class to facilitate loading/accessing structured data.
static std::string DWI_NRRD_MIMETYPE_DESCRIPTION()
virtual bool AppliesTo(const std::string &path) const
Checks if the MimeType can handle file at the given location.
void SetComment(const std::string &comment)
virtual bool AppliesTo(const std::string &path) const override
Checks if the MimeType can handle file at the given location.
static std::string QBI_MIMETYPE_DESCRIPTION()
virtual bool AppliesTo(const std::string &path) const override
Checks if the MimeType can handle file at the given location.
The CustomMimeType class represents a custom mime-type which may be registered as a service object...
static std::string DEFAULT_BASE_NAME()
virtual DiffusionImageNiftiMimeType * Clone() const override
static std::string DWI_NIFTI_MIMETYPE_DESCRIPTION()
static std::string DTI_MIMETYPE_NAME()
DiffusionImageNiftiMimeType()
void AddExtension(const std::string &extension)
void SetCategory(const std::string &category)
static std::vector< CustomMimeType * > Get()
static CustomMimeType DTI_MIMETYPE()
static std::string DWI_NIFTI_MIMETYPE_NAME()
static std::string QBI_MIMETYPE_NAME()
virtual DiffusionImageNrrdMimeType * Clone() const override
static DiffusionImageNiftiMimeType DWI_NIFTI_MIMETYPE()
static std::string DWI_NRRD_MIMETYPE_NAME()
static itkEventMacro(BoundingShapeInteractionEvent, itk::AnyEvent) class MITKBOUNDINGSHAPE_EXPORT BoundingShapeInteractor Pointer New()
Basic interaction methods for mitk::GeometryData.