Program: gdcm
Module: $RCSfile: TestBuildUpDicomDir.cxx,v $
Language: C++
- Date: $Date: 2005/10/18 08:35:46 $
- Version: $Revision: 1.5 $
+ Date: $Date: 2005/10/19 13:15:36 $
+ 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
{
if (argc)
{
- std::cerr << "Usage: " << argv[0] << " dummy ";
+ std::cerr << "Usage: " << argv[0] << " dummy " << std::endl;
}
gdcm::DicomDir *dcmdir;
// Write it on disc
dcmdir->Write("NewDICOMDIR");
+
delete dcmdir;
// Read the newly written DicomDir
errorFound = true;
break;
}
-/*
- if ( s1111->GetEntryString(0x0004,0x1500) != "imageFileName1111 " )
- {
- errorFound = true;
- break;
- }
-*/
+
if ( (s1112 = s111->GetNextImage()) == 0 )
{
std::cout << "missing image S1112" << std::endl;
errorFound = true;
break;
}
-/*
- if ( s1112->GetEntryString(0x0004,0x1500) != "imageFileName1112 " )
- {
- errorFound = true;
- break;
- }
- */
- break; // No error found. Stop looping
+
+ break; // No error found. Stop looping
}
delete newDicomDir;
Program: gdcm
Module: $RCSfile: TestReadWriteReadCompare.cxx,v $
Language: C++
- Date: $Date: 2005/10/18 08:35:46 $
- Version: $Revision: 1.25 $
+ Date: $Date: 2005/10/19 13:15:37 $
+ Version: $Revision: 1.26 $
Copyright (c) CREATIS (Centre de Recherche et d'Applications en Traitement de
l'Image). All rights reserved. See Doc/License.txt or
if( !fileout->IsReadable() )
{
- std::cout << "Failed" << std::endl
- << "Test::TestReadWriteReadCompare: Could not parse the newly "
- << "written image:" << filename << std::endl;
- delete file;
- delete filehelper;
- return 1;
+ std::cout << "Failed" << std::endl
+ << "Test::TestReadWriteReadCompare: Could not parse the newly "
+ << "written image:" << filename << std::endl;
+ delete file;
+ delete filehelper;
+ delete fileout;
+ return 1;
}
gdcm::FileHelper *reread = new gdcm::FileHelper( fileout );
<< reread->GetFile()->GetZSize() << std::endl;
delete file;
delete filehelper;
+ delete fileout;
delete reread;
return 1;
}
<< dataSize << " # " << dataSizeWritten << std::endl;
delete file;
delete filehelper;
+ delete fileout;
delete reread;
return 1;
}
<< " Pixel differ (as expanded in memory)." << std::endl;
delete file;
delete filehelper;
+ delete fileout;
delete reread;
return 1;
}
//////////////// Clean up:
delete file;
delete filehelper;
+ delete fileout;
delete reread;
return 0;
Program: gdcm
Module: $RCSfile: gdcmDicomDir.cxx,v $
Language: C++
- Date: $Date: 2005/10/18 08:35:49 $
- Version: $Revision: 1.160 $
+ Date: $Date: 2005/10/19 13:15:38 $
+ Version: $Revision: 1.161 $
Copyright (c) CREATIS (Centre de Recherche et d'Applications en Traitement de
l'Image). All rights reserved. See Doc/License.txt or
*/
bool DicomDir::Load( )
{
- // We should clean out anything that already exists.
- Initialize(); // sets all private fields to NULL
-
if (!ParseDir)
{
if ( ! this->Document::Load( ) )
{
// We should clean out anything that already exists.
Initialize(); // sets all private fields to NULL
-
- SetFileName( fileName );
- if (!ParseDir)
- {
- if ( ! this->Document::Load( ) )
- return false;
- }
- return DoTheLoadingJob( );
+ return Load();
}
/// DEPRECATED : use SetDirectoryName(dname) instead
*/
bool DicomDir::DoTheLoadingJob( )
{
- // We should clean out anything that already exists.
- Initialize(); // sets all private fields to NULL
+ Progress = 0.0f;
+ Abort = false;
if (!ParseDir)
{
// Only if user passed a DICOMDIR
// ------------------------------
Fp = 0;
- if ( !OpenFile() )
- {
- return false;
- }
if (!Document::Load() )
{
return false;
continue;
}
if ( si )
- //MoveSQItem(si,tmpSI); // Old code : Copies each Entry
- // -and then removes the source-
si->MoveObject(tmpSI); // New code : Copies the List
tmpSI=s->GetNextSQItem();
}
break;
case GDCM_DICOMDIR_META:
- elemList = Global::GetDicomDirElements()->GetDicomDirMetaElements();
- si = new DicomDirMeta(true);
if ( MetaElems )
{
delete MetaElems;
gdcmErrorMacro( "MetaElements already exist, they will be destroyed");
}
- MetaElems = static_cast<DicomDirMeta *>(si);
+ elemList = Global::GetDicomDirElements()->GetDicomDirMetaElements();
+ MetaElems = new DicomDirMeta(true);
+ si = MetaElems;
break;
default:
return;
Program: gdcm
Module: $RCSfile: gdcmDocument.cxx,v $
Language: C++
- Date: $Date: 2005/10/19 12:01:50 $
- Version: $Revision: 1.298 $
+ Date: $Date: 2005/10/19 13:15:39 $
+ Version: $Revision: 1.299 $
Copyright (c) CREATIS (Centre de Recherche et d'Applications en Traitement de
l'Image). All rights reserved. See Doc/License.txt or
if ( newDocEntry->GetGroup()%2 != 0 )
{
Fp->seekg( l, std::ios::cur);
- RemoveEntry( newDocEntry ); // Remove and delete
- //used = false; // never used
+ delete newDocEntry; // Delete, not in the set
continue;
}
}
{
// User asked to skip *any* SeQuence
Fp->seekg( l, std::ios::cur);
- //used = false; // never used
- RemoveEntry( newDocEntry ); // Remove and delete
+ delete newDocEntry; // Delete, not in the set
continue;
}
// delay the dynamic cast as late as possible
// is a Document, then we are building the first depth level.
// Hence the SeqEntry we are building simply has a depth
// level of one:
-// SQItem *parentSQItem = dynamic_cast< SQItem* > ( set );
if ( set == this ) // ( dynamic_cast< Document* > ( set ) )
{
newSeqEntry->SetDepthLevel( 1 );
- // newSeqEntry->SetKey( newSeqEntry->GetKey() );
}
// But when "set" is already a SQItem, we are building a nested
// sequence, and hence the depth level of the new SeqEntry
else if (SQItem *parentSQItem = dynamic_cast< SQItem* > ( set ) )
{
newSeqEntry->SetDepthLevel( parentSQItem->GetDepthLevel() + 1 );
-
- // newSeqEntry->SetKey( parentSQItem->GetBaseTagKey()
- // + newSeqEntry->GetKey() );
}
if ( l != 0 )