Program: gdcm
Module: $RCSfile: TestWriteSimple.cxx,v $
Language: C++
- Date: $Date: 2005/03/03 11:03:41 $
- Version: $Revision: 1.27 $
+ Date: $Date: 2005/04/19 10:05:37 $
+ 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
fileToBuild->InsertValEntry(str.str(),0x0028,0x0101); // Bits Stored
str.str("");
- str << img.componentSize - 1;
+ str << ( img.componentSize - 1 );
fileToBuild->InsertValEntry(str.str(),0x0028,0x0102); // High Bit
// Set the pixel representation
{
for(int c=0;c<img.components;c++)
{
- *tmp = j%256;
+ *tmp = (unsigned char)(j%256);
if( img.componentSize>8 )
{
- *(tmp+1) = j/256;
+ *(tmp+1) = (unsigned char)(j/256);
}
tmp += img.componentSize/8;
}
size_t dataSizeWritten = reread->GetImageDataSize();
uint8_t *imageDataWritten = reread->GetImageData();
+ // Test the image write mode
+ if (reread->GetFile()->GetFileType() != file->GetWriteType())
+ {
+ std::cout << "Failed" << std::endl
+ << " File type differ: "
+ << file->GetWriteType() << " # "
+ << reread->GetFile()->GetFileType() << std::endl;
+ delete fileToBuild;
+ delete file;
+ delete reread;
+ delete[] imageData;
+
+ return 1;
+ }
+
// Test the image size
if (fileToBuild->GetXSize() != reread->GetFile()->GetXSize() ||
fileToBuild->GetYSize() != reread->GetFile()->GetYSize() ||
return 1;
}
- // gdcm::Debug::DebugOn();
+ gdcm::Debug::DebugOn();
int ret=0;
int i=0;
while( Images[i].sizeX>0 && Images[i].sizeY>0 )
{
- std::cout << std::endl << "Test n :" << i << std::endl;
+ std::cout << "Test n :" << i;
ret += WriteSimple(Images[i] );
i++;
}