Program: gdcm
Module: $RCSfile: vtkGdcmWriter.cxx,v $
Language: C++
- Date: $Date: 2005/01/25 15:44:25 $
- Version: $Revision: 1.15 $
+ Date: $Date: 2005/01/28 10:07:35 $
+ Version: $Revision: 1.16 $
Copyright (c) CREATIS (Centre de Recherche et d'Applications en Traitement de
l'Image). All rights reserved. See Doc/License.txt or
#include "gdcmFile.h"
#include "gdcmFileHelper.h"
#include "gdcmDebug.h"
+#include "gdcmUtil.h"
#include "vtkGdcmWriter.h"
#include <vtkObjectFactory.h>
#include <vtkPointData.h>
#include <vtkLookupTable.h>
-vtkCxxRevisionMacro(vtkGdcmWriter, "$Revision: 1.15 $");
+vtkCxxRevisionMacro(vtkGdcmWriter, "$Revision: 1.16 $");
vtkStandardNewMacro(vtkGdcmWriter);
//-----------------------------------------------------------------------------
this->LookupTable = NULL;
this->FileDimensionality = 3;
this->WriteType = VTK_GDCM_WRITE_TYPE_EXPLICIT_VR;
+
+ UIDPrefix = "";
+ StudyInstanceUID = "";
+ SeriesInstanceUID = "";
+ FrameOfReferenceInstanceUID = "";
}
vtkGdcmWriter::~vtkGdcmWriter()
}
}
+void vtkGdcmWriter::SetUIDPrefix(const char *prefix)
+{
+ UIDPrefix = prefix;
+}
+
+const char *vtkGdcmWriter::GetUIDPrefix()
+{
+ return UIDPrefix.c_str();
+}
+
+void vtkGdcmWriter::NewStudyInstanceUID()
+{
+ StudyInstanceUID = "";
+}
+
+void vtkGdcmWriter::NewSeriesInstanceUID()
+{
+ SeriesInstanceUID = "";
+}
+
+void vtkGdcmWriter::NewFrameOfReferenceInstanceUID()
+{
+ FrameOfReferenceInstanceUID = "";
+}
+
//-----------------------------------------------------------------------------
// Protected
/**
// From here, the write of the file begins
gdcm::FileHelper *dcmFile = new gdcm::FileHelper();
+ // Set the image UID
+ if( StudyInstanceUID.empty() )
+ StudyInstanceUID = gdcm::Util::CreateUniqueUID( UIDPrefix );
+ if( SeriesInstanceUID.empty() )
+ SeriesInstanceUID = gdcm::Util::CreateUniqueUID( UIDPrefix );
+ if( FrameOfReferenceInstanceUID.empty() )
+ FrameOfReferenceInstanceUID = gdcm::Util::CreateUniqueUID( UIDPrefix );
+ std::string uid = gdcm::Util::CreateUniqueUID( UIDPrefix );
+
+ dcmFile->InsertValEntry(uid,0x0008,0x0018); //[SOP Instance UID]
+ dcmFile->InsertValEntry(uid,0x0002,0x0003); //[Media Stored SOP Instance UID]
+ dcmFile->InsertValEntry(StudyInstanceUID,0x0020,0x000d); //[Study Instance UID]
+ dcmFile->InsertValEntry(SeriesInstanceUID,0x0020,0x000e); //[Series Instance UID]
+ dcmFile->InsertValEntry(FrameOfReferenceInstanceUID,0x0020, 0x0052); //[Frame of Reference UID]
+
// Set the image informations
SetImageInformation(dcmFile,image);
Program: gdcm
Module: $RCSfile: vtkGdcmWriter.h,v $
Language: C++
- Date: $Date: 2004/12/10 13:49:08 $
- Version: $Revision: 1.4 $
+ Date: $Date: 2005/01/28 10:07:35 $
+ Version: $Revision: 1.5 $
Copyright (c) CREATIS (Centre de Recherche et d'Applications en Traitement de
l'Image). All rights reserved. See Doc/License.txt or
#include <vtkImageWriter.h>
#include <vtkLookupTable.h>
-#include <list>
#include <string>
//-----------------------------------------------------------------------------
vtkGetMacro(WriteType,int);
const char *GetWriteTypeAsString();
+ void SetUIDPrefix(const char *prefix);
+ const char *GetUIDPrefix();
+
+ void NewStudyInstanceUID();
+ void NewSeriesInstanceUID();
+ void NewFrameOfReferenceInstanceUID();
+
protected:
vtkGdcmWriter();
~vtkGdcmWriter();
// Variables
vtkLookupTable *LookupTable;
int WriteType;
+
+ //BTX
+ std::string UIDPrefix;
+ std::string StudyInstanceUID;
+ std::string SeriesInstanceUID;
+ std::string FrameOfReferenceInstanceUID;
+ //ETX
};
//-----------------------------------------------------------------------------
#endif
-