Slicer  4.11
Slicer is a multi-platform, free and open source software package for visualization and medical image computing
itkMRMLIDImageIO.h
Go to the documentation of this file.
1 /*=auto=========================================================================
2 
3  Portions (c) Copyright 2005 Brigham and Women's Hospital (BWH) All Rights Reserved.
4 
5  See COPYRIGHT.txt
6  or http://www.slicer.org/copyright/copyright.txt for details.
7 
8 =========================================================================auto=*/
9 
10 #ifndef itkMRMLIDImageIO_h
11 #define itkMRMLIDImageIO_h
12 
13 #ifdef _MSC_VER
14 #pragma warning ( disable : 4786 )
15 #endif
16 
17 #include <vtkVersion.h>
18 
19 #include "itkMRMLIDIOExport.h"
20 
21 #include "itkImageIOBase.h"
22 
23 class vtkMRMLVolumeNode;
26 class vtkImageData;
27 class vtkMRMLNode;
28 
29 namespace itk
30 {
54 class MRMLIDImageIO_EXPORT MRMLIDImageIO : public ImageIOBase
55 {
56 public:
59  typedef ImageIOBase Superclass;
60  typedef SmartPointer<Self> Pointer;
61 
63  itkNewMacro(Self);
64 
66  itkTypeMacro(MRMLIDImageIO, ImageIOBase);
67 
70  bool CanReadFile(const char*) override;
71 
72  virtual bool CanUseOwnBuffer();
73  virtual void ReadUsingOwnBuffer();
74  virtual void * GetOwnBuffer();
75 
77  void ReadImageInformation() override;
78 
80  void Read(void* buffer) override;
81 
82  /*-------- This part of the interfaces deals with writing data. ----- */
83 
86  bool CanWriteFile(const char*) override;
87 
90  void WriteImageInformation() override;
91 
94  void Write(const void* buffer) override;
95 
96 protected:
97  MRMLIDImageIO();
98  ~MRMLIDImageIO() override;
99  void PrintSelf(std::ostream& os, Indent indent) const override;
100 
102  virtual void WriteImageInformation(vtkMRMLVolumeNode *, vtkImageData*,
103  int *scalarType, int *numberOfScalarComponents);
104 
107  void SetDWDictionaryValues(MetaDataDictionary &dict,
109 
112  void SetDTDictionaryValues(MetaDataDictionary &dict,
114 
117  void SetDWNodeValues(vtkMRMLDiffusionWeightedVolumeNode *dw,
118  MetaDataDictionary &dict);
119 
122  void SetDTNodeValues(vtkMRMLDiffusionImageVolumeNode *di,
123  MetaDataDictionary &dict);
124 
125  void RequestModified(vtkMRMLNode* modifiedObject);
126 
127 private:
128  MRMLIDImageIO(const Self&) = delete;
129  void operator=(const Self&) = delete;
130 
131  bool IsAVolumeNode(const char*);
132  vtkMRMLVolumeNode* FileNameToVolumeNodePtr(const char*);
133 
134  std::string m_Scheme;
135  std::string m_Authority;
136  std::string m_SceneID;
137  std::string m_NodeID;
138 
139 };
140 
141 
142 }
143 #endif
SmartPointer< Self > Pointer
ImageIOBase Superclass
Simplified inverse ITK transforms.
MRML node for representing a volume (image stack).
MRMLIDImageIO Self
MRML node for representing diffusion weighted MRI volume.
MRML node for representing diffusion weighted MRI volume.
#define MRMLIDImageIO_EXPORT
Abstract Superclass for all specific types of MRML nodes.
Definition: vtkMRMLNode.h:167
ImageIO object for reading and writing imaegs from a MRML scene.