Copyright (c) CREATIS (Centre de Recherche et d'Applications en Traitement de
l'Image). All rights reserved. See Doc/License.txt or
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.
=========================================================================*/
PURPOSE. See the above copyright notices for more information.
=========================================================================*/
- 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::string fileName = argv[1];
+ std::string mode = argv[2];
+
+ //e1 = new gdcm::File( fileName.c_str() );
+
+ // new style :
+ e1 = new gdcm::File( );
+ e1->SetLoadMode(0);
+ e1->Load( fileName.c_str() );
std::cout <<std::endl <<" dataSize " << dataSize << std::endl;
int nX,nY,nZ,sPP,planarConfig;
std::string pixelType, transferSyntaxName;
std::cout <<std::endl <<" dataSize " << dataSize << std::endl;
int nX,nY,nZ,sPP,planarConfig;
std::string pixelType, transferSyntaxName;
<< " SampleserPixel=" << sPP
<< " PlanarConfiguration=" << planarConfig
<< " PhotometricInterpretation="
<< " SampleserPixel=" << sPP
<< " PlanarConfiguration=" << planarConfig
<< " PhotometricInterpretation="
<< std::endl;
int numberOfScalarComponents=e1->GetNumberOfScalarComponents();
std::cout << "NumberOfScalarComponents " << numberOfScalarComponents <<std::endl;
<< std::endl;
int numberOfScalarComponents=e1->GetNumberOfScalarComponents();
std::cout << "NumberOfScalarComponents " << numberOfScalarComponents <<std::endl;
&& transferSyntaxName != "Explicit VR - Little Endian"
&& transferSyntaxName != "Deflated Explicit VR - Little Endian"
&& transferSyntaxName != "Explicit VR - Big Endian"
&& transferSyntaxName != "Explicit VR - Little Endian"
&& transferSyntaxName != "Deflated Explicit VR - Little Endian"
&& transferSyntaxName != "Explicit VR - Big Endian"
f1->GetPixelReadConverter()->Print();
std::cout << std::endl << "==========================================="
<< std::endl;
f1->GetPixelReadConverter()->Print();
std::cout << std::endl << "==========================================="
<< std::endl;
- sprintf(zozo, "%s.ACR", toto.c_str());
- printf ("WriteACR\n");
- f1->WriteAcr(zozo);
+ fileNameToWrite = fileName + ".ACR";
+ std::cout << "WriteACR" << std::endl;
+ 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
break;
case 'd' : // Not document in the 'usage', because the method is knowed to be bugged.
// ecriture d'un fichier DICOM Implicit VR
- sprintf(zozo, "%s.DCM", toto.c_str());
- printf ("WriteDCM Implicit VR\n");
- f1->WriteDcmImplVR(zozo);
+ fileNameToWrite = fileName + ".DCM";
+ std::cout << "WriteDCM Implicit VR" << std::endl;
+ f1->WriteDcmImplVR(fileNameToWrite);
break;
case 'r' :
// Ecriture d'un Raw File, a afficher avec
// affim filein= dimx= dimy= nbit= signe=
break;
case 'r' :
// Ecriture d'un Raw File, a afficher avec
// affim filein= dimx= dimy= nbit= signe=
- sprintf(zozo, "%s.VDCM", toto.c_str());
- printf ("WriteDCM Explicit VR + VideoInv\n");
- f1->WriteDcmExplVR(zozo);
+ fileNameToWrite = fileName + ".VDCM";
+ std::cout << "WriteDCM Explicit VR + VideoInv" << std::endl;
+ f1->WriteDcmExplVR(fileNameToWrite);