Program: gdcm
Module: $RCSfile: BuildUpDicomDir.cxx,v $
Language: C++
- Date: $Date: 2005/01/25 15:44:22 $
- Version: $Revision: 1.13 $
+ Date: $Date: 2005/02/02 10:06:31 $
+ Version: $Revision: 1.14 $
Copyright (c) CREATIS (Centre de Recherche et d'Applications en Traitement de
l'Image). All rights reserved. See Doc/License.txt or
* and writes a file named NewDICOMDIR.
*/
-int main(int argc, char* argv[])
+int main(int argc, char *argv[])
{
std::string dirName = "NewDICOMDIR";
Program: gdcm
Module: $RCSfile: FindTags.cxx,v $
Language: C++
- Date: $Date: 2005/01/25 15:44:22 $
- Version: $Revision: 1.12 $
+ Date: $Date: 2005/02/02 10:06:31 $
+ 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 <iostream>
#include <stdio.h> // for sscanf
-int main(int argc, char* argv[])
+int main(int argc, char *argv[])
{
- std::string toto, titi;
+ std::string fileName;
gdcm::FileHelper *f1;
if(argc > 1 )
f1 = new gdcm::FileHelper(argv[1]);
else {
- toto = GDCM_DATA_ROOT;
- toto += "/test.acr";
- f1 = new gdcm::FileHelper(toto);
+ fileName = GDCM_DATA_ROOT;
+ fileName += "/test.acr";
+ f1 = new gdcm::FileHelper(fileName);
}
std::string ManufacturerName="SIEMENS ";
std::string RecCode="ACR-NEMA 2.0";
std::string ImagePositionPatient, Location, ImageLocation;
- std::string zozo;
+ std::string fileNameToWrite;
char c;
float x, y, z, l;
sscanf(ImagePositionPatient.c_str(), "%f%c%f%c%f", &x,&c,&y,&c,&z);
-// ceci est probablement une mauvaise idée !
+// probablely a bad idea !
// (peut casser l'ordre des images si la pile d'images
// traverse l'axe des X, ou des Y, ou des Z)
//l=sqrt(x*x + y*y + z*z);
-// ceci ne marchera pas si on se déplace à Z constant :-(
+// Will not work if we move on a Z constant :-(
l=z;
// existerait-il qq chose qui marche à tout coup?
// a eclaircir !
// SetEntryLength is private now.
-//TO DO : see is the pb goes on...
+//TO DO : see if the pb goes on...
//f1->GetFile()->SetEntryLength(strlen(Location.c_str())-1, 0x0020,0x0050);
//f1->SetValEntry(Location, 0x0028,0x0200);
//f1->GetFile()->SetEntryLength(strlen(ImageLocation.c_str())-1, 0x0020,0x0050); // prudence !
-// void* imageData= f1->GetImageData();
+// void *imageData= f1->GetImageData();
// ecriture d'un fichier ACR à partir d'un dcmFile correct.
- std::cout << "----------------avant PrintEntry---------------------" << std::endl;
+ std::cout << "----------------before PrintEntry---------------------" << std::endl;
f1->GetFile()->Print();
- std::cout << "----------------avant WriteDcm---------------------" << std::endl;
+ std::cout << "----------------before WriteDcm---------------------" << std::endl;
// ecriture d'un fichier ACR à partir d'un dcmFile correct.
- zozo = toto + ".acr";
+ fileNameToWrite = fileName + ".acr";
std::cout << "WriteACR" << std::endl;
- f1->WriteAcr(zozo);
+ f1->WriteAcr(fileNameToWrite);
std::cout << "----------------apres Write---------------------" << std::endl;
Program: gdcm
Module: $RCSfile: FlatHashTablePrint.cxx,v $
Language: C++
- Date: $Date: 2005/01/21 11:40:52 $
- Version: $Revision: 1.8 $
+ Date: $Date: 2005/02/02 10:06:31 $
+ 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
// as line argument) and print them. This is an illustration of the
// usage of \ref gdcmDocument::BuildFlatHashTable().
-int main(int , char* [])
+int main(int, char*[])
{
/* if (argc < 2)
{
return 1;
}
- gdcm::File* header = new gdcm::File( argv[1] );
- gdcm::TagDocEntryHT* Ht = header->BuildFlatHashTable();
+ 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: 2005/01/21 11:40:52 $
- Version: $Revision: 1.10 $
+ Date: $Date: 2005/02/02 10:06:31 $
+ 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
#include <iostream>
-int main(int argc, char* argv[])
+int main(int argc, char *argv[])
{
gdcm::File *e1;
Program: gdcm
Module: $RCSfile: PrintFile.cxx,v $
Language: C++
- Date: $Date: 2005/02/01 11:13:08 $
- Version: $Revision: 1.28 $
+ Date: $Date: 2005/02/02 10:06:31 $
+ Version: $Revision: 1.29 $
Copyright (c) CREATIS (Centre de Recherche et d'Applications en Traitement de
l'Image). All rights reserved. See Doc/License.txt or
#include <iostream>
-int main(int argc, char* argv[])
+int main(int argc, char *argv[])
{
gdcm::File *e1;
gdcm::FileHelper *f1;
Program: gdcm
Module: $RCSfile: TestChangeHeader.cxx,v $
Language: C++
- Date: $Date: 2005/01/25 15:44:22 $
- Version: $Revision: 1.12 $
+ Date: $Date: 2005/02/02 10:06:31 $
+ 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
// This examples read two images (could be the same). Try to modify
// Acquisition Matrix and then write the image again
-int main(int argc, char* argv[])
+int main(int argc, char *argv[])
{
if (argc < 3)
{
Program: gdcm
Module: $RCSfile: TestCopyDicom.cxx,v $
Language: C++
- Date: $Date: 2005/01/25 15:44:22 $
- Version: $Revision: 1.22 $
+ Date: $Date: 2005/02/02 10:06:31 $
+ Version: $Revision: 1.23 $
Copyright (c) CREATIS (Centre de Recherche et d'Applications en Traitement de
l'Image). All rights reserved. See Doc/License.txt or
#endif
// return true if the file exists
-bool FileExists(const char* filename)
+bool FileExists(const char *filename)
{
#ifdef _MSC_VER
# define access _access
}
}
-bool RemoveFile(const char* source)
+bool RemoveFile(const char *source)
{
#ifdef _MSC_VER
#define _unlink unlink
gdcm::FileHelper *copy = new gdcm::FileHelper( output );
size_t dataSize = original->GetImageDataSize();
- uint8_t* imageData = original->GetImageData();
+ uint8_t *imageData = original->GetImageData();
(void)imageData;
(void)dataSize;
//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 File !)
- // Waiting for a 'clean' solution, I keep the method ...JPRx
- gdcm::DocEntry* d=original->GetFile()->GetFirstEntry();
+ gdcm::DocEntry *d = original->GetFile()->GetFirstEntry();
while(d)
{
- if ( gdcm::BinEntry* b = dynamic_cast<gdcm::BinEntry*>(d) )
+ if ( gdcm::BinEntry *b = dynamic_cast<gdcm::BinEntry*>(d) )
{
copy->GetFile()->InsertBinEntry( b->GetBinArea(),b->GetLength(),
b->GetGroup(),b->GetElement(),
b->GetVR() );
}
- else if ( gdcm::ValEntry* v = dynamic_cast<gdcm::ValEntry*>(d) )
+ else if ( gdcm::ValEntry *v = dynamic_cast<gdcm::ValEntry*>(d) )
{
copy->GetFile()->InsertValEntry( v->GetValue(),
v->GetGroup(),v->GetElement(),
Program: gdcm
Module: $RCSfile: TestDcm2Acr.cxx,v $
Language: C++
- Date: $Date: 2005/01/21 11:40:52 $
- Version: $Revision: 1.8 $
+ Date: $Date: 2005/02/02 10:06:31 $
+ 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
#include <iostream>
-int main(int argc, char* argv[])
+int main(int argc, char *argv[])
{
- std::string toto;
- std::string zozo;
+ std::string fileName;
+ std::string fileNameToWrite;
- gdcm::FileHelper * f1;
+ gdcm::FileHelper *f1;
std::cout << " Before gdcmFileHelper()" << std::endl;
std::cout << "\n\n---------------------------------------" << std::endl;
if (argc > 1)
{
- toto = argv[1];
- f1 = new gdcm::FileHelper(toto);
+ fileName = argv[1];
+ f1 = new gdcm::FileHelper(fileName);
}
else
{
filename += "/test.acr";
f1 = new gdcm::FileHelper(filename);
}
- std::cout << " Sortie gdcmFileHelper()" << std::endl;
+ std::cout << " After gdcmFileHelper()" << std::endl;
- //e1.PrintPubDict(std::cout);
f1->GetFile()->Print();
- //cle = gdcmDictEntry::TranslateToKey(0x0028,0x0008);
-
int dataSize = f1->GetImageDataSize();
std::cout << "dataSize:" << dataSize << std::endl;
- // void* imageData= f1->GetFile()->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 ACR à partir d'un dcmFile correct.
- zozo = toto + ".nema";
- f1->WriteAcr(zozo);
+ fileNameToWrite = fileName + ".nema";
+ f1->WriteAcr(fileNameToWrite);
std::cout << "\n\n---------------------------------------\n\n" << std::endl;
f1->GetFile()->Print();
Program: gdcm
Module: $RCSfile: TestFromScratch.cxx,v $
Language: C++
- Date: $Date: 2005/02/01 11:13:08 $
- Version: $Revision: 1.16 $
+ Date: $Date: 2005/02/02 10:06:32 $
+ 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
int dataSize = f1->GetImageDataSize();
std::cout << "DataSize: " << dataSize << std::endl;
// Since we know the image is 16bits:
- uint8_t* imageData = f1->GetImageData();
+ uint8_t *imageData = f1->GetImageData();
// Hopefully default to something
gdcm::File *h2 = new gdcm::File();
// Copy of the header content
- gdcm::DocEntry* d = h1->GetFirstEntry();
+ gdcm::DocEntry *d = h1->GetFirstEntry();
while(d)
{
- if ( gdcm::ValEntry* v = dynamic_cast<gdcm::ValEntry*>(d) )
+ if ( gdcm::ValEntry *v = dynamic_cast<gdcm::ValEntry*>(d) )
{
// Do not bother with field from private dict
if( v->GetName() != "gdcm::Unknown" )
Program: gdcm
Module: $RCSfile: TestPapyrus.cxx,v $
Language: C++
- Date: $Date: 2005/02/01 10:34:59 $
- Version: $Revision: 1.12 $
+ Date: $Date: 2005/02/02 10:06:32 $
+ 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
#endif
// return true if the file exists
-bool FileExists(const char* filename)
+bool FileExists(const char *filename)
{
#ifdef _MSC_VER
# define access _access
}
}
-bool RemoveFile(const char* source)
+bool RemoveFile(const char *source)
{
#ifdef _MSC_VER
#define _unlink unlink
// and we don't perform any integrity check
// ----------------------------------------------------------------------
-int main(int argc, char* argv[])
+int main(int argc, char *argv[])
{
if (argc < 3)
{
return 0;
}
// to be sure to be at the beginning
- Fp->seekg(0, std::ios::end);
+ Fp->seekg(0, std::ios::end);
uint32_t offset;
std::string previousRows = Rows;
Program: gdcm
Module: $RCSfile: TestReadWriteReadCompare.cxx,v $
Language: C++
- Date: $Date: 2005/01/21 11:40:52 $
- Version: $Revision: 1.9 $
+ Date: $Date: 2005/02/02 10:06:32 $
+ 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
//Generated file:
#include "gdcmDataImages.h"
-int main(int argc, char* argv[])
+int main(int argc, char *argv[])
{
if (argc<2)
{
Program: gdcm
Module: $RCSfile: TestWrite.cxx,v $
Language: C++
- Date: $Date: 2005/01/24 16:10:49 $
- Version: $Revision: 1.17 $
+ Date: $Date: 2005/02/02 10:06:32 $
+ 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
int main(int argc, char *argv[])
{
- std::string zozo;
+ std::string fileNameToWrite;
gdcm::File *e1;
gdcm::FileHelper *f1;
- void* imageData;
+ void *imageData;
int dataSize;
if (argc < 3) {
<< "--------------------- file :" << argv[1]
<< std::endl;
- std::string toto = argv[1];
+ std::string fileName = argv[1];
std::string mode = argv[2];
- e1 = new gdcm::File( toto.c_str() );
+ e1 = new gdcm::File( fileName.c_str() );
if (!e1->IsReadable())
{
std::cerr << "Sorry, not a Readable DICOM / ACR File" <<std::endl;
// ecriture d'un fichier ACR
// à partir d'un dcmFile correct.
- zozo = toto + ".ACR";
+ fileNameToWrite = fileName + ".ACR";
std::cout << "WriteACR" << std::endl;
- f1->WriteAcr(zozo);
+ f1->WriteAcr(fileNameToWrite);
break;
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 dcmFile correct.
- zozo = toto + ".DCM";
+ fileNameToWrite = fileName + ".DCM";
std::cout << "WriteDCM Implicit VR" << std::endl;
- f1->WriteDcmImplVR(zozo);
+ f1->WriteDcmImplVR(fileNameToWrite);
break;
case 'x' :
// ecriture d'un fichier DICOM Explicit VR
// à partir d'un dcmFile correct.
- zozo = toto + ".XDCM";
+ fileNameToWrite = fileName + ".XDCM";
std::cout << "WriteDCM Explicit VR" << std::endl;
- f1->WriteDcmExplVR(zozo);
+ f1->WriteDcmExplVR(fileNameToWrite);
break;
case 'r' :
// Ecriture d'un Raw File, a afficher avec
// affim filein= dimx= dimy= nbit= signe=
- zozo = toto + ".RAW";
+ fileNameToWrite = fileName + ".RAW";
std::cout << "WriteRaw" << std::endl;
- f1->WriteRawData(zozo);
+ f1->WriteRawData(fileNameToWrite);
break;
case 'v' :
((uint16_t*)imageData)[i] += 60000; //32767;
}
}
- zozo = toto + ".VDCM";
+ fileNameToWrite = fileName + ".VDCM";
std::cout << "WriteDCM Explicit VR + VideoInv" << std::endl;
- f1->WriteDcmExplVR(zozo);
+ f1->WriteDcmExplVR(fileNameToWrite);
break;
}
Program: gdcm
Module: $RCSfile: TestWriteSimple.cxx,v $
Language: C++
- Date: $Date: 2005/01/22 12:39:11 $
- Version: $Revision: 1.10 $
+ Date: $Date: 2005/02/02 10:06:32 $
+ 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
#include "gdcmFile.h"
#include "gdcmFileHelper.h"
-int main(int argc, char* argv[])
+int main(int argc, char *argv[])
{
if (argc < 3)
{
const char *output = argv[2];
gdcm::File *f1 = new gdcm::File( header );
- gdcm::FileHelper *f2 = new gdcm::FileHelper( f1 );
+ gdcm::FileHelper *f2 = new gdcm::FileHelper( f1 );
// If the following call is important, then the API sucks. Why is it
// required to allocate PixelData when we are not using it !?
Program: gdcm
Module: $RCSfile: Volume2Dicom.cxx,v $
Language: C++
- Date: $Date: 2005/01/21 11:40:53 $
- Version: $Revision: 1.5 $
+ Date: $Date: 2005/02/02 10:06:32 $
+ 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
const unsigned int Dimension = 3;
void gdcmwrite(const char *inputfile, std::string directory);
-void GetFileDateAndTime(const char *inputfile, std::string &date, std::string &time);
+void GetFileDateAndTime(const char *inputfile,
+ std::string &date, std::string &time);
-int main( int argc, char * argv[] )
+int main( int argc, char *argv[] )
{
if (argc < 2)
{
// just an utility function to retrieve date and time of a file
-void GetFileDateAndTime(const char *inputfile, std::string &date, std::string &time)
+void GetFileDateAndTime(const char *inputfile, std::string &date,
+ std::string &time)
{
struct stat buf;
if (stat(inputfile, &buf) == 0)
Program: gdcm
Module: $RCSfile: Write.cxx,v $
Language: C++
- Date: $Date: 2005/01/24 16:10:49 $
- Version: $Revision: 1.18 $
+ Date: $Date: 2005/02/02 10:06:32 $
+ Version: $Revision: 1.19 $
Copyright (c) CREATIS (Centre de Recherche et d'Applications en Traitement de
l'Image). All rights reserved. See Doc/License.txt or
#include <iostream>
-int main(int argc, char* argv[])
+int main(int argc, char *argv[])
{
- std::string zozo;
+ std::string FileNameToWrite;
- gdcm::File* e1;
- gdcm::FileHelper * f1;
+ gdcm::File *e1;
+ gdcm::FileHelper *f1;
- //gdcmDocument * d; //not used
- uint8_t* imageData;
+ uint8_t *imageData;
int dataSize;
if (argc < 3) {
<< "--------------------- file :" << argv[1]
<< std::endl;
- std::string toto = argv[1];
+ std::string FileName = argv[1];
- e1 = new gdcm::File( toto.c_str() );
+ e1 = new gdcm::File( FileName.c_str() );
if (!e1->IsReadable()) {
std::cerr << "Sorry, not a Readable DICOM / ACR File" <<std::endl;
return 0;
// ecriture d'un fichier ACR
// à partir d'un dcmFile correct.
- zozo = toto + ".ACR";
+ FileNameToWrite = FileName + ".ACR";
std::cout << "WriteACR" << std::endl;
- f1->WriteAcr(zozo);
+ f1->WriteAcr(FileNameToWrite);
break;
case 'd' :
// ecriture d'un fichier DICOM Implicit VR
// à partir d'un dcmFile correct.
- zozo = toto + ".DCM";
+ FileNameToWrite = FileName + ".DCM";
std::cout << "WriteDCM Implicit VR" << std::endl;
- f1->WriteDcmImplVR(zozo);
+ f1->WriteDcmImplVR(FileNameToWrite);
break;
case 'x' :
// ecriture d'un fichier DICOM Explicit VR
// à partir d'un dcmFile correct.
- zozo = toto + ".DCM";
+ FileNameToWrite = FileName + ".DCM";
std::cout << "WriteDCM Implicit VR" << std::endl;
- f1->WriteDcmExplVR(zozo);
+ f1->WriteDcmExplVR(FileNameToWrite);
break;
case 'r' :
// Ecriture d'un Raw File, a afficher avec
// affim filein= dimx= dimy= nbit= signe=
- zozo = toto + ".RAW";
+ FileNameToWrite = FileName + ".RAW";
std::cout << "WriteRaw" << std::endl;
- f1->WriteRawData(zozo);
+ f1->WriteRawData(FileNameToWrite);
break;
}
Program: gdcm
Module: $RCSfile: WriteDicom.cxx,v $
Language: C++
- Date: $Date: 2005/01/25 15:44:22 $
- Version: $Revision: 1.15 $
+ Date: $Date: 2005/02/02 10:06:32 $
+ 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
// Writting of a DICOM file based on a correct dicom header
// and data pixel of another image
-int main(int argc, char* argv[])
+int main(int argc, char *argv[])
{
if (argc < 3)
// and that does the job
int dataSize = f2->GetImageDataSize();
- uint8_t* imageData = f2->GetImageData();
+ uint8_t *imageData = f2->GetImageData();
std::cout << "dataSize :" << dataSize << std::endl;
Program: gdcm
Module: $RCSfile: WriteDicomSimple.cxx,v $
Language: C++
- Date: $Date: 2005/01/25 15:44:22 $
- Version: $Revision: 1.10 $
+ Date: $Date: 2005/02/02 10:06:32 $
+ 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
#define COLOR_WINDOW 256
#define COLOR_LEVEL 128
-int main(int argc, char* argv[])
+int main(int argc, char *argv[])
{
if (argc < 3)
{
Program: gdcm
Module: $RCSfile: WriteRead.cxx,v $
Language: C++
- Date: $Date: 2005/01/21 11:40:53 $
- Version: $Revision: 1.12 $
+ Date: $Date: 2005/02/02 10:06:32 $
+ 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 <iostream>
-int main(int argc, char* argv[])
+int main(int argc, char *argv[])
{
- std::string zozo;
-
- gdcm::File* e1, *e2;
- gdcm::FileHelper * f1, *f2;
+ std::string fileNameToWrite;
+ gdcm::File *e1;
+ gdcm::File *e2;
+ gdcm::FileHelper *f1;
+ gdcm::FileHelper *f2;
uint8_t* imageData, *imageData2;
int dataSize, dataSize2;
return 1;
}
- std::string toto = argv[1];
+ std::string fileName = argv[1];
// --------------------- we read the input image
std::cout << argv[1] << std::endl;
- e1 = new gdcm::File( toto );
+ e1 = new gdcm::File( fileName );
if (!e1->IsReadable()) {
- std::cerr << "Sorry, " << toto <<" not a Readable DICOM / ACR File"
+ std::cerr << "Sorry, " << fileName <<" not a Readable DICOM / ACR File"
<<std::endl;
return 0;
}
// --------------------- we write it as an Explicit VR DICOM file
- zozo = "temp.XDCM";
+ fileNameToWrite = "temp.XDCM";
std::cout << "WriteDCM Explicit VR" << std::endl;
- f1->WriteDcmExplVR(zozo);
+ f1->WriteDcmExplVR(fileNameToWrite);
// --------------------- we read the written image
- e2 = new gdcm::File( zozo );
+ e2 = new gdcm::File( fileNameToWrite );
if (!e2->IsReadable()) {
- std::cerr << "Sorry, " << zozo << " not a Readable DICOM / ACR File"
+ std::cerr << "Sorry, " << fileNameToWrite << " not a Readable DICOM / ACR File"
<<std::endl;
return 0;
}
std::cout << " ----------------------------------------- "
<< "Bad shot! Lengthes are different : "
<< dataSize << " # " << dataSize2
- << " for file : " << toto << std::endl;
+ << " for file : " << fileName << std::endl;
return 0;
}
if (int res=memcmp(imageData,imageData2,dataSize) !=0) {
std::cout << " ----------------------------------------- "
<< "Bad shot! Pixels are different : "
- << " for file : " << toto << std::endl;
+ << " for file : " << fileName << std::endl;
std::cout << "memcmp(imageData,imageData2,dataSize) = " << res << std::endl;
return 1;
}
Program: gdcm
Module: $RCSfile: makeDicomDir.cxx,v $
Language: C++
- Date: $Date: 2005/01/18 07:55:16 $
- Version: $Revision: 1.11 $
+ Date: $Date: 2005/02/02 10:06:32 $
+ 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
* and writes a file named NewDICOMDIR..
*/
-int main(int argc, char* argv[]) {
+int main(int argc, char *argv[])
+{
gdcm::DicomDir *dcmdir;
std::string dirName;
# Black list of images known to break lots of readers (efilm, xmedcon ...):
SET(BLACK_LIST
- # serial killer (also segfaults vtkgdcmViewer, but NOT PrintFile)
- #"gdcm-JPEG-LossLessThoravision.dcm"
-
- # Mathieu: temporarily remove as it kills my gnome session (but not kde)
- # JPR: also breaks TestReadWriteReadCompare : Pixel differ (as expanded
- # in memory)
- #"KODAK-12-MONO1-Odd_Terminated_Sequence.dcm"
# Multiframe Papyrus format image
- # Just to remember this format exist, and is gdcm::Header compliant
- # (NOT gdcm::File ...)
+ # Just to remember this format exists, and is gdcm::File compliant
+ # (NOT gdcm::FileHelper ...)
# any contribution is welcome
- "PET-cardio-Multiframe-Papyrus.dcm"
+ "PET-cardio-Multiframe-Papyrus.dcm"
+ # From David Clunie's Compresion Dataset
"D_CLUNIE_CT1_JLSN.dcm"
"D_CLUNIE_CT1_JLSL.dcm"
"D_CLUNIE_CT1_J2KR.dcm"
Program: gdcm
Module: $RCSfile: TestAllEntryVerify.cxx,v $
Language: C++
- Date: $Date: 2005/01/27 10:47:29 $
- Version: $Revision: 1.23 $
+ Date: $Date: 2005/02/02 10:05:26 $
+ 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
typedef std::string EntryValueType; // same type as ValEntry::value
typedef std::map< gdcm::TagKey, EntryValueType > MapEntryValues;
-typedef MapEntryValues* MapEntryValuesPtr;
+typedef MapEntryValues *MapEntryValuesPtr;
typedef std::string FileNameType;
typedef std::map< FileNameType, MapEntryValuesPtr > MapFileValuesType;
bool Check( std::string fileName );
private:
- bool AddKeyValuePairToMap( std::string& key, std::string& value );
+ bool AddKeyValuePairToMap( std::string &key, std::string &value );
- std::istream& eatwhite(std::istream& is);
- void eatwhite(std::string& toClean);
- std::string ExtractFirstString(std::string& toSplit);
- void CleanUpLine( std::string& line );
+ std::istream& eatwhite(std::istream &is);
+ void eatwhite(std::string &toClean);
+ std::string ExtractFirstString(std::string &toSplit);
+ void CleanUpLine( std::string &line );
bool Check( MapFileValuesType::iterator &fileIt );
- std::string ExtractValue(std::string& toSplit) throw ( ParserException );
- void ParseRegularLine( std::string& line ) throw ( ParserException );
+ std::string ExtractValue(std::string &toSplit) throw ( ParserException );
+ void ParseRegularLine( std::string &line ) throw ( ParserException );
void FirstPassReferenceFile() throw ( ParserException );
bool SecondPassReferenceFile() throw ( ParserException );
- void HandleFileName( std::string& line ) throw ( ParserException );
- void HandleKey( std::string& line ) throw ( ParserException );
- bool HandleValue( std::string& line ) throw ( ParserException );
+ void HandleFileName( std::string &line ) throw ( ParserException );
+ void HandleKey( std::string &line ) throw ( ParserException );
+ bool HandleValue( std::string &line ) throw ( ParserException );
static uint16_t axtoi( char* );
private:
std::string CurrentValue;
/// The current MapEntryValues pointer:
- MapEntryValues* CurrentMapEntryValuesPtr;
+ MapEntryValues *CurrentMapEntryValuesPtr;
};
ReferenceFileParser::ReferenceFileParser()
return intValue;
}
-void ReferenceFileParser::SetDataPath( std::string& inDataPath )
+void ReferenceFileParser::SetDataPath( std::string &inDataPath )
{
DataPath = inDataPath;
}
-bool ReferenceFileParser::AddKeyValuePairToMap( std::string& key,
- std::string& value )
+bool ReferenceFileParser::AddKeyValuePairToMap( std::string &key,
+ std::string &value )
{
if ( !CurrentMapEntryValuesPtr )
return false;
return true;
}
-std::istream& ReferenceFileParser::eatwhite( std::istream& is )
+std::istream &ReferenceFileParser::eatwhite( std::istream &is )
{
char c;
while (is.get(c)) {
toClean.erase( 0, toClean.find_first_of( " " ) + 1 );
}
-std::string ReferenceFileParser::ExtractFirstString( std::string& toSplit )
+std::string ReferenceFileParser::ExtractFirstString( std::string &toSplit )
{
std::string firstString;
eatwhite( toSplit );
return firstString;
}
-std::string ReferenceFileParser::ExtractValue( std::string& toSplit )
+std::string ReferenceFileParser::ExtractValue( std::string &toSplit )
throw ( ParserException )
{
eatwhite( toSplit );
from.seekg( 0, std::ios::beg );
}
-bool ReferenceFileParser::Open( std::string& referenceFileName )
+bool ReferenceFileParser::Open( std::string &referenceFileName )
{
from.open( referenceFileName.c_str(), std::ios::in );
if ( !from.is_open() )
return true; //??
}
-void ReferenceFileParser::CleanUpLine( std::string& line )
+void ReferenceFileParser::CleanUpLine( std::string &line )
{
// Cleanup from comments:
if ( line.find_first_of( "#" ) != std::string::npos )
eatwhite( line );
}
-void ReferenceFileParser::HandleFileName( std::string& line )
+void ReferenceFileParser::HandleFileName( std::string &line )
throw ( ParserException )
{
if ( line.length() == 0 )
CurrentFileName = ExtractFirstString(line);
}
-void ReferenceFileParser::HandleKey( std::string& line )
+void ReferenceFileParser::HandleKey( std::string &line )
throw ( ParserException )
{
if ( CurrentKey.length() != 0 )
}
}
-bool ReferenceFileParser::HandleValue( std::string& line )
+bool ReferenceFileParser::HandleValue( std::string &line )
throw ( ParserException )
{
if ( line.length() == 0 )
return true;
}
-void ReferenceFileParser::ParseRegularLine( std::string& line)
+void ReferenceFileParser::ParseRegularLine( std::string &line)
throw ( ParserException )
{
if ( line.length() == 0 )
return true; //??
}
-int TestAllEntryVerify(int argc, char* argv[])
+int TestAllEntryVerify(int argc, char *argv[])
{
if ( argc > 2 )
{
Program: gdcm
Module: $RCSfile: TestBug.cxx,v $
Language: C++
- Date: $Date: 2005/01/21 11:40:54 $
- Version: $Revision: 1.18 $
+ Date: $Date: 2005/02/02 10:05:26 $
+ Version: $Revision: 1.19 $
Copyright (c) CREATIS (Centre de Recherche et d'Applications en Traitement de
l'Image). All rights reserved. See Doc/License.txt or
#include "gdcmFile.h"
-int TestBug(int argc, char* argv[])
+int TestBug(int argc, char *argv[])
{
- gdcm::File* e1;
+ gdcm::File *e1;
if (argc > 1)
e1 = new gdcm::File( argv[1] );
filename += "/test.acr";
e1 = new gdcm::File( filename.c_str() );
}
- //e1->PrintPubDict();
- //e1->GetPubDict()->GetEntriesByKey();
+
e1->GetPubDict()->Print();
delete e1;
Program: gdcm
Module: $RCSfile: TestChangeHeader.cxx,v $
Language: C++
- Date: $Date: 2005/01/25 15:29:33 $
- Version: $Revision: 1.32 $
+ Date: $Date: 2005/02/02 10:05:26 $
+ 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
// and pixels of an other image
-int TestChangeHeader(int argc, char* argv[])
+int TestChangeHeader(int argc, char *argv[])
{
if (argc < 3)
{
int dataSize = f2->GetImageDataSize();
printf ("dataSize %d\n",dataSize);
- uint8_t* imageData= f2->GetImageData();
+ uint8_t *imageData= f2->GetImageData();
// TODO : Why don't we merge theese 2 functions ?
Program: gdcm
Module: $RCSfile: TestCopyDicom.cxx,v $
Language: C++
- Date: $Date: 2005/01/26 16:43:10 $
- Version: $Revision: 1.37 $
+ Date: $Date: 2005/02/02 10:05:26 $
+ Version: $Revision: 1.38 $
Copyright (c) CREATIS (Centre de Recherche et d'Applications en Traitement de
l'Image). All rights reserved. See Doc/License.txt or
}
}
-bool RemoveFile(const char* source)
+bool RemoveFile(const char *source)
{
#ifdef _MSC_VER
#define _unlink unlink
return unlink(source) != 0 ? false : true;
}
-int CopyDicom(std::string const & filename,
- std::string const & output )
+int CopyDicom(std::string const &filename,
+ std::string const &output )
{
std::cout << " Testing: " << filename << std::endl;
if( FileExists( output.c_str() ) )
//////////////// Step 2:
std::cout << "2...";
- gdcm::DocEntry* d=originalH->GetFirstEntry();
+ gdcm::DocEntry *d=originalH->GetFirstEntry();
while(d)
{
- if ( gdcm::BinEntry* b = dynamic_cast<gdcm::BinEntry*>(d) )
+ if ( gdcm::BinEntry *b = dynamic_cast<gdcm::BinEntry*>(d) )
{
copyH->InsertBinEntry( b->GetBinArea(),b->GetLength(),
b->GetGroup(),b->GetElement(),
b->GetVR() );
}
- else if ( gdcm::ValEntry* v = dynamic_cast<gdcm::ValEntry*>(d) )
+ else if ( gdcm::ValEntry *v = dynamic_cast<gdcm::ValEntry*>(d) )
{
copyH->InsertValEntry( v->GetValue(),
v->GetGroup(),v->GetElement(),
gdcm::FileHelper *copy = new gdcm::FileHelper( copyH );
size_t dataSize = original->GetImageDataSize();
- uint8_t* imageData = original->GetImageData();
+ uint8_t *imageData = original->GetImageData();
// Useless to set the image data, because it's already made when
// copying the corresponding BinEntry that contains the pixel data
//////////////// Step 5:
std::cout << "5...";
size_t dataSizeWritten = copy->GetImageDataSize();
- uint8_t* imageDataWritten = copy->GetImageData();
+ uint8_t *imageDataWritten = copy->GetImageData();
if (dataSize != dataSizeWritten)
{
// Here we load a gdcmFile and then try to create from scratch a copy of it,
// copying field by field the dicom image
-int TestCopyDicom(int argc, char* argv[])
+int TestCopyDicom(int argc, char *argv[])
{
if ( argc == 3 )
{
Program: gdcm
Module: $RCSfile: TestCopyRescaleDicom.cxx,v $
Language: C++
- Date: $Date: 2005/01/26 16:43:10 $
- Version: $Revision: 1.12 $
+ Date: $Date: 2005/02/02 10:05:26 $
+ 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
//////////////// Step 2:
std::cout << "2...";
- // Copy of the header content
+ // Copy of the file content
gdcm::DocEntry* d = originalF->GetFirstEntry();
while(d)
{
Program: gdcm
Module: $RCSfile: TestDicomDirElement.cxx,v $
Language: C++
- Date: $Date: 2005/01/26 16:43:10 $
- Version: $Revision: 1.2 $
+ Date: $Date: 2005/02/02 10:05:26 $
+ 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
}
ddElt->Print( std::cout );
+ // TODO : User add an Entry (e.g Physician Name )
+
delete ddElt;
return 0;
}
Program: gdcm
Module: $RCSfile: TestDicomString.cxx,v $
Language: C++
- Date: $Date: 2005/01/08 23:18:31 $
- Version: $Revision: 1.4 $
+ Date: $Date: 2005/02/02 10:05:26 $
+ Version: $Revision: 1.5 $
Copyright (c) CREATIS (Centre de Recherche et d'Applications en Traitement de
l'Image). All rights reserved. See Doc/License.txt or
#include "gdcmUtil.h"
#include <assert.h>
-int TestDicomString(int , char* [])
+int TestDicomString(int, char *[])
{
int i;
const char *s = "\0\0";
char s1[] = "\0";
char s2[] = "\0\0";
char s3[] = "\0\0\0";
-char s4[] = "\0abc";*/
+char s4[] = "\0abc";
+*/
return 0;
}
Program: gdcm
Module: $RCSfile: TestDict.cxx,v $
Language: C++
- Date: $Date: 2005/01/26 16:43:10 $
- Version: $Revision: 1.6 $
+ Date: $Date: 2005/02/02 10:05:26 $
+ 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
#include <iostream>
#include <iomanip>
-int TestDict(int , char* [])
+int TestDict(int , char *[])
{
- std::cout << "-------- Test Default Dicom Dictionary : ----------" << std::endl;
+ std::cout << "----- Test Default Dicom Dictionary : ----------" << std::endl;
// Just to improve test coverage:
gdcm::Dict *tempDict = new gdcm::Dict("dummyFileNameThatDoesntExist");
// Default dict is supposed to be used.
tempDict->Print();
- std::cout << "-------- end Test Default Dicom Dictionary : --------" << std::endl;
+ std::cout << "---- end Test Default Dicom Dictionary : -------" << std::endl;
// Lets delete it.
delete tempDict;
Program: gdcm
Module: $RCSfile: TestDirList.cxx,v $
Language: C++
- Date: $Date: 2005/01/14 23:57:06 $
- Version: $Revision: 1.2 $
+ Date: $Date: 2005/02/02 10:05:26 $
+ 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
=========================================================================*/
#include "gdcmDirList.h"
-int TestDirList(int , char* [])
+int TestDirList(int , char *[])
{
std::string path = GDCM_DATA_ROOT;
std::cerr << path << std::endl;
Program: gdcm
Module: $RCSfile: TestHash.cxx,v $
Language: C++
- Date: $Date: 2004/11/16 04:28:20 $
- Version: $Revision: 1.16 $
+ Date: $Date: 2005/02/02 10:05:26 $
+ 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
#include <string>
#include <iostream>
-int TestHash( int, char * [] )
+int TestHash( int, char *[] )
{
std::cout << "Test::TestHash : " << std::endl;
std::cout << " Checks that the basic STL <map> functionalities required "
Program: gdcm
Module: $RCSfile: TestReadWriteReadCompare.cxx,v $
Language: C++
- Date: $Date: 2005/01/21 11:40:54 $
- Version: $Revision: 1.20 $
+ Date: $Date: 2005/02/02 10:05:26 $
+ Version: $Revision: 1.21 $
Copyright (c) CREATIS (Centre de Recherche et d'Applications en Traitement de
l'Image). All rights reserved. See Doc/License.txt or
//////////////// Step 1 (see above description):
- gdcm::File *header = new gdcm::File( filename );
- if( !header->IsReadable() )
+ gdcm::File *file = new gdcm::File( filename );
+ if( !file->IsReadable() )
{
std::cerr << "Test::TestReadWriteReadCompare: Image not gdcm compatible:"
<< filename << std::endl;
- delete header;
+ delete file;
return 1;
}
std::cout << " step 1...";
//////////////// Step 2:
- gdcm::FileHelper* file = new gdcm::FileHelper( header );
- int dataSize = file->GetImageDataSize();
- uint8_t* imageData = file->GetImageData(); //EXTREMELY IMPORTANT
+ gdcm::FileHelper *filehelper = new gdcm::FileHelper( file );
+ int dataSize = filehelper->GetImageDataSize();
+ uint8_t *imageData = filehelper->GetImageData(); //EXTREMELY IMPORTANT
// Sure, it is : It's up to the user to decide if he wants to
// GetImageData or if he wants to GetImageDataRaw
// (even if we do it by setting a flag, he will have to decide)
// --> I did. ctest doesn't break. But ... is it enought to say it's OK ?
- file->SetImageData(imageData, dataSize);
+ filehelper->SetImageData(imageData, dataSize);
- file->SetWriteModeToRGB();
- file->WriteDcmExplVR( output );
+ filehelper->SetWriteModeToRGB();
+ filehelper->WriteDcmExplVR( output );
std::cout << "2...";
//////////////// Step 3:
- gdcm::FileHelper* reread = new gdcm::FileHelper( output );
+ gdcm::FileHelper *reread = new gdcm::FileHelper( output );
if( !reread->GetFile()->IsReadable() )
{
std::cerr << "Failed" << std::endl
<< "Test::TestReadWriteReadCompare: Could not reread image "
<< "written:" << filename << std::endl;
- delete header;
delete file;
+ delete filehelper;
delete reread;
return 1;
}
std::cout << "3...";
// For the next step:
int dataSizeWritten = reread->GetImageDataSize();
- uint8_t* imageDataWritten = reread->GetImageData();
+ uint8_t *imageDataWritten = reread->GetImageData();
//////////////// Step 4:
// Test the image size
- if (header->GetXSize() != reread->GetFile()->GetXSize() ||
- header->GetYSize() != reread->GetFile()->GetYSize() ||
- header->GetZSize() != reread->GetFile()->GetZSize())
+ if (file->GetXSize() != reread->GetFile()->GetXSize() ||
+ file->GetYSize() != reread->GetFile()->GetYSize() ||
+ file->GetZSize() != reread->GetFile()->GetZSize())
{
std::cout << "Failed" << std::endl
<< " X Size differs: "
- << "X: " << header->GetXSize() << " # "
+ << "X: " << file->GetXSize() << " # "
<< reread->GetFile()->GetXSize() << " | "
- << "Y: " << header->GetYSize() << " # "
+ << "Y: " << file->GetYSize() << " # "
<< reread->GetFile()->GetYSize() << " | "
- << "Z: " << header->GetZSize() << " # "
+ << "Z: " << file->GetZSize() << " # "
<< reread->GetFile()->GetZSize() << std::endl;
- delete header;
delete file;
+ delete filehelper;
delete reread;
return 1;
}
std::cout << "Failed" << std::endl
<< " Pixel areas lengths differ: "
<< dataSize << " # " << dataSizeWritten << std::endl;
- delete header;
delete file;
+ delete filehelper;
delete reread;
return 1;
}
// Test the data's content
- if (int res = memcmp(imageData, imageDataWritten, dataSize) !=0)
+ if (memcmp(imageData, imageDataWritten, dataSize) !=0)
{
- (void)res;
std::cout << "Failed" << std::endl
<< " Pixel differ (as expanded in memory)." << std::endl;
- delete header;
delete file;
+ delete filehelper;
delete reread;
return 1;
}
std::cout << "4...OK." << std::endl ;
//////////////// Clean up:
- delete header;
delete file;
+ delete filehelper;
delete reread;
return 0;
}
-int TestReadWriteReadCompare(int argc, char* argv[])
+int TestReadWriteReadCompare(int argc, char *argv[])
{
int result = 0;
if (argc == 3)
Program: gdcm
Module: $RCSfile: TestTS.cxx,v $
Language: C++
- Date: $Date: 2005/01/23 10:12:32 $
- Version: $Revision: 1.8 $
+ Date: $Date: 2005/02/02 10:05:26 $
+ 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
std::cout << ts.IsTransferSyntax( "1.2.840.10008.1.2.4.55" ) << std::endl;
// JPEG Lossless, Non-Hierarchical (Process 14)
std::cout << ts.IsTransferSyntax( "1.2.840.10008.1.2.4.57" ) << std::endl;
- // JPEG Lossless, Hierarchical, First-Order Prediction (Process 14, [Selection Value 1])
+ // JPEG Lossless, Hierarchical, First-Order Prediction (Process 14,
+ // [Selection Value 1])
std::cout << ts.IsTransferSyntax( "1.2.840.10008.1.2.4.70" ) << std::endl;
// JPEG 2000 Lossless
std::cout << ts.IsTransferSyntax( "1.2.840.10008.1.2.4.90" ) << std::endl;
std::cout << "Test TS:" << std::endl;
std::cout << ts.IsJPEGLossless( "1.2.840.10008.1.2.4.55") << std::endl;
//if ( key == "1.2.840.10008.1.2.4.55"
-// || key == "1.2.840.10008.1.2.4.57"
-// || key == "1.2.840.10008.1.2.4.70" )
+// || key == "1.2.840.10008.1.2.4.57"
+// || key == "1.2.840.10008.1.2.4.70" )
std::cout << ts.IsRLELossless( "1.2.840.10008.1.2.5") << std::endl;
std::cout << ts.IsJPEGLossless( "1.2.840.10008.1.2.5") << std::endl;
std::cout << ts.IsJPEG2000( "1.2.840.10008.1.2.5") << std::endl;
std::cout << ts.IsJPEG( "1.2.840.10008.1.2.5") << std::endl;
- std::cout << ts.GetSpecialTransferSyntax( ts.GetSpecialTransferSyntax( "1.2.840.10008.1.2.5")) << std::endl;
- std::cout << gdcm::Global::GetTS()->IsRLELossless( "1.2.840.10008.1.2.5" ) << std::endl;
+ std::cout << ts.GetSpecialTransferSyntax(
+ ts.GetSpecialTransferSyntax( "1.2.840.10008.1.2.5")) << std::endl;
+ std::cout << gdcm::Global::GetTS()->IsRLELossless( "1.2.840.10008.1.2.5" )
+ << std::endl;
return ts.GetValue( "" ) != gdcm::GDCM_UNFOUND;
}
Program: gdcm
Module: $RCSfile: TestUtil.cxx,v $
Language: C++
- Date: $Date: 2005/01/27 12:02:26 $
- Version: $Revision: 1.9 $
+ Date: $Date: 2005/02/02 10:05:26 $
+ 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 "gdcmDebug.h"
#include <iostream>
-int TestUtil(int , char * [])
+int TestUtil(int , char *[])
{
// Time
std::cout << "Time:" << gdcm::Util::GetCurrentDateTime() << std::endl;
Program: gdcm
Module: $RCSfile: TestVR.cxx,v $
Language: C++
- Date: $Date: 2005/01/28 09:31:51 $
- Version: $Revision: 1.6 $
+ Date: $Date: 2005/02/02 10:05:26 $
+ 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
gdcm::VR *vr = new gdcm::VR();
- // There should be 16 entries
+ // There should be 16 entries ...
vr->Print( std::cout );
vr->IsVROfStringRepresentable( "PN" );
vr->IsVROfBinaryRepresentable( "PN" );
vr->IsVROfSequence( "" );
-
+ vr->IsVROfSequence( "SQ" );
delete vr;
return 0;
}
Program: gdcm
Module: $RCSfile: TestWriteSimple.cxx,v $
Language: C++
- Date: $Date: 2005/01/26 16:43:10 $
- Version: $Revision: 1.17 $
+ Date: $Date: 2005/02/02 10:05:26 $
+ 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
// Step 5 : Read the written image
std::cout << "5...";
- gdcm::FileHelper* reread = new gdcm::FileHelper( fileName );
+ gdcm::FileHelper *reread = new gdcm::FileHelper( fileName );
if( !reread->GetFile()->IsReadable() )
{
std::cerr << "Failed" << std::endl
// Step 6 : Compare to the written image
std::cout << "6...";
size_t dataSizeWritten = reread->GetImageDataSize();
- uint8_t* imageDataWritten = reread->GetImageData();
+ uint8_t *imageDataWritten = reread->GetImageData();
// Test the image size
if (fileToBuild->GetXSize() != reread->GetFile()->GetXSize() ||
return 0;
}
-int TestWriteSimple(int argc, char* argv[])
+int TestWriteSimple(int argc, char *argv[])
{
if (argc < 1)
{
Program: gdcm
Module: $RCSfile: VTKTestRead.cxx,v $
Language: C++
- Date: $Date: 2005/01/25 15:45:49 $
- Version: $Revision: 1.8 $
+ Date: $Date: 2005/02/02 10:05:26 $
+ 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
#endif
int VTKReadTest(vtkTesting *t,vtkImageViewer *viewer,
- std::string const & filename,
- std::string const & referenceFileName)
+ std::string const &filename,
+ std::string const &referenceFileName)
{
int retVal = 0; //by default this is an error
}
int ret = 0;
- vtkTesting* t = vtkTesting::New();
+ vtkTesting *t = vtkTesting::New();
vtkImageViewer *viewer;
if( show )
viewer = vtkImageViewer::New();
Program: gdcm
Module: $RCSfile: VTKTestReadSeq.cxx,v $
Language: C++
- Date: $Date: 2005/01/25 15:45:49 $
- Version: $Revision: 1.7 $
+ Date: $Date: 2005/02/02 10:05:26 $
+ 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
#define vtkFloatingPointType float
#endif
-int VTKReadSeqTest(vtkTesting *t,vtkImageViewer *viewer,
- std::string const & filename,
- std::string const & referenceFileName)
+int VTKReadSeqTest(vtkTesting *t, vtkImageViewer *viewer,
+ std::string const &filename,
+ std::string const &referenceFileName)
{
int retVal = 0; //by default this is an error
Program: gdcm
Module: $RCSfile: VTKTestWrite.cxx,v $
Language: C++
- Date: $Date: 2005/01/25 15:45:49 $
- Version: $Revision: 1.7 $
+ Date: $Date: 2005/02/02 10:05:26 $
+ 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
#endif
int VTKWriteTest(vtkTesting *t,vtkImageViewer *viewer,
- std::string const & filename,
- std::string const & referenceFileName)
+ std::string const &filename,
+ std::string const &referenceFileName)
{
int retVal = 0; //by default this is an error
}
int ret = 0;
- vtkTesting* t = vtkTesting::New();
+ vtkTesting *t = vtkTesting::New();
vtkImageViewer *viewer;
if( show )
viewer = vtkImageViewer::New();
Program: gdcm
Module: $RCSfile: gdcmBinEntry.cxx,v $
Language: C++
- Date: $Date: 2005/02/01 10:29:54 $
- Version: $Revision: 1.60 $
+ Date: $Date: 2005/02/02 10:02:16 $
+ Version: $Revision: 1.61 $
Copyright (c) CREATIS (Centre de Recherche et d'Applications en Traitement de
l'Image). All rights reserved. See Doc/License.txt or
/**
* \brief Constructor from a given BinEntry
*/
-BinEntry::BinEntry(DictEntry *e) : ContentEntry(e)
+BinEntry::BinEntry(DictEntry *e)
+ :ContentEntry(e)
{
BinArea = 0;
SelfArea = true;
* \brief Constructor from a given BinEntry
* @param e Pointer to existing Doc entry
*/
-BinEntry::BinEntry(DocEntry *e) : ContentEntry(e->GetDictEntry())
+BinEntry::BinEntry(DocEntry *e)
+ : ContentEntry(e->GetDictEntry())
{
Copy(e);
void* binArea = GetBinArea();
if (binArea)
{
- //s << " [" << GDCM_BINLOADED
s << " [" << GetValue()
<< "; length = " << GetLength() << "]";
}
}
else
{
- //s << " [gdcm::Binary data NOT loaded]";
s << " [" <<GetValue() << "]";
}
}
Program: gdcm
Module: $RCSfile: gdcmContentEntry.cxx,v $
Language: C++
- Date: $Date: 2005/01/30 17:30:57 $
- Version: $Revision: 1.8 $
+ Date: $Date: 2005/02/02 10:02:16 $
+ 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
* \brief Constructor for a given DictEntry
* @param e Pointer to existing dictionary entry
*/
-ContentEntry::ContentEntry(DictEntry *e) : DocEntry(e)
+ContentEntry::ContentEntry(DictEntry *e)
+ : DocEntry(e)
{
Value = GDCM_UNFOUND;
}
* @param e Pointer to existing Doc entry
*/
ContentEntry::ContentEntry(DocEntry *e)
- : DocEntry(e->GetDictEntry())
+ : DocEntry(e->GetDictEntry())
{
Copy(e);
}
Program: gdcm
Module: $RCSfile: gdcmDebug.cxx,v $
Language: C++
- Date: $Date: 2005/02/01 13:00:16 $
- Version: $Revision: 1.21 $
+ Date: $Date: 2005/02/02 10:02:16 $
+ 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
/**
* \brief Gets the debug flag value
- * @param level Get the debug flag
* @return debug flag value
*/
bool Debug::GetDebugFlag ()
/**
* \brief Set Accessor
- * @param flag Set the debug flag to redirect to file
+ * @param filename File to redirect debug info
* Absolutely nothing is check. You have to pass in
* a correct filename
*/
Program: gdcm
Module: $RCSfile: gdcmDicomDir.cxx,v $
Language: C++
- Date: $Date: 2005/02/01 13:00:16 $
- Version: $Revision: 1.125 $
+ Date: $Date: 2005/02/02 10:02:16 $
+ Version: $Revision: 1.126 $
Copyright (c) CREATIS (Centre de Recherche et d'Applications en Traitement de
l'Image). All rights reserved. See Doc/License.txt or
* \brief Constructor : creates an empty DicomDir
*/
DicomDir::DicomDir()
- :Document( )
+ :Document( )
{
Initialize(); // sets all private fields to NULL
NewMeta();
/**
* \brief Constructor Parses recursively the directory and creates the DicomDir
* or uses an already built DICOMDIR, depending on 'parseDir' value.
- * @param fileName name
+ * @param fileName name
* - of the root directory (parseDir = true)
* - of the DICOMDIR (parseDir = false)
* @param parseDir boolean
* \brief create a Document-like chained list from a root Directory
* @param path entry point of the tree-like structure
*/
-void DicomDir::CreateDicomDirChainedList(std::string const & path)
+void DicomDir::CreateDicomDirChainedList(std::string const &path)
{
CallStartMethod();
DirList dirList(path,1); // gets recursively the file list
Program: gdcm
Module: $RCSfile: gdcmDicomDirPatient.cxx,v $
Language: C++
- Date: $Date: 2005/02/01 10:29:55 $
- Version: $Revision: 1.36 $
+ Date: $Date: 2005/02/02 10:02:16 $
+ 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 Constructor
* \note End user must use : DicomDir::NewPatient()
*/
-DicomDirPatient::DicomDirPatient(bool empty):
- DicomDirObject()
+DicomDirPatient::DicomDirPatient(bool empty)
+ :DicomDirObject()
{
if( !empty )
{
Program: gdcm
Module: $RCSfile: gdcmDicomDirStudy.cxx,v $
Language: C++
- Date: $Date: 2005/02/01 10:29:55 $
- Version: $Revision: 1.35 $
+ Date: $Date: 2005/02/02 10:02:16 $
+ Version: $Revision: 1.36 $
Copyright (c) CREATIS (Centre de Recherche et d'Applications en Traitement de
l'Image). All rights reserved. See Doc/License.txt or
* \brief Constructor
* \note End user must use : DicomDirPatient::NewStudy()
*/
-DicomDirStudy::DicomDirStudy(bool empty):
- DicomDirObject()
+DicomDirStudy::DicomDirStudy(bool empty)
+ :DicomDirObject()
{
if( !empty )
{
*/
DicomDirSerie *DicomDirStudy::NewSerie()
{
- DicomDirSerie* st = new DicomDirSerie();
+ DicomDirSerie *st = new DicomDirSerie();
Series.push_back(st);
return st;
}
Program: gdcm
Module: $RCSfile: gdcmDictSet.cxx,v $
Language: C++
- Date: $Date: 2005/02/01 10:29:55 $
- Version: $Revision: 1.57 $
+ Date: $Date: 2005/02/02 10:02:16 $
+ Version: $Revision: 1.58 $
Copyright (c) CREATIS (Centre de Recherche et d'Applications en Traitement de
l'Image). All rights reserved. See Doc/License.txt or
* @param name Symbolic name that be used as identifier of the newly
* created dictionary.
*/
-Dict *DictSet::LoadDictFromFile(std::string const & filename,
- DictKey const & name)
+Dict *DictSet::LoadDictFromFile(std::string const &filename,
+ DictKey const &name)
{
Dict *newDict = new Dict(filename);
AppendDict(newDict, name);
Program: gdcm
Module: $RCSfile: gdcmDocEntry.cxx,v $
Language: C++
- Date: $Date: 2005/02/01 10:29:55 $
- Version: $Revision: 1.50 $
+ Date: $Date: 2005/02/02 10:02:17 $
+ 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
{
uint32_t ffff = 0xffffffff;
uint16_t group = GetGroup();
- VRKey vr = GetVR();
+ VRKey vr = GetVR();
uint16_t el = GetElement();
uint32_t lgr = GetLength();
//
// ----------- Writes the common part
//
- binary_write( *fp, group); //group
- binary_write( *fp, el); //element
+ binary_write( *fp, group); //group number
+ binary_write( *fp, el); //element number
if ( filetype == ExplicitVR )
{
Program: gdcm
Module: $RCSfile: gdcmDocEntrySet.cxx,v $
Language: C++
- Date: $Date: 2005/02/01 10:29:55 $
- Version: $Revision: 1.50 $
+ Date: $Date: 2005/02/02 10:02:17 $
+ 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
*/
void *DocEntrySet::GetEntryBinArea(uint16_t group, uint16_t elem)
{
- BinEntry *entry = GetBinEntry(group,elem);
+ BinEntry *entry = GetBinEntry(group, elem);
if( entry )
return entry->GetBinArea();
return 0;
*/
int DocEntrySet::GetEntryLength(uint16_t group, uint16_t elem)
{
- DocEntry *entry = GetDocEntry(group,elem);
+ DocEntry *entry = GetDocEntry(group, elem);
if( entry )
return entry->GetLength();
return -1;
*/
std::string DocEntrySet::GetEntryVR(uint16_t group, uint16_t elem)
{
- DocEntry *entry = GetDocEntry(group,elem);
+ DocEntry *entry = GetDocEntry(group, elem);
if( entry )
return entry->GetVR();
return GDCM_UNFOUND;
* @param group group number of the Dicom Element to modify
* @param elem element number of the Dicom Element to modify
*/
-bool DocEntrySet::SetValEntry(std::string const& content,
+bool DocEntrySet::SetValEntry(std::string const &content,
uint16_t group, uint16_t elem)
{
ValEntry *entry = GetValEntry(group, elem);
* \return pointer to the modified/created Header Entry (NULL when creation
* failed).
*/
-BinEntry *DocEntrySet::InsertBinEntry(uint8_t *binArea,int lgth,
+BinEntry *DocEntrySet::InsertBinEntry(uint8_t *binArea, int lgth,
uint16_t group, uint16_t elem,
TagName const &vr )
{
* @param elem element number of the new Entry
* @param vr VR of the new Entry
*/
-BinEntry *DocEntrySet::NewBinEntry(uint16_t group,uint16_t elem,
- TagName const & vr)
+BinEntry *DocEntrySet::NewBinEntry(uint16_t group, uint16_t elem,
+ TagName const &vr)
{
DictEntry *dictEntry = GetDictEntry(group, elem, vr);
gdcmAssertMacro(dictEntry);
* @param group group number of the new Entry
* @param elem element number of the new Entry
*/
-SeqEntry* DocEntrySet::NewSeqEntry(uint16_t group,uint16_t elem)
+SeqEntry* DocEntrySet::NewSeqEntry(uint16_t group, uint16_t elem)
{
DictEntry *dictEntry = GetDictEntry(group, elem, "SQ");
gdcmAssertMacro(dictEntry);
* @return Corresponding DictEntry when it exists, NULL otherwise.
*/
DictEntry *DocEntrySet::GetDictEntry(uint16_t group, uint16_t elem,
- TagName const & vr)
+ TagName const &vr)
{
DictEntry *dictEntry = GetDictEntry(group,elem);
DictEntry *goodEntry = dictEntry;
Program: gdcm
Module: $RCSfile: gdcmDocument.cxx,v $
Language: C++
- Date: $Date: 2005/02/01 10:29:55 $
- Version: $Revision: 1.218 $
+ Date: $Date: 2005/02/02 10:02:17 $
+ Version: $Revision: 1.219 $
Copyright (c) CREATIS (Centre de Recherche et d'Applications en Traitement de
l'Image). All rights reserved. See Doc/License.txt or
* \brief constructor
* @param filename 'Document' (File or DicomDir) to be opened for parsing
*/
-Document::Document( std::string const &filename ) : ElementSet(-1)
+Document::Document( std::string const &filename )
+ :ElementSet(-1)
{
SetMaxSizeLoadEntry(MAX_SIZE_LOAD_ELEMENT_VALUE);
Filename = filename;
gdcmVerboseMacro( "Starting parsing of file: " << Filename.c_str());
// Fp->seekg( 0, std::ios::beg);
- Fp->seekg(0, std::ios::end);
+ Fp->seekg(0, std::ios::end);
long lgt = Fp->tellg();
- Fp->seekg( 0, std::ios::beg);
+ Fp->seekg(0, std::ios::beg);
CheckSwap();
long beg = Fp->tellg();
* \brief This default constructor doesn't parse the file. You should
* then invoke \ref Document::SetFileName and then the parsing.
*/
-Document::Document() : ElementSet(-1)
+Document::Document()
+ :ElementSet(-1)
{
Fp = 0;
*/
bool Document::IsDocEntryAnInteger(DocEntry *entry)
{
- uint16_t elem = entry->GetElement();
- uint16_t group = entry->GetGroup();
+ uint16_t elem = entry->GetElement();
+ uint16_t group = entry->GetGroup();
const std::string &vr = entry->GetVR();
- uint32_t length = entry->GetLength();
+ uint32_t length = entry->GetLength();
// When we have some semantics on the element we just read, and if we
// a priori know we are dealing with an integer, then we shall be
{
RefPubDict = Global::GetDicts()->GetDefaultPubDict();
RefShaDict = NULL;
- Filetype = Unknown;
+ Filetype = Unknown;
}
/**
{
// We reached the EOF (or an error occured) therefore
// header parsing has to be considered as finished.
- //std::cout << e;
return 0;
}
Program: gdcm
Module: $RCSfile: gdcmFile.cxx,v $
Language: C++
- Date: $Date: 2005/02/01 10:29:55 $
- Version: $Revision: 1.206 $
+ Date: $Date: 2005/02/02 10:02:17 $
+ Version: $Revision: 1.207 $
Copyright (c) CREATIS (Centre de Recherche et d'Applications en Traitement de
l'Image). All rights reserved. See Doc/License.txt or
* \brief Constructor
* @param filename name of the file whose header we want to analyze
*/
-File::File( std::string const &filename ):
- Document( filename )
+File::File( std::string const &filename )
+ :Document( filename )
{
RLEInfo = new RLEFramesInfo;
JPEGInfo = new JPEGFragmentsInfo;
BinEntry *b = GetBinEntry(GrPixel,NumPixel);
if ( GetPixelSize() == 16 )
{
- uint16_t *im16 = (uint16_t*)b->GetBinArea();
+ uint16_t *im16 = (uint16_t *)b->GetBinArea();
int lgr = b->GetLength();
for( int i = 0; i < lgr / 2; i++ )
{
#endif //GDCM_WORDS_BIGENDIAN
*/
- Document::WriteContent(fp,filetype);
+ Document::WriteContent(fp, filetype);
/*
#ifdef GDCM_WORDS_BIGENDIAN
*/
int File::GetSamplesPerPixel()
{
- const std::string& strSize = GetEntryValue(0x0028,0x0002);
+ const std::string &strSize = GetEntryValue(0x0028,0x0002);
if ( strSize == GDCM_UNFOUND )
{
gdcmVerboseMacro( "(0028,0002) is supposed to be mandatory");
*/
bool File::IsMonochrome()
{
- const std::string& PhotometricInterp = GetEntryValue( 0x0028, 0x0004 );
+ const std::string &PhotometricInterp = GetEntryValue( 0x0028, 0x0004 );
if ( Util::DicomStringEqual(PhotometricInterp, "MONOCHROME1")
|| Util::DicomStringEqual(PhotometricInterp, "MONOCHROME2") )
{
Program: gdcm
Module: $RCSfile: gdcmFileHelper.cxx,v $
Language: C++
- Date: $Date: 2005/02/01 10:29:55 $
- Version: $Revision: 1.9 $
+ Date: $Date: 2005/02/02 10:02:18 $
+ 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
* seen as a side effect).
* @param filename file to be opened for parsing
*/
-FileHelper::FileHelper(std::string const & filename )
+FileHelper::FileHelper(std::string const &filename )
{
FileInternal = new File( filename );
SelfHeader = true;
Program: gdcm
Module: $RCSfile: gdcmJpeg.cxx,v $
Language: C++
- Date: $Date: 2005/01/31 04:00:04 $
- Version: $Revision: 1.39 $
+ Date: $Date: 2005/02/02 10:02:18 $
+ 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
* @return 1 on success, 0 on error
*/
-bool gdcm_write_JPEG_file (std::ofstream* fp, void* im_buf,
+bool gdcm_write_JPEG_file (std::ofstream *fp, void *im_buf,
int image_width, int image_height, int quality)
{
- JSAMPLE* image_buffer = (JSAMPLE*) im_buf;
+ JSAMPLE *image_buffer = (JSAMPLE*) im_buf;
/* This struct contains the JPEG compression parameters and pointers to
* working space (which is allocated as needed by the JPEG library).
* @return 1 on success, 0 on error
*/
void *SampBuffer;
-bool JPEGFragment::ReadJPEGFile (std::ifstream* fp, void* image_buffer , int& statesuspension)
+bool JPEGFragment::ReadJPEGFile (std::ifstream *fp, void *image_buffer, int &statesuspension)
{
pImage = (uint8_t*)image_buffer;
// This struct contains the JPEG decompression parameters and pointers to
Program: gdcm
Module: $RCSfile: gdcmPixelReadConvert.cxx,v $
Language: C++
- Date: $Date: 2005/02/01 10:29:55 $
- Version: $Revision: 1.43 $
+ Date: $Date: 2005/02/02 10:02:18 $
+ Version: $Revision: 1.44 $
Copyright (c) CREATIS (Centre de Recherche et d'Applications en Traitement de
l'Image). All rights reserved. See Doc/License.txt or
// Constructor / Destructor
PixelReadConvert::PixelReadConvert()
{
- RGB = 0;
- RGBSize = 0;
- Raw = 0;
- RawSize = 0;
- LutRGBA = 0;
- LutRedData = 0;
+ RGB = 0;
+ RGBSize = 0;
+ Raw = 0;
+ RawSize = 0;
+ LutRGBA = 0;
+ LutRedData = 0;
LutGreenData = 0;
- LutBlueData =0;
+ LutBlueData = 0;
}
PixelReadConvert::~PixelReadConvert()
throw ( FormatError )
{
int nbPixels = XSize * YSize;
- uint16_t* localDecompres = (uint16_t*)Raw;
+ uint16_t *localDecompres = (uint16_t*)Raw;
for( int p = 0; p < nbPixels; p += 2 )
{
uint32_t s32;
uint16_t high;
uint16_t low;
- uint32_t* im32 = (uint32_t*)Raw;
+ uint32_t *im32 = (uint32_t*)Raw;
switch ( SwapCode )
{
case 1234:
{
uint16_t mask = 0xffff;
mask = mask >> ( BitsAllocated - BitsStored );
- uint16_t* deb = (uint16_t*)Raw;
+ uint16_t *deb = (uint16_t*)Raw;
for(int i = 0; i<l; i++)
{
*deb = (*deb >> (BitsStored - HighBitPosition - 1)) & mask;
{
uint32_t mask = 0xffffffff;
mask = mask >> ( BitsAllocated - BitsStored );
- uint32_t* deb = (uint32_t*)Raw;
+ uint32_t *deb = (uint32_t*)Raw;
for(int i = 0; i<l; i++)
{
*deb = (*deb >> (BitsStored - HighBitPosition - 1)) & mask;
int l = XSize * YSize * ZSize;
- uint8_t* a = copyRaw;
- uint8_t* b = copyRaw + l;
- uint8_t* c = copyRaw + l + l;
+ uint8_t *a = copyRaw;
+ uint8_t *b = copyRaw + l;
+ uint8_t *c = copyRaw + l + l;
for (int j = 0; j < l; j++)
{
// We give up the checking to avoid some (useless ?) overhead
// (optimistic asumption)
int i;
- uint8_t* a = LutRGBA + 0;
+ uint8_t *a = LutRGBA + 0;
for( i=0; i < lengthR; ++i )
{
*a = LutRedData[i*mult+1];
// Build RGB Pixels
AllocateRGB();
- uint8_t* localRGB = RGB;
+ uint8_t *localRGB = RGB;
for (size_t i = 0; i < RawSize; ++i )
{
int j = Raw[i] * 4;
* @param indent Indentation string to be prepended during printing.
* @param os Stream to print to.
*/
-void PixelReadConvert::Print( std::ostream &os, std::string const & indent )
+void PixelReadConvert::Print( std::ostream &os, std::string const &indent )
{
os << indent
<< "--- Pixel information -------------------------"
Program: gdcm
Module: $RCSfile: gdcmRLEFramesInfo.cxx,v $
Language: C++
- Date: $Date: 2005/02/01 13:00:16 $
- Version: $Revision: 1.12 $
+ Date: $Date: 2005/02/02 10:02:18 $
+ 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
* Dicom encapsulated file and decompress it.
* @param fp already open File Pointer
* at which the pixel data should be copied
+ * @param raw raw
+ * @param xSize x Size
+ * @param ySize y Size
+ * @param BitsAllocated Bits allocated
* @return Boolean
*/
-bool RLEFramesInfo::DecompressRLEFile( std::ifstream *fp , uint8_t *raw, int xSize, int ySize, int zSize, int bitsAllocated )
+bool RLEFramesInfo::DecompressRLEFile( std::ifstream *fp , uint8_t *raw,
+ int xSize, int ySize, int zSize,
+ int bitsAllocated )
{
uint8_t *subRaw = raw;
long rawSegmentSize = xSize * ySize;
* @param numberOfFrames number of frames
* @return Boolean always true
*/
-bool RLEFramesInfo::ConvertRLE16BitsFromRLE8Bits( uint8_t* raw, int xSize,
- int ySize,int numberOfFrames )
+bool RLEFramesInfo::ConvertRLE16BitsFromRLE8Bits(uint8_t *raw, int xSize,
+ int ySize, int numberOfFrames)
{
size_t pixelNumber = xSize * ySize;
size_t rawSize = xSize * ySize * numberOfFrames;
// per pixel we cannot work in place within Raw and hence
// we copy it in a safe place, say copyRaw.
- uint8_t* copyRaw = new uint8_t[rawSize * 2];
+ uint8_t *copyRaw = new uint8_t[rawSize * 2];
memmove( copyRaw, raw, rawSize * 2 );
- uint8_t* x = raw;
- uint8_t* a = copyRaw;
- uint8_t* b = a + pixelNumber;
+ uint8_t *x = raw;
+ uint8_t *a = copyRaw;
+ uint8_t *b = a + pixelNumber;
for ( int i = 0; i < numberOfFrames; i++ )
{
}
delete[] copyRaw;
- /// \todo check that operator new []didn't fail, and sometimes return false
+ /// \todo check that operator new [] didn't fail, and sometimes return false
return true;
}
Program: gdcm
Module: $RCSfile: gdcmTS.cxx,v $
Language: C++
- Date: $Date: 2005/02/01 10:29:56 $
- Version: $Revision: 1.39 $
+ Date: $Date: 2005/02/02 10:02:18 $
+ 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
return TsMap.count(key);
}
-TSAtr const & TS::GetValue(TSKey const &key)
+TSAtr const &TS::GetValue(TSKey const &key)
{
// First thing clean up the string sometime the transfer syntax is padded with spaces
std::string copy = key;
Program: gdcm
Module: $RCSfile: gdcmUtil.cxx,v $
Language: C++
- Date: $Date: 2005/02/01 10:29:56 $
- Version: $Revision: 1.128 $
+ Date: $Date: 2005/02/02 10:02:18 $
+ Version: $Revision: 1.129 $
Copyright (c) CREATIS (Centre de Recherche et d'Applications en Traitement de
l'Image). All rights reserved. See Doc/License.txt or
#include <stdio.h> //only included in implementation file
#if defined(_MSC_VER) || defined(__MINGW32__)
- #include <winsock.h> // for gethostname & gethostbyname
+ #include <winsock.h> // for gethostname and gethostbyname
#undef GetCurrentTime
#else
#ifndef __BORLANDC__
*/
void Util::Tokenize (const std::string &str,
std::vector<std::string> &tokens,
- const std::string& delimiters)
+ const std::string &delimiters)
{
std::string::size_type lastPos = str.find_first_not_of(delimiters,0);
std::string::size_type pos = str.find_first_of (delimiters,lastPos);
Program: gdcm
Module: $RCSfile: gdcmValEntry.cxx,v $
Language: C++
- Date: $Date: 2005/02/01 10:29:56 $
- Version: $Revision: 1.54 $
+ Date: $Date: 2005/02/02 10:02:18 $
+ Version: $Revision: 1.55 $
Copyright (c) CREATIS (Centre de Recherche et d'Applications en Traitement de
l'Image). All rights reserved. See Doc/License.txt or
* \brief Constructor from a given DictEntry
* @param e Pointer to existing dictionary entry
*/
-ValEntry::ValEntry(DictEntry *e) : ContentEntry(e)
+ValEntry::ValEntry(DictEntry *e)
+ : ContentEntry(e)
{
}
* @param e Pointer to existing Doc entry
*/
ValEntry::ValEntry(DocEntry *e)
- : ContentEntry(e->GetDictEntry())
+ : ContentEntry(e->GetDictEntry())
{
Copy(e);
}
{
uint16_t g = GetGroup();
uint16_t e = GetElement();
- VRKey vr = GetVR();
+ VRKey vr = GetVR();
std::ostringstream s;
std::string st;
std::string d2;
return;
}
- TS * ts = Global::GetTS();
+ TS *ts = Global::GetTS();
TSAtr v = GetValue(); // not applicable for SQ ...
d2 = Util::CreateCleanString(v); // replace non printable characters by '.'