Program: gdcm
Module: $RCSfile: vtkGdcmWriter.cxx,v $
Language: C++
- Date: $Date: 2005/01/21 11:40:56 $
- Version: $Revision: 1.13 $
+ Date: $Date: 2005/01/24 16:51:01 $
+ Version: $Revision: 1.14 $
Copyright (c) CREATIS (Centre de Recherche et d'Applications en Traitement de
l'Image). All rights reserved. See Doc/License.txt or
#include <vtkPointData.h>
#include <vtkLookupTable.h>
-vtkCxxRevisionMacro(vtkGdcmWriter, "$Revision: 1.13 $");
+vtkCxxRevisionMacro(vtkGdcmWriter, "$Revision: 1.14 $");
vtkStandardNewMacro(vtkGdcmWriter);
//-----------------------------------------------------------------------------
str.str("");
str << dim[0];
- file->ReplaceOrCreate(str.str(),0x0028,0x0011); // Columns
+ file->Insert(str.str(),0x0028,0x0011); // Columns
str.str("");
str << dim[1];
- file->ReplaceOrCreate(str.str(),0x0028,0x0010); // Rows
+ file->Insert(str.str(),0x0028,0x0010); // Rows
if(dim[2]>1)
{
str.str("");
str << dim[2];
- //file->ReplaceOrCreate(str.str(),0x0028,0x0012); // Planes
- file->ReplaceOrCreate(str.str(),0x0028,0x0008); // Number of Frames
+ //file->Insert(str.str(),0x0028,0x0012); // Planes
+ file->Insert(str.str(),0x0028,0x0008); // Number of Frames
}
// Pixel type
str.str("");
str << image->GetScalarSize()*8;
- file->ReplaceOrCreate(str.str(),0x0028,0x0100); // Bits Allocated
- file->ReplaceOrCreate(str.str(),0x0028,0x0101); // Bits Stored
+ file->Insert(str.str(),0x0028,0x0100); // Bits Allocated
+ file->Insert(str.str(),0x0028,0x0101); // Bits Stored
str.str("");
str << image->GetScalarSize()*8-1;
- file->ReplaceOrCreate(str.str(),0x0028,0x0102); // High Bit
+ file->Insert(str.str(),0x0028,0x0102); // High Bit
// Pixel Repr
// FIXME : what do we do when the ScalarType is
{
str << "1"; // Signed
}
- file->ReplaceOrCreate(str.str(),0x0028,0x0103); // Pixel Representation
+ file->Insert(str.str(),0x0028,0x0103); // Pixel Representation
// Samples per pixel
str.str("");
str << image->GetNumberOfScalarComponents();
- file->ReplaceOrCreate(str.str(),0x0028,0x0002); // Samples per Pixel
+ file->Insert(str.str(),0x0028,0x0002); // Samples per Pixel
// Spacing
double *sp = image->GetSpacing();
str.str("");
str << sp[0] << "\\" << sp[1];
- file->ReplaceOrCreate(str.str(),0x0028,0x0030); // Pixel Spacing
+ file->Insert(str.str(),0x0028,0x0030); // Pixel Spacing
str.str("");
str << sp[2];
- file->ReplaceOrCreate(str.str(),0x0018,0x0088); // Spacing Between Slices
+ file->Insert(str.str(),0x0018,0x0088); // Spacing Between Slices
// Origin
double *org = image->GetOrigin();
str.str("");
str << org[0] << "\\" << org[1] << "\\" << org[2];
- file->ReplaceOrCreate(str.str(),0x0020,0x0032); // Image Position Patient
+ file->Insert(str.str(),0x0020,0x0032); // Image Position Patient
// Window / Level
double *rng=image->GetScalarRange();
str.str("");
str << rng[1]-rng[0];
- file->ReplaceOrCreate(str.str(),0x0028,0x1051); // Window Width
+ file->Insert(str.str(),0x0028,0x1051); // Window Width
str.str("");
str << (rng[1]+rng[0])/2.0;
- file->ReplaceOrCreate(str.str(),0x0028,0x1050); // Window Center
+ file->Insert(str.str(),0x0028,0x1050); // Window Center
// Pixels
unsigned char *data;