Medical Imaging Interaction Toolkit  2016.11.0
Medical Imaging Interaction Toolkit
mitkNrrdTbssRoiImageWriter.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_NRRDTBSSROIVOL_WRITER__H_
18 #define _MITK_NRRDTBSSROIVOL_WRITER__H_
19 
20 #include <itkProcessObject.h>
22 #include <mitkTbssRoiImage.h>
23 #include "MitkQuantificationExports.h"
24 
25 namespace mitk
26 {
27 
33 class MITKQUANTIFICATION_EXPORT NrrdTbssRoiImageWriter : public mitk::FileWriterWithInformation
34 {
35 public:
36 
37  typedef itk::Image<unsigned char,3> ImageType;
38 
40 
42 
43  itkFactorylessNewMacro(Self)
44  itkCloneMacro(Self)
45 
47 
52  itkSetStringMacro( FileName );
53 
57  itkGetStringMacro( FileName );
58 
62  itkSetStringMacro( FilePrefix );
63 
67  itkGetStringMacro( FilePrefix );
68 
72  itkSetStringMacro( FilePattern );
73 
77  itkGetStringMacro( FilePattern );
78 
83  using ProcessObject::SetInput;
84  void SetInput( InputType* input );
85 
89  InputType* GetInput();
90 
94  itkGetMacro( Success, bool );
95 
99  virtual std::vector<std::string> GetPossibleFileExtensions() override;
100 
101  std::string GetSupportedBaseData() const override;
102 
103  // FileWriterWithInformation methods
104  virtual const char * GetDefaultFilename() override { return "TbssRoiImage.roi"; }
105  virtual const char * GetFileDialogPattern() override { return "Tbss Roi Images (*.roi)"; }
106  virtual const char * GetDefaultExtension() override { return ".roi"; }
107  virtual bool CanWriteBaseDataType(BaseData::Pointer data) override
108  {
109  return (dynamic_cast<mitk::TbssRoiImage*>(data.GetPointer()) != nullptr);
110  }
111 
112 
113  virtual void DoWrite(BaseData::Pointer data) override {
114  if (CanWriteBaseDataType(data)) {
115  this->SetInput(dynamic_cast<mitk::TbssRoiImage*>(data.GetPointer()));
116  this->Update();
117  }
118  }
119 
120 protected:
121 
123 
124  virtual ~NrrdTbssRoiImageWriter();
125 
126  virtual void GenerateData() override;
127 
128  std::string m_FileName;
129 
130  std::string m_FilePrefix;
131 
132  std::string m_FilePattern;
133 
134  bool m_Success;
135 
136 };
137 
138 
139 } // end of namespace mitk
140 
141 #endif
this class encapsulates diffusion volumes (vectorimages not yet supported by mitkImage) ...
virtual bool CanWriteBaseDataType(BaseData::Pointer data) override
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 const char * GetFileDialogPattern() override
virtual const char * GetDefaultExtension() override
#define mitkClassMacro(className, SuperClassName)
Definition: mitkCommon.h:44
Interface class of writers that write data to files.
virtual void DoWrite(BaseData::Pointer data) override
#define mitkWriterMacro
itk::Image< unsigned char, 3 > ImageType