Medical Imaging Interaction Toolkit  2016.11.0
Medical Imaging Interaction Toolkit
mitkDiffusionIOMimeTypes.cpp
Go to the documentation of this file.
1 /*===================================================================
2 
3 The Medical Imaging Interaction Toolkit (MITK)
4 
5 Copyright (c) German Cancer Research Center,
6 Division of Medical and Biological Informatics.
7 All rights reserved.
8 
9 This software is distributed WITHOUT ANY WARRANTY; without
10 even the implied warranty of MERCHANTABILITY or FITNESS FOR
11 A PARTICULAR PURPOSE.
12 
13 See LICENSE.txt or http://www.mitk.org for details.
14 
15 ===================================================================*/
16 
18 #include "mitkIOMimeTypes.h"
19 #include <itksys/SystemTools.hxx>
20 #include <itkNrrdImageIO.h>
21 #include <itkMetaDataDictionary.h>
22 #include <itkMetaDataObject.h>
23 #include <mitkLogMacros.h>
24 
25 namespace mitk
26 {
27 
28 std::vector<CustomMimeType*> DiffusionIOMimeTypes::Get()
29 {
30  std::vector<CustomMimeType*> mimeTypes;
31 
32  // order matters here (descending rank for mime types)
33 
34  mimeTypes.push_back(FIBERBUNDLE_VTK_MIMETYPE().Clone());
35  mimeTypes.push_back(FIBERBUNDLE_TRK_MIMETYPE().Clone());
36 
37  mimeTypes.push_back(CONNECTOMICS_MIMETYPE().Clone());
38 
39  mimeTypes.push_back(PLANARFIGURECOMPOSITE_MIMETYPE().Clone());
40 
41  return mimeTypes;
42 }
43 
44 // Mime Types
46 {
48  std::string category = "Planar Figure Composite";
49  mimeType.SetComment("Planar Figure Composite");
50  mimeType.SetCategory(category);
51  mimeType.AddExtension("pfc");
52  return mimeType;
53 }
54 
56 {
58  std::string category = "VTK Fibers";
59  mimeType.SetComment("VTK Fibers");
60  mimeType.SetCategory(category);
61  mimeType.AddExtension("fib");
62 // mimeType.AddExtension("vtk");
63  return mimeType;
64 }
65 
67 {
69  std::string category = "TrackVis Fibers";
70  mimeType.SetComment("TrackVis Fibers");
71  mimeType.SetCategory(category);
72  mimeType.AddExtension("trk");
73  return mimeType;
74 }
75 
77 {
79  std::string category = "Connectomics Networks";
80  mimeType.SetComment("Connectomics Networks Files");
81  mimeType.SetCategory(category);
82  mimeType.AddExtension("cnf");
83  return mimeType;
84 }
85 
87 {
89  std::string category = "Connectomics Networks export";
90  mimeType.SetComment("Connectomics Matrix Files");
91  mimeType.SetCategory(category);
92  mimeType.AddExtension("mat");
93  return mimeType;
94 }
95 
97 {
99  std::string category = "Connectomics Networks export";
100  mimeType.SetComment("Connectomics Connection Lists");
101  mimeType.SetCategory(category);
102  mimeType.AddExtension("txt");
103  return mimeType;
104 }
105 
106 // Names
108 {
109  static std::string name = IOMimeTypes::DEFAULT_BASE_NAME() + ".FiberBundle.vtk";
110  return name;
111 }
112 
114 {
115  static std::string name = IOMimeTypes::DEFAULT_BASE_NAME() + ".FiberBundle.trk";
116  return name;
117 }
118 
120 {
121  static std::string name = IOMimeTypes::DEFAULT_BASE_NAME() + ".cnf";
122  return name;
123 }
124 
126 {
127  static std::string name = IOMimeTypes::DEFAULT_BASE_NAME() + ".mat";
128  return name;
129 }
130 
132 {
133  static std::string name = IOMimeTypes::DEFAULT_BASE_NAME() + ".txt";
134  return name;
135 }
136 
138 {
139  static std::string name = IOMimeTypes::DEFAULT_BASE_NAME() + ".pfc";
140  return name;
141 }
142 
143 // Descriptions
145 {
146  static std::string description = "Fiberbundles";
147  return description;
148 }
149 
151 {
152  static std::string description = "Connectomics Networks";
153  return description;
154 }
155 
157 {
158  static std::string description = "Planar Figure Composite";
159  return description;
160 }
161 
162 }
static std::string CONNECTOMICS_MATRIX_MIMETYPE_NAME()
static CustomMimeType FIBERBUNDLE_TRK_MIMETYPE()
static std::string PLANARFIGURECOMPOSITE_MIMETYPE_NAME()
Pointer Clone() const
static std::string CONNECTOMICS_LIST_MIMETYPE_NAME()
static std::string CONNECTOMICS_MIMETYPE_DESCRIPTION()
static std::string FIBERBUNDLE_MIMETYPE_DESCRIPTION()
static CustomMimeType CONNECTOMICS_MIMETYPE()
DataCollection - Class to facilitate loading/accessing structured data.
static std::string FIBERBUNDLE_VTK_MIMETYPE_NAME()
void SetComment(const std::string &comment)
static std::string CONNECTOMICS_MIMETYPE_NAME()
static CustomMimeType CONNECTOMICS_LIST_MIMETYPE()
The CustomMimeType class represents a custom mime-type which may be registered as a service object...
static std::vector< CustomMimeType * > Get()
static std::string DEFAULT_BASE_NAME()
static std::string FIBERBUNDLE_TRK_MIMETYPE_NAME()
void AddExtension(const std::string &extension)
static CustomMimeType PLANARFIGURECOMPOSITE_MIMETYPE()
static CustomMimeType FIBERBUNDLE_VTK_MIMETYPE()
void SetCategory(const std::string &category)
static CustomMimeType CONNECTOMICS_MATRIX_MIMETYPE()
static std::string PLANARFIGURECOMPOSITE_MIMETYPE_DESCRIPTION()