From: jpr Date: Tue, 11 Apr 2006 16:05:03 +0000 (+0000) Subject: Pass the VR to method InsertEntryString X-Git-Url: https://git.creatis.insa-lyon.fr/pubgit/?a=commitdiff_plain;h=d4473ebbcf880af0d6dd9c5603929f3bf61b8162;p=gdcm.git Pass the VR to method InsertEntryString --- diff --git a/Testing/TestBuildUpDicomDir.cxx b/Testing/TestBuildUpDicomDir.cxx index 64efd4b0..a30c88c5 100644 --- a/Testing/TestBuildUpDicomDir.cxx +++ b/Testing/TestBuildUpDicomDir.cxx @@ -3,8 +3,8 @@ Program: gdcm Module: $RCSfile: TestBuildUpDicomDir.cxx,v $ Language: C++ - Date: $Date: 2005/10/25 14:52:30 $ - Version: $Revision: 1.8 $ + Date: $Date: 2006/04/11 16:05:03 $ + Version: $Revision: 1.9 $ Copyright (c) CREATIS (Centre de Recherche et d'Applications en Traitement de l'Image). All rights reserved. See Doc/License.txt or @@ -39,7 +39,9 @@ int TestBuildUpDicomDir(int argc, char *argv[]) { std::cerr << "Usage: " << argv[0] << " dummy " << std::endl; } - + + //gdcm::Debug::DebugOn(); + bool errorFound = false; gdcm::DicomDir *dcmdir; std::string dirName; @@ -74,17 +76,17 @@ int TestBuildUpDicomDir(int argc, char *argv[]) s11 = p1->NewStudy(); s11->SetEntryString("StudyDescrOne.One_",0x0008, 0x1030); // we know entry (0008,1060) is not yet created - s11->InsertEntryString("Dr Mabuse", 0x0008, 0x1060); + s11->InsertEntryString("Dr^Mabuse", 0x0008, 0x1060, "PN"); // fill here other Study characteristics gdcm::DicomDirStudy *s12 = p1->NewStudy(); s12->SetEntryString("StudyDescrOne.Two",0x0008, 0x1030); - s12->InsertEntryString("Dr Zorglub", 0x0008, 0x1060); + s12->InsertEntryString("Dr^Zorglub", 0x0008, 0x1060, "PN"); // fill here other Study characteristics gdcm::DicomDirStudy *s13 = p1->NewStudy(); s13->SetEntryString("StudyDescrOne.Tree",0x0008, 0x1030); - s13->InsertEntryString("Dr Follamour", 0x0008, 0x1060); + s13->InsertEntryString("Dr^Follamour", 0x0008, 0x1060, "PN"); // fill here other Study characteristics gdcm::DicomDirSerie *s111; @@ -251,7 +253,9 @@ int TestBuildUpDicomDir(int argc, char *argv[]) << "]" << std::endl; valueStuff = s11->GetEntryString(0x0008, 0x1060); - if (!gdcm::Util::DicomStringEqual(valueStuff, "Dr Mabuse") ) +std::cout << "----------------length-----------------" << valueStuff.length() << +std::endl; + if (!gdcm::Util::DicomStringEqual(valueStuff, "Dr^Mabuse") ) { std::cout << "2 : 0x0008,0x1060 [" << s11->GetEntryString(0x0008,0x1060) @@ -259,7 +263,7 @@ int TestBuildUpDicomDir(int argc, char *argv[]) errorFound = true; break; } - std::cout << "Pysician : [" + std::cout << "Physician : [" << valueStuff << "]" << std::endl; if ( (s12 = p1->GetNextStudy()) == 0 ) @@ -281,7 +285,7 @@ int TestBuildUpDicomDir(int argc, char *argv[]) << "]" << std::endl; if ( gdcm::Util::DicomStringEqual(s12->GetEntryString(0x0008, - 0x1060),"Dr Zorglub " )) + 0x1060),"Dr^Zorglub " )) { std::cout << "4 0x0008,0x1060 [" << s12->GetEntryString(0x0008,0x1060) @@ -289,7 +293,8 @@ int TestBuildUpDicomDir(int argc, char *argv[]) errorFound = true; break; } - std::cout << "Pysician : [" + std::cout << "___________________________________" << std::endl; + std::cout << "Pysician Reading Study: [" << s12->GetEntryString(0x0008,0x1060) << "]" << std::endl; @@ -308,7 +313,7 @@ int TestBuildUpDicomDir(int argc, char *argv[]) << "]" << std::endl; valueStuff = s13->GetEntryString(0x0008, 0x1060); - if (!gdcm::Util::DicomStringEqual(valueStuff, "Dr Follamour") ) + if (!gdcm::Util::DicomStringEqual(valueStuff, "Dr^Follamour") ) { std::cout << "5 0x0008,0x1060 [" << valueStuff diff --git a/Testing/TestCopyRescaleDicom.cxx b/Testing/TestCopyRescaleDicom.cxx index 58491763..4421bff8 100644 --- a/Testing/TestCopyRescaleDicom.cxx +++ b/Testing/TestCopyRescaleDicom.cxx @@ -3,8 +3,8 @@ Program: gdcm Module: $RCSfile: TestCopyRescaleDicom.cxx,v $ Language: C++ - Date: $Date: 2005/10/18 08:35:46 $ - Version: $Revision: 1.21 $ + Date: $Date: 2006/04/11 16:05:03 $ + Version: $Revision: 1.22 $ Copyright (c) CREATIS (Centre de Recherche et d'Applications en Traitement de l'Image). All rights reserved. See Doc/License.txt or @@ -114,10 +114,10 @@ int CopyRescaleDicom(std::string const &filename, if( bitsStored == "16" ) { std::cout << "Rescale..."; - copyF.InsertEntryString( "8", 0x0028, 0x0100); // Bits Allocated - copyF.InsertEntryString( "8", 0x0028, 0x0101); // Bits Stored - copyF.InsertEntryString( "7", 0x0028, 0x0102); // High Bit - copyF.InsertEntryString( "0", 0x0028, 0x0103); // Pixel Representation + copyF.InsertEntryString( "8", 0x0028, 0x0100, "US"); // Bits Allocated + copyF.InsertEntryString( "8", 0x0028, 0x0101, "US"); // Bits Stored + copyF.InsertEntryString( "7", 0x0028, 0x0102, "US"); // High Bit + copyF.InsertEntryString( "0", 0x0028, 0x0103, "US"); // Pixel Representation // We assume the value were from 0 to uint16_t max rescaleSize = dataSize / 2; diff --git a/Testing/TestImageSet.cxx b/Testing/TestImageSet.cxx index 4caf0ade..789a43b2 100644 --- a/Testing/TestImageSet.cxx +++ b/Testing/TestImageSet.cxx @@ -3,8 +3,8 @@ Program: gdcm Module: $RCSfile: TestImageSet.cxx,v $ Language: C++ - Date: $Date: 2005/10/25 14:52:31 $ - Version: $Revision: 1.6 $ + Date: $Date: 2006/04/11 16:05:03 $ + Version: $Revision: 1.7 $ Copyright (c) CREATIS (Centre de Recherche et d'Applications en Traitement de l'Image). All rights reserved. See Doc/License.txt or @@ -152,19 +152,19 @@ gdcm::File *WriteImage(gdcm::File *file, const std::string &fileName) std::ostringstream str; // Set the image size - file->InsertEntryString("256",0x0028,0x0011); // Columns - file->InsertEntryString("256",0x0028,0x0010); // Rows + file->InsertEntryString("256",0x0028,0x0011,"US"); // Columns + file->InsertEntryString("256",0x0028,0x0010,"US"); // Rows // Set the pixel type - file->InsertEntryString("8",0x0028,0x0100); // Bits Allocated - file->InsertEntryString("8",0x0028,0x0101); // Bits Stored - file->InsertEntryString("7",0x0028,0x0102); // High Bit + file->InsertEntryString("8",0x0028,0x0100,"US"); // Bits Allocated + file->InsertEntryString("8",0x0028,0x0101,"US"); // Bits Stored + file->InsertEntryString("7",0x0028,0x0102,"US"); // High Bit // Set the pixel representation - file->InsertEntryString("0",0x0028,0x0103); // Pixel Representation + file->InsertEntryString("0",0x0028,0x0103,"US"); // Pixel Representation // Set the samples per pixel - file->InsertEntryString("1",0x0028,0x0002); // Samples per Pixel + file->InsertEntryString("1",0x0028,0x0002,"US"); // Samples per Pixel // The so called 'prepared image', built ex nihilo just before, // has NO Pixel Element yet. @@ -252,10 +252,10 @@ int TestImageSet(int argc, char *argv[]) // It's up to the user to initialize Serie UID and Study UID // Study Instance UID studyUID = gdcm::Util::CreateUniqueUID(); - file->InsertEntryString(studyUID, 0x0020, 0x000d); + file->InsertEntryString(studyUID, 0x0020, 0x000d, "UI"); // Series Instance UID serieUID = gdcm::Util::CreateUniqueUID(); - file->InsertEntryString(serieUID, 0x0020, 0x000e); + file->InsertEntryString(serieUID, 0x0020, 0x000e, "UI"); newFile = WriteImage(file, fileName.str()); if( !newFile ) @@ -287,8 +287,8 @@ int TestImageSet(int argc, char *argv[]) std::ostringstream fileName; fileName << "FileSeq" << i << ".dcm"; file = gdcm::File::New(); - file->InsertEntryString(studyUID, 0x0020, 0x000d); - file->InsertEntryString(serieUID, 0x0020, 0x000e); + file->InsertEntryString(studyUID, 0x0020, 0x000d, "UI"); + file->InsertEntryString(serieUID, 0x0020, 0x000e, "UI"); newFile = WriteImage(file, fileName.str()); if( !newFile ) @@ -319,9 +319,9 @@ int TestImageSet(int argc, char *argv[]) std::ostringstream fileName; fileName << "FileSeq" << i << ".dcm"; file = gdcm::File::New(); - file->InsertEntryString(studyUID, 0x0020, 0x000d); + file->InsertEntryString(studyUID, 0x0020, 0x000d, "UI"); serieUID = gdcm::Util::CreateUniqueUID(); - file->InsertEntryString(serieUID, 0x0020, 0x000e); + file->InsertEntryString(serieUID, 0x0020, 0x000e, "UI"); newFile = WriteImage(file, fileName.str()); if( !newFile ) { diff --git a/Testing/TestMakeIcon.cxx b/Testing/TestMakeIcon.cxx index 678f8930..2da82ce3 100644 --- a/Testing/TestMakeIcon.cxx +++ b/Testing/TestMakeIcon.cxx @@ -3,8 +3,8 @@ Program: gdcm Module: $RCSfile: TestMakeIcon.cxx,v $ Language: C++ - Date: $Date: 2005/10/25 14:52:31 $ - Version: $Revision: 1.10 $ + Date: $Date: 2006/04/11 16:05:03 $ + Version: $Revision: 1.11 $ Copyright (c) CREATIS (Centre de Recherche et d'Applications en Traitement de l'Image). All rights reserved. See Doc/License.txt or @@ -73,16 +73,16 @@ int TestMakeIcon (int argc, char *argv[]) uint16_t binVal[3]={0x52f7,0xf358,0xad9b}; - sqi->InsertEntryString( "MONOCHROME2", 0x0028,0x0004); - sqi->InsertEntryString( "128", 0x0028,0x0010); - sqi->InsertEntryString( "8", 0x0028,0x0100); - sqi->InsertEntryString( "8", 0x0028,0x0101); - sqi->InsertEntryString( "7", 0x0028,0x0102); - sqi->InsertEntryString( "0", 0x0028,0x0103); + sqi->InsertEntryString( "MONOCHROME2", 0x0028,0x0004, "CS"); + sqi->InsertEntryString( "128", 0x0028,0x0010, "US"); + sqi->InsertEntryString( "8", 0x0028,0x0100, "US"); + sqi->InsertEntryString( "8", 0x0028,0x0101, "US"); + sqi->InsertEntryString( "7", 0x0028,0x0102, "US"); + sqi->InsertEntryString( "0", 0x0028,0x0103, "US"); sqi->InsertEntryBinArea( (uint8_t *)binVal, 3*2, 0x0005,0x0010,"OW"); sqi->InsertEntryBinArea( pixels, lgth, 0x7fe0,0x0010); // just to see if it's stored a the right place - sqi->InsertEntryString( "128", 0x0028,0x0011); + sqi->InsertEntryString( "128", 0x0028,0x0011, "US"); fh->WriteDcmExplVR(output); diff --git a/Testing/TestWriteSimple.cxx b/Testing/TestWriteSimple.cxx index b955cde0..4b8685d1 100644 --- a/Testing/TestWriteSimple.cxx +++ b/Testing/TestWriteSimple.cxx @@ -3,8 +3,8 @@ Program: gdcm Module: $RCSfile: TestWriteSimple.cxx,v $ Language: C++ - Date: $Date: 2006/04/07 14:15:56 $ - Version: $Revision: 1.48 $ + Date: $Date: 2006/04/11 16:05:03 $ + Version: $Revision: 1.49 $ Copyright (c) CREATIS (Centre de Recherche et d'Applications en Traitement de l'Image). All rights reserved. See Doc/License.txt or @@ -127,16 +127,16 @@ int WriteSimple(Image &img) // Set the image size str.str(""); str << img.sizeX; - fileToBuild->InsertEntryString(str.str(),0x0028,0x0011); // Columns + fileToBuild->InsertEntryString(str.str(),0x0028,0x0011,"US"); // Columns str.str(""); str << img.sizeY; - fileToBuild->InsertEntryString(str.str(),0x0028,0x0010); // Rows + fileToBuild->InsertEntryString(str.str(),0x0028,0x0010,"US"); // Rows if(img.sizeZ>1) { str.str(""); str << img.sizeZ; - fileToBuild->InsertEntryString(str.str(),0x0028,0x0008); // Number of Frames + fileToBuild->InsertEntryString(str.str(),0x0028,0x0008, "IS"); // Number of Frames } fileName << "-" << img.sizeX << "-" << img.sizeY << "-" << img.sizeZ; @@ -144,20 +144,20 @@ int WriteSimple(Image &img) // Set the pixel type str.str(""); str << img.componentSize; - fileToBuild->InsertEntryString(str.str(),0x0028,0x0100); // Bits Allocated + fileToBuild->InsertEntryString(str.str(),0x0028,0x0100,"US"); // Bits Allocated str.str(""); str << img.componentUse; - fileToBuild->InsertEntryString(str.str(),0x0028,0x0101); // Bits Stored + fileToBuild->InsertEntryString(str.str(),0x0028,0x0101,"US"); // Bits Stored str.str(""); str << ( img.componentSize - 1 ); - fileToBuild->InsertEntryString(str.str(),0x0028,0x0102); // High Bit + fileToBuild->InsertEntryString(str.str(),0x0028,0x0102,"US"); // High Bit // Set the pixel representation str.str(""); str << img.sign; - fileToBuild->InsertEntryString(str.str(),0x0028,0x0103); // Pixel Representation + fileToBuild->InsertEntryString(str.str(),0x0028,0x0103, "US"); // Pixel Representation fileName << "-" << img.componentSize; if(img.sign == 0) @@ -179,7 +179,7 @@ int WriteSimple(Image &img) // Set the samples per pixel str.str(""); str << img.components; - fileToBuild->InsertEntryString(str.str(),0x0028,0x0002); // Samples per Pixel + fileToBuild->InsertEntryString(str.str(),0x0028,0x0002, "US"); // Samples per Pixel // Step 2 : Create the output image std::cout << "2...";