Program: gdcm
Module: $RCSfile: FindTags.cxx,v $
Language: C++
- Date: $Date: 2005/01/20 16:16:58 $
- Version: $Revision: 1.9 $
+ Date: $Date: 2005/01/21 11:40:52 $
+ Version: $Revision: 1.10 $
Copyright (c) CREATIS (Centre de Recherche et d'Applications en Traitement de
l'Image). All rights reserved. See Doc/License.txt or
=========================================================================*/
#include "gdcmFileHelper.h"
-#include "gdcmHeader.h"
+#include "gdcmFile.h"
#include "gdcmUtil.h"
#include <iostream>
f1->SetEntry(ManufacturerName ,0x0008,0x0070);
// ImagePositionPatient
- ImagePositionPatient = f1->GetHeader()->GetEntry(0x0020,0x0032);
+ ImagePositionPatient = f1->GetFile()->GetEntry(0x0020,0x0032);
// Image Position (RET)
f1->SetEntry(ImagePositionPatient, 0x0020,0x0030);
// SetEntryLength is private now.
//TO DO : see is the pb goes on...
-//f1->GetHeader()->SetEntryLength(strlen(Location.c_str())-1, 0x0020,0x0050);
+//f1->GetFile()->SetEntryLength(strlen(Location.c_str())-1, 0x0020,0x0050);
// Image Location
zizi = gdcm::Util::Format("%d",0x7FE0);
ImageLocation = gdcm::Util::DicomString(zizi.c_str());
//f1->SetEntry(Location, 0x0028,0x0200);
-//f1->GetHeader()->SetEntryLength(strlen(ImageLocation.c_str())-1, 0x0020,0x0050); // prudence !
+//f1->GetFile()->SetEntryLength(strlen(ImageLocation.c_str())-1, 0x0020,0x0050); // prudence !
// void* imageData= f1->GetImageData();
-// ecriture d'un fichier ACR à partir d'un dcmHeader correct.
+// ecriture d'un fichier ACR à partir d'un dcmFile correct.
std::cout << "----------------avant PrintEntry---------------------" << std::endl;
- f1->GetHeader()->Print();
+ f1->GetFile()->Print();
std::cout << "----------------avant WriteDcm---------------------" << std::endl;
-// ecriture d'un fichier ACR à partir d'un dcmHeader correct.
+// ecriture d'un fichier ACR à partir d'un dcmFile correct.
zozo = toto + ".acr";
std::cout << "WriteACR" << std::endl;
Program: gdcm
Module: $RCSfile: FlatHashTablePrint.cxx,v $
Language: C++
- Date: $Date: 2005/01/14 17:31:34 $
- Version: $Revision: 1.7 $
+ Date: $Date: 2005/01/21 11:40:52 $
+ Version: $Revision: 1.8 $
Copyright (c) CREATIS (Centre de Recherche et d'Applications en Traitement de
l'Image). All rights reserved. See Doc/License.txt or
PURPOSE. See the above copyright notices for more information.
=========================================================================*/
-#include "gdcmHeader.h"
+#include "gdcmFile.h"
#include "gdcmDocEntry.h"
// Iterate on all the Dicom entries encountered in the gdcmFile (given
return 1;
}
- gdcm::Header* header = new gdcm::Header( argv[1] );
+ gdcm::File* header = new gdcm::File( argv[1] );
gdcm::TagDocEntryHT* Ht = header->BuildFlatHashTable();
for (gdcm::TagDocEntryHT::iterator tag = Ht->begin(); tag != Ht->end(); ++tag)
Program: gdcm
Module: $RCSfile: PrintDocument.cxx,v $
Language: C++
- Date: $Date: 2004/12/03 20:16:55 $
- Version: $Revision: 1.9 $
+ Date: $Date: 2005/01/21 11:40:52 $
+ Version: $Revision: 1.10 $
Copyright (c) CREATIS (Centre de Recherche et d'Applications en Traitement de
l'Image). All rights reserved. See Doc/License.txt or
PURPOSE. See the above copyright notices for more information.
=========================================================================*/
-#include "gdcmHeader.h"
+#include "gdcmFile.h"
#include <iostream>
int main(int argc, char* argv[])
{
- gdcm::Header *e1;
+ gdcm::File *e1;
std::string fileName;
if (argc != 2) {
fileName += "/test.acr";
}
- e1= new gdcm::Header( fileName.c_str() );
+ e1= new gdcm::File( fileName.c_str() );
e1->SetPrintLevel(2);
Program: gdcm
Module: $RCSfile: PrintFile.cxx,v $
Language: C++
- Date: $Date: 2005/01/20 16:16:58 $
- Version: $Revision: 1.23 $
+ Date: $Date: 2005/01/21 11:40:52 $
+ Version: $Revision: 1.24 $
Copyright (c) CREATIS (Centre de Recherche et d'Applications en Traitement de
l'Image). All rights reserved. See Doc/License.txt or
PURPOSE. See the above copyright notices for more information.
=========================================================================*/
-#include "gdcmHeader.h"
+#include "gdcmFile.h"
#include "gdcmDebug.h"
#include "gdcmFileHelper.h"
int main(int argc, char* argv[])
{
- gdcm::Header *e1;
+ gdcm::File *e1;
gdcm::FileHelper *f1;
std::string fileName;
if (argc != 2)
if (argc > 3)
gdcm::Debug::SetDebugOn();
- e1= new gdcm::Header( fileName.c_str() );
+ e1= new gdcm::File( fileName.c_str() );
f1 = new gdcm::FileHelper(e1);
if (argc > 2)
Program: gdcm
Module: $RCSfile: PrintHeader.cxx,v $
Language: C++
- Date: $Date: 2005/01/12 11:40:50 $
- Version: $Revision: 1.15 $
+ Date: $Date: 2005/01/21 11:40:52 $
+ 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
PURPOSE. See the above copyright notices for more information.
=========================================================================*/
-#include "gdcmHeader.h"
+#include "gdcmFile.h"
#include "gdcmDebug.h"
#include <iostream>
if (argc > 3)
gdcm::Debug::SetDebugOn();
- gdcm::Header *e1 = new gdcm::Header( fileName.c_str() );
+ gdcm::File *e1 = new gdcm::File( fileName.c_str() );
if (argc > 2)
{
Program: gdcm
Module: $RCSfile: TestChangeHeader.cxx,v $
Language: C++
- Date: $Date: 2005/01/20 16:16:58 $
- Version: $Revision: 1.7 $
+ Date: $Date: 2005/01/21 11:40:52 $
+ Version: $Revision: 1.8 $
Copyright (c) CREATIS (Centre de Recherche et d'Applications en Traitement de
l'Image). All rights reserved. See Doc/License.txt or
PURPOSE. See the above copyright notices for more information.
=========================================================================*/
-#include "gdcmHeader.h"
+#include "gdcmFile.h"
#include "gdcmFileHelper.h"
// This examples read two images (could be the same). Try to modify
return 1;
}
- gdcm::Header *h1 = new gdcm::Header( argv[1] );
+ gdcm::File *h1 = new gdcm::File( argv[1] );
gdcm::FileHelper *f1 = new gdcm::FileHelper( h1 );
gdcm::FileHelper *f2 = new gdcm::FileHelper( argv[2] );
// 0018 1310 US ACQ Acquisition Matrix
gdcm::DictEntry *dictEntry =
- f2->GetHeader()->GetPubDict()->GetDictEntry( 0x0018, 1310 );
+ f2->GetFile()->GetPubDict()->GetDictEntry( 0x0018, 1310 );
std::cerr << std::hex << dictEntry->GetGroup() << "," << dictEntry->GetElement() << std::endl;
- std::string matrix = f2->GetHeader()->GetEntry(0x0018, 0x1310);
+ std::string matrix = f2->GetFile()->GetEntry(0x0018, 0x1310);
if(matrix != "gdcm::Unfound")
{
std::cerr << "Aquisition Matrix:" << matrix << std::endl;
- f1->GetHeader()->ReplaceOrCreate( matrix, 0x0018, 0x1310);
+ f1->GetFile()->ReplaceOrCreate( matrix, 0x0018, 0x1310);
}
f1->GetImageData();
Program: gdcm
Module: $RCSfile: TestCopyDicom.cxx,v $
Language: C++
- Date: $Date: 2005/01/20 16:31:42 $
- Version: $Revision: 1.19 $
+ Date: $Date: 2005/01/21 11:40:52 $
+ Version: $Revision: 1.20 $
Copyright (c) CREATIS (Centre de Recherche et d'Applications en Traitement de
l'Image). All rights reserved. See Doc/License.txt or
PURPOSE. See the above copyright notices for more information.
=========================================================================*/
-#include "gdcmHeader.h"
+#include "gdcmFile.h"
#include "gdcmFileHelper.h"
#include "gdcmDocument.h"
#include "gdcmValEntry.h"
gdcm::FileHelper *original = new gdcm::FileHelper( filename );
std::cout << "--- Original ----------------------" << std::endl;
- //original->GetHeader()->Print();
+ //original->GetFile()->Print();
gdcm::FileHelper *copy = new gdcm::FileHelper( output );
// Warning :Accessor gdcmElementSet::GetEntry() should not exist
// It was commented out by Mathieu, that was a *good* idea
- // (the user does NOT have to know the way we implemented the Header !)
+ // (the user does NOT have to know the way we implemented the File !)
// Waiting for a 'clean' solution, I keep the method ...JPRx
- gdcm::DocEntry* d=original->GetHeader()->GetFirstEntry();
+ gdcm::DocEntry* d=original->GetFile()->GetFirstEntry();
while(d)
{
if ( gdcm::BinEntry* b = dynamic_cast<gdcm::BinEntry*>(d) )
{
- copy->GetHeader()->ReplaceOrCreate(
+ copy->GetFile()->ReplaceOrCreate(
b->GetBinArea(),
b->GetLength(),
b->GetGroup(),
}
else if ( gdcm::ValEntry* v = dynamic_cast<gdcm::ValEntry*>(d) )
{
- copy->GetHeader()->ReplaceOrCreate(
+ copy->GetFile()->ReplaceOrCreate(
v->GetValue(),
v->GetGroup(),
v->GetElement(),
// << std::endl;
}
- d=original->GetHeader()->GetNextEntry();
+ d=original->GetFile()->GetNextEntry();
}
//copy->GetImageData();
std::cout << "--- Copy ----------------------" << std::endl;
std::cout <<std::endl << "DO NOT care about Offset" <<std::endl<<std::endl;;
- copy->GetHeader()->Print();
+ copy->GetFile()->Print();
std::cout << "--- ---- ----------------------" << std::endl;
copy->WriteDcmExplVR( output );
Program: gdcm
Module: $RCSfile: TestDcm2Acr.cxx,v $
Language: C++
- Date: $Date: 2005/01/20 16:31:42 $
- Version: $Revision: 1.7 $
+ Date: $Date: 2005/01/21 11:40:52 $
+ Version: $Revision: 1.8 $
Copyright (c) CREATIS (Centre de Recherche et d'Applications en Traitement de
l'Image). All rights reserved. See Doc/License.txt or
=========================================================================*/
#include "gdcmFileHelper.h"
-#include "gdcmHeader.h"
+#include "gdcmFile.h"
#include <iostream>
std::cout << " Sortie gdcmFileHelper()" << std::endl;
//e1.PrintPubDict(std::cout);
- f1->GetHeader()->Print();
+ f1->GetFile()->Print();
//cle = gdcmDictEntry::TranslateToKey(0x0028,0x0008);
int dataSize = f1->GetImageDataSize();
std::cout << "dataSize:" << dataSize << std::endl;
- // void* imageData= f1->GetHeader()->GetImageData();
+ // void* imageData= f1->GetFile()->GetImageData();
// Ecriture d'un Raw File, a afficher avec affim filein= dim= nbit= signe=
//f1->WriteRawData("image.raw");
- // ecriture d'un fichier DICOM à partir d'un dcmHeader correct.
+ // ecriture d'un fichier DICOM à partir d'un dcmFile correct.
//f1->WriteDcmImplVR("image.dcm");
- // ecriture d'un fichier ACR à partir d'un dcmHeader correct.
+ // ecriture d'un fichier ACR à partir d'un dcmFile correct.
zozo = toto + ".nema";
f1->WriteAcr(zozo);
std::cout << "\n\n---------------------------------------\n\n" << std::endl;
- f1->GetHeader()->Print();
+ f1->GetFile()->Print();
return 0;
}
Program: gdcm
Module: $RCSfile: TestFromScratch.cxx,v $
Language: C++
- Date: $Date: 2005/01/20 16:31:42 $
- Version: $Revision: 1.11 $
+ Date: $Date: 2005/01/21 11:40:52 $
+ Version: $Revision: 1.12 $
Copyright (c) CREATIS (Centre de Recherche et d'Applications en Traitement de
l'Image). All rights reserved. See Doc/License.txt or
PURPOSE. See the above copyright notices for more information.
=========================================================================*/
-#include "gdcmHeader.h"
+#include "gdcmFile.h"
#include "gdcmFileHelper.h"
#include "gdcmDictEntry.h"
#include "gdcmDocEntry.h"
std::string filename = argv[1];
gdcm::FileHelper *f1 = new gdcm::FileHelper( filename );
- gdcm::Header *h1 = f1->GetHeader();
+ gdcm::File *h1 = f1->GetFile();
int dataSize = f1->GetImageDataSize();
std::cout << "DataSize: " << dataSize << std::endl;
uint8_t* imageData = f1->GetImageData();
// Hopefully default to something
- gdcm::Header *h2 = new gdcm::Header();
+ gdcm::File *h2 = new gdcm::File();
// Copy of the header content
gdcm::DocEntry* d = h1->GetFirstEntry();
Program: gdcm
Module: $RCSfile: TestPapyrus.cxx,v $
Language: C++
- Date: $Date: 2005/01/20 16:16:58 $
- Version: $Revision: 1.4 $
+ Date: $Date: 2005/01/21 11:40:52 $
+ 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
PURPOSE. See the above copyright notices for more information.
=========================================================================*/
-#include "gdcmHeader.h"
+#include "gdcmFile.h"
#include "gdcmFileHelper.h"
#include "gdcmDocument.h"
#include "gdcmValEntry.h"
}
// ----------------------------------------------------------------------
-// Here we load a supposed to be Papyrus File (gdcm::Header compliant)
+// Here we load a supposed to be Papyrus File (gdcm::File compliant)
// and then try to get the pixels, using low-level SeqEntry accessors.
// Since it's not a general purpose Papyrus related program
// (just a light example) we suppose *everything* is clean
}
}
gdcm::FileHelper *original = new gdcm::FileHelper( filename );
- gdcm::Header *h = original->GetHeader();
+ gdcm::File *h = original->GetFile();
// Look for private Papyrus Sequence
gdcm::SeqEntry *seqPapyrus= h->GetSeqEntry(0x0041, 0x1050);
std::string NumberOfFrames = gdcm::Util::Format("%d", nbImages);
- gdcm::Header *n = new gdcm::Header();
- n->InitializeDefaultHeader();
+ gdcm::File *n = new gdcm::File();
+ n->InitializeDefaultFile();
n->ReplaceOrCreate(MediaStSOPinstUID, 0x0002,0x0002);
// Whe keep default gdcm Transfer Syntax (Explicit VR Little Endian)
Program: gdcm
Module: $RCSfile: TestReadWriteReadCompare.cxx,v $
Language: C++
- Date: $Date: 2005/01/20 16:16:58 $
- Version: $Revision: 1.8 $
+ Date: $Date: 2005/01/21 11:40:52 $
+ 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
PURPOSE. See the above copyright notices for more information.
=========================================================================*/
-#include "gdcmHeader.h"
+#include "gdcmFile.h"
#include "gdcmFileHelper.h"
//Generated file:
std::cout << " For all images in gdcmData (and not blacklisted in "
"Test/CMakeLists.txt)" << std::endl;
std::cout << " apply the following multistep test: " << std::endl;
- std::cout << " step 1: parse the image (as gdcmHeader) and call"
+ std::cout << " step 1: parse the image (as gdcmFile) and call"
<< " IsReadable(). " << std::endl;
std::cout << " step 2: write the corresponding image in DICOM V3 "
<< "with explicit" << std::endl
//////////////// Step 1 (see above description):
- gdcm::Header *header = new gdcm::Header( filename );
+ gdcm::File *header = new gdcm::File( filename );
if( !header->IsReadable() )
{
std::cerr << "Test::TestReadWriteReadCompare: Image not gdcm compatible:"
//////////////// Step 3:
gdcm::FileHelper *reread = new gdcm::FileHelper( "TestReadWriteReadCompare.dcm" );
- if( !reread->GetHeader()->IsReadable() )
+ if( !reread->GetFile()->IsReadable() )
{
std::cerr << "Test::TestReadWriteReadCompare: Could not reread image "
<< "written:" << filename << std::endl;
Program: gdcm
Module: $RCSfile: TestWrite.cxx,v $
Language: C++
- Date: $Date: 2005/01/20 16:16:58 $
- Version: $Revision: 1.15 $
+ Date: $Date: 2005/01/21 11:40:52 $
+ 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
PURPOSE. See the above copyright notices for more information.
=========================================================================*/
-#include "gdcmHeader.h"
+#include "gdcmFile.h"
#include "gdcmFileHelper.h"
#include <iostream>
{
std::string zozo;
- gdcm::Header *e1;
+ gdcm::File *e1;
gdcm::FileHelper *f1;
void* imageData;
}
/*
if (0) { // Just to keep the code for further use
- std::cout <<std::endl << "-------- Test gdcmHeader ------" <<std::endl;
- e1 = new gdcmHeaderHelper(argv[1]);
- if (!f1->GetHeader()->IsReadable()) {
+ std::cout <<std::endl << "-------- Test gdcmFile ------" <<std::endl;
+ e1 = new gdcmFileHelper(argv[1]);
+ if (!f1->GetFile()->IsReadable()) {
std::cout << "Sorry, not a DICOM / ACR File" <<std::endl;
exit(0);
}
- std::cout << std::endl << "----------------------> after new gdcmHeader"
+ std::cout << std::endl << "----------------------> after new gdcmFile"
<< std::endl;
e1->PrintEntry();
std::cout <<std::endl <<"---------------------------------------"
std::string toto = argv[1];
std::string mode = argv[2];
- e1 = new gdcm::Header( toto.c_str() );
+ e1 = new gdcm::File( toto.c_str() );
if (!e1->IsReadable())
{
std::cerr << "Sorry, not a Readable DICOM / ACR File" <<std::endl;
{
case 'a' :
// ecriture d'un fichier ACR
- // à partir d'un dcmHeader correct.
+ // à partir d'un dcmFile correct.
zozo = toto + ".ACR";
std::cout << "WriteACR" << std::endl;
case 'd' : // Not document in the 'usage', because the method is knowed to be bugged.
// ecriture d'un fichier DICOM Implicit VR
- // à partir d'un dcmHeader correct.
+ // à partir d'un dcmFile correct.
zozo = toto + ".DCM";
std::cout << "WriteDCM Implicit VR" << std::endl;
case 'x' :
// ecriture d'un fichier DICOM Explicit VR
- // à partir d'un dcmHeader correct.
+ // à partir d'un dcmFile correct.
zozo = toto + ".XDCM";
std::cout << "WriteDCM Explicit VR" << std::endl;
case 'v' :
- if ( f1->GetHeader()->GetBitsAllocated() == 8)
+ if ( f1->GetFile()->GetBitsAllocated() == 8)
{
std::cout << "videoinv for 8 bits" << std::endl;
for (int i=0; i<dataSize; i++)
Program: gdcm
Module: $RCSfile: TestWriteSimple.cxx,v $
Language: C++
- Date: $Date: 2005/01/20 16:31:42 $
- Version: $Revision: 1.8 $
+ Date: $Date: 2005/01/21 11:40:53 $
+ 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
PURPOSE. See the above copyright notices for more information.
=========================================================================*/
-#include "gdcmHeader.h"
+#include "gdcmFile.h"
#include "gdcmFileHelper.h"
int main(int argc, char* argv[])
if (argc < 3)
{
std::cerr << "Usage :" << std::endl << argv[0] <<
- " InputHeader OutputDicom" << std::endl;
+ " InputFile OutputDicom" << std::endl;
return 0;
}
std::string header = argv[1];
const char *output = argv[2];
- gdcm::Header *f1 = new gdcm::Header( header );
+ gdcm::File *f1 = new gdcm::File( header );
gdcm::FileHelper *f2 = new gdcm::FileHelper( f1 );
// If the following call is important, then the API sucks. Why is it
Program: gdcm
Module: $RCSfile: Volume2Dicom.cxx,v $
Language: C++
- Date: $Date: 2005/01/20 16:16:58 $
- Version: $Revision: 1.4 $
+ Date: $Date: 2005/01/21 11:40:53 $
+ 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
* It's aim is to show people how to write their data volume into DICOM slices
*/
-#include "gdcmHeader.h"
+#include "gdcmFile.h"
#include "gdcmDocEntry.h"
#include "gdcmBinEntry.h"
#include "gdcmFileHelper.h"
////////////////////////////////////////////////////////////
// Create a new dicom header and fill in some info //
////////////////////////////////////////////////////////////
- gdcm::Header *h1 = new gdcm::Header();
+ gdcm::File *h1 = new gdcm::File();
//h1->SetDateAndTime(filedate, filetime);
//h1->SetModality("CT");
Program: gdcm
Module: $RCSfile: Write.cxx,v $
Language: C++
- Date: $Date: 2005/01/20 16:31:42 $
- Version: $Revision: 1.16 $
+ Date: $Date: 2005/01/21 11:40:53 $
+ Version: $Revision: 1.17 $
Copyright (c) CREATIS (Centre de Recherche et d'Applications en Traitement de
l'Image). All rights reserved. See Doc/License.txt or
PURPOSE. See the above copyright notices for more information.
=========================================================================*/
-#include "gdcmHeader.h"
+#include "gdcmFile.h"
#include "gdcmFileHelper.h"
#include <iostream>
{
std::string zozo;
- gdcm::Header* e1;
+ gdcm::File* e1;
gdcm::FileHelper * f1;
//gdcmDocument * d; //not used
}
/*
if (0) { // Just to keep the code for further use
- std::cout <<std::endl << "-------- Test gdcmHeader ------" <<std::endl;
- e1 = new gdcmHeaderHelper(argv[1]);
- if (!f1->GetHeader()->IsReadable()) {
+ std::cout <<std::endl << "-------- Test gdcmFile ------" <<std::endl;
+ e1 = new gdcmFileHelper(argv[1]);
+ if (!f1->GetFile()->IsReadable()) {
std::cout << "Sorry, not a DICOM / ACR File" <<std::endl;
exit(0);
}
- std::cout << std::endl << "----------------------> after new gdcmHeader"
+ std::cout << std::endl << "----------------------> after new gdcmFile"
<< std::endl;
e1->PrintEntry();
std::cout <<std::endl <<"---------------------------------------"
std::string toto = argv[1];
- e1 = new gdcm::Header( toto.c_str() );
+ e1 = new gdcm::File( toto.c_str() );
if (!e1->IsReadable()) {
std::cerr << "Sorry, not a Readable DICOM / ACR File" <<std::endl;
return 0;
{
case 'a' :
// ecriture d'un fichier ACR
- // à partir d'un dcmHeader correct.
+ // à partir d'un dcmFile correct.
zozo = toto + ".ACR";
std::cout << "WriteACR" << std::endl;
case 'd' :
// ecriture d'un fichier DICOM Implicit VR
- // à partir d'un dcmHeader correct.
+ // à partir d'un dcmFile correct.
zozo = toto + ".DCM";
std::cout << "WriteDCM Implicit VR" << std::endl;
case 'x' :
// ecriture d'un fichier DICOM Explicit VR
- // à partir d'un dcmHeader correct.
+ // à partir d'un dcmFile correct.
zozo = toto + ".DCM";
std::cout << "WriteDCM Implicit VR" << std::endl;
Program: gdcm
Module: $RCSfile: WriteDicom.cxx,v $
Language: C++
- Date: $Date: 2005/01/20 16:16:58 $
- Version: $Revision: 1.11 $
+ Date: $Date: 2005/01/21 11:40:53 $
+ Version: $Revision: 1.12 $
Copyright (c) CREATIS (Centre de Recherche et d'Applications en Traitement de
l'Image). All rights reserved. See Doc/License.txt or
PURPOSE. See the above copyright notices for more information.
=========================================================================*/
-#include "gdcmHeader.h"
+#include "gdcmFile.h"
#include "gdcmFileHelper.h"
// Writting of a DICOM file based on a correct dicom header
// We assume that DICOM fields of second file actually exists :
- std::string nbFrames = f2->GetHeader()->GetEntry(0x0028, 0x0008);
+ std::string nbFrames = f2->GetFile()->GetEntry(0x0028, 0x0008);
if(nbFrames != "gdcm::Unfound") {
- f1->GetHeader()->ReplaceOrCreate( nbFrames, 0x0028, 0x0008);
+ f1->GetFile()->ReplaceOrCreate( nbFrames, 0x0028, 0x0008);
}
- f1->GetHeader()->ReplaceOrCreate(
- f2->GetHeader()->GetEntry(0x0028, 0x0010), 0x0028, 0x0010); // nbLig
- f1->GetHeader()->ReplaceOrCreate(
- f2->GetHeader()->GetEntry(0x0028, 0x0011), 0x0028, 0x0011); // nbCol
+ f1->GetFile()->ReplaceOrCreate(
+ f2->GetFile()->GetEntry(0x0028, 0x0010), 0x0028, 0x0010); // nbLig
+ f1->GetFile()->ReplaceOrCreate(
+ f2->GetFile()->GetEntry(0x0028, 0x0011), 0x0028, 0x0011); // nbCol
// Some other tags should be updated:
// TODO : Shouldn't we merge those two functions ?
f1->SetImageData( imageData, dataSize);
- f1->GetHeader()->Print();
+ f1->GetFile()->Print();
- std::string s0 = f2->GetHeader()->GetEntry(0x7fe0, 0x0000);
- std::string s10 = f2->GetHeader()->GetEntry(0x7fe0, 0x0010);
+ std::string s0 = f2->GetFile()->GetEntry(0x7fe0, 0x0000);
+ std::string s10 = f2->GetFile()->GetEntry(0x7fe0, 0x0010);
std::cout << "lgr 7fe0, 0000 " << s0 << std::endl;
std::cout << "lgr 7fe0, 0010 " << s10 << std::endl;
Program: gdcm
Module: $RCSfile: WriteDicomSimple.cxx,v $
Language: C++
- Date: $Date: 2005/01/20 16:16:58 $
- Version: $Revision: 1.7 $
+ Date: $Date: 2005/01/21 11:40:53 $
+ Version: $Revision: 1.8 $
Copyright (c) CREATIS (Centre de Recherche et d'Applications en Traitement de
l'Image). All rights reserved. See Doc/License.txt or
* The image content is a horizontal grayscale from
*
*/
-#include "gdcmHeader.h"
+#include "gdcmFile.h"
#include "gdcmFileHelper.h"
#include <iostream>
// Step 1 : Create the header of the image
- gdcm::Header *header = new gdcm::Header();
+ gdcm::File *header = new gdcm::File();
std::ostringstream str;
// Set the image size
Program: gdcm
Module: $RCSfile: WriteRead.cxx,v $
Language: C++
- Date: $Date: 2005/01/20 16:31:42 $
- Version: $Revision: 1.11 $
+ Date: $Date: 2005/01/21 11:40:53 $
+ Version: $Revision: 1.12 $
Copyright (c) CREATIS (Centre de Recherche et d'Applications en Traitement de
l'Image). All rights reserved. See Doc/License.txt or
PURPOSE. See the above copyright notices for more information.
=========================================================================*/
-#include "gdcmHeader.h"
+#include "gdcmFile.h"
#include "gdcmFileHelper.h"
#include <iostream>
{
std::string zozo;
- gdcm::Header* e1, *e2;
+ gdcm::File* e1, *e2;
gdcm::FileHelper * f1, *f2;
uint8_t* imageData, *imageData2;
std::cout << argv[1] << std::endl;
- e1 = new gdcm::Header( toto );
+ e1 = new gdcm::File( toto );
if (!e1->IsReadable()) {
std::cerr << "Sorry, " << toto <<" not a Readable DICOM / ACR File"
<<std::endl;
// --------------------- we read the written image
- e2 = new gdcm::Header( zozo );
+ e2 = new gdcm::File( zozo );
if (!e2->IsReadable()) {
std::cerr << "Sorry, " << zozo << " not a Readable DICOM / ACR File"
<<std::endl;
Program: gdcm
Module: $RCSfile: TestAllEntryVerify.cxx,v $
Language: C++
- Date: $Date: 2005/01/08 23:18:30 $
- Version: $Revision: 1.19 $
+ Date: $Date: 2005/01/21 11:40:53 $
+ Version: $Revision: 1.20 $
Copyright (c) CREATIS (Centre de Recherche et d'Applications en Traitement de
l'Image). All rights reserved. See Doc/License.txt or
PURPOSE. See the above copyright notices for more information.
=========================================================================*/
-#include "gdcmHeader.h"
+#include "gdcmFile.h"
#include <map>
#include <list>
{
std::string fileName = DataPath + fileIt->first;
std::cout << Indent << "FileName: " << fileName << std::endl;
- gdcm::Header* tested = new gdcm::Header( fileName.c_str() );
+ gdcm::File* tested = new gdcm::File( fileName.c_str() );
if( !tested->IsReadable() )
{
std::cerr << Indent << "Failed\n"
Program: gdcm
Module: $RCSfile: TestAllReadCompareDicom.cxx,v $
Language: C++
- Date: $Date: 2005/01/20 16:16:59 $
- Version: $Revision: 1.24 $
+ Date: $Date: 2005/01/21 11:40:53 $
+ Version: $Revision: 1.25 $
Copyright (c) CREATIS (Centre de Recherche et d'Applications en Traitement de
l'Image). All rights reserved. See Doc/License.txt or
PURPOSE. See the above copyright notices for more information.
=========================================================================*/
-#include "gdcmHeader.h"
+#include "gdcmFile.h"
#include "gdcmFileHelper.h"
#include <iostream>
////// Step 1:
std::cout << " 1...";
gdcm::FileHelper* tested = new gdcm::FileHelper( filename );
- if( !tested->GetHeader()->IsReadable() )
+ if( !tested->GetFile()->IsReadable() )
{
std::cout << " Failed" << std::endl
<< " Image not gdcm compatible:"
std::cout << "3a...";
gdcm::FileHelper* reference = new gdcm::FileHelper( referenceFileName );
- if( !reference->GetHeader()->IsReadable() )
+ if( !reference->GetFile()->IsReadable() )
{
std::cout << " Failed" << std::endl
<< " reference image "
return 1;
}
- std::string PixelType = reference->GetHeader()->GetPixelType();
+ std::string PixelType = reference->GetFile()->GetPixelType();
////// Step 3b:
std::cout << "3b...";
uint8_t* referenceImageData = reference->GetImageData();
// Test the image size
- if (tested->GetHeader()->GetXSize() != reference->GetHeader()->GetXSize() ||
- tested->GetHeader()->GetYSize() != reference->GetHeader()->GetYSize() ||
- tested->GetHeader()->GetZSize() != reference->GetHeader()->GetZSize())
+ if (tested->GetFile()->GetXSize() != reference->GetFile()->GetXSize() ||
+ tested->GetFile()->GetYSize() != reference->GetFile()->GetYSize() ||
+ tested->GetFile()->GetZSize() != reference->GetFile()->GetZSize())
{
std::cout << "Failed" << std::endl
<< " Size differs: "
- << "X: " << tested->GetHeader()->GetXSize() << " # "
- << reference->GetHeader()->GetXSize() << " | "
- << "Y: " << tested->GetHeader()->GetYSize() << " # "
- << reference->GetHeader()->GetYSize() << " | "
- << "Z: " << tested->GetHeader()->GetZSize() << " # "
- << reference->GetHeader()->GetZSize() << std::endl;
+ << "X: " << tested->GetFile()->GetXSize() << " # "
+ << reference->GetFile()->GetXSize() << " | "
+ << "Y: " << tested->GetFile()->GetYSize() << " # "
+ << reference->GetFile()->GetYSize() << " | "
+ << "Z: " << tested->GetFile()->GetZSize() << " # "
+ << reference->GetFile()->GetZSize() << std::endl;
delete reference;
delete tested;
return 1;
<< std::endl;
std::cout << " apply the following to each filename.xxx: "
<< std::endl;
- std::cout << " step 1: parse the image (as gdcmHeader) and call"
+ std::cout << " step 1: parse the image (as gdcmFile) and call"
<< " IsReadable(). "
<< std::endl;
std::cout << " step 2: find in GDCM_DATA_ROOT/BaselineDicom/filename.dcm"
Program: gdcm
Module: $RCSfile: TestBug.cxx,v $
Language: C++
- Date: $Date: 2005/01/08 15:03:58 $
- Version: $Revision: 1.17 $
+ Date: $Date: 2005/01/21 11:40:54 $
+ Version: $Revision: 1.18 $
Copyright (c) CREATIS (Centre de Recherche et d'Applications en Traitement de
l'Image). All rights reserved. See Doc/License.txt or
// We have to be carefull when the code both use cout + printf VC++ gets
// confused, thus make sure we use only one kind of iostream
-#include "gdcmHeader.h"
+#include "gdcmFile.h"
int TestBug(int argc, char* argv[])
{
- gdcm::Header* e1;
+ gdcm::File* e1;
if (argc > 1)
- e1 = new gdcm::Header( argv[1] );
+ e1 = new gdcm::File( argv[1] );
else {
std::string filename = GDCM_DATA_ROOT;
filename += "/test.acr";
- e1 = new gdcm::Header( filename.c_str() );
+ e1 = new gdcm::File( filename.c_str() );
}
//e1->PrintPubDict();
//e1->GetPubDict()->GetEntriesByKey();
Program: gdcm
Module: $RCSfile: TestCopyDicom.cxx,v $
Language: C++
- Date: $Date: 2005/01/20 16:16:59 $
- Version: $Revision: 1.32 $
+ Date: $Date: 2005/01/21 11:40:54 $
+ Version: $Revision: 1.33 $
Copyright (c) CREATIS (Centre de Recherche et d'Applications en Traitement de
l'Image). All rights reserved. See Doc/License.txt or
PURPOSE. See the above copyright notices for more information.
=========================================================================*/
-#include "gdcmHeader.h"
+#include "gdcmFile.h"
#include "gdcmFileHelper.h"
#include "gdcmValEntry.h"
#include "gdcmBinEntry.h"
//////////////// Step 1:
std::cout << " 1...";
- gdcm::Header *originalH = new gdcm::Header( filename );
- gdcm::Header *copyH = new gdcm::Header( );
+ gdcm::File *originalH = new gdcm::File( filename );
+ gdcm::File *copyH = new gdcm::File( );
//First of all copy the header field by field
copy = new gdcm::FileHelper( output );
//Is the file written still gdcm parsable ?
- if ( !copy->GetHeader()->IsReadable() )
+ if ( !copy->GetFile()->IsReadable() )
{
std::cout << " Failed" << std::endl
<< " " << output << " not readable" << std::endl;
<< std::endl;
std::cout << " apply the following to each filename.xxx: "
<< std::endl;
- std::cout << " step 1: parse the image (as gdcmHeader) and call"
+ std::cout << " step 1: parse the image (as gdcmFile) and call"
<< " IsReadable(). After that, call GetImageData() and "
<< "GetImageDataSize() "
<< std::endl;
Program: gdcm
Module: $RCSfile: TestCopyRescaleDicom.cxx,v $
Language: C++
- Date: $Date: 2005/01/20 16:16:59 $
- Version: $Revision: 1.7 $
+ Date: $Date: 2005/01/21 11:40:54 $
+ Version: $Revision: 1.8 $
Copyright (c) CREATIS (Centre de Recherche et d'Applications en Traitement de
l'Image). All rights reserved. See Doc/License.txt or
PURPOSE. See the above copyright notices for more information.
=========================================================================*/
-#include "gdcmHeader.h"
+#include "gdcmFile.h"
#include "gdcmFileHelper.h"
#include "gdcmValEntry.h"
#include "gdcmBinEntry.h"
//////////////// Step 1:
std::cout << " 1...";
- gdcm::Header *originalH = new gdcm::Header( filename );
- gdcm::Header *copyH = new gdcm::Header( );
+ gdcm::File *originalH = new gdcm::File( filename );
+ gdcm::File *copyH = new gdcm::File( );
//First of all copy the header field by field
// Warning :Accessor gdcmElementSet::GetEntry() should not exist
// It was commented out by Mathieu, that was a *good* idea
- // (the user does NOT have to know the way we implemented the Header !)
+ // (the user does NOT have to know the way we implemented the File !)
// Waiting for a 'clean' solution, I keep the method ...JPRx
copy = new gdcm::FileHelper( output );
//Is the file written still gdcm parsable ?
- if ( !copy->GetHeader()->IsReadable() )
+ if ( !copy->GetFile()->IsReadable() )
{
std::cout << " Failed" << std::endl
<< " " << output << " not readable" << std::endl;
size_t dataSizeWritten = copy->GetImageDataSize();
uint8_t* imageDataWritten = copy->GetImageData();
- if (originalH->GetXSize() != copy->GetHeader()->GetXSize() ||
- originalH->GetYSize() != copy->GetHeader()->GetYSize() ||
- originalH->GetZSize() != copy->GetHeader()->GetZSize())
+ if (originalH->GetXSize() != copy->GetFile()->GetXSize() ||
+ originalH->GetYSize() != copy->GetFile()->GetYSize() ||
+ originalH->GetZSize() != copy->GetFile()->GetZSize())
{
std::cout << "Failed" << std::endl
<< " X Size differs: "
<< "X: " << originalH->GetXSize() << " # "
- << copy->GetHeader()->GetXSize() << " | "
+ << copy->GetFile()->GetXSize() << " | "
<< "Y: " << originalH->GetYSize() << " # "
- << copy->GetHeader()->GetYSize() << " | "
+ << copy->GetFile()->GetYSize() << " | "
<< "Z: " << originalH->GetZSize() << " # "
- << copy->GetHeader()->GetZSize() << std::endl;
+ << copy->GetFile()->GetZSize() << std::endl;
delete original;
delete copy;
delete originalH;
<< std::endl;
std::cout << " apply the following to each filename.xxx: "
<< std::endl;
- std::cout << " step 1: parse the image (as gdcmHeader) and call"
+ std::cout << " step 1: parse the image (as gdcmFile) and call"
<< " IsReadable(). After that, call GetImageData() and "
<< "GetImageDataSize() "
<< std::endl;
Program: gdcm
Module: $RCSfile: TestReadWriteReadCompare.cxx,v $
Language: C++
- Date: $Date: 2005/01/20 16:31:42 $
- Version: $Revision: 1.19 $
+ Date: $Date: 2005/01/21 11:40:54 $
+ Version: $Revision: 1.20 $
Copyright (c) CREATIS (Centre de Recherche et d'Applications en Traitement de
l'Image). All rights reserved. See Doc/License.txt or
PURPOSE. See the above copyright notices for more information.
=========================================================================*/
-#include "gdcmHeader.h"
+#include "gdcmFile.h"
#include "gdcmFileHelper.h"
//Generated file:
//////////////// Step 1 (see above description):
- gdcm::Header *header = new gdcm::Header( filename );
+ gdcm::File *header = new gdcm::File( filename );
if( !header->IsReadable() )
{
std::cerr << "Test::TestReadWriteReadCompare: Image not gdcm compatible:"
//////////////// Step 3:
gdcm::FileHelper* reread = new gdcm::FileHelper( output );
- if( !reread->GetHeader()->IsReadable() )
+ if( !reread->GetFile()->IsReadable() )
{
std::cerr << "Failed" << std::endl
<< "Test::TestReadWriteReadCompare: Could not reread image "
//////////////// Step 4:
// Test the image size
- if (header->GetXSize() != reread->GetHeader()->GetXSize() ||
- header->GetYSize() != reread->GetHeader()->GetYSize() ||
- header->GetZSize() != reread->GetHeader()->GetZSize())
+ if (header->GetXSize() != reread->GetFile()->GetXSize() ||
+ header->GetYSize() != reread->GetFile()->GetYSize() ||
+ header->GetZSize() != reread->GetFile()->GetZSize())
{
std::cout << "Failed" << std::endl
<< " X Size differs: "
<< "X: " << header->GetXSize() << " # "
- << reread->GetHeader()->GetXSize() << " | "
+ << reread->GetFile()->GetXSize() << " | "
<< "Y: " << header->GetYSize() << " # "
- << reread->GetHeader()->GetYSize() << " | "
+ << reread->GetFile()->GetYSize() << " | "
<< "Z: " << header->GetZSize() << " # "
- << reread->GetHeader()->GetZSize() << std::endl;
+ << reread->GetFile()->GetZSize() << std::endl;
delete header;
delete file;
delete reread;
std::cout << " For all images in gdcmData (and not blacklisted in "
"Test/CMakeLists.txt)" << std::endl;
std::cout << " apply the following multistep test: " << std::endl;
- std::cout << " step 1: parse the image (as gdcmHeader) and call"
+ std::cout << " step 1: parse the image (as gdcmFile) and call"
<< " IsReadable(). " << std::endl;
std::cout << " step 2: write the corresponding image in DICOM V3 "
<< "with explicit" << std::endl
Program: gdcm
Module: $RCSfile: TestWriteSimple.cxx,v $
Language: C++
- Date: $Date: 2005/01/20 16:16:59 $
- Version: $Revision: 1.12 $
+ Date: $Date: 2005/01/21 11:40:54 $
+ Version: $Revision: 1.13 $
Copyright (c) CREATIS (Centre de Recherche et d'Applications en Traitement de
l'Image). All rights reserved. See Doc/License.txt or
* The image content is a horizontal grayscale from
*
*/
-#include "gdcmHeader.h"
+#include "gdcmFile.h"
#include "gdcmFileHelper.h"
#include <iostream>
// Step 1 : Create the header of the image
std::cout << " 1...";
- gdcm::Header *header = new gdcm::Header();
+ gdcm::File *header = new gdcm::File();
std::ostringstream str;
// Set the image size
// Step 5 : Read the written image
std::cout << "5...";
gdcm::FileHelper* reread = new gdcm::FileHelper( fileName );
- if( !reread->GetHeader()->IsReadable() )
+ if( !reread->GetFile()->IsReadable() )
{
std::cerr << "Failed" << std::endl
<< "Test::TestReadWriteReadCompare: Could not reread image "
uint8_t* imageDataWritten = reread->GetImageData();
// Test the image size
- if (header->GetXSize() != reread->GetHeader()->GetXSize() ||
- header->GetYSize() != reread->GetHeader()->GetYSize() ||
- header->GetZSize() != reread->GetHeader()->GetZSize())
+ if (header->GetXSize() != reread->GetFile()->GetXSize() ||
+ header->GetYSize() != reread->GetFile()->GetYSize() ||
+ header->GetZSize() != reread->GetFile()->GetZSize())
{
std::cout << "Failed" << std::endl
<< " X Size differs: "
<< "X: " << header->GetXSize() << " # "
- << reread->GetHeader()->GetXSize() << " | "
+ << reread->GetFile()->GetXSize() << " | "
<< "Y: " << header->GetYSize() << " # "
- << reread->GetHeader()->GetYSize() << " | "
+ << reread->GetFile()->GetYSize() << " | "
<< "Z: " << header->GetZSize() << " # "
- << reread->GetHeader()->GetZSize() << std::endl;
+ << reread->GetFile()->GetZSize() << std::endl;
delete header;
delete file;
delete reread;
def _BaseTest(self, FileSet):
for entry in FileSet:
fileName = os.path.join(GDCM_TEST_DATA_PATH, entry[0])
- reader = gdcmHeader(fileName)
+ reader = gdcmFile(fileName)
assert reader.IsReadable(),\
- "File '%s' is not readable by gdcmHeader" % fileName
+ "File '%s' is not readable by gdcmFile" % fileName
valDict = reader.GetEntry()
for subEntry in entry[1]:
gdcmException.cxx
gdcmFileHelper.cxx
gdcmGlobal.cxx
- gdcmHeader.cxx
+ gdcmFile.cxx
gdcmJPEGFragment.cxx
gdcmJPEGFragmentsInfo.cxx
gdcmJpeg8.cxx
Program: gdcm
Module: $RCSfile: gdcm.h,v $
Language: C++
- Date: $Date: 2004/11/26 10:55:04 $
- Version: $Revision: 1.50 $
+ Date: $Date: 2005/01/21 11:40:55 $
+ Version: $Revision: 1.51 $
Copyright (c) CREATIS (Centre de Recherche et d'Applications en Traitement de
l'Image). All rights reserved. See Doc/License.txt or
#include "gdcmDictSet.h"
#include "gdcmDocument.h"
-#include "gdcmHeader.h"
-#include "gdcmSerieHeader.h"
#include "gdcmFile.h"
+#include "gdcmFileHelper.h"
+#include "gdcmSerieHeader.h"
#include "gdcmUtil.h"
Program: gdcm
Module: $RCSfile: gdcmBase.h,v $
Language: C++
- Date: $Date: 2005/01/16 04:50:40 $
- Version: $Revision: 1.3 $
+ Date: $Date: 2005/01/21 11:40:55 $
+ Version: $Revision: 1.4 $
Copyright (c) CREATIS (Centre de Recherche et d'Applications en Traitement de
l'Image). All rights reserved. See Doc/License.txt or
/// \note 0 for Light Print; 1 for 'medium' Print, 2 for Heavy
void SetPrintLevel(int level) { PrintLevel = level; };
- /// \brief Gets the print level for the Dicom Header Elements
+ /// \brief Gets the print level for the Dicom Entries
int GetPrintLevel() { return PrintLevel; };
protected:
- /// \brief Amount of printed details for each Header Entry (Dicom Element):
+ /// \brief Amount of printed details for each Dicom Entries :
/// 0 : stands for the least detail level.
int PrintLevel;
};
Program: gdcm
Module: $RCSfile: gdcmBinEntry.h,v $
Language: C++
- Date: $Date: 2005/01/16 04:50:41 $
- Version: $Revision: 1.31 $
+ Date: $Date: 2005/01/21 11:40:55 $
+ Version: $Revision: 1.32 $
Copyright (c) CREATIS (Centre de Recherche et d'Applications en Traitement de
l'Image). All rights reserved. See Doc/License.txt or
//-----------------------------------------------------------------------------
/**
- * \brief Any Dicom Document (File Header or DicomDir) contains
+ * \brief Any Dicom Document (File or DicomDir) contains
* a set of DocEntry entries
* (when successfuly parsed against a given Dicom dictionary)
* BinEntry is a specialisation of ValEntry (for non std::string
void Print( std::ostream &os = std::cout, std::string const & indent = "" );
void WriteContent( std::ofstream *fp, FileType ft);
- /// \brief Returns the area value of the current Dicom Header Entry
+ /// \brief Returns the area value of the current Dicom Entry
/// when it's not string-translatable (e.g : a LUT table)
uint8_t *GetBinArea() { return BinArea; }
void SetBinArea( uint8_t *area, bool self = true );
- /// Sets the value (string) of the current Dicom Document Entry
+ /// Sets the value (string) of the current Dicom Entry
virtual void SetValue(std::string const &val) { SetValueOnly(val); };
private:
/// \brief unsecure memory area to hold 'non string' values
Program: gdcm
Module: $RCSfile: gdcmDicomDir.cxx,v $
Language: C++
- Date: $Date: 2005/01/20 16:16:41 $
- Version: $Revision: 1.111 $
+ Date: $Date: 2005/01/21 11:40:55 $
+ Version: $Revision: 1.112 $
Copyright (c) CREATIS (Centre de Recherche et d'Applications en Traitement de
l'Image). All rights reserved. See Doc/License.txt or
#include "gdcmUtil.h"
#include "gdcmDebug.h"
#include "gdcmGlobal.h"
-#include "gdcmHeader.h"
+#include "gdcmFile.h"
#include "gdcmSeqEntry.h"
#include "gdcmSQItem.h"
#include "gdcmValEntry.h"
// Public
/**
* \brief This predicate, based on hopefully reasonable heuristics,
- * decides whether or not the current header was properly parsed
+ * decides whether or not the current document was properly parsed
* and contains the mandatory information for being considered as
* a well formed and usable DicomDir.
* @return true when Document is the one of a reasonable DicomDir,
DirList dirList(path,1); // gets recursively the file list
unsigned int count = 0;
VectDocument list;
- Header *header;
+ File *header;
DirListType fileList = dirList.GetFilenames();
break;
}
- header = new Header( it->c_str() );
+ header = new File( it->c_str() );
if( !header )
{
- gdcmVerboseMacro( "Failure in new Header " << it->c_str() );
+ gdcmVerboseMacro( "Failure in new gdcm::File " << it->c_str() );
continue;
}
if( header->IsReadable() )
{
- // Add the file header to the chained list:
+ // Add the file to the chained list:
list.push_back(header);
gdcmVerboseMacro( "Readable " << it->c_str() );
}
std::sort(list.begin(), list.end(), DicomDir::HeaderLessThan );
std::string tmp = dirList.GetDirName();
- //for each Header of the chained list, add/update the Patient/Study/Serie/Image info
+ //for each File of the chained list, add/update the Patient/Study/Serie/Image info
SetElements(tmp, list);
CallEndMethod();
itDoc!=list.end();
++itDoc)
{
- delete dynamic_cast<Header *>(*itDoc);
+ delete dynamic_cast<File *>(*itDoc);
}
}
Program: gdcm
Module: $RCSfile: gdcmDocEntry.h,v $
Language: C++
- Date: $Date: 2005/01/19 15:58:00 $
- Version: $Revision: 1.39 $
+ Date: $Date: 2005/01/21 11:40:55 $
+ Version: $Revision: 1.40 $
Copyright (c) CREATIS (Centre de Recherche et d'Applications en Traitement de
l'Image). All rights reserved. See Doc/License.txt or
namespace gdcm
{
-class Header;
+class File;
class ValEntry;
class BinEntry;
class SeqEntry;
DocEntry(DictEntry*);
virtual ~DocEntry() {};
- /// Returns the Dicom Group number of the current Dicom Header Entry
+ /// Returns the Dicom Group number of the current Dicom entry
uint16_t GetGroup() { return DicomDict->GetGroup(); };
- /// Returns the Dicom Element number of the current Dicom Header Entry
+ /// Returns the Dicom Element number of the current Dicom entry
uint16_t GetElement() { return DicomDict->GetElement();};
- /// Returns the 'key' of the current Dicom Header Entry
+ /// Returns the 'key' of the current Dicom entry
void SetKey( TagKey const &key ) { Key = key; }
- /// Returns the 'key' of the current Dicom Header Entry
+ /// Returns the 'key' of the current Dicom entry
std::string const &GetKey() const { return Key; }
/// \brief Returns the 'Name' '(e.g. "Patient's Name") found in the Dicom
std::string const &GetName() const { return DicomDict->GetName(); };
/// \brief Returns the 'Value Representation' (e.g. "PN" : Person Name,
- /// "SL" : Signed Long), found in the Dicom Header or in the Dicom
- /// Dictionnary, of the current Dicom Header Entry
+ /// "SL" : Signed Long), found in the Dicom header or in the Dicom
+ /// Dictionnary, of the current Dicom entry
std::string const &GetVR() const { return DicomDict->GetVR(); };
/// \brief Returns the 'Value Multiplicity' (e.g. "1", "1-n", "6"),
- /// found in the Dicom Header or in the Dicom Dictionnary
- /// of the current Dicom Header Entry
+ /// found in the Dicom entry or in the Dicom Dictionnary
+ /// of the current Dicom entry
std::string const &GetVM() const { return DicomDict->GetVM(); };
- /// Sets the 'Value Multiplicity' of the current Dicom Header Entry
+ /// Sets the 'Value Multiplicity' of the current Dicom entry
void SetVM( TagName const &v) { DicomDict->SetVM(v); };
/// \brief Returns offset (since the beginning of the file, including
- /// the File Preamble, if any) of the value of the current Dicom HeaderEntry
- /// \warning offset of the *value*, not of the Dicom Header Entry
+ /// the File Preamble, if any) of the value of the current Dicom entry
+ /// \warning offset of the *value*, not of the Dicom entry
size_t GetOffset() { return Offset; };
/// \brief Sets only 'Read Length' (*not* 'Usable Length') of the current
- /// Dicom Header Entry
+ /// Dicom entry
void SetReadLength(uint32_t l) { ReadLength = l; };
- /// \brief Returns the 'read length' of the current Dicom Header Entry
- /// \warning this value is the one stored in the Dicom Header but not
+ /// \brief Returns the 'read length' of the current Dicom entry
+ /// \warning this value is the one stored in the Dicom header but not
/// mandatoryly the one thats's used (in case on SQ, or delimiters,
/// the usable length is set to zero)
uint32_t GetReadLength() { return ReadLength; };
/// \brief Sets both 'Read Length' and 'Usable Length' of the current
- /// Dicom Header Entry
+ /// Dicom entry
void SetLength(uint32_t l) { Length = l; };
- /// \brief Returns the actual value length of the current Dicom Header Entry
- /// \warning this value is not *always* the one stored in the Dicom Header
+ /// \brief Returns the actual value length of the current Dicom entry
+ /// \warning this value is not *always* the one stored in the Dicom header
/// in case of well knowned bugs
uint32_t GetLength() { return Length; };
// The following 3 members, for internal use only !
- /// \brief Sets the offset of the Dicom Element
+ /// \brief Sets the offset of the Dicom entry
/// \warning use with caution !
/// @param of offset to be set
void SetOffset(size_t of) { Offset = of; };
- /// Sets to TRUE the ImplicitVr flag of the current Dicom Element
+ /// Sets to TRUE the ImplicitVr flag of the current Dicom entry
void SetImplicitVR() { ImplicitVR = true; };
- /// \brief Tells us if the current Dicom Element was checked as ImplicitVr
- /// @return true if the current Dicom Element was checked as ImplicitVr
+ /// \brief Tells us if the current Dicom entry was checked as ImplicitVr
+ /// @return true if the current Dicom entry was checked as ImplicitVr
bool IsImplicitVR() { return ImplicitVR; };
- /// \brief Tells us if the VR of the current Dicom Element is Unknown
+ /// \brief Tells us if the VR of the current Dicom entry is Unknown
/// @return true if the VR is unknown
bool IsVRUnknown() { return DicomDict->IsVRUnknown(); };
- /// \brief Tells us if the VM of the current Dicom Element is Unknown
+ /// \brief Tells us if the VM of the current Dicom entry is Unknown
/// @return true if the VM is unknown
bool IsVMUnknown() { return DicomDict->IsVMUnknown(); };
- /// \brief Gets the DicEntry of the current Dicom Element
- /// @return The DicEntry of the current Dicom Element
+ /// \brief Gets the DicEntry of the current Dicom entry
+ /// @return The DicEntry of the current Dicom entry
DictEntry * GetDictEntry() { return DicomDict; };
virtual void WriteContent(std::ofstream *fp, FileType filetype);
virtual void Print (std::ostream &os = std::cout, std::string const & indent = "");
protected:
- /// \brief Sets the DicEntry of the current Dicom Element
- /// \remarks Used only by the Header !!! (possible because of a friend
+ /// \brief Sets the DicEntry of the current Dicom entry
+ /// \remarks Used only by the gdcm::File !!! (possible because of a friend
/// link between them)
/// @param newEntry pointer to the DictEntry
void SetDictEntry(DictEntry *newEntry) { DicomDict = newEntry; };
/// \brief pointer to the underlying Dicom dictionary element
DictEntry *DicomDict;
- /// \brief Correspond to the real length of the datas
+ /// \brief Correspond to the real length of the data
/// This length might always be even
uint32_t Length;
- /// \brief Length to read in the file to obtain datas.
+ /// \brief Length to read in the file to obtain data
uint32_t ReadLength;
/// \brief Even when reading explicit vr files, some elements happen to
private:
// FIXME: In fact we should be more specific and use :
- // friend DocEntry * Header::ReadNextElement(void);
- friend class Header;
+ // friend DocEntry *File::ReadNextElement(void);
+ friend class File;
};
} // end namespace gdcm
//-----------------------------------------------------------------------------
Program: gdcm
Module: $RCSfile: gdcmDocEntryArchive.cxx,v $
Language: C++
- Date: $Date: 2005/01/17 11:13:21 $
- Version: $Revision: 1.7 $
+ Date: $Date: 2005/01/21 11:40:55 $
+ Version: $Revision: 1.8 $
Copyright (c) CREATIS (Centre de Recherche et d'Applications en Traitement de
l'Image). All rights reserved. See Doc/License.txt or
/**
* \brief Constructor
*/
-DocEntryArchive::DocEntryArchive(Header *header):
+DocEntryArchive::DocEntryArchive(File *header):
HeaderHT(header->TagHT)
{
}
Program: gdcm
Module: $RCSfile: gdcmDocEntryArchive.h,v $
Language: C++
- Date: $Date: 2005/01/20 11:39:49 $
- Version: $Revision: 1.5 $
+ Date: $Date: 2005/01/21 11:40:55 $
+ 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
#ifndef GDCMDOCENTRYARCHIVE_H
#define GDCMDOCENTRYARCHIVE_H
-#include "gdcmHeader.h"
+#include "gdcmFile.h"
namespace gdcm
{
//-----------------------------------------------------------------------------
/**
* \brief Container
- * It's goal is to change the Header correctly. At this time, the change is
+ * It's goal is to change the File header correctly. At this time, the change is
* only made for the first level of the Document. In the future, it might
* consider Dicom Sequences (SeqEntry, within any SQItem).
* The change is made by replacing a DocEntry by an other that is created
- * outside the class. The old value is kept. When we restore the Header
+ * outside the class. The old value is kept. When we restore the File
* status, the added DocEntry is deleted and replaced by the old value.
*/
class GDCM_EXPORT DocEntryArchive
{
public:
- DocEntryArchive(Header *header);
+ DocEntryArchive(File *f);
~DocEntryArchive();
void Print(std::ostream &os = std::cout);
void ClearArchive(void);
private:
- TagDocEntryHT &HeaderHT;
+ TagDocEntryHT &HeaderHT; // we keep the name HeaderHT
TagDocEntryHT Archive;
};
} // end namespace gdcm
Program: gdcm
Module: $RCSfile: gdcmDocument.h,v $
Language: C++
- Date: $Date: 2005/01/20 16:17:00 $
- Version: $Revision: 1.95 $
+ Date: $Date: 2005/01/21 11:40:55 $
+ Version: $Revision: 1.96 $
Copyright (c) CREATIS (Centre de Recherche et d'Applications en Traitement de
l'Image). All rights reserved. See Doc/License.txt or
//-----------------------------------------------------------------------------
/**
- * \brief Derived by both Header and DicomDir
+ * \brief Derived by both gdcm::File and gdcm::DicomDir
*/
class GDCM_EXPORT Document : public ElementSet
{
public:
-// Informations contained in the parser
+// Informations contained in the gdcm::Document
virtual bool IsReadable();
FileType GetFileType();
protected:
// Methods
// Constructor and destructor are protected to forbid end user
- // to instanciate from this class Document (only Header and
- // DicomDir are meaningfull).
+ // to instanciate from this class Document (only gdcm::File and
+ // gdcm::DicomDir are meaningfull).
Document();
Document( std::string const &filename );
virtual ~Document();
/// the well known 'Bad Big Endian' and 'Bad Little Endian' codes
int SwapCode;
- ///\brief whether we already parsed group 0002
+ ///\brief whether we already parsed group 0002 (Meta Elements)
bool Group0002Parsed;
///\brief whether file has a DCM Preamble
bool HasDCMPreamble;
- /// File Pointer, opened during Header parsing.
+ /// File Pointer, opened during Document parsing.
std::ifstream *Fp;
/// ACR, ACR_LIBIDO, ExplicitVR, ImplicitVR, Unknown
Program: gdcm
Module: $RCSfile: gdcmFileHelper.cxx,v $
Language: C++
- Date: $Date: 2005/01/20 16:22:52 $
- Version: $Revision: 1.1 $
+ Date: $Date: 2005/01/21 11:40:55 $
+ Version: $Revision: 1.2 $
Copyright (c) CREATIS (Centre de Recherche et d'Applications en Traitement de
l'Image). All rights reserved. See Doc/License.txt or
#include "gdcmDebug.h"
#include "gdcmUtil.h"
#include "gdcmBinEntry.h"
-#include "gdcmHeader.h"
+#include "gdcmFile.h"
#include "gdcmPixelReadConvert.h"
#include "gdcmPixelWriteConvert.h"
#include "gdcmDocEntryArchive.h"
// Constructor / Destructor
/**
* \brief Constructor dedicated to deal with the *pixels* area of a ACR/DICOMV3
- * file (Header only deals with the ... header)
+ * file (gdcm::File only deals with the ... header)
* Opens (in read only and when possible) an existing file and checks
* for DICOM compliance. Returns NULL on failure.
* It will be up to the user to load the pixels into memory
- * (see GetImageData, GetImageDataRaw)
* \note the in-memory representation of all available tags found in
* the DICOM header is post-poned to first header information access.
* This avoid a double parsing of public part of the header when
*/
FileHelper::FileHelper( )
{
- HeaderInternal = new Header( );
+ FileInternal = new File( );
SelfHeader = true;
- Initialise();
+ Initialize();
}
/**
* \brief Constructor dedicated to deal with the *pixels* area of a ACR/DICOMV3
- * file (Header only deals with the ... header)
+ * file (File only deals with the ... header)
* Opens (in read only and when possible) an existing file and checks
* for DICOM compliance. Returns NULL on failure.
* It will be up to the user to load the pixels into memory
- * (see GetImageData, GetImageDataRaw)
* \note the in-memory representation of all available tags found in
* the DICOM header is post-poned to first header information access.
* This avoid a double parsing of public part of the header when
* seen as a side effect).
* @param header already built Header
*/
-FileHelper::FileHelper(Header *header)
+FileHelper::FileHelper(File *header)
{
- HeaderInternal = header;
+ FileInternal = header;
SelfHeader = false;
- Initialise();
+ Initialize();
}
/**
* \brief Constructor dedicated to deal with the *pixels* area of a ACR/DICOMV3
- * file (Header only deals with the ... header)
+ * file (gdcm::File only deals with the ... header)
* Opens (in read only and when possible) an existing file and checks
* for DICOM compliance. Returns NULL on failure.
* It will be up to the user to load the pixels into memory
- * (see GetImageData, GetImageDataRaw)
* \note the in-memory representation of all available tags found in
* the DICOM header is post-poned to first header information access.
* This avoid a double parsing of public part of the header when
*/
FileHelper::FileHelper(std::string const & filename )
{
- HeaderInternal = new Header( filename );
+ FileInternal = new File( filename );
SelfHeader = true;
- Initialise();
+ Initialize();
}
/**
if( SelfHeader )
{
- delete HeaderInternal;
+ delete FileInternal;
}
- HeaderInternal = 0;
+ FileInternal = 0;
}
//-----------------------------------------------------------------------------
// Print
void FileHelper::Print(std::ostream &os, std::string const &)
{
- HeaderInternal->SetPrintLevel(PrintLevel);
- HeaderInternal->Print(os);
+ FileInternal->SetPrintLevel(PrintLevel);
+ FileInternal->Print(os);
PixelReadConverter->SetPrintLevel(PrintLevel);
PixelReadConverter->Print(os);
return 0;
}
- if ( HeaderInternal->HasLUT() && PixelReadConverter->BuildRGBImage() )
+ if ( FileInternal->HasLUT() && PixelReadConverter->BuildRGBImage() )
{
return PixelReadConverter->GetRGB();
}
return 0;
}
- if ( HeaderInternal->HasLUT() && PixelReadConverter->BuildRGBImage() )
+ if ( FileInternal->HasLUT() && PixelReadConverter->BuildRGBImage() )
{
if ( PixelReadConverter->GetRGBSize() > maxSize )
{
bool check = CheckWriteIntegrity();
if(check)
{
- check = HeaderInternal->Write(fileName,WriteType);
+ check = FileInternal->Write(fileName,WriteType);
}
RestoreWrite();
// --------------------------------------------------------------
// Special Patch to allow gdcm to re-write ACR-LibIDO formated images
//
- // ...and we restore the Header to be Dicom Compliant again
+ // ...and we restore the header to be Dicom Compliant again
// just after writting
RestoreWriteOfLibido();
// ----------------- End of Special Patch ----------------
bool FileHelper::SetEntry(std::string const &content,
uint16_t group, uint16_t elem)
{
- return HeaderInternal->SetEntry(content,group,elem);
+ return FileInternal->SetEntry(content,group,elem);
}
bool FileHelper::SetEntry(uint8_t *content, int lgth,
uint16_t group, uint16_t elem)
{
- return HeaderInternal->SetEntry(content,lgth,group,elem);
+ return FileInternal->SetEntry(content,lgth,group,elem);
}
/**
- * \brief Modifies the value of a given Doc Entry (Dicom Element)
+ * \brief Modifies the value of a given DocEntry (Dicom entry)
* when it exists. Create it with the given value when unexistant.
* @param content (string) Value to be set
* @param group Group number of the Entry
* @param elem Element number of the Entry
- * \return pointer to the modified/created Header Entry (NULL when creation
+ * \return pointer to the modified/created Dicom entry (NULL when creation
* failed).
*/
bool FileHelper::ReplaceOrCreate(std::string const &content,
uint16_t group, uint16_t elem)
{
- return HeaderInternal->ReplaceOrCreate(content,group,elem) != NULL;
+ return FileInternal->ReplaceOrCreate(content,group,elem) != NULL;
}
/*
- * \brief Modifies the value of a given Header Entry (Dicom Element)
+ * \brief Modifies the value of a given DocEntry (Dicom entry)
* when it exists. Create it with the given value when unexistant.
* A copy of the binArea is made to be kept in the Document.
* @param binArea (binary) value to be set
* @param group Group number of the Entry
* @param elem Element number of the Entry
- * \return pointer to the modified/created Header Entry (NULL when creation
+ * \return pointer to the modified/created Dicom entry (NULL when creation
* failed).
*/
bool FileHelper::ReplaceOrCreate(uint8_t *binArea, int lgth,
uint16_t group, uint16_t elem)
{
- return HeaderInternal->ReplaceOrCreate(binArea,lgth,group,elem) != NULL;
+ return FileInternal->ReplaceOrCreate(binArea,lgth,group,elem) != NULL;
}
/**
{
if(PixelWriteConverter->GetUserData())
{
- int numberBitsAllocated = HeaderInternal->GetBitsAllocated();
+ int numberBitsAllocated = FileInternal->GetBitsAllocated();
if ( numberBitsAllocated == 0 || numberBitsAllocated == 12 )
{
numberBitsAllocated = 16;
}
- size_t decSize = HeaderInternal->GetXSize()
- * HeaderInternal->GetYSize()
- * HeaderInternal->GetZSize()
+ size_t decSize = FileInternal->GetXSize()
+ * FileInternal->GetYSize()
+ * FileInternal->GetZSize()
* ( numberBitsAllocated / 8 )
- * HeaderInternal->GetSamplesPerPixel();
+ * FileInternal->GetSamplesPerPixel();
size_t rgbSize = decSize;
- if( HeaderInternal->HasLUT() )
+ if( FileInternal->HasLUT() )
rgbSize = decSize * 3;
switch(WriteMode)
*/
void FileHelper::SetWriteToRaw()
{
- if( HeaderInternal->GetNumberOfScalarComponents() == 3
- && !HeaderInternal->HasLUT())
+ if( FileInternal->GetNumberOfScalarComponents() == 3
+ && !FileInternal->HasLUT())
{
SetWriteToRGB();
}
else
{
ValEntry *photInt = CopyValEntry(0x0028,0x0004);
- if(HeaderInternal->HasLUT())
+ if(FileInternal->HasLUT())
{
photInt->SetValue("PALETTE COLOR ");
}
PixelReadConverter->GetRawSize());
BinEntry *pixel =
- CopyBinEntry(GetHeader()->GetGrPixel(),GetHeader()->GetNumPixel());
+ CopyBinEntry(GetFile()->GetGrPixel(),GetFile()->GetNumPixel());
pixel->SetValue(GDCM_BINLOADED);
pixel->SetBinArea(PixelWriteConverter->GetData(),false);
pixel->SetLength(PixelWriteConverter->GetDataSize());
}
}
-
/**
* \brief
*/
void FileHelper::SetWriteToRGB()
{
- if(HeaderInternal->GetNumberOfScalarComponents()==3)
+ if(FileInternal->GetNumberOfScalarComponents()==3)
{
PixelReadConverter->BuildRGBImage();
}
BinEntry *pixel =
- CopyBinEntry(GetHeader()->GetGrPixel(),GetHeader()->GetNumPixel());
+ CopyBinEntry(GetFile()->GetGrPixel(),GetFile()->GetNumPixel());
pixel->SetValue(GDCM_BINLOADED);
pixel->SetBinArea(PixelWriteConverter->GetData(),false);
pixel->SetLength(PixelWriteConverter->GetDataSize());
// For old ACR-NEMA
// Thus, we have a RGB image and the bits allocated = 24 and
// samples per pixels = 1 (in the read file)
- if(HeaderInternal->GetBitsAllocated()==24)
+ if(FileInternal->GetBitsAllocated()==24)
{
ValEntry *bitsAlloc = CopyValEntry(0x0028,0x0100);
bitsAlloc->SetValue("8 ");
Archive->Restore(0x0028,0x0002);
Archive->Restore(0x0028,0x0004);
Archive->Restore(0x0028,0x0006);
- Archive->Restore(GetHeader()->GetGrPixel(),GetHeader()->GetNumPixel());
+ Archive->Restore(GetFile()->GetGrPixel(),GetFile()->GetNumPixel());
// For old ACR-NEMA (24 bits problem)
Archive->Restore(0x0028,0x0100);
void FileHelper::SetWriteToLibido()
{
ValEntry *oldRow = dynamic_cast<ValEntry *>
- (HeaderInternal->GetDocEntry(0x0028, 0x0010));
+ (FileInternal->GetDocEntry(0x0028, 0x0010));
ValEntry *oldCol = dynamic_cast<ValEntry *>
- (HeaderInternal->GetDocEntry(0x0028, 0x0011));
+ (FileInternal->GetDocEntry(0x0028, 0x0011));
if( oldRow && oldCol )
{
void FileHelper::SetWriteToNoLibido()
{
ValEntry *recCode = dynamic_cast<ValEntry *>
- (HeaderInternal->GetDocEntry(0x0008,0x0010));
+ (FileInternal->GetDocEntry(0x0008,0x0010));
if( recCode )
{
if( recCode->GetValue() == "ACRNEMA_LIBIDO_1.1" )
ValEntry *FileHelper::CopyValEntry(uint16_t group,uint16_t elem)
{
- DocEntry *oldE = HeaderInternal->GetDocEntry(group, elem);
+ DocEntry *oldE = FileInternal->GetDocEntry(group, elem);
ValEntry *newE;
if(oldE)
}
else
{
- newE = GetHeader()->NewValEntry(group,elem);
+ newE = GetFile()->NewValEntry(group,elem);
}
return newE;
*/
BinEntry *FileHelper::CopyBinEntry(uint16_t group,uint16_t elem)
{
- DocEntry *oldE = HeaderInternal->GetDocEntry(group, elem);
+ DocEntry *oldE = FileInternal->GetDocEntry(group, elem);
BinEntry *newE;
if(oldE)
}
else
{
- newE = GetHeader()->NewBinEntry(group,elem);
+ newE = GetFile()->NewBinEntry(group,elem);
}
return newE;
/**
* \brief Factorization for various forms of constructors.
*/
-void FileHelper::Initialise()
+void FileHelper::Initialize()
{
WriteMode = WMODE_RAW;
WriteType = ExplicitVR;
PixelReadConverter = new PixelReadConvert;
PixelWriteConverter = new PixelWriteConvert;
- Archive = new DocEntryArchive( HeaderInternal );
+ Archive = new DocEntryArchive( FileInternal );
- if ( HeaderInternal->IsReadable() )
+ if ( FileInternal->IsReadable() )
{
- PixelReadConverter->GrabInformationsFromHeader( HeaderInternal );
+ PixelReadConverter->GrabInformationsFromHeader( FileInternal );
}
}
if ( ! raw )
{
// The Raw image migth not be loaded yet:
- std::ifstream *fp = HeaderInternal->OpenFile();
+ std::ifstream *fp = FileInternal->OpenFile();
PixelReadConverter->ReadAndDecompressPixelData( fp );
if(fp)
- HeaderInternal->CloseFile();
+ FileInternal->CloseFile();
raw = PixelReadConverter->GetRaw();
if ( ! raw )
Program: gdcm
Module: $RCSfile: gdcmFileHelper.h,v $
Language: C++
- Date: $Date: 2005/01/20 16:35:10 $
- Version: $Revision: 1.2 $
+ Date: $Date: 2005/01/21 11:40:55 $
+ Version: $Revision: 1.3 $
Copyright (c) CREATIS (Centre de Recherche et d'Applications en Traitement de
l'Image). All rights reserved. See Doc/License.txt or
namespace gdcm
{
-class Header;
+class File;
class ValEntry;
class BinEntry;
class PixelReadConvert;
class DocEntryArchive;
//-----------------------------------------------------------------------------
/**
- * \brief In addition to Dicom Header exploration, this class is designed
+ * \brief In addition to Dicom header exploration, this class is designed
* for accessing the image/volume content. One can also use it to
* write Dicom/ACR-NEMA/RAW files.
*/
public:
FileHelper( );
- FileHelper( Header *header );
+ FileHelper( File *header );
FileHelper( std::string const &filename );
virtual ~FileHelper();
void Print(std::ostream &os = std::cout, std::string const & indent = "");
- /// Accessor to \ref Header
- Header *GetHeader() { return HeaderInternal; }
+ /// Accessor to \ref File
+ File *GetFile() { return FileInternal; }
size_t GetImageDataSize();
size_t GetImageDataRawSize();
BinEntry *CopyBinEntry(uint16_t group,uint16_t elem);
private:
- void Initialise();
+ void Initialize();
uint8_t *GetRaw();
// members variables:
- /// Header to use to load the file
- Header *HeaderInternal;
+ /// gdcm::File to use to load the file
+ File *FileInternal;
/// \brief Whether the underlying \ref Header was loaded by
/// the constructor or passed to the constructor. When false
Program: gdcm
Module: $RCSfile: gdcmPixelReadConvert.cxx,v $
Language: C++
- Date: $Date: 2005/01/17 03:05:55 $
- Version: $Revision: 1.30 $
+ Date: $Date: 2005/01/21 11:40:55 $
+ Version: $Revision: 1.31 $
Copyright (c) CREATIS (Centre de Recherche et d'Applications en Traitement de
l'Image). All rights reserved. See Doc/License.txt or
=========================================================================*/
-////////////////// TEMPORARY NOTE
-// look for "fixMem" and convert that to a member of this class
-// Removing the prefix fixMem and dealing with allocations should do the trick
-//
-// grep PixelReadConvert everywhere and clean up !
-
#include "gdcmDebug.h"
-#include "gdcmHeader.h"
+#include "gdcmFile.h"
#include "gdcmGlobal.h"
#include "gdcmTS.h"
#include "gdcmPixelReadConvert.h"
}
}
-void PixelReadConvert::GrabInformationsFromHeader( Header *header )
+void PixelReadConvert::GrabInformationsFromHeader( File *header )
{
// Number of Bits Allocated for storing a Pixel is defaulted to 16
// when absent from the header.
HasLUT = header->HasLUT();
if ( HasLUT )
{
- // Just in case some access to a Header element requires disk access.
+ // Just in case some access to a File element requires disk access.
LutRedDescriptor = header->GetEntry( 0x0028, 0x1101 );
LutGreenDescriptor = header->GetEntry( 0x0028, 0x1102 );
LutBlueDescriptor = header->GetEntry( 0x0028, 0x1103 );
// [ refer to invocation of Document::SetMaxSizeLoadEntry() in
// Document::Document() ], the loading of the value (content) of a
// [Bin|Val]Entry occurence migth have been hindered (read simply NOT
- // loaded). Hence, we first try to obtain the LUTs data from the header
- // and when this fails we read the LUTs data directely from disk.
+ // loaded). Hence, we first try to obtain the LUTs data from the file
+ // and when this fails we read the LUTs data directly from disk.
/// \TODO Reading a [Bin|Val]Entry directly from disk is a kludge.
/// We should NOT bypass the [Bin|Val]Entry class. Instead
/// an access to an UNLOADED content of a [Bin|Val]Entry occurence
}
/**
- * \brief Build Red/Green/Blue/Alpha LUT from Header
+ * \brief Build Red/Green/Blue/Alpha LUT from File
* when (0028,0004),Photometric Interpretation = [PALETTE COLOR ]
* and (0028,1101),(0028,1102),(0028,1102)
* - xxx Palette Color Lookup Table Descriptor - are found
Program: gdcm
Module: $RCSfile: gdcmPixelReadConvert.h,v $
Language: C++
- Date: $Date: 2005/01/16 04:50:42 $
- Version: $Revision: 1.11 $
+ Date: $Date: 2005/01/21 11:40:55 $
+ Version: $Revision: 1.12 $
Copyright (c) CREATIS (Centre de Recherche et d'Applications en Traitement de
l'Image). All rights reserved. See Doc/License.txt or
namespace gdcm
{
-class Header;
+class File;
class RLEFramesInfo;
class JPEGFragmentsInfo;
void Print( std::ostream &os = std::cout, std::string const & indent = "" );
// In progress
- void GrabInformationsFromHeader( Header *header );
+ void GrabInformationsFromHeader( File *f );
bool ReadAndDecompressPixelData( std::ifstream *fp );
void Squeeze();
bool BuildRGBImage();
Program: gdcm
Module: $RCSfile: gdcmSerieHeader.cxx,v $
Language: C++
- Date: $Date: 2005/01/18 11:56:52 $
- Version: $Revision: 1.11 $
+ Date: $Date: 2005/01/21 11:40:55 $
+ Version: $Revision: 1.12 $
Copyright (c) CREATIS (Centre de Recherche et d'Applications en Traitement de
l'Image). All rights reserved. See Doc/License.txt or
#include "gdcmSerieHeader.h"
#include "gdcmDirList.h"
-#include "gdcmHeader.h"
+#include "gdcmFile.h"
#include "gdcmDebug.h"
#include <math.h>
namespace gdcm
{
-typedef std::vector<Header* > GdcmHeaderVector;
+typedef std::vector<File* > GdcmFileVector;
//-----------------------------------------------------------------------------
// Constructor / Destructor
SerieHeader::SerieHeader()
SerieHeader::~SerieHeader()
{
/// \todo
- for ( GdcmHeaderList::const_iterator it = CoherentGdcmFileList.begin();
+ for ( GdcmFileList::const_iterator it = CoherentGdcmFileList.begin();
it != CoherentGdcmFileList.end(); ++it)
{
delete *it;
void SerieHeader::AddFileName(std::string const &filename)
{
//directly use string and not const char*:
- Header *header = new Header( filename );
+ File *header = new File( filename );
if( header->IsReadable() )
{
// 0020 000e UI REL Series Instance UID
std::vector<float> distlist;
//!\todo rewrite this for loop.
- for ( GdcmHeaderList::const_iterator
+ for ( GdcmFileList::const_iterator
it = CoherentGdcmFileList.begin();
it != CoherentGdcmFileList.end(); ++it )
{
// Then I order the slices according to the value "dist". Finally, once
// I've read in all the slices, I calculate the z-spacing as the difference
// between the "dist" values for the first two slices.
- GdcmHeaderVector CoherentGdcmFileVector(n);
+ GdcmFileVector CoherentGdcmFileVector(n);
// CoherentGdcmFileVector.reserve( n );
CoherentGdcmFileVector.resize( n );
// gdcmAssertMacro( CoherentGdcmFileVector.capacity() >= n );
n = 0;
//VC++ don't understand what scope is !! it -> it2
- for (GdcmHeaderList::const_iterator it2 = CoherentGdcmFileList.begin();
+ for (GdcmFileList::const_iterator it2 = CoherentGdcmFileList.begin();
it2 != CoherentGdcmFileList.end(); ++it2, ++n)
{
//2*n sort algo !!
CoherentGdcmFileList.clear(); //this doesn't delete list's element, node only
//VC++ don't understand what scope is !! it -> it3
- for (GdcmHeaderVector::const_iterator it3 = CoherentGdcmFileVector.begin();
+ for (GdcmFileVector::const_iterator it3 = CoherentGdcmFileVector.begin();
it3 != CoherentGdcmFileVector.end(); ++it3)
{
CoherentGdcmFileList.push_back( *it3 );
int n = 0;//CoherentGdcmFileList.size() is a O(N) operation
unsigned char *partition;
- GdcmHeaderList::const_iterator it = CoherentGdcmFileList.begin();
+ GdcmFileList::const_iterator it = CoherentGdcmFileList.begin();
min = max = (*it)->GetImageNumber();
for (; it != CoherentGdcmFileList.end(); ++it, ++n)
partition = new unsigned char[n];
memset(partition, 0, n);
- GdcmHeaderVector CoherentGdcmFileVector(n);
+ GdcmFileVector CoherentGdcmFileVector(n);
//VC++ don't understand what scope is !! it -> it2
- for (GdcmHeaderList::const_iterator it2 = CoherentGdcmFileList.begin();
+ for (GdcmFileList::const_iterator it2 = CoherentGdcmFileList.begin();
it2 != CoherentGdcmFileList.end(); ++it2)
{
pos = (*it2)->GetImageNumber();
//VC++ don't understand what scope is !! it -> it3
CoherentGdcmFileList.clear(); //this doesn't delete list's element, node only
- for ( GdcmHeaderVector::const_iterator it3 = CoherentGdcmFileVector.begin();
+ for ( GdcmFileVector::const_iterator it3 = CoherentGdcmFileVector.begin();
it3 != CoherentGdcmFileVector.end(); ++it3 )
{
CoherentGdcmFileList.push_back( *it3 );
Program: gdcm
Module: $RCSfile: gdcmSerieHeader.h,v $
Language: C++
- Date: $Date: 2005/01/14 21:30:53 $
- Version: $Revision: 1.6 $
+ Date: $Date: 2005/01/21 11:40:56 $
+ 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
namespace gdcm
{
-class Header;
+class File;
//-----------------------------------------------------------------------------
/**
- * \ingroup SerieHeader
* \brief
* - This class should be used for a stack of 2D dicom images.
- * - For a multiframe dicom image better use directly SerieHeader
-*/
+ */
class GDCM_EXPORT SerieHeader
{
public:
- typedef std::list<Header* > GdcmHeaderList;
+ typedef std::list<File* > GdcmFileList;
SerieHeader();
~SerieHeader();
/// \brief Gets the *coherent* File List
/// @return the *coherent* File List
/// Caller must call OrderGdcmFileList first
- const GdcmHeaderList &GetGdcmFileList() { return CoherentGdcmFileList; }
+ const GdcmFileList &GetGdcmFileList() { return CoherentGdcmFileList; }
private:
bool ImagePositionPatientOrdering();
bool ImageNumberOrdering();
bool FileNameOrdering();
- GdcmHeaderList CoherentGdcmFileList;
+ GdcmFileList CoherentGdcmFileList;
/// Ref to the current Serie Instance UID to avoid mixing two series
/// within the same directory
std::string CurrentSerieUID;
Program: gdcm
Module: $RCSfile: gdcmUtil.cxx,v $
Language: C++
- Date: $Date: 2005/01/18 16:19:57 $
- Version: $Revision: 1.112 $
+ Date: $Date: 2005/01/21 11:40:56 $
+ Version: $Revision: 1.113 $
Copyright (c) CREATIS (Centre de Recherche et d'Applications en Traitement de
l'Image). All rights reserved. See Doc/License.txt or
// In this case we should maybe check the string was not truncated.
// But I don't known how to check that...
#if defined(_MSC_VER) || defined(__BORLANDC__) || defined(__MINGW32__)
- // with WinSock DLL we need to initialise the WinSock before using gethostname
+ // with WinSock DLL we need to initialize the WinSock before using gethostname
WORD wVersionRequested = MAKEWORD(1,0);
WSADATA WSAData;
int err = WSAStartup(wVersionRequested,&WSAData);
Program: gdcm
Module: $RCSfile: gdcmValEntry.h,v $
Language: C++
- Date: $Date: 2005/01/16 04:50:42 $
- Version: $Revision: 1.36 $
+ Date: $Date: 2005/01/21 11:40:56 $
+ Version: $Revision: 1.37 $
Copyright (c) CREATIS (Centre de Recherche et d'Applications en Traitement de
l'Image). All rights reserved. See Doc/License.txt or
{
//-----------------------------------------------------------------------------
/**
- * \brief Any Dicom Document (File Header or DicomDir) contains
- * a set of DocEntry entries
+ * \brief Any Dicom Document (File header or DicomDir) contains
+ * a set of DocEntry - Dicom entries -
* (when successfuly parsed against a given Dicom dictionary)
* ValEntry is an elementary DocEntry (as opposed to SeqEntry)
*/
~ValEntry();
/// \brief Returns the 'Value' (e.g. "Dupond Marcel") converted into a
- /// 'string', event if it's stored as an integer in the header of the
- /// current Dicom Document Entry
+ /// 'string', event if it's physically stored as an integer in the header of the
+ /// current Document (File or DicomDir)
std::string const &GetValue() const { return Value; };
- /// Sets the value (string) of the current Dicom Document Entry.
+ /// Sets the value (string) of the current Dicom entry.
/// The size is updated
virtual void SetValue(std::string const &val);
virtual void WriteContent(std::ofstream *fp, FileType filetype);
protected:
- /// Sets the value (string) of the current Dicom Document Entry
+ /// Sets the value (string) of the current Dicom entry
void SetValueOnly(std::string const &val) { Value = val; };
private:
// Members :
- /// \brief Document Entry value, internaly represented as a std::string
+ /// \brief Dicom entry value, internaly represented as a std::string.
/// The Value Representation (\ref VR) is independently used
/// in order to interpret (decode) this field.
std::string Value;
Program: gdcm
Module: $RCSfile: vtkGdcmReader.cxx,v $
Language: C++
- Date: $Date: 2005/01/20 16:17:01 $
- Version: $Revision: 1.65 $
+ Date: $Date: 2005/01/21 11:40:56 $
+ Version: $Revision: 1.66 $
Copyright (c) CREATIS (Centre de Recherche et d'Applications en Traitement de
l'Image). All rights reserved. See Doc/License.txt or
// is compared to this new value to find a modification in the class
// parameters
// 2b/ the core of ExecuteData then needs gdcmFile (which in turns
-// initialises gdcmHeader in the constructor) in order to access
+// initialises gdcmFile in the constructor) in order to access
// the data-image.
//
// Possible solution:
// maintain a list of gdcmFiles (created by say ExecuteInformation) created
-// once and for all accross the life of vtkGdcmHeader (it would only load
+// once and for all accross the life of vtkGdcmFile (it would only load
// new gdcmFile if the user changes the list). ExecuteData would then use
// those gdcmFile and hence avoid calling the construtor:
// - advantage: the header of the files would only be parser once.
// - drawback: once execute information is called (i.e. on creation of
-// a vtkGdcmHeader) the gdcmFile structure is loaded in memory.
-// The average size of a gdcmHeader being of 100Ko, is one
+// a vtkGdcmFile) the gdcmFile structure is loaded in memory.
+// The average size of a gdcmFile being of 100Ko, is one
// loads 10 stacks of images with say 200 images each, you
// end-up with a loss of 200Mo...
//
// //////////////////////////////////////////////////////////////
#include "gdcmFileHelper.h"
-#include "gdcmHeader.h"
+#include "gdcmFile.h"
#include "vtkGdcmReader.h"
//#include <stdio.h>
#include <vtkPointData.h>
#include <vtkLookupTable.h>
-vtkCxxRevisionMacro(vtkGdcmReader, "$Revision: 1.65 $");
+vtkCxxRevisionMacro(vtkGdcmReader, "$Revision: 1.66 $");
vtkStandardNewMacro(vtkGdcmReader);
//-----------------------------------------------------------------------------
fclose(fp);
// Stage 1.2: check for Gdcm parsability
- gdcm::Header GdcmHeader(filename->c_str() );
- if (!GdcmHeader.IsReadable())
+ gdcm::File GdcmFile(filename->c_str() );
+ if (!GdcmFile.IsReadable())
{
vtkErrorMacro(<< "Gdcm cannot parse file " << filename->c_str());
vtkErrorMacro(<< "Removing this file from readed files "
}
// Stage 1.3: further gdcm compatibility on PixelType
- std::string type = GdcmHeader.GetPixelType();
+ std::string type = GdcmFile.GetPixelType();
if ( (type != "8U") && (type != "8S")
&& (type != "16U") && (type != "16S")
&& (type != "32U") && (type != "32S") )
}
// Stage 2: check coherence of the set of files
- int NX = GdcmHeader.GetXSize();
- int NY = GdcmHeader.GetYSize();
- int NZ = GdcmHeader.GetZSize();
+ int NX = GdcmFile.GetXSize();
+ int NY = GdcmFile.GetYSize();
+ int NZ = GdcmFile.GetZSize();
if (FoundReferenceFile)
{
// Stage 2.1: mandatory coherence stage:
ReferenceNZ = NZ;
ReturnedTotalNumberOfPlanes += NZ - 1; // First plane already added
this->ImageType = type;
- this->PixelSize = GdcmHeader.GetPixelSize();
+ this->PixelSize = GdcmFile.GetPixelSize();
- if( GdcmHeader.HasLUT() && this->AllowLookupTable )
+ if( GdcmFile.HasLUT() && this->AllowLookupTable )
{
// I could raise an error is AllowLookupTable is on and HasLUT() off
- this->NumComponents = GdcmHeader.GetNumberOfScalarComponentsRaw();
+ this->NumComponents = GdcmFile.GetNumberOfScalarComponentsRaw();
}
else
{
- this->NumComponents = GdcmHeader.GetNumberOfScalarComponents(); //rgb or mono
+ this->NumComponents = GdcmFile.GetNumberOfScalarComponents(); //rgb or mono
}
//Set image spacing
- this->DataSpacing[0] = GdcmHeader.GetXSpacing();
- this->DataSpacing[1] = GdcmHeader.GetYSpacing();
- this->DataSpacing[2] = GdcmHeader.GetZSpacing();
+ this->DataSpacing[0] = GdcmFile.GetXSpacing();
+ this->DataSpacing[1] = GdcmFile.GetYSpacing();
+ this->DataSpacing[2] = GdcmFile.GetZSpacing();
//Set image origin
- //this->DataOrigin[0] = GdcmHeader.GetXOrigin();
- //this->DataOrigin[1] = GdcmHeader.GetYOrigin();
- //this->DataOrigin[2] = GdcmHeader.GetZOrigin();
+ //this->DataOrigin[0] = GdcmFile.GetXOrigin();
+ //this->DataOrigin[1] = GdcmFile.GetYOrigin();
+ //this->DataOrigin[2] = GdcmFile.GetZOrigin();
}
} // End of loop on filename
// line comes first (for some axis related reasons?). Hence we need
// to load the image line by line, starting from the end.
- int numColumns = file.GetHeader()->GetXSize();
- int numLines = file.GetHeader()->GetYSize();
- int numPlanes = file.GetHeader()->GetZSize();
- int lineSize = NumComponents * numColumns * file.GetHeader()->GetPixelSize();
+ int numColumns = file.GetFile()->GetXSize();
+ int numLines = file.GetFile()->GetYSize();
+ int numPlanes = file.GetFile()->GetZSize();
+ int lineSize = NumComponents * numColumns * file.GetFile()->GetPixelSize();
int planeSize = lineSize * numLines;
unsigned char *src;
- if( file.GetHeader()->HasLUT() && AllowLookupTable )
+ if( file.GetFile()->HasLUT() && AllowLookupTable )
{
size = file.GetImageDataSize();
src = (unsigned char*) file.GetImageDataRaw();
Program: gdcm
Module: $RCSfile: vtkGdcmWriter.cxx,v $
Language: C++
- Date: $Date: 2005/01/20 16:31:43 $
- Version: $Revision: 1.12 $
+ Date: $Date: 2005/01/21 11:40:56 $
+ Version: $Revision: 1.13 $
Copyright (c) CREATIS (Centre de Recherche et d'Applications en Traitement de
l'Image). All rights reserved. See Doc/License.txt or
=========================================================================*/
-#include "gdcmHeader.h"
+#include "gdcmFile.h"
#include "gdcmFileHelper.h"
#include "gdcmDebug.h"
#include "vtkGdcmWriter.h"
#include <vtkPointData.h>
#include <vtkLookupTable.h>
-vtkCxxRevisionMacro(vtkGdcmWriter, "$Revision: 1.12 $");
+vtkCxxRevisionMacro(vtkGdcmWriter, "$Revision: 1.13 $");
vtkStandardNewMacro(vtkGdcmWriter);
//-----------------------------------------------------------------------------