Program: gdcm
Module: $RCSfile: TestAllEntryVerify.cxx,v $
Language: C++
- Date: $Date: 2005/02/02 10:05:26 $
- Version: $Revision: 1.24 $
+ Date: $Date: 2005/02/03 10:00:06 $
+ 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
ReferenceFileParser();
~ReferenceFileParser();
- bool Open( std::string& referenceFileName );
+ bool Open( std::string &referenceFileName );
void Print();
void SetDataPath(std::string&);
bool Check();
private:
bool AddKeyValuePairToMap( std::string &key, std::string &value );
- std::istream& eatwhite(std::istream &is);
+ std::istream &eatwhite(std::istream &is);
void eatwhite(std::string &toClean);
std::string ExtractFirstString(std::string &toSplit);
void CleanUpLine( std::string &line );
{
for (MapFileValuesType::iterator i = ProducedMap.begin();
i != ProducedMap.end();
- ++i)
+ ++i)
{
delete i->second;
}
}
-/// As gotten from:
+/// As got from:
/// http://community.borland.com/article/0,1410,17203,0.html
uint16_t ReferenceFileParser::axtoi(char *hexStg)
{
{
for (MapFileValuesType::iterator i = ProducedMap.begin();
i != ProducedMap.end();
- ++i)
+ ++i)
{
std::cout << Indent << "FileName: " << i->first << std::endl;
MapEntryValuesPtr KeyValues = i->second;
for (MapEntryValues::iterator j = KeyValues->begin();
j != KeyValues->end();
- ++j)
+ ++j)
{
std::cout << Indent
- << " Key: " << j->first
+ << " Key: " << j->first
<< " Value: " << j->second
<< std::endl;
}
bool ret = true;
for (MapFileValuesType::iterator i = ProducedMap.begin();
i != ProducedMap.end();
- ++i)
+ ++i)
{
ret &= Check(i);
}
{
std::string fileName = DataPath + fileIt->first;
std::cout << Indent << "FileName: " << fileName << std::endl;
- gdcm::File* tested = new gdcm::File( fileName.c_str() );
+ gdcm::File *tested = new gdcm::File( fileName.c_str() );
if( !tested->IsReadable() )
{
std::cerr << Indent << "Failed\n"
MapEntryValuesPtr KeyValues = fileIt->second;
for (MapEntryValues::iterator j = KeyValues->begin();
j != KeyValues->end();
- ++j)
+ ++j)
{
std::string key = j->first;
return is;
}
-void ReferenceFileParser::eatwhite( std::string& toClean )
+void ReferenceFileParser::eatwhite( std::string &toClean )
{
while( toClean.find_first_of( " " ) == 0 )
toClean.erase( 0, toClean.find_first_of( " " ) + 1 );
Program: gdcm
Module: $RCSfile: TestAllReadCompareDicom.cxx,v $
Language: C++
- Date: $Date: 2005/02/01 13:42:44 $
- Version: $Revision: 1.29 $
+ Date: $Date: 2005/02/03 10:00:06 $
+ Version: $Revision: 1.30 $
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 InternalTest(std::string const & filename,
- std::string const & referenceFileName )
+int InternalTest(std::string const &filename,
+ std::string const &referenceFileName )
{
std::cout << " Testing: " << filename << std::endl;
////// Step 1:
std::cout << " 1...";
- gdcm::FileHelper* tested = new gdcm::FileHelper( filename );
+ gdcm::FileHelper *tested = new gdcm::FileHelper( filename );
if( !tested->GetFile()->IsReadable() )
{
std::cout << " Failed" << std::endl
std::ifstream testFILE( referenceFileName.c_str() );
if (! testFILE )
{
- uint8_t* testedImageData = tested->GetImageData(); // Kludge
+ uint8_t *testedImageData = tested->GetImageData(); // Kludge
(void)testedImageData;
tested->SetWriteModeToRGB();
////// When reference file is not gdcm readable test is failed:
std::cout << "3a...";
- gdcm::FileHelper* reference = new gdcm::FileHelper( referenceFileName );
+ gdcm::FileHelper *reference = new gdcm::FileHelper( referenceFileName );
if( !reference->GetFile()->IsReadable() )
{
std::cout << " Failed" << std::endl
////// Step 3b:
std::cout << "3b...";
int testedDataSize = tested->GetImageDataSize();
- uint8_t* testedImageData = tested->GetImageData();
+ uint8_t *testedImageData = tested->GetImageData();
int referenceDataSize = reference->GetImageDataSize();
- uint8_t* referenceImageData = reference->GetImageData();
+ uint8_t *referenceImageData = reference->GetImageData();
// Test the image size
if (tested->GetFile()->GetXSize() != reference->GetFile()->GetXSize() ||
return 0;
}
-int TestAllReadCompareDicom(int argc, char* argv[])
+int TestAllReadCompareDicom(int argc, char *argv[])
{
if ( argc == 3 )
{
Program: gdcm
Module: $RCSfile: TestCopyDicom.cxx,v $
Language: C++
- Date: $Date: 2005/02/02 10:05:26 $
- Version: $Revision: 1.38 $
+ Date: $Date: 2005/02/03 10:00:06 $
+ Version: $Revision: 1.39 $
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
Program: gdcm
Module: $RCSfile: TestCopyRescaleDicom.cxx,v $
Language: C++
- Date: $Date: 2005/02/02 10:05:26 $
- Version: $Revision: 1.13 $
+ Date: $Date: 2005/02/03 10:00:06 $
+ 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
//Generated file:
#include "gdcmDataImages.h"
-bool FileExists(const char* filename);
+bool FileExists(const char *filename);
-bool RemoveFile(const char* source);
+bool RemoveFile(const char *source);
-int CopyRescaleDicom(std::string const & filename,
- std::string const & output )
+int CopyRescaleDicom(std::string const &filename,
+ std::string const &output )
{
std::cout << " Testing: " << filename << std::endl;
if( FileExists( output.c_str() ) )
//////////////// Step 2:
std::cout << "2...";
// Copy of the file content
- gdcm::DocEntry* d = originalF->GetFirstEntry();
+ gdcm::DocEntry *d = originalF->GetFirstEntry();
while(d)
{
- if ( gdcm::BinEntry* b = dynamic_cast<gdcm::BinEntry*>(d) )
+ if ( gdcm::BinEntry *b = dynamic_cast<gdcm::BinEntry*>(d) )
{
copyF->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) )
{
copyF->InsertValEntry( v->GetValue(),
v->GetGroup(),v->GetElement(),
size_t rescaleSize;
uint8_t *rescaleImage;
- const std::string & bitsStored = originalF->GetEntryValue(0x0028,0x0101);
+ const std::string &bitsStored = originalF->GetEntryValue(0x0028,0x0101);
if( bitsStored == "16" )
{
std::cout << "Rescale...";
- copyF->InsertValEntry( "8", 0x0028, 0x0100); // BitsAllocated
- copyF->InsertValEntry( "8", 0x0028, 0x0101); // BitsStored
- copyF->InsertValEntry( "7", 0x0028, 0x0102); // HighBit
- copyF->InsertValEntry( "0", 0x0028, 0x0103); //Pixel Representation
+ copyF->InsertValEntry( "8", 0x0028, 0x0100); // Bits Allocated
+ copyF->InsertValEntry( "8", 0x0028, 0x0101); // Bits Stored
+ copyF->InsertValEntry( "7", 0x0028, 0x0102); // High Bit
+ copyF->InsertValEntry( "0", 0x0028, 0x0103); // Pixel Representation
// We assume the value were from 0 to uint16_t max
rescaleSize = dataSize / 2;
rescaleImage = new uint8_t[dataSize];
- uint16_t* imageData16 = (uint16_t*)original->GetImageData();
+ uint16_t *imageData16 = (uint16_t*)original->GetImageData();
for(unsigned int i=0; i<rescaleSize; i++)
{
rescaleImage[i] = imageData16[i]/256;
//////////////// Step 5:
std::cout << "5...";
size_t dataSizeWritten = copy->GetImageDataSize();
- uint8_t* imageDataWritten = copy->GetImageData();
+ uint8_t *imageDataWritten = copy->GetImageData();
if (originalF->GetXSize() != copy->GetFile()->GetXSize() ||
originalF->GetYSize() != copy->GetFile()->GetYSize() ||
// Here we load a gdcmFile and then try to create from scratch a copy of it,
// copying field by field the dicom image
-int TestCopyRescaleDicom(int argc, char* argv[])
+int TestCopyRescaleDicom(int argc, char *argv[])
{
if ( argc == 3 )
{
Program: gdcm
Module: $RCSfile: TestDicomDir.cxx,v $
Language: C++
- Date: $Date: 2005/02/01 10:52:09 $
- Version: $Revision: 1.37 $
+ Date: $Date: 2005/02/03 10:00:06 $
+ 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
return 0;
}
-int TestDicomDir(int argc, char* argv[])
+int TestDicomDir(int argc, char *argv[])
{
gdcm::DicomDir *dicomdir;
- gdcm::DicomDirPatient * pa1;
- gdcm::DicomDirStudy *st1;
- gdcm::DicomDirSerie *se1;
- gdcm::DicomDirImage *im1;
+ gdcm::DicomDirPatient *pa1;
+ gdcm::DicomDirStudy *st1;
+ gdcm::DicomDirSerie *se1;
+ gdcm::DicomDirImage *im1;
gdcm::TSKey v;
<< std::endl<< std::endl;
gdcm::DicomDirPatient *pa2;
- gdcm::DicomDirStudy *st2;
- gdcm::DicomDirSerie *se2;
- gdcm::DicomDirImage *im2;
+ gdcm::DicomDirStudy *st2;
+ gdcm::DicomDirSerie *se2;
+ gdcm::DicomDirImage *im2;
pa1 = dicomdir->GetFirstPatient();
pa2 = d2->GetFirstPatient();
Program: gdcm
Module: $RCSfile: TestSerieHelper.cxx,v $
Language: C++
- Date: $Date: 2005/02/02 14:26:34 $
- Version: $Revision: 1.1 $
+ Date: $Date: 2005/02/03 10:00:06 $
+ 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
typedef std::list<gdcm::File* > GdcmFileList;
-int TestSerieHelper(int argc, char* argv[])
+int TestSerieHelper(int argc, char *argv[])
{
gdcm::SerieHelper *s;
}
//if (argc > 2)
- // gdcm::Debug::SetDebugOn();
+ // gdcm::Debug::DebugOn();
std::cout << "Dir Name :[" << dirName << "]" << std::endl;
Program: gdcm
Module: $RCSfile: VTKTestReadSeq.cxx,v $
Language: C++
- Date: $Date: 2005/02/02 10:05:26 $
- Version: $Revision: 1.8 $
+ Date: $Date: 2005/02/03 10:00:06 $
+ 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
}
int ret = 0;
- vtkTesting* t = vtkTesting::New();
+ vtkTesting *t = vtkTesting::New();
vtkImageViewer *viewer;
if( show )
viewer = vtkImageViewer::New();
Program: gdcm
Module: $RCSfile: gdcmDocument.cxx,v $
Language: C++
- Date: $Date: 2005/02/02 18:13:57 $
- Version: $Revision: 1.221 $
+ Date: $Date: 2005/02/03 10:03:07 $
+ Version: $Revision: 1.222 $
Copyright (c) CREATIS (Centre de Recherche et d'Applications en Traitement de
l'Image). All rights reserved. See Doc/License.txt or
* \brief Loads the element while preserving the current
* underlying file position indicator as opposed to
* LoadDocEntry that modifies it.
- * @param entry Header Entry whose value will be loaded.
- * @return
+ * @param entry DocEntry whose value will be loaded.
*/
void Document::LoadDocEntrySafe(DocEntry *entry)
{
* \brief Compares two documents, according to \ref DicomDir rules
* \warning Does NOT work with ACR-NEMA files
* \todo Find a trick to solve the pb (use RET fields ?)
- * @param document
+ * @param document to compare with current one
* @return true if 'smaller'
*/
bool Document::operator<(Document &document)
// Protected
/**
* \brief Reads a supposed to be 16 Bits integer
- * (swaps it depending on processor endianity)
+ * (swaps it depending on processor endianness)
* @return read value
*/
uint16_t Document::ReadInt16()
/**
* \brief Reads a supposed to be 32 Bits integer
- * (swaps it depending on processor endianity)
+ * (swaps it depending on processor endianness)
* @return read value
*/
uint32_t Document::ReadInt32()
Program: gdcm
Module: $RCSfile: gdcmFileHelper.h,v $
Language: C++
- Date: $Date: 2005/02/02 16:18:48 $
- Version: $Revision: 1.8 $
+ Date: $Date: 2005/02/03 10:03:07 $
+ 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
virtual ~FileHelper();
- void Print(std::ostream &os = std::cout, std::string const & indent = "");
+ void Print(std::ostream &os = std::cout, std::string const &indent = "");
/// Accessor to \ref File
File *GetFile() { return FileInternal; }
void SetUserData(uint8_t *data, size_t expectedSize);
uint8_t* GetUserData();
size_t GetUserDataSize();
- // RBG data (from file
+ // RBG data (from file)
uint8_t* GetRGBData();
size_t GetRGBDataSize();
- // RAW data (from file
+ // RAW data (from file)
uint8_t* GetRawData();
size_t GetRawDataSize();
uint8_t* GetLutRGBA();
// Write mode
- void SetWriteModeToRaw() { SetWriteMode(WMODE_RAW); };
- void SetWriteModeToRGB() { SetWriteMode(WMODE_RGB); };
- void SetWriteMode(FileMode mode) { WriteMode = mode; };
- FileMode GetWriteMode() { return WriteMode; };
+ void SetWriteModeToRaw() { SetWriteMode(WMODE_RAW); };
+ void SetWriteModeToRGB() { SetWriteMode(WMODE_RGB); };
+ void SetWriteMode(FileMode mode) { WriteMode = mode; };
+ FileMode GetWriteMode() { return WriteMode; };
// Write format
void SetWriteTypeToDcmImplVR() { SetWriteType(ImplicitVR); };
void SetWriteTypeToDcmExplVR() { SetWriteType(ExplicitVR); };
- void SetWriteTypeToAcr() { SetWriteType(ACR); };
+ void SetWriteTypeToAcr() { SetWriteType(ACR); };
void SetWriteTypeToAcrLibido() { SetWriteType(ACR_LIBIDO); };
- void SetWriteType(FileType format) { WriteType = format; };
- FileType GetWriteType() { return WriteType; };
+ void SetWriteType(FileType format) { WriteType = format; };
+ FileType GetWriteType() { return WriteType; };
// Write pixels of ONE image on hard drive
- // No test is made on processor "endianity"
+ // No test is made on processor "endianness"
// The user must call his reader correctly
bool WriteRawData (std::string const &fileName);
bool WriteDcmImplVR(std::string const &fileName);
void SetWriteToNoLibido();
void RestoreWriteOfLibido();
- ValEntry *CopyValEntry(uint16_t group,uint16_t elem);
- BinEntry *CopyBinEntry(uint16_t group,uint16_t elem);
+ ValEntry *CopyValEntry(uint16_t group, uint16_t elem);
+ BinEntry *CopyBinEntry(uint16_t group, uint16_t elem);
private:
void Initialize();
Program: gdcm
Module: $RCSfile: gdcmPixelReadConvert.cxx,v $
Language: C++
- Date: $Date: 2005/02/02 16:34:55 $
- Version: $Revision: 1.45 $
+ Date: $Date: 2005/02/03 10:03:07 $
+ Version: $Revision: 1.46 $
Copyright (c) CREATIS (Centre de Recherche et d'Applications en Traitement de
l'Image). All rights reserved. See Doc/License.txt or
//-----------------------------------------------------------------------------
// Public
/**
- * \brief Predicate to know wether the image[s] (once Raw) is RGB.
+ * \brief Predicate to know whether the image[s] (once Raw) is RGB.
* \note See comments of \ref ConvertHandleColor
*/
bool PixelReadConvert::IsRawRGB()
}
return true;
}
-
+/**
+ * \brief Gets various usefull informations from the file header
+ * @param file gdcm::File pointer
+ */
void PixelReadConvert::GrabInformationsFromFile( File *file )
{
// Number of Bits Allocated for storing a Pixel is defaulted to 16
HighBitPosition = BitsAllocated - 1;
}
- XSize = file->GetXSize();
- YSize = file->GetYSize();
- ZSize = file->GetZSize();
+ XSize = file->GetXSize();
+ YSize = file->GetYSize();
+ ZSize = file->GetZSize();
SamplesPerPixel = file->GetSamplesPerPixel();
- PixelSize = file->GetPixelSize();
- PixelSign = file->IsSignedPixelData();
- SwapCode = file->GetSwapCode();
- std::string ts = file->GetTransferSyntax();
+ PixelSize = file->GetPixelSize();
+ PixelSign = file->IsSignedPixelData();
+ SwapCode = file->GetSwapCode();
+ std::string ts = file->GetTransferSyntax();
IsRaw =
( ! file->IsDicomV3() )
|| Global::GetTS()->GetSpecialTransferSyntax(ts) == TS::ImplicitVRLittleEndian
// variable). But RawSize is the right size of the image !
if( PixelDataLength != RawSize)
{
- gdcmVerboseMacro( "Mismatch between PixelReadConvert and RawSize." );
+ gdcmVerboseMacro( "Mismatch between PixelReadConvert : "
+ << PixelDataLength << " and RawSize : " << RawSize );
}
if( PixelDataLength > RawSize)
{
Program: gdcm
Module: $RCSfile: gdcmPixelReadConvert.h,v $
Language: C++
- Date: $Date: 2005/02/02 16:34:55 $
- Version: $Revision: 1.17 $
+ Date: $Date: 2005/02/03 10:03:07 $
+ 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
PixelReadConvert();
virtual ~PixelReadConvert();
- void Print( std::ostream &os = std::cout, std::string const & indent = "" );
+ void Print( std::ostream &os = std::cout, std::string const &indent = "" );
// Getter accessors:
- uint8_t* GetRGB() { return RGB; }
+ uint8_t *GetRGB() { return RGB; }
size_t GetRGBSize() { return RGBSize; }
- uint8_t* GetRaw() { return Raw; }
+ uint8_t *GetRaw() { return Raw; }
size_t GetRawSize() { return RawSize; }
- uint8_t* GetLutRGBA() { return LutRGBA; }
+ uint8_t *GetLutRGBA() { return LutRGBA; }
// Predicates:
bool IsRawRGB();
private:
// Use the fp:
- void ReadAndDecompress12BitsTo16Bits( std::ifstream *fp ) throw ( FormatError );
+ void ReadAndDecompress12BitsTo16Bits( std::ifstream *fp )
+ throw ( FormatError );
bool ReadAndDecompressJPEGFile( std::ifstream *fp );
// In place (within Decompressed and with no fp access) decompression