Program: gdcm
Module: $RCSfile: gdcmContentEntry.cxx,v $
Language: C++
- Date: $Date: 2005/02/02 10:02:16 $
- Version: $Revision: 1.9 $
+ Date: $Date: 2005/06/24 10:55:58 $
+ Version: $Revision: 1.10 $
Copyright (c) CREATIS (Centre de Recherche et d'Applications en Traitement de
l'Image). All rights reserved. See Doc/License.txt or
DocEntry::Copy(doc);
ContentEntry *entry = dynamic_cast<ContentEntry *>(doc);
- if(entry)
+ if ( entry )
Value = entry->Value;
}
Program: gdcm
Module: $RCSfile: gdcmDebug.cxx,v $
Language: C++
- Date: $Date: 2005/02/04 16:51:36 $
- Version: $Revision: 1.24 $
+ Date: $Date: 2005/06/24 10:55:58 $
+ 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
}
/**
- * \brief Accessor to know if debug info are redirected to file
+ * \brief Accessor to know whether debug info are redirected to file
*/
bool Debug::GetDebugToFile ()
{
/**
* \brief Set the filename the debug stream should be redirect to
- * Settting a filename also set DebugToFile to true
+ * Settting a filename also sets DebugToFile to true
* @param filename File to redirect debug info
* Absolutely nothing is check. You have to pass in
* a correct filename
void Debug::SetDebugFilename (std::string const &filename)
{
DebugToFile = true; // Just in case ...
- DebugFlag = true; // Just in case ...
- if( DebugFile.is_open() )
+ DebugFlag = true; // Just in case ...
+ if ( DebugFile.is_open() )
DebugFile.close();
DebugFile.open( filename.c_str() );
}
Program: gdcm
Module: $RCSfile: gdcmDicomDir.cxx,v $
Language: C++
- Date: $Date: 2005/06/17 12:36:07 $
- Version: $Revision: 1.141 $
+ Date: $Date: 2005/06/24 10:55:58 $
+ Version: $Revision: 1.142 $
Copyright (c) CREATIS (Centre de Recherche et d'Applications en Traitement de
l'Image). All rights reserved. See Doc/License.txt or
*/
bool DicomDir::IsReadable()
{
- if( Filetype == Unknown)
+ if ( Filetype == Unknown )
{
gdcmWarningMacro( "Wrong filetype");
return false;
}
- if( !MetaElems )
+ if ( !MetaElems )
{
gdcmWarningMacro( "Meta Elements missing in DicomDir");
return false;
}
- if( Patients.size() <= 0 )
+ if ( Patients.size() <= 0 )
{
gdcmWarningMacro( "NO Patient in DicomDir");
return false;
*/
DicomDirMeta *DicomDir::NewMeta()
{
- if( MetaElems )
+ if ( MetaElems )
delete MetaElems;
DocEntry *entry = GetFirstEntry();
- if( entry )
+ if ( entry )
{
MetaElems = new DicomDirMeta(true); // true = empty
entry = GetFirstEntry();
while( entry )
{
- if( dynamic_cast<SeqEntry *>(entry) )
+ if ( dynamic_cast<SeqEntry *>(entry) )
break;
RemoveEntryNoDestroy(entry);
void DicomDir::SetStartMethod( DicomDir::Method *method, void *arg,
DicomDir::Method *argDelete )
{
- if( StartArg && StartMethodArgDelete )
+ if ( StartArg && StartMethodArgDelete )
{
StartMethodArgDelete( StartArg );
}
void DicomDir::SetProgressMethod( DicomDir::Method *method, void *arg,
DicomDir::Method *argDelete )
{
- if( ProgressArg && ProgressMethodArgDelete )
+ if ( ProgressArg && ProgressMethodArgDelete )
{
ProgressMethodArgDelete( ProgressArg );
}
void DicomDir::SetEndMethod( DicomDir::Method *method, void *arg,
DicomDir::Method *argDelete )
{
- if( EndArg && EndMethodArgDelete )
+ if ( EndArg && EndMethodArgDelete )
{
EndMethodArgDelete( EndArg );
}
std::ofstream *fp = new std::ofstream(fileName.c_str(),
std::ios::out | std::ios::binary);
- if( !fp )
+ if ( !fp )
{
gdcmWarningMacro("Failed to open(write) File: " << fileName.c_str());
return false;
{
Progress = (float)(count+1)/(float)fileList.size();
CallProgressMethod();
- if( Abort )
+ if ( Abort )
{
break;
}
f->SetLoadMode(LoadMode); // we allow user not to load Sequences...
f->Load( it->c_str() );
-// if( !f )
+// if ( !f )
// {
// gdcmWarningMacro( "Failure in new gdcm::File " << it->c_str() );
// continue;
// }
- if( f->IsReadable() )
+ if ( f->IsReadable() )
{
// Add the file to the chained list:
list.push_back(f);
{
Progress = 0.0f;
Abort = false;
- if( StartMethod )
+ if ( StartMethod )
{
StartMethod( StartArg );
}
*/
void DicomDir::CallProgressMethod()
{
- if( ProgressMethod )
+ if ( ProgressMethod )
{
ProgressMethod( ProgressArg );
}
void DicomDir::CallEndMethod()
{
Progress = 1.0f;
- if( EndMethod )
+ if ( EndMethod )
{
EndMethod( EndArg );
}
continue;
}
- if( v == "PATIENT " )
+ if ( v == "PATIENT " )
{
si = new DicomDirPatient(true);
- if( !AddPatientToEnd( static_cast<DicomDirPatient *>(si)) )
+ if ( !AddPatientToEnd( static_cast<DicomDirPatient *>(si)) )
{
delete si;
si = NULL;
gdcmErrorMacro( "Add PatientToEnd failed");
}
}
- else if( v == "STUDY " )
+ else if ( v == "STUDY " )
{
si = new DicomDirStudy(true);
- if( !AddStudyToEnd( static_cast<DicomDirStudy *>(si)) )
+ if ( !AddStudyToEnd( static_cast<DicomDirStudy *>(si)) )
{
delete si;
si = NULL;
gdcmErrorMacro( "Add AddStudyToEnd failed");
}
}
- else if( v == "SERIES" )
+ else if ( v == "SERIES" )
{
si = new DicomDirSerie(true);
- if( !AddSerieToEnd( static_cast<DicomDirSerie *>(si)) )
+ if ( !AddSerieToEnd( static_cast<DicomDirSerie *>(si)) )
{
delete si;
si = NULL;
gdcmErrorMacro( "Add AddSerieToEnd failed");
}
}
- else if( v == "IMAGE " )
+ else if ( v == "IMAGE " )
{
si = new DicomDirImage(true);
- if( !AddImageToEnd( static_cast<DicomDirImage *>(si)) )
+ if ( !AddImageToEnd( static_cast<DicomDirImage *>(si)) )
{
delete si;
si = NULL;
// neither an 'IMAGE' SQItem. Skip to next item.
continue;
}
- if( si )
+ if ( si )
MoveSQItem(si,tmpSI);
tmpSI=s->GetNextSQItem();
*/
bool DicomDir::AddStudyToEnd(DicomDirStudy *dd)
{
- if( Patients.size() > 0 )
+ if ( Patients.size() > 0 )
{
ListDicomDirPatient::iterator itp = Patients.end();
itp--;
*/
bool DicomDir::AddSerieToEnd(DicomDirSerie *dd)
{
- if( Patients.size() > 0 )
+ if ( Patients.size() > 0 )
{
ListDicomDirPatient::iterator itp = Patients.end();
itp--;
DicomDirStudy *study = (*itp)->GetLastStudy();
- if( study )
+ if ( study )
{
study->AddSerie(dd);
return true;
*/
bool DicomDir::AddImageToEnd(DicomDirImage *dd)
{
- if( Patients.size() > 0 )
+ if ( Patients.size() > 0 )
{
ListDicomDirPatient::iterator itp = Patients.end();
itp--;
DicomDirStudy *study = (*itp)->GetLastStudy();
- if( study )
+ if ( study )
{
DicomDirSerie *serie = study->GetLastSerie();
- if( serie )
+ if ( serie )
{
serie->AddImage(dd);
return true;
serCurInstanceUID = (*it)->GetEntryValue(0x0020,0x000e);
serCurID = (*it)->GetEntryValue(0x0020,0x0011);
- if( patCurName != patPrevName || patCurID != patPrevID || first )
+ if ( patCurName != patPrevName || patCurID != patPrevID || first )
{
SetElement(path, GDCM_DICOMDIR_PATIENT, *it);
first = true;
}
// if new Study Deal with 'STUDY' Elements
- if( studCurInstanceUID != studPrevInstanceUID || studCurID != studPrevID
+ if ( studCurInstanceUID != studPrevInstanceUID || studCurID != studPrevID
|| first )
{
SetElement(path, GDCM_DICOMDIR_STUDY, *it);
}
// if new Serie Deal with 'SERIE' Elements
- if( serCurInstanceUID != serPrevInstanceUID || serCurID != serPrevID
+ if ( serCurInstanceUID != serPrevInstanceUID || serCurID != serPrevID
|| first )
{
SetElement(path, GDCM_DICOMDIR_SERIE, *it);
case GDCM_DICOMDIR_IMAGE:
elemList = Global::GetDicomDirElements()->GetDicomDirImageElements();
si = new DicomDirImage(true);
- if( !AddImageToEnd(static_cast<DicomDirImage *>(si)) )
+ if ( !AddImageToEnd(static_cast<DicomDirImage *>(si)) )
{
delete si;
gdcmErrorMacro( "Add ImageToEnd failed");
case GDCM_DICOMDIR_SERIE:
elemList = Global::GetDicomDirElements()->GetDicomDirSerieElements();
si = new DicomDirSerie(true);
- if( !AddSerieToEnd(static_cast<DicomDirSerie *>(si)) )
+ if ( !AddSerieToEnd(static_cast<DicomDirSerie *>(si)) )
{
delete si;
gdcmErrorMacro( "Add SerieToEnd failed");
case GDCM_DICOMDIR_STUDY:
elemList = Global::GetDicomDirElements()->GetDicomDirStudyElements();
si = new DicomDirStudy(true);
- if( !AddStudyToEnd(static_cast<DicomDirStudy *>(si)) )
+ if ( !AddStudyToEnd(static_cast<DicomDirStudy *>(si)) )
{
delete si;
gdcmErrorMacro( "Add StudyToEnd failed");
case GDCM_DICOMDIR_PATIENT:
elemList = Global::GetDicomDirElements()->GetDicomDirPatientElements();
si = new DicomDirPatient(true);
- if( !AddPatientToEnd(static_cast<DicomDirPatient *>(si)) )
+ if ( !AddPatientToEnd(static_cast<DicomDirPatient *>(si)) )
{
delete si;
gdcmErrorMacro( "Add PatientToEnd failed");
case GDCM_DICOMDIR_META:
elemList = Global::GetDicomDirElements()->GetDicomDirMetaElements();
si = new DicomDirMeta(true);
- if( MetaElems )
+ if ( MetaElems )
{
delete MetaElems;
gdcmErrorMacro( "MetaElements already exist, they will be destroyed");
entry->SetOffset(0); // just to avoid further missprinting
- if( header )
+ if ( header )
{
// NULL when we Build Up (ex nihilo) a DICOMDIR
// or when we add the META elems
val = GDCM_UNFOUND;
}
- if( val == GDCM_UNFOUND)
+ if ( val == GDCM_UNFOUND)
{
- if( tmpGr == 0x0004 && tmpEl == 0x1130 ) // File-set ID
+ if ( tmpGr == 0x0004 && tmpEl == 0x1130 ) // File-set ID
{
// force to the *end* File Name
val = Util::GetName( path );
}
- else if( tmpGr == 0x0004 && tmpEl == 0x1500 ) // Only used for image
+ else if ( tmpGr == 0x0004 && tmpEl == 0x1500 ) // Only used for image
{
- if( header->GetFileName().substr(0, path.length()) != path )
+ if ( header->GetFileName().substr(0, path.length()) != path )
{
gdcmWarningMacro( "The base path of file name is incorrect");
val = header->GetFileName();
*/
void DicomDir::Print(std::ostream &os, std::string const & )
{
- if( MetaElems )
+ if ( MetaElems )
{
MetaElems->SetPrintLevel(PrintLevel);
MetaElems->Print(os);
Program: gdcm
Module: $RCSfile: gdcmDicomDirElement.cxx,v $
Language: C++
- Date: $Date: 2005/06/07 09:58:29 $
- Version: $Revision: 1.37 $
+ Date: $Date: 2005/06/24 10:55:58 $
+ 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
{
std::string filename = DictSet::BuildDictPath() + DICT_ELEM;
std::ifstream from(filename.c_str());
- if(!from)
+ if ( !from )
{
gdcmWarningMacro( "Can't open DicomDirElement dictionary"
<< filename.c_str());
from.getline(buff, 1024, ' ');
strType = buff;
- if( strType == "metaElem" )
+ if ( strType == "metaElem" )
type = DD_META;
- else if( strType == "patientElem" )
+ else if ( strType == "patientElem" )
type = DD_PATIENT;
- else if( strType == "studyElem" )
+ else if ( strType == "studyElem" )
type = DD_STUDY;
- else if( strType == "serieElem" )
+ else if ( strType == "serieElem" )
type = DD_SERIE;
- else if( strType == "imageElem" )
+ else if ( strType == "imageElem" )
type = DD_IMAGE;
else
{
type = DD_UNKNOWN;
}
- if( type!=DD_UNKNOWN )
+ if ( type!=DD_UNKNOWN )
{
from >> std::hex >> elem.Group >> elem.Elem;
Program: gdcm
Module: $RCSfile: gdcmDicomDirImage.cxx,v $
Language: C++
- Date: $Date: 2005/02/01 10:29:55 $
- Version: $Revision: 1.22 $
+ Date: $Date: 2005/06/24 10:55:58 $
+ Version: $Revision: 1.23 $
Copyright (c) CREATIS (Centre de Recherche et d'Applications en Traitement de
l'Image). All rights reserved. See Doc/License.txt or
DicomDirImage::DicomDirImage(bool empty):
DicomDirObject()
{
- if( !empty )
+ if ( !empty )
{
ListDicomDirImageElem const &elemList =
Global::GetDicomDirElements()->GetDicomDirImageElements();
i!= DocEntries.end();
++i)
{
- if( (*i)->GetGroup() == 0x0004 && (*i)->GetElement() == 0x1500 )
+ if ( (*i)->GetGroup() == 0x0004 && (*i)->GetElement() == 0x1500 )
{
os << (dynamic_cast<ValEntry *>(*i))->GetValue(); //FIXME
}
Program: gdcm
Module: $RCSfile: gdcmDicomDirMeta.cxx,v $
Language: C++
- Date: $Date: 2005/02/01 10:29:55 $
- Version: $Revision: 1.27 $
+ Date: $Date: 2005/06/24 10:55:58 $
+ Version: $Revision: 1.28 $
Copyright (c) CREATIS (Centre de Recherche et d'Applications en Traitement de
l'Image). All rights reserved. See Doc/License.txt or
DicomDirMeta::DicomDirMeta(bool empty):
DicomDirObject()
{
- if( !empty )
+ if ( !empty )
{
ListDicomDirStudyElem const &elemList =
Global::GetDicomDirElements()->GetDicomDirMetaElements();
Program: gdcm
Module: $RCSfile: gdcmDicomDirPatient.cxx,v $
Language: C++
- Date: $Date: 2005/02/02 10:02:16 $
- Version: $Revision: 1.37 $
+ Date: $Date: 2005/06/24 10:55:58 $
+ 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
DicomDirPatient::DicomDirPatient(bool empty)
:DicomDirObject()
{
- if( !empty )
+ if ( !empty )
{
ListDicomDirStudyElem const &elemList =
Global::GetDicomDirElements()->GetDicomDirPatientElements();
Program: gdcm
Module: $RCSfile: gdcmDicomDirSerie.cxx,v $
Language: C++
- Date: $Date: 2005/02/01 10:29:55 $
- Version: $Revision: 1.37 $
+ Date: $Date: 2005/06/24 10:55:58 $
+ 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
DicomDirSerie::DicomDirSerie(bool empty):
DicomDirObject()
{
- if( !empty )
+ if ( !empty )
{
ListDicomDirSerieElem const &elemList =
Global::GetDicomDirElements()->GetDicomDirSerieElements();
Program: gdcm
Module: $RCSfile: gdcmDicomDirStudy.cxx,v $
Language: C++
- Date: $Date: 2005/02/02 10:02:16 $
- Version: $Revision: 1.36 $
+ Date: $Date: 2005/06/24 10:55:58 $
+ Version: $Revision: 1.37 $
Copyright (c) CREATIS (Centre de Recherche et d'Applications en Traitement de
l'Image). All rights reserved. See Doc/License.txt or
DicomDirStudy::DicomDirStudy(bool empty)
:DicomDirObject()
{
- if( !empty )
+ if ( !empty )
{
ListDicomDirStudyElem const &elemList =
Global::GetDicomDirElements()->GetDicomDirStudyElements();
Program: gdcm
Module: $RCSfile: gdcmDict.cxx,v $
Language: C++
- Date: $Date: 2005/06/02 12:26:42 $
- Version: $Revision: 1.76 $
+ Date: $Date: 2005/06/24 10:55:58 $
+ Version: $Revision: 1.77 $
Copyright (c) CREATIS (Centre de Recherche et d'Applications en Traitement de
l'Image). All rights reserved. See Doc/License.txt or
TagName name;
std::ifstream from( filename.c_str() );
- if( !from )
+ if ( !from )
{
gdcmWarningMacro( "Can't open dictionary" << filename.c_str());
// Using default embeded one:
{
const TagKey &key = newEntry.GetKey();
- if(KeyHt.count(key) == 1)
+ if ( KeyHt.count(key) == 1 )
{
gdcmWarningMacro( "Already present" << key.c_str());
return false;
bool Dict::RemoveEntry(TagKey const &key)
{
TagKeyHT::const_iterator it = KeyHt.find(key);
- if(it != KeyHt.end())
+ if ( it != KeyHt.end() )
{
KeyHt.erase(key);
DictEntry *Dict::GetFirstEntry()
{
ItKeyHt = KeyHt.begin();
- if( ItKeyHt != KeyHt.end() )
+ if ( ItKeyHt != KeyHt.end() )
return &(ItKeyHt->second);
return NULL;
}
Program: gdcm
Module: $RCSfile: gdcmDictEntry.cxx,v $
Language: C++
- Date: $Date: 2005/06/14 14:00:03 $
- Version: $Revision: 1.49 $
+ Date: $Date: 2005/06/24 10:55:58 $
+ Version: $Revision: 1.50 $
Copyright (c) CREATIS (Centre de Recherche et d'Applications en Traitement de
l'Image). All rights reserved. See Doc/License.txt or
std::ostringstream s;
vr = GetVR();
- if(vr==GDCM_UNKNOWN)
+ if ( vr==GDCM_UNKNOWN )
vr=" ";
s << DictEntry::TranslateToKey(GetGroup(),GetElement());
s << " [" << vr << "] ";
- if (PrintLevel >= 1)
+ if ( PrintLevel >= 1 )
{
s.setf(std::ios::left);
s << std::setw(66-GetName().length()) << " ";
Program: gdcm
Module: $RCSfile: gdcmDictGroupName.cxx,v $
Language: C++
- Date: $Date: 2005/04/06 12:49:27 $
- Version: $Revision: 1.3 $
+ Date: $Date: 2005/06/24 10:55:58 $
+ Version: $Revision: 1.4 $
Copyright (c) CREATIS (Centre de Recherche et d'Applications en Traitement de
l'Image). All rights reserved. See Doc/License.txt or
{
std::string filename = DictSet::BuildDictPath() + DICT_GROUP_NAME;
std::ifstream from(filename.c_str());
- if(!from)
+ if ( !from )
{
gdcmWarningMacro("Can't open dictionary" << filename.c_str());
FillDefaultDictGroupName(groupName);
from.getline(buff, 1024, '"');
from.getline(buff, 1024, '"');
value = buff;
- if(!from.eof())
+ if ( !from.eof() )
groupName[key] = value;
from.getline(buff, 1024, '\n');
const TagName &DictGroupName::GetName(uint16_t group)
{
DictGroupNameHT::const_iterator it = groupName.find(group);
- if (it == groupName.end())
+ if ( it == groupName.end() )
{
return GDCM_UNFOUND;
}
Program: gdcm
Module: $RCSfile: gdcmDictSet.cxx,v $
Language: C++
- Date: $Date: 2005/06/14 18:37:55 $
- Version: $Revision: 1.64 $
+ Date: $Date: 2005/06/24 10:55:58 $
+ Version: $Revision: 1.65 $
Copyright (c) CREATIS (Centre de Recherche et d'Applications en Traitement de
l'Image). All rights reserved. See Doc/License.txt or
Dict *DictSet::GetDict(DictKey const &dictName)
{
DictSetHT::iterator dict = Dicts.find(dictName);
- if(dict != Dicts.end())
+ if ( dict != Dicts.end() )
{
return dict->second;
}
TagKeyHT::iterator it;
it = VirtualEntries.find(tag);
- if(it != VirtualEntries.end())
+ if ( it != VirtualEntries.end() )
{
entry = &(it->second);
}
Dict *DictSet::GetFirstEntry()
{
ItDictHt = Dicts.begin();
- if( ItDictHt != Dicts.end() )
+ if ( ItDictHt != Dicts.end() )
return ItDictHt->second;
return NULL;
}
Program: gdcm
Module: $RCSfile: gdcmDirList.cxx,v $
Language: C++
- Date: $Date: 2005/05/11 14:40:57 $
- Version: $Revision: 1.50 $
+ Date: $Date: 2005/06/24 10:55:59 $
+ Version: $Revision: 1.51 $
Copyright (c) CREATIS (Centre de Recherche et d'Applications en Traitement de
l'Image). All rights reserved. See Doc/License.txt or
{
struct stat fs;
assert( dirName[dirName.size()-1] != '/' );
- if(stat(dirName.c_str(), &fs) == 0)
+ if ( stat(dirName.c_str(), &fs) == 0 )
{
#if _WIN32
return ((fs.st_mode & _S_IFDIR) != 0);
b = FindNextFile(hFile, &fileData))
{
fileName = fileData.cFileName;
- if( fileData.dwFileAttributes & FILE_ATTRIBUTE_DIRECTORY )
+ if ( fileData.dwFileAttributes & FILE_ATTRIBUTE_DIRECTORY )
{
// Need to check for . and .. to avoid infinite loop
- if( fileName != "." && fileName != ".." && recursive )
+ if ( fileName != "." && fileName != ".." && recursive )
{
numberOfFiles += Explore(dirName+fileName,recursive);
}
{
fileName = dirName + d->d_name;
stat(fileName.c_str(), &buf); //really discard output ?
- if( S_ISREG(buf.st_mode) ) //is it a regular file?
+ if ( S_ISREG(buf.st_mode) ) //is it a regular file?
{
Filenames.push_back( fileName );
numberOfFiles++;
}
- else if( S_ISDIR(buf.st_mode) ) //directory?
+ else if ( S_ISDIR(buf.st_mode) ) //directory?
{
- if( d->d_name[0] != '.' && recursive ) //we are also skipping hidden files
+ if ( d->d_name[0] != '.' && recursive ) //we are also skipping hidden files
{
numberOfFiles += Explore( fileName, recursive);
}
Program: gdcm
Module: $RCSfile: gdcmDocEntry.cxx,v $
Language: C++
- Date: $Date: 2005/06/14 14:00:04 $
- Version: $Revision: 1.58 $
+ Date: $Date: 2005/06/24 10:55:59 $
+ Version: $Revision: 1.59 $
Copyright (c) CREATIS (Centre de Recherche et d'Applications en Traitement de
l'Image). All rights reserved. See Doc/License.txt or
o = GetOffset();
vr = GetVR();
- if(vr==GDCM_UNKNOWN)
+ if ( vr==GDCM_UNKNOWN )
vr=" ";
s << DictEntry::TranslateToKey(GetGroup(),GetElement());
Program: gdcm
Module: $RCSfile: gdcmDocEntryArchive.cxx,v $
Language: C++
- Date: $Date: 2005/05/24 09:14:09 $
- Version: $Revision: 1.14 $
+ Date: $Date: 2005/06/24 10:55:59 $
+ Version: $Revision: 1.15 $
Copyright (c) CREATIS (Centre de Recherche et d'Applications en Traitement de
l'Image). All rights reserved. See Doc/License.txt or
*/
bool DocEntryArchive::Push(DocEntry *newEntry)
{
- if(!newEntry)
+ if ( !newEntry )
return false;
uint16_t group = newEntry->GetDictEntry()->GetGroup();
uint16_t elem = newEntry->GetDictEntry()->GetElement();
std::string key = DictEntry::TranslateToKey(group,elem);
- if( Archive.find(key)==Archive.end() )
+ if ( Archive.find(key)==Archive.end() )
{
// Save the old DocEntry if any
DocEntry *old = ArchFile->GetDocEntry(group, elem);
Archive[key] = old;
- if( old )
+ if ( old )
ArchFile->RemoveEntryNoDestroy(old);
// Set the new DocEntry
{
std::string key = DictEntry::TranslateToKey(group, elem);
- if( Archive.find(key)==Archive.end() )
+ if ( Archive.find(key)==Archive.end() )
{
// Save the old DocEntry if any
DocEntry *old = ArchFile->GetDocEntry(group, elem);
Archive[key] = old;
- if( old )
+ if ( old )
ArchFile->RemoveEntryNoDestroy(old);
return true;
std::string key=DictEntry::TranslateToKey(group, elem);
TagDocEntryHT::iterator restoreIt=Archive.find(key);
- if( restoreIt!=Archive.end() )
+ if ( restoreIt!=Archive.end() )
{
// Delete the new value
DocEntry *rem = ArchFile->GetDocEntry(group, elem);
- if( rem )
+ if ( rem )
ArchFile->RemoveEntry(rem);
// Restore the old value
- if( Archive[key] )
+ if ( Archive[key] )
ArchFile->AddEntry(Archive[key]);
Archive.erase(restoreIt);
it!=Archive.end();
++it)
{
- if(it->second)
+ if ( it->second )
it->second->Print(os);
}
}
Program: gdcm
Module: $RCSfile: gdcmDocEntrySet.cxx,v $
Language: C++
- Date: $Date: 2005/02/17 11:03:32 $
- Version: $Revision: 1.56 $
+ Date: $Date: 2005/06/24 10:55:59 $
+ Version: $Revision: 1.57 $
Copyright (c) CREATIS (Centre de Recherche et d'Applications en Traitement de
l'Image). All rights reserved. See Doc/License.txt or
std::string DocEntrySet::GetEntryValue(uint16_t group, uint16_t elem)
{
ContentEntry *entry = dynamic_cast<ContentEntry *>(GetDocEntry(group,elem));
- if( entry )
+ if ( entry )
return entry->GetValue();
return GDCM_UNFOUND;
}
void *DocEntrySet::GetEntryBinArea(uint16_t group, uint16_t elem)
{
BinEntry *entry = GetBinEntry(group, elem);
- if( entry )
+ if ( entry )
return entry->GetBinArea();
return 0;
}
int DocEntrySet::GetEntryLength(uint16_t group, uint16_t elem)
{
DocEntry *entry = GetDocEntry(group, elem);
- if( entry )
+ if ( entry )
return entry->GetLength();
return -1;
}
std::string DocEntrySet::GetEntryVR(uint16_t group, uint16_t elem)
{
DocEntry *entry = GetDocEntry(group, elem);
- if( entry )
+ if ( entry )
return entry->GetVR();
return GDCM_UNFOUND;
}
*/
bool DocEntrySet::SetValEntry(std::string const &content, ValEntry *entry)
{
- if(entry)
+ if (entry)
{
entry->SetValue(content);
return true;
*/
bool DocEntrySet::SetBinEntry(uint8_t *content, int lgth, BinEntry *entry)
{
- if(entry)
+ if (entry)
{
entry->SetBinArea(content);
entry->SetLength(lgth);
valEntry = dynamic_cast<ValEntry *>(currentEntry);
// Verify the VR
- if( valEntry )
- if( valEntry->GetVR()!=vr )
+ if ( valEntry )
+ if ( valEntry->GetVR()!=vr )
valEntry = NULL;
// if currentEntry doesn't correspond to the requested valEntry
- if( !valEntry)
+ if ( !valEntry)
{
- if( !RemoveEntry(currentEntry) )
+ if ( !RemoveEntry(currentEntry) )
{
gdcmWarningMacro( "Removal of previous DocEntry failed.");
}
// Create a new valEntry if necessary
- if( !valEntry )
+ if ( !valEntry )
{
valEntry = NewValEntry( group, elem, vr );
binEntry = dynamic_cast<BinEntry *>(currentEntry);
// Verify the VR
- if( binEntry )
- if( binEntry->GetVR()!=vr )
+ if ( binEntry )
+ if ( binEntry->GetVR()!=vr )
binEntry = NULL;
// if currentEntry doesn't correspond to the requested valEntry
- if( !binEntry)
+ if ( !binEntry)
{
- if( !RemoveEntry(currentEntry) )
+ if ( !RemoveEntry(currentEntry) )
{
gdcmWarningMacro( "Removal of previous DocEntry failed.");
}
// Create a new binEntry if necessary
- if( !binEntry)
+ if ( !binEntry)
{
binEntry = NewBinEntry(group, elem, vr);
// Set the binEntry value
uint8_t *tmpArea;
- if( lgth>0 && binArea )
+ if ( lgth>0 && binArea )
{
tmpArea = new uint8_t[lgth];
memcpy(tmpArea,binArea,lgth);
{
tmpArea = 0;
}
- if( !SetBinEntry(tmpArea,lgth,binEntry) )
+ if ( !SetBinEntry(tmpArea,lgth,binEntry) )
{
- if( tmpArea )
+ if ( tmpArea )
{
delete[] tmpArea;
}
DocEntry *currentEntry = GetDocEntry( group, elem );
// Verify the currentEntry
- if( currentEntry )
+ if ( currentEntry )
{
seqEntry = dynamic_cast<SeqEntry *>(currentEntry);
// Verify the VR
- if( seqEntry )
+ if ( seqEntry )
seqEntry = NULL;
// if currentEntry doesn't correspond to the requested seqEntry
- if( !seqEntry )
+ if ( !seqEntry )
{
if (!RemoveEntry(currentEntry))
{
}
}
// Create a new seqEntry if necessary
- if( !seqEntry )
+ if ( !seqEntry )
{
seqEntry = NewSeqEntry(group, elem);
- if( !AddEntry(seqEntry) )
+ if ( !AddEntry(seqEntry) )
{
gdcmWarningMacro( "AddEntry failed although this is a creation.");
// in the SeqEntry, at the end.
return seqEntry;
}
-
-
/**
* \brief Checks if a given Dicom Element exists within the H table
* \brief Build a new Val Entry from all the low level arguments.
* Check for existence of dictionary entry, and build
* a default one when absent.
- * @param group group number of the new Entry
- * @param elem element number of the new Entry
- * @param vr VR of the new Entry
+ * @param group Group number of the new Entry
+ * @param elem Element number of the new Entry
+ * @param vr V(alue) R(epresentation) of the new Entry
*/
ValEntry *DocEntrySet::NewValEntry(uint16_t group,uint16_t elem,
TagName const &vr)
* \brief Build a new Bin Entry from all the low level arguments.
* Check for existence of dictionary entry, and build
* a default one when absent.
- * @param group group number of the new Entry
- * @param elem element number of the new Entry
- * @param vr VR of the new Entry
+ * @param group Group number of the new Entry
+ * @param elem Element number of the new Entry
+ * @param vr V(alue) R(epresentation) of the new Entry
*/
BinEntry *DocEntrySet::NewBinEntry(uint16_t group, uint16_t elem,
TagName const &vr)
* \brief Build a new Seq Entry from all the low level arguments.
* Check for existence of dictionary entry, and build
* a default one when absent.
- * @param group group number of the new Entry
- * @param elem element number of the new Entry
+ * @param group Group number of the new Entry
+ * @param elem Element number of the new Entry
*/
SeqEntry* DocEntrySet::NewSeqEntry(uint16_t group, uint16_t elem)
{
/**
* \brief Request a new virtual dict entry to the dict set
- * @param group group number of the underlying DictEntry
- * @param elem element number of the underlying DictEntry
- * @param vr VR (Value Representation) of the underlying DictEntry
- * @param vm VM (Value Multiplicity) of the underlying DictEntry
+ * @param group Group number of the underlying DictEntry
+ * @param elem Element number of the underlying DictEntry
+ * @param vr V(alue) R(epresentation) of the underlying DictEntry
+ * @param vm V(alue) M(ultiplicity) of the underlying DictEntry
* @param name english name
*/
DictEntry* DocEntrySet::NewVirtualDictEntry( uint16_t group, uint16_t elem,
* \brief Searches [both] the public [and the shadow dictionary (when they
* exist)] for the presence of the DictEntry with given
* group and element. The public dictionary has precedence on the
- * shadow one.
- * @param group group number of the searched DictEntry
- * @param elem element number of the searched DictEntry
+ * shadow one(s), if any.
+ * @param group Group number of the searched DictEntry
+ * @param elem Element number of the searched DictEntry
* @return Corresponding DictEntry when it exists, NULL otherwise.
*/
DictEntry *DocEntrySet::GetDictEntry(uint16_t group,uint16_t elem)
* group and element, and create a new virtual DictEntry if necessary
* @param group group number of the searched DictEntry
* @param elem element number of the searched DictEntry
- * @param vr Value Representation to use, if necessary
+ * @param vr V(alue) R(epresentation) to use, if necessary
* @return Corresponding DictEntry when it exists, NULL otherwise.
*/
DictEntry *DocEntrySet::GetDictEntry(uint16_t group, uint16_t elem,
Program: gdcm
Module: $RCSfile: gdcmElementSet.cxx,v $
Language: C++
- Date: $Date: 2005/02/07 08:48:18 $
- Version: $Revision: 1.58 $
+ Date: $Date: 2005/06/24 10:55:59 $
+ Version: $Revision: 1.59 $
Copyright (c) CREATIS (Centre de Recherche et d'Applications en Traitement de
l'Image). All rights reserved. See Doc/License.txt or
{
const TagKey &key = newEntry->GetKey();
- if( TagHT.count(key) == 1 )
+ if ( TagHT.count(key) == 1 )
{
gdcmWarningMacro( "Key already present: " << key.c_str());
return false;
bool ElementSet::RemoveEntry( DocEntry *entryToRemove)
{
const TagKey &key = entryToRemove->GetKey();
- if( TagHT.count(key) == 1 )
+ if ( TagHT.count(key) == 1 )
{
TagHT.erase(key);
//gdcmWarningMacro( "One element erased.");
bool ElementSet::RemoveEntryNoDestroy(DocEntry *entryToRemove)
{
const TagKey &key = entryToRemove->GetKey();
- if( TagHT.count(key) == 1 )
+ if ( TagHT.count(key) == 1 )
{
TagHT.erase(key);
//gdcmWarningMacro( "One element erased.");
Program: gdcm
Module: $RCSfile: gdcmException.cxx,v $
Language: C++
- Date: $Date: 2005/02/01 10:29:55 $
- Version: $Revision: 1.26 $
+ Date: $Date: 2005/06/24 10:55:59 $
+ Version: $Revision: 1.27 $
Copyright (c) CREATIS (Centre de Recherche et d'Applications en Traitement de
l'Image). All rights reserved. See Doc/License.txt or
std::string name;
std::string iname = typeid(*this).name();
- if(iname[0] == 'Q')
+ if ( iname[0] == 'Q' )
{
nested = iname[1] - '0';
iname = std::string(iname, 2, std::string::npos);
::sscanf(iname.c_str(), "%u%n", &nb, &offset);
iname = std::string(iname, offset, std::string::npos);
name += std::string(iname, 0, nb);
- if(i + 1 < nested) name += "::";
- iname = std::string(iname, nb, std::string::npos);
+ if ( i + 1 < nested) name += "::";
+ iname = std::string(iname, nb, std::string::npos );
}
return name;
#else // no class name demangling
Module: $RCSfile: gdcmFileHelper.cxx,v $
Language: C++
- Date: $Date: 2005/06/22 07:53:52 $
- Version: $Revision: 1.45 $
+ Date: $Date: 2005/06/24 10:55:59 $
+ 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
*/
FileHelper::~FileHelper()
{
- if( PixelReadConverter )
+ if ( PixelReadConverter )
{
delete PixelReadConverter;
}
- if( PixelWriteConverter )
+ if ( PixelWriteConverter )
{
delete PixelWriteConverter;
}
- if( Archive )
+ if ( Archive )
{
delete Archive;
}
- if( SelfHeader )
+ if ( SelfHeader )
{
delete FileInternal;
}
return false;
}
- if( PixelWriteConverter->GetUserData() )
+ if ( PixelWriteConverter->GetUserData() )
{
fp1.write( (char *)PixelWriteConverter->GetUserData(),
PixelWriteConverter->GetUserDataSize() );
/// \todo the best trick would be *change* the recognition code
/// but pb expected if user deals with, e.g. COMPLEX images
- if( WriteType == ACR_LIBIDO )
+ if ( WriteType == ACR_LIBIDO )
{
SetWriteToLibido();
}
}
bool check = CheckWriteIntegrity(); // verifies length
- if(check)
+ if (check)
{
check = FileInternal->Write(fileName,WriteType);
}
*/
bool FileHelper::CheckWriteIntegrity()
{
- if(PixelWriteConverter->GetUserData())
+ if ( PixelWriteConverter->GetUserData() )
{
int numberBitsAllocated = FileInternal->GetBitsAllocated();
if ( numberBitsAllocated == 0 || numberBitsAllocated == 12 )
* FileInternal->GetSamplesPerPixel()
* ( numberBitsAllocated / 8 );
size_t rgbSize = decSize;
- if( FileInternal->HasLUT() )
+ if ( FileInternal->HasLUT() )
rgbSize = decSize * 3;
switch(WriteMode)
{
case WMODE_RAW :
- if( decSize!=PixelWriteConverter->GetUserDataSize() )
+ if ( decSize!=PixelWriteConverter->GetUserDataSize() )
{
gdcmWarningMacro( "Data size (Raw) is incorrect. Should be "
<< decSize << " / Found :"
}
break;
case WMODE_RGB :
- if( rgbSize!=PixelWriteConverter->GetUserDataSize() )
+ if ( rgbSize!=PixelWriteConverter->GetUserDataSize() )
{
gdcmWarningMacro( "Data size (RGB) is incorrect. Should be "
<< decSize << " / Found "
*/
void FileHelper::SetWriteToRaw()
{
- if( FileInternal->GetNumberOfScalarComponents() == 3
- && !FileInternal->HasLUT())
+ if ( FileInternal->GetNumberOfScalarComponents() == 3
+ && !FileInternal->HasLUT() )
{
SetWriteToRGB();
}
else
{
ValEntry *photInt = CopyValEntry(0x0028,0x0004);
- if(FileInternal->HasLUT())
+ if (FileInternal->HasLUT() )
{
photInt->SetValue("PALETTE COLOR ");
}
PixelReadConverter->GetRawSize());
std::string vr = "OB";
- if( FileInternal->GetBitsAllocated()>8 )
+ if ( FileInternal->GetBitsAllocated()>8 )
vr = "OW";
- if( FileInternal->GetBitsAllocated()==24 ) // For RGB ACR files
+ if ( FileInternal->GetBitsAllocated()==24 ) // For RGB ACR files
vr = "OB";
BinEntry *pixel =
CopyBinEntry(GetFile()->GetGrPixel(),GetFile()->GetNumPixel(),vr);
*/
void FileHelper::SetWriteToRGB()
{
- if(FileInternal->GetNumberOfScalarComponents()==3)
+ if ( FileInternal->GetNumberOfScalarComponents()==3 )
{
PixelReadConverter->BuildRGBImage();
ValEntry *photInt = CopyValEntry(0x0028,0x0004);
photInt->SetValue("RGB ");
- if(PixelReadConverter->GetRGB())
+ if ( PixelReadConverter->GetRGB() )
{
PixelWriteConverter->SetReadData(PixelReadConverter->GetRGB(),
PixelReadConverter->GetRGBSize());
}
std::string vr = "OB";
- if( FileInternal->GetBitsAllocated()>8 )
+ if ( FileInternal->GetBitsAllocated()>8 )
vr = "OW";
- if( FileInternal->GetBitsAllocated()==24 ) // For RGB ACR files
+ if ( FileInternal->GetBitsAllocated()==24 ) // For RGB ACR files
vr = "OB";
BinEntry *pixel =
CopyBinEntry(GetFile()->GetGrPixel(),GetFile()->GetNumPixel(),vr);
// For old '24 Bits' ACR-NEMA
// Thus, we have a RGB image and the bits allocated = 24 and
// samples per pixels = 1 (in the read file)
- if(FileInternal->GetBitsAllocated()==24)
+ if ( FileInternal->GetBitsAllocated()==24 )
{
ValEntry *bitsAlloc = CopyValEntry(0x0028,0x0100);
bitsAlloc->SetValue("8 ");
ValEntry *oldCol = dynamic_cast<ValEntry *>
(FileInternal->GetDocEntry(0x0028, 0x0011));
- if( oldRow && oldCol )
+ if ( oldRow && oldCol )
{
std::string rows, columns;
{
ValEntry *recCode = dynamic_cast<ValEntry *>
(FileInternal->GetDocEntry(0x0008,0x0010));
- if( recCode )
+ if ( recCode )
{
- if( recCode->GetValue() == "ACRNEMA_LIBIDO_1.1" )
+ if ( recCode->GetValue() == "ACRNEMA_LIBIDO_1.1" )
{
ValEntry *libidoCode = CopyValEntry(0x0008,0x0010);
libidoCode->SetValue("");
DocEntry *oldE = FileInternal->GetDocEntry(group, elem);
ValEntry *newE;
- if( oldE )
+ if ( oldE )
{
newE = new ValEntry(oldE->GetDictEntry());
newE->Copy(oldE);
DocEntry *oldE = FileInternal->GetDocEntry(group, elem);
BinEntry *newE;
- if( oldE )
- if( oldE->GetVR()!=vr )
+ if ( oldE )
+ if ( oldE->GetVR()!=vr )
oldE = NULL;
- if( oldE )
+ if ( oldE )
{
newE = new BinEntry(oldE->GetDictEntry());
newE->Copy(oldE);
// The Raw image migth not be loaded yet:
std::ifstream *fp = FileInternal->OpenFile();
PixelReadConverter->ReadAndDecompressPixelData( fp );
- if(fp)
+ if ( fp )
FileInternal->CloseFile();
raw = PixelReadConverter->GetRaw();
Program: gdcm
Module: $RCSfile: gdcmJpeg.cxx,v $
Language: C++
- Date: $Date: 2005/02/11 20:04:08 $
- Version: $Revision: 1.48 $
+ Date: $Date: 2005/06/24 10:55:59 $
+ Version: $Revision: 1.49 $
Copyright (c) CREATIS (Centre de Recherche et d'Applications en Traitement de
l'Image). All rights reserved. See Doc/License.txt or
return 0;
}
// Now we can initialize the JPEG decompression object.
- if( statesuspension == 0 )
+ if ( statesuspension == 0 )
{
jpeg_create_decompress(&cinfo);
jpeg_stdio_src(&cinfo, fp, this, 1);
}
// Step 3: read file parameters with jpeg_read_header()
- if( statesuspension < 2 )
+ if ( statesuspension < 2 )
{
- if( jpeg_read_header(&cinfo, TRUE) == JPEG_SUSPENDED )
+ if ( jpeg_read_header(&cinfo, TRUE) == JPEG_SUSPENDED )
{
// Suspension in jpeg_read_header
statesuspension = 2;
// Step 4: set parameters for decompression
// prevent the library from performing any color space conversion
- if( cinfo.process == JPROC_LOSSLESS )
+ if ( cinfo.process == JPROC_LOSSLESS )
{
cinfo.jpeg_color_space = JCS_UNKNOWN;
cinfo.out_color_space = JCS_UNKNOWN;
}
// Step 5: Start decompressor
- if(statesuspension < 3 )
+ if (statesuspension < 3 )
{
- if( jpeg_start_decompress(&cinfo) == FALSE )
+ if ( jpeg_start_decompress(&cinfo) == FALSE )
{
// Suspension: jpeg_start_decompress
statesuspension = 3;
while (cinfo.output_scanline < cinfo.output_height)
{
- if( jpeg_read_scanlines(&cinfo, buffer, 1) == 0 )
+ if ( jpeg_read_scanlines(&cinfo, buffer, 1) == 0 )
{
// Suspension in jpeg_read_scanlines
statesuspension = 3;
}
// Step 7: Finish decompression
- if( jpeg_finish_decompress(&cinfo) == FALSE )
+ if ( jpeg_finish_decompress(&cinfo) == FALSE )
{
// Suspension: jpeg_finish_decompress
statesuspension = 4;
Program: gdcm
Module: $RCSfile: gdcmMpeg.cxx,v $
Language: C++
- Date: $Date: 2005/06/02 12:32:55 $
- Version: $Revision: 1.4 $
+ Date: $Date: 2005/06/24 10:55:59 $
+ Version: $Revision: 1.5 $
Copyright (c) CREATIS (Centre de Recherche et d'Applications en Traitement de
l'Image). All rights reserved. See Doc/License.txt or
int i;
/* Clip table */
- if (!(Clip=(unsigned char *)malloc(1024)))
+ if ( !(Clip=(unsigned char *)malloc(1024)) )
Error("Clip[] malloc failed\n");
Clip += 384;
Clip[i] = (i<0) ? 0 : ((i>255) ? 255 : i);
/* IDCT */
- if (Reference_IDCT_Flag)
+ if ( Reference_IDCT_Flag )
Initialize_Reference_IDCT();
else
Initialize_Fast_IDCT();
static int Table_6_20[3] = {6,8,12};
/* check scalability mode of enhancement layer */
- if (Two_Streams && (enhan.scalable_mode!=SC_SNR) && (base.scalable_mode!=SC_DP))
- Error("unsupported scalability mode\n");
-
+ if ( Two_Streams && (enhan.scalable_mode!=SC_SNR)
+ &&
+ (base.scalable_mode!=SC_DP) )
+ {
+ Error("unsupported scalability mode\n");
+ }
/* force MPEG-1 parameters for proper decoder behavior */
/* see ISO/IEC 13818-2 section D.9.14 */
- if (!base.MPEG2_Flag)
+ if ( !base.MPEG2_Flag )
{
progressive_sequence = 1;
progressive_frame = 1;
for (cc=0; cc<3; cc++)
{
- if (cc==0)
+ if ( cc==0 )
size = Coded_Picture_Width*Coded_Picture_Height;
else
size = Chroma_Width*Chroma_Height;
- if (!(backward_reference_frame[cc] = (unsigned char *)malloc(size)))
+ if ( !(backward_reference_frame[cc] = (unsigned char *)malloc(size)) )
Error("backward_reference_frame[] malloc failed\n");
- if (!(forward_reference_frame[cc] = (unsigned char *)malloc(size)))
+ if ( !(forward_reference_frame[cc] = (unsigned char *)malloc(size)) )
Error("forward_reference_frame[] malloc failed\n");
- if (!(auxframe[cc] = (unsigned char *)malloc(size)))
+ if ( !(auxframe[cc] = (unsigned char *)malloc(size)) )
Error("auxframe[] malloc failed\n");
- if(Ersatz_Flag)
- if (!(substitute_frame[cc] = (unsigned char *)malloc(size)))
+ if ( Ersatz_Flag )
+ if ( !(substitute_frame[cc] = (unsigned char *)malloc(size)) )
Error("substitute_frame[] malloc failed\n");
- if (base.scalable_mode==SC_SPAT)
+ if ( base.scalable_mode==SC_SPAT )
{
/* this assumes lower layer is 4:2:0 */
- if (!(llframe0[cc] = (unsigned char *)malloc((lower_layer_prediction_horizontal_size*lower_layer_prediction_vertical_size)/(cc?4:1))))
+ if ( !(llframe0[cc] = (unsigned char *)malloc((lower_layer_prediction_horizontal_size*lower_layer_prediction_vertical_size)/(cc?4:1))))
Error("llframe0 malloc failed\n");
- if (!(llframe1[cc] = (unsigned char *)malloc((lower_layer_prediction_horizontal_size*lower_layer_prediction_vertical_size)/(cc?4:1))))
+ if ( !(llframe1[cc] = (unsigned char *)malloc((lower_layer_prediction_horizontal_size*lower_layer_prediction_vertical_size)/(cc?4:1))))
Error("llframe1 malloc failed\n");
}
}
/* SCALABILITY: Spatial */
- if (base.scalable_mode==SC_SPAT)
+ if ( base.scalable_mode==SC_SPAT )
{
- if (!(lltmp = (short *)malloc(lower_layer_prediction_horizontal_size*((lower_layer_prediction_vertical_size*vertical_subsampling_factor_n)/vertical_subsampling_factor_m)*sizeof(short))))
+ if ( !(lltmp = (short *)malloc(lower_layer_prediction_horizontal_size*((lower_layer_prediction_vertical_size*vertical_subsampling_factor_n)/vertical_subsampling_factor_m)*sizeof(short))))
Error("lltmp malloc failed\n");
}
ld = &base;
-
/* return when end of sequence (0) or picture
header has been parsed (1) */
ret = Headers();
- if(ret==1)
+ if ( ret==1 )
{
ret = video_sequence(&Bitstream_Framenum);
}
free(forward_reference_frame[i]);
free(auxframe[i]);
- if (base.scalable_mode==SC_SPAT)
+ if ( base.scalable_mode==SC_SPAT )
{
free(llframe0[i]);
free(llframe1[i]);
}
}
- if (base.scalable_mode==SC_SPAT)
+ if ( base.scalable_mode==SC_SPAT )
free(lltmp);
#ifdef DISPLAY
- if (Output_Type==T_X11)
+ if ( Output_Type==T_X11 )
Terminate_Display_Process();
#endif
}
Decode_Picture(Bitstream_Framenum, Sequence_Framenum);
/* update picture numbers */
- if (!Second_Field)
+ if ( !Second_Field )
{
Bitstream_Framenum++;
Sequence_Framenum++;
{
Decode_Picture(Bitstream_Framenum, Sequence_Framenum);
- if (!Second_Field)
+ if ( !Second_Field )
{
Bitstream_Framenum++;
Sequence_Framenum++;
#endif
- if(base.Infile != 0)
+ if ( base.Infile != 0 )
{
Initialize_Buffer();
- if(Show_Bits(8)==0x47)
+ if ( Show_Bits(8)==0x47 )
{
sprintf(Error_Text,"Decoder currently does not parse transport streams\n");
Error(Error_Text);
Initialize_Buffer();
}
- if(base.Infile!=0)
+ if ( base.Infile!=0 )
{
//lseek(base.Infile, 0l, SEEK_SET);
//fp->seekg(mpeg_start, ios_base::beg);
Initialize_Buffer();
- if(Two_Streams)
+ if ( Two_Streams )
{
abort();
ld = &enhan; /* select enhancement layer context */
- if ((enhan.Infile = open(Enhancement_Layer_Bitstream_Filename,O_RDONLY|O_BINARY))<0)
+ if ( (enhan.Infile = open(Enhancement_Layer_Bitstream_Filename,O_RDONLY|O_BINARY))<0)
{
sprintf(Error_Text,"enhancment layer bitstream file %s not found\n",
Enhancement_Layer_Bitstream_Filename);
//close(base.Infile);
- if (Two_Streams)
+ if ( Two_Streams )
{
abort();
close(enhan.Infile);
Program: gdcm
Module: $RCSfile: gdcmPixelWriteConvert.cxx,v $
Language: C++
- Date: $Date: 2005/02/16 11:20:51 $
- Version: $Revision: 1.8 $
+ Date: $Date: 2005/06/24 10:55:59 $
+ 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
*/
uint8_t *PixelWriteConvert::GetData()
{
- if(UserData)
+ if ( UserData )
{
return UserData;
}
*/
size_t PixelWriteConvert::GetDataSize()
{
- if(UserData)
+ if ( UserData )
{
return UserDataSize;
}
Program: gdcm
Module: $RCSfile: gdcmSQItem.cxx,v $
Language: C++
- Date: $Date: 2005/02/07 08:48:18 $
- Version: $Revision: 1.70 $
+ Date: $Date: 2005/06/24 10:55:59 $
+ Version: $Revision: 1.71 $
Copyright (c) CREATIS (Centre de Recherche et d'Applications en Traitement de
l'Image). All rights reserved. See Doc/License.txt or
it != DocEntries.end();
++it)
{
- if( *it == entryToRemove )
+ if ( *it == entryToRemove )
{
DocEntries.erase(it);
gdcmWarningMacro( "One element erased: " << entryToRemove->GetKey() );
it != DocEntries.end();
++it)
{
- if( *it == entryToRemove )
+ if ( *it == entryToRemove )
{
DocEntries.erase(it);
gdcmWarningMacro( "One element erased, no destroyed: "
DocEntry *SQItem::GetFirstEntry()
{
ItDocEntries = DocEntries.begin();
- if( ItDocEntries != DocEntries.end() )
+ if ( ItDocEntries != DocEntries.end() )
return *ItDocEntries;
return 0;
}
DocEntry *SQItem::GetNextEntry()
{
++ItDocEntries;
- if( ItDocEntries != DocEntries.end() )
+ if ( ItDocEntries != DocEntries.end() )
return *ItDocEntries;
return NULL;
}
Program: gdcm
Module: $RCSfile: gdcmSerieHelper.cxx,v $
Language: C++
- Date: $Date: 2005/06/03 16:08:16 $
- Version: $Revision: 1.9 $
+ Date: $Date: 2005/06/24 10:55:59 $
+ Version: $Revision: 1.10 $
Copyright (c) CREATIS (Centre de Recherche et d'Applications en Traitement de
l'Image). All rights reserved. See Doc/License.txt or
{
// Create a DICOM file
File *header = new File( filename );
- if( header->IsReadable() )
+ if ( header->IsReadable() )
{
int allrules = 1;
// First step the user has defined s set of rules for the DICOM he is looking for
{
const Rule &r = *it;
const std::string s;// = header->GetEntryValue( r.first );
- if( !Util::DicomStringEqual(s, r.second.c_str()))
+ if ( !Util::DicomStringEqual(s, r.second.c_str()) )
{
// Argh ! This rule is unmatch let's just quit
allrules = 0;
break;
}
}
- if( allrules ) // all rules are respected:
+ if ( allrules ) // all rules are respected:
{
// Alright ! we have a found a DICOM that match the user expectation.
// Let's add it !
*/
void SerieHelper::OrderFileList(FileList *coherentFileList)
{
- if( ImagePositionPatientOrdering( coherentFileList ) )
+ if ( ImagePositionPatientOrdering( coherentFileList ) )
{
return ;
}
- else if( ImageNumberOrdering(coherentFileList ) )
+ else if ( ImageNumberOrdering(coherentFileList ) )
{
return ;
}
FileList *SerieHelper::GetFirstCoherentFileList()
{
ItListHt = CoherentFileListHT.begin();
- if( ItListHt != CoherentFileListHT.end() )
+ if ( ItListHt != CoherentFileListHT.end() )
return ItListHt->second;
return NULL;
}
it = fileList->begin();
it != fileList->end(); ++it )
{
- if( first )
+ if ( first )
{
(*it)->GetImageOrientationPatient( cosines );
// gdcmAssertMacro( CoherentFileVector.capacity() >= n );
// Find out if min/max are coherent
- if( min == max )
+ if ( min == max )
{
gdcmWarningMacro( "Looks like all images have the exact same image position...");
return false;
}
// Find out if image numbers are coherent (consecutive)
- if( min == max || max == 0 || max >= (n+min))
+ if ( min == max || max == 0 || max >= (n+min) )
return false;
std::sort(fileList->begin(), fileList->end(), SerieHelper::ImageNumberLessThan );
Program: gdcm
Module: $RCSfile: gdcmTS.cxx,v $
Language: C++
- Date: $Date: 2005/06/09 21:14:43 $
- Version: $Revision: 1.47 $
+ Date: $Date: 2005/06/24 10:55:59 $
+ Version: $Revision: 1.48 $
Copyright (c) CREATIS (Centre de Recherche et d'Applications en Traitement de
l'Image). All rights reserved. See Doc/License.txt or
{
std::string filename = DictSet::BuildDictPath() + DICT_TS;
std::ifstream from(filename.c_str());
- if( !from )
+ if ( !from )
{
gdcmWarningMacro("Can't open dictionary" << filename.c_str());
FillDefaultTSDict( TsMap );
from >> std::ws;
std::getline(from, name);
- if(key != "")
+ if (key != "")
{
TsMap[key] = name;
}
{
bool r = false;
// First check this is an actual transfer syntax
- if( IsTransferSyntax(key) )
+ if ( IsTransferSyntax(key) )
{
if ( key == SpecialStrings[RLELossless] )
{
{
bool r = false;
// First check this is an actual transfer syntax
- if( IsTransferSyntax(key) )
+ if ( IsTransferSyntax(key) )
{
if ( key == SpecialStrings[JPEGFullProgressionProcess10_12]
|| key == SpecialStrings[JPEGLosslessProcess14]
{
bool r = false;
// First check this is an actual transfer syntax
- if( IsTransferSyntax(key) )
+ if ( IsTransferSyntax(key) )
{
if ( key == SpecialStrings[JPEGBaselineProcess1]
|| key == SpecialStrings[JPEGExtendedProcess2_4]
{
bool r = false;
// First check this is an actual transfer syntax
- if( IsTransferSyntax(key) )
+ if ( IsTransferSyntax(key) )
{
if ( key == SpecialStrings[JPEG2000Lossless]
|| key == SpecialStrings[JPEG2000] )
{
bool r = false;
// First check this is an actual transfer syntax
- if( IsTransferSyntax(key) )
+ if ( IsTransferSyntax(key) )
{
if ( IsJPEGLossy( key )
|| IsJPEGLossless( key )
{
bool r = false;
// First check this is an actual transfer syntax
- if( IsTransferSyntax(key) )
+ if ( IsTransferSyntax(key) )
{
if ( key == SpecialStrings[JPEGLSLossless]
|| key == SpecialStrings[JPEGLSNearLossless] )
{
bool r = false;
// First check this is an actual transfer syntax
- if( IsTransferSyntax(key) )
+ if ( IsTransferSyntax(key) )
{
if ( key == SpecialStrings[MPEG2MainProfile] )
{
Program: gdcm
Module: $RCSfile: gdcmUtil.cxx,v $
Language: C++
- Date: $Date: 2005/06/08 12:24:53 $
- Version: $Revision: 1.154 $
+ Date: $Date: 2005/06/24 10:55:59 $
+ Version: $Revision: 1.155 $
Copyright (c) CREATIS (Centre de Recherche et d'Applications en Traitement de
l'Image). All rights reserved. See Doc/License.txt or
for(unsigned int i=0; i<str.size(); i++)
{
- if(!isprint((unsigned char)str[i]))
+ if (!isprint((unsigned char)str[i]) )
{
str[i] = '.';
}
}
- if(str.size() > 0)
+ if (str.size() > 0 )
{
- if(!isprint((unsigned char)s[str.size()-1]))
+ if (!isprint((unsigned char)s[str.size()-1]) )
{
- if(s[str.size()-1] == 0)
+ if (s[str.size()-1] == 0 )
{
str[str.size()-1] = ' ';
}
std::string name = pathname;
int size = name.size();
- if( name[size-1] != SEPARATOR_X && name[size-1] != SEPARATOR_WIN )
+ if ( name[size-1] != SEPARATOR_X && name[size-1] != SEPARATOR_WIN )
{
name += SEPARATOR;
}
std::string res = fullName;
int pos1 = res.rfind("/");
int pos2 = res.rfind("\\");
- if( pos1 > pos2)
+ if ( pos1 > pos2 )
{
res.resize(pos1);
}
std::string::size_type slash_pos = filename.rfind("/");
std::string::size_type backslash_pos = filename.rfind("\\");
slash_pos = slash_pos > backslash_pos ? slash_pos : backslash_pos;
- if(slash_pos != std::string::npos)
+ if (slash_pos != std::string::npos )
{
return filename.substr(slash_pos + 1);
}
std::string Util::DicomString(const char *s)
{
size_t l = strlen(s);
- if( l%2 )
+ if ( l%2 )
{
l++;
}
// s2 is the string from the DICOM reference: 'MONOCHROME1'
std::string s1_even = s1; //Never change input parameter
std::string s2_even = DicomString( s2 );
- if( s1_even[s1_even.size()-1] == ' ')
+ if ( s1_even[s1_even.size()-1] == ' ' )
{
s1_even[s1_even.size()-1] = '\0'; //replace space character by null
}
char **paddrs;
int sock, status=0;
- if(gethostname(hostname, MAXHOSTNAMELEN) != 0)
+ if (gethostname(hostname, MAXHOSTNAMELEN) != 0 )
{
perror("gethostname");
return -1;
paddrs = phost->h_addr_list;
sock = socket(AF_INET, SOCK_DGRAM, IPPROTO_UDP);
- if(sock == -1)
+ if (sock == -1 )
{
perror("sock");
return -1;
memcpy(&psa->sin_addr, *paddrs, sizeof(struct in_addr));
status = ioctl(sock, SIOCGARP, &parpreq);
- if(status == -1)
+ if (status == -1 )
{
perror("SIOCGARP");
return -1;
#define ifreq_size(i) sizeof(struct ifreq)
#endif // HAVE_SA_LEN
- if( (sd = socket(AF_INET, SOCK_DGRAM, IPPROTO_IP)) < 0 )
+ if ( (sd = socket(AF_INET, SOCK_DGRAM, IPPROTO_IP)) < 0 )
{
return -1;
}
{
std::string prefix;
std::string append;
- if( root.empty() )
+ if ( root.empty() )
{
// gdcm UID prefix, as supplied by http://www.medicalconnections.co.uk
prefix = RootUID;
append += tmp;
// If append is too long we need to rehash it
- if( (prefix + append).size() > 64 )
+ if ( (prefix + append).size() > 64 )
{
gdcmErrorMacro( "Size of UID is too long." );
// we need a hash function to truncate this number
void Util::SetRootUID(const std::string &root)
{
- if( root.empty() )
+ if ( root.empty() )
RootUID = GDCM_UID;
else
RootUID = root;
char szHostName[HOST_NAME_MAX+1];
int r = gethostname(szHostName, HOST_NAME_MAX);
- if( r == 0 )
+ if ( r == 0 )
{
// Get host adresses
struct hostent *pHost = gethostbyname(szHostName);
{
for( int j = 0; j<pHost->h_length; j++ )
{
- if( j > 0 ) str += ".";
+ if ( j > 0 ) str += ".";
str += Util::Format("%u",
(unsigned int)((unsigned char*)pHost->h_addr_list[i])[j]);
Program: gdcm
Module: $RCSfile: gdcmVR.cxx,v $
Language: C++
- Date: $Date: 2005/02/11 15:22:19 $
- Version: $Revision: 1.36 $
+ Date: $Date: 2005/06/24 10:55:59 $
+ Version: $Revision: 1.37 $
Copyright (c) CREATIS (Centre de Recherche et d'Applications en Traitement de
l'Image). All rights reserved. See Doc/License.txt or
{
std::string filename = DictSet::BuildDictPath() + DICT_VR;
std::ifstream from(filename.c_str());
- if(!from)
+ if ( !from )
{
gdcmWarningMacro("Can't open dictionary" << filename.c_str());
FillDefaultVRDict(vr);
from >> std::ws;
from.getline(buff, 1024, '\n');
- if(key != "")
+ if ( key != "" )
{
vr[key] = name;
}
Program: gdcm
Module: $RCSfile: gdcmValEntry.cxx,v $
Language: C++
- Date: $Date: 2005/06/07 10:07:20 $
- Version: $Revision: 1.61 $
+ Date: $Date: 2005/06/24 10:55:59 $
+ Version: $Revision: 1.62 $
Copyright (c) CREATIS (Centre de Recherche et d'Applications en Traitement de
l'Image). All rights reserved. See Doc/License.txt or
if ( l != 0) // To avoid to be cheated by 'zero length' integers
{
const VRKey &vr = GetVR();
- if( vr == "US" || vr == "SS" )
+ if ( vr == "US" || vr == "SS" )
{
// for multivaluated items
l = (Util::CountSubstring(val, "\\") + 1) * 2;
ContentEntry::SetValue(val);
}
- else if( vr == "UL" || vr == "SL" )
+ else if ( vr == "UL" || vr == "SL" )
{
// for multivaluated items
l = (Util::CountSubstring(val, "\\") + 1) * 4;;
TSAtr v = GetValue();
d2 = Util::CreateCleanString(v); // replace non printable characters by '.'
- if( (long)GetLength() <= ValEntry::GetMaxSizePrintEntry()
+ if ( (long)GetLength() <= ValEntry::GetMaxSizePrintEntry()
|| PrintLevel >= 3
|| d2.find(GDCM_NOTLOADED) < d2.length() )
{
Program: gdcm
Module: $RCSfile: gdcmValidator.cxx,v $
Language: C++
- Date: $Date: 2005/06/17 12:15:54 $
- Version: $Revision: 1.3 $
+ Date: $Date: 2005/06/24 10:55:59 $
+ Version: $Revision: 1.4 $
Copyright (c) CREATIS (Centre de Recherche et d'Applications en Traitement de
l'Image). All rights reserved. See Doc/License.txt or
{
const std::string &s = v->GetValue();
std::string::size_type n = s.find("\\");
- if (n == s.npos) // none found
+ if ( n == s.npos ) // none found
{
n = 0;
}
}
else if ( gdcm::ValEntry *v = dynamic_cast<gdcm::ValEntry*>(d) )
{
- if( !CheckVM(v))
+ if ( !CheckVM(v) )
{
std::cout << "Rah this DICOM contains one wrong tag:" <<
v->GetValue() << " " <<