X-Git-Url: https://git.creatis.insa-lyon.fr/pubgit/?a=blobdiff_plain;f=Example%2FWriteDicomSimple.cxx;h=213ce26820dd9e922d7e50f02c6094cd7568fe12;hb=e0e3ff9986778666bc665801af48923d30eb8ee7;hp=f426800e245a657670610e1d8da6a7fb6ccc3fd6;hpb=922095a0dd56f24d651b36f62256690020937d9a;p=gdcm.git diff --git a/Example/WriteDicomSimple.cxx b/Example/WriteDicomSimple.cxx index f426800e..213ce268 100644 --- a/Example/WriteDicomSimple.cxx +++ b/Example/WriteDicomSimple.cxx @@ -3,8 +3,8 @@ Program: gdcm Module: $RCSfile: WriteDicomSimple.cxx,v $ Language: C++ - Date: $Date: 2004/12/10 13:49:06 $ - Version: $Revision: 1.3 $ + Date: $Date: 2005/01/08 23:18:30 $ + Version: $Revision: 1.6 $ Copyright (c) CREATIS (Centre de Recherche et d'Applications en Traitement de l'Image). All rights reserved. See Doc/License.txt or @@ -26,6 +26,7 @@ #include "gdcmFile.h" #include +#include // Image size #define SIZE_X 256 @@ -62,39 +63,39 @@ int main(int argc, char* argv[]) // Set the image size str.str(""); str << SIZE_X; - header->ReplaceOrCreateByNumber(str.str(),0x0028,0x0011); // Columns + header->ReplaceOrCreate(str.str(),0x0028,0x0011); // Columns str.str(""); str << SIZE_Y; - header->ReplaceOrCreateByNumber(str.str(),0x0028,0x0010); // Rows + header->ReplaceOrCreate(str.str(),0x0028,0x0010); // Rows // Set the pixel type str.str(""); str << COMPONENT_SIZE * 8; - header->ReplaceOrCreateByNumber(str.str(),0x0028,0x0100); // Bits Allocated - header->ReplaceOrCreateByNumber(str.str(),0x0028,0x0101); // Bits Stored + header->ReplaceOrCreate(str.str(),0x0028,0x0100); // Bits Allocated + header->ReplaceOrCreate(str.str(),0x0028,0x0101); // Bits Stored str.str(""); str << COMPONENT_SIZE * 8 - 1; - header->ReplaceOrCreateByNumber(str.str(),0x0028,0x0102); // High Bit + header->ReplaceOrCreate(str.str(),0x0028,0x0102); // High Bit // Set the pixel representation str.str(""); str << "0"; // Unsigned - header->ReplaceOrCreateByNumber(str.str(),0x0028,0x0103); // Pixel Representation + header->ReplaceOrCreate(str.str(),0x0028,0x0103); // Pixel Representation // Set the samples per pixel str.str(""); str << COMPONENT; - header->ReplaceOrCreateByNumber(str.str(),0x0028,0x0002); // Samples per Pixel + header->ReplaceOrCreate(str.str(),0x0028,0x0002); // Samples per Pixel // Set the Window / Level str.str(""); str << COLOR_WINDOW; - header->ReplaceOrCreateByNumber(str.str(),0x0028,0x1051); // Window Width + header->ReplaceOrCreate(str.str(),0x0028,0x1051); // Window Width str.str(""); str << COLOR_LEVEL; - header->ReplaceOrCreateByNumber(str.str(),0x0028,0x1050); // Window Center + header->ReplaceOrCreate(str.str(),0x0028,0x1050); // Window Center if( !header->IsReadable() ) { @@ -189,3 +190,4 @@ int main(int argc, char* argv[]) return 0; } +