[Insight-developers] Re: Meta data dictionary passing through the
ITK pipeline
Douglas Alan
douglas_alan at harvard.edu
Tue Jul 24 17:18:06 EDT 2007
Hi, Jim -- enclosed is a set of diffs for the changes you made to
Slicer3 at NA-MIC Programming Week that provide for propagation of an
input file's MetaDataDictionary to a MRML node. Thanks muchly for your
help in getting us past this roadblock!
|>oug
diff -ru slicer-3beta.orig/Slicer3/Libs/MRML/vtkMRMLVolumeArchetypeStorageNode.cxx slicer-3beta/Slicer3/Libs/MRML/vtkMRMLVolumeArchetypeStorageNode.cxx
--- slicer-3beta.orig/Slicer3/Libs/MRML/vtkMRMLVolumeArchetypeStorageNode.cxx 2007-02-06 18:06:46.000000000 -0500
+++ slicer-3beta/Slicer3/Libs/MRML/vtkMRMLVolumeArchetypeStorageNode.cxx 2007-06-26 13:59:35.000000000 -0400
@@ -212,6 +212,7 @@
}
// set volume attributes
volNode->SetStorageNodeID(this->GetID());
+ volNode->SetMetaDataDictionary( reader->GetMetaDataDictionary() );
//TODO update scene to send Modified event
vtkImageChangeInformation *ici = vtkImageChangeInformation::New();
diff -ru slicer-3beta.orig/Slicer3/Libs/MRML/vtkMRMLVolumeNode.cxx slicer-3beta/Slicer3/Libs/MRML/vtkMRMLVolumeNode.cxx
--- slicer-3beta.orig/Slicer3/Libs/MRML/vtkMRMLVolumeNode.cxx 2007-06-26 16:29:25.000000000 -0400
+++ slicer-3beta/Slicer3/Libs/MRML/vtkMRMLVolumeNode.cxx 2007-06-26 16:43:23.000000000 -0400
@@ -622,8 +622,6 @@
{
this->Dictionary = dictionary;
this->Modified();
-
- vtkWarningMacro(<< dictionary );
}
const itk::MetaDataDictionary&
diff -ru slicer-3beta.orig/Slicer3/Libs/MRML/vtkMRMLVolumeNode.h slicer-3beta/Slicer3/Libs/MRML/vtkMRMLVolumeNode.h
--- slicer-3beta.orig/Slicer3/Libs/MRML/vtkMRMLVolumeNode.h 2007-01-09 00:23:39.000000000 -0500
+++ slicer-3beta/Slicer3/Libs/MRML/vtkMRMLVolumeNode.h 2007-06-26 14:09:33.000000000 -0400
@@ -34,6 +34,8 @@
#include "vtkMRMLVolumeDisplayNode.h"
#include "vtkMRMLTransformableNode.h"
+#include "itkMetaDataDictionary.h"
+
class vtkImageData;
class VTK_MRML_EXPORT vtkMRMLVolumeNode : public vtkMRMLTransformableNode
@@ -165,6 +167,13 @@
ImageDataModifiedEvent = 18001,
};
//ETX
+
+//BTX
+ // Description:
+ // Set/Get the ITK MetaDataDictionary
+ void SetMetaDataDictionary( const itk::MetaDataDictionary& );
+ const itk::MetaDataDictionary& GetMetaDataDictionary() const;
+//ETX
protected:
vtkMRMLVolumeNode();
@@ -189,6 +198,10 @@
vtkImageData *ImageData;
vtkMRMLVolumeDisplayNode *VolumeDisplayNode;
+ //BTX
+ itk::MetaDataDictionary Dictionary;
+ //ETX
+
};
#endif
diff -ru slicer-3beta.orig/Slicer3/Libs/vtkITK/vtkITKArchetypeImageSeriesReader.cxx slicer-3beta/Slicer3/Libs/vtkITK/vtkITKArchetypeImageSeriesReader.cxx
--- slicer-3beta.orig/Slicer3/Libs/vtkITK/vtkITKArchetypeImageSeriesReader.cxx 2007-06-26 14:18:02.000000000 -0400
+++ slicer-3beta/Slicer3/Libs/vtkITK/vtkITKArchetypeImageSeriesReader.cxx 2007-06-26 14:19:42.000000000 -0400
@@ -503,7 +503,7 @@
// Copy the MetaDataDictionary from the ITK layer to the VTK layer
if (imageIO.GetPointer() != NULL)
{
- this->Dictionary = imageIO.GetMetaDataDictionary();
+ this->Dictionary = imageIO->GetMetaDataDictionary();
}
}
@@ -516,7 +516,7 @@
vtkErrorMacro(<<"The subclass has not defined anything for ExecuteData!\n");
}
-const MetaDataDictionary&
+const itk::MetaDataDictionary&
vtkITKArchetypeImageSeriesReader
::GetMetaDataDictionary() const
{
diff -ru slicer-3beta.orig/Slicer3/Libs/vtkITK/vtkITKArchetypeImageSeriesReader.h slicer-3beta/Slicer3/Libs/vtkITK/vtkITKArchetypeImageSeriesReader.h
--- slicer-3beta.orig/Slicer3/Libs/vtkITK/vtkITKArchetypeImageSeriesReader.h 2007-01-09 00:23:40.000000000 -0500
+++ slicer-3beta/Slicer3/Libs/vtkITK/vtkITKArchetypeImageSeriesReader.h 2007-06-26 14:16:55.000000000 -0400
@@ -30,6 +30,7 @@
#include "vtkImageSource.h"
#include "vtkMatrix4x4.h"
#include "itkSpatialOrientation.h"
+#include "itkMetaDataDictionary.h"
#include <vector>
#include <string>
@@ -206,6 +207,12 @@
// Returns an IJK to RAS transformation matrix
vtkMatrix4x4* GetRasToIjkMatrix();
+ // Description:
+ // Return the MetaDataDictionary from the ITK layer
+ //BTX
+ const itk::MetaDataDictionary& GetMetaDataDictionary() const;
+ //ETX
+
protected:
vtkITKArchetypeImageSeriesReader();
~vtkITKArchetypeImageSeriesReader();
@@ -232,6 +239,7 @@
//BTX
std::vector<std::string> FileNames;
CoordinateOrientationCode DesiredCoordinateOrientation;
+ itk::MetaDataDictionary Dictionary;
//ETX
virtual void ExecuteInformation();
// defined in the subclasses
More information about the Insight-developers
mailing list