Medical Imaging Interaction Toolkit  2016.11.0
Medical Imaging Interaction Toolkit
mitkNrrdTbssImageWriter.h
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 
17 #ifndef _MITK_NRRDTBSSVOL_WRITER__H_
18 #define _MITK_NRRDTBSSVOL_WRITER__H_
19 
20 #include <itkProcessObject.h>
22 #include <mitkTbssImage.h>
23 #include "MitkQuantificationExports.h"
24 
25 namespace mitk
26 {
27 
33 class MITKQUANTIFICATION_EXPORT NrrdTbssImageWriter : public mitk::FileWriterWithInformation
34 {
35 public:
36 
38 
40 
41  itkFactorylessNewMacro(Self)
42  itkCloneMacro(Self)
43 
45 
50  itkSetStringMacro( FileName )
51 
55  itkGetStringMacro( FileName )
56 
60  itkSetStringMacro( FilePrefix )
61 
65  itkGetStringMacro( FilePrefix )
66 
70  itkSetStringMacro( FilePattern )
71 
75  itkGetStringMacro( FilePattern )
76 
81  using ProcessObject::SetInput;
82  void SetInput( InputType* input );
86  InputType* GetInput();
87 
91  itkGetMacro( Success, bool )
92 
96  virtual std::vector<std::string> GetPossibleFileExtensions() override;
97 
98  std::string GetSupportedBaseData() const override;
99 
100  // FileWriterWithInformation methods
101  virtual const char * GetDefaultFilename() override { return "TbssImage.tbss"; }
102  virtual const char * GetFileDialogPattern() override { return "Tbss Images (*.tbss)"; }
103  virtual const char * GetDefaultExtension() override { return ".tbss"; }
104  virtual bool CanWriteBaseDataType(BaseData::Pointer data) override
105  {
106  return (dynamic_cast<mitk::TbssImage*>(data.GetPointer()) != nullptr);
107  }
108 
109 
110  virtual void DoWrite(BaseData::Pointer data) override {
111  if (CanWriteBaseDataType(data)) {
112  this->SetInput(dynamic_cast<mitk::TbssImage*>(data.GetPointer()));
113  this->Update();
114  }
115  }
116 
117 protected:
118 
120 
121  virtual ~NrrdTbssImageWriter();
122 
123  virtual void GenerateData() override;
124 
125  std::string m_FileName;
126 
127  std::string m_FilePrefix;
128 
129  std::string m_FilePattern;
130 
131  bool m_Success;
132 
133 
134 
135 
136 };
137 
138 
139 } // end of namespace mitk
140 
141 
142 
143 #endif
static void Update(vtkPolyData *)
Definition: mitkSurface.cpp:35
STL namespace.
DataCollection - Class to facilitate loading/accessing structured data.
Interface for FileWriters with extra information. Should be merged into FileWriter.
virtual bool CanWriteBaseDataType(BaseData::Pointer data) override
#define mitkClassMacro(className, SuperClassName)
Definition: mitkCommon.h:44
virtual const char * GetFileDialogPattern() override
Interface class of writers that write data to files.
#define mitkWriterMacro
virtual void DoWrite(BaseData::Pointer data) override
virtual const char * GetDefaultExtension() override
this class encapsulates diffusion volumes (vectorimages not yet supported by mitkImage) ...
Definition: mitkTbssImage.h:34