Program: gdcm
Module: $RCSfile: ReWrite.cxx,v $
Language: C++
- Date: $Date: 2005/08/30 15:13:05 $
- Version: $Revision: 1.11 $
+ Date: $Date: 2005/10/21 08:39: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
<< " SampleserPixel=" << sPP
<< " PlanarConfiguration=" << planarConfig
<< " PhotometricInterpretation="
- << f->GetEntryValue(0x0028,0x0004)
+ << f->GetEntryString(0x0028,0x0004)
<< std::endl;
int numberOfScalarComponents=f->GetNumberOfScalarComponents();
case 'D' : // Not documented in the 'usage', because the method
case 'd' : // is known to be bugged.
- // Writting a DICOM Implicit VR file
- // from a full gdcm readable File
+ // Writting a DICOM Implicit VR file
+ // from a full gdcm readable File
std::cout << "WriteDCM Implicit VR" << std::endl;
fh->WriteDcmImplVR(outputFileName);
// from a full gdcm readable File
std::cout << "WriteDCM Explicit VR" << std::endl;
- fh->WriteDcmExplVR(outputFileName);
+ // fh->WriteDcmExplVR(outputFileName);
+ // Try this one :
+ fh->SetWriteTypeToDcmExplVR();
+ fh->Write(outputFileName);
break;
case 'R' :
std::cout << "WriteRaw" << std::endl;
fh->WriteRawData(outputFileName);
break;
+
+ // Just for fun :
+ // Write a 'Video inverse' version of the file.
+ // *Not* described, on purpose, in the USAGE
+
+ case 'V' :
+ case 'v' :
+
+ if ( fh->GetFile()->GetBitsAllocated() == 8)
+ {
+ std::cout << "videoinv for 8 bits" << std::endl;
+ for (int i=0; i<dataSize; i++)
+ {
+ ((uint8_t*)imageData)[i] = 255 - ((uint8_t*)imageData)[i];
+ }
+ }
+ else
+ {
+ std::cout << "videoinv for 16 bits" << std::endl;
+ for (int i=0; i<dataSize/2; i++)
+ {
+ ((uint16_t*)imageData)[i] = 65535 - ((uint16_t*)imageData)[i];
+ }
+ }
+ std::cout << "WriteDCM Explicit VR + VideoInv" << std::endl;
+ fh->WriteDcmExplVR(outputFileName);
+ break;
}
delete f;