Program: gdcm
Module: $RCSfile: gdcmSerieHelper.cxx,v $
Language: C++
- Date: $Date: 2005/05/27 21:19:03 $
- Version: $Revision: 1.8 $
+ 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 !
* But as I don't know how to do it, I leave it this way
* BTW, this is also a Strategy, I don't know this is the best approach :)
*/
-void SerieHelper::OrderFileList(FileList *CoherentFileList)
+void SerieHelper::OrderFileList(FileList *coherentFileList)
{
- if( ImagePositionPatientOrdering( CoherentFileList ) )
+ if ( ImagePositionPatientOrdering( coherentFileList ) )
{
return ;
}
- else if( ImageNumberOrdering(CoherentFileList ) )
+ else if ( ImageNumberOrdering(coherentFileList ) )
{
return ;
}
else
{
- FileNameOrdering(CoherentFileList );
+ FileNameOrdering(coherentFileList );
}
}
FileList *SerieHelper::GetFirstCoherentFileList()
{
ItListHt = CoherentFileListHT.begin();
- if( ItListHt != CoherentFileListHT.end() )
+ if ( ItListHt != CoherentFileListHT.end() )
return ItListHt->second;
return NULL;
}
/**
* \brief Get the Coherent Files list according to its Serie UID
* @param SerieUID SerieUID
- * \return pointer to the Coherent Filseslist if found, otherwhise NULL
+ * \return pointer to the Coherent Files list if found, otherwhise NULL
*/
FileList *SerieHelper::GetCoherentFileList(std::string SerieUID)
{
* -# Image Position Patient
* -# Image Number
* -# More to come :-)
+ * WARNING : FileList = std::vector<File* >
* @param fileList Coherent File list (same Serie UID) to sort
* @return false only if the header is bugged !
*/
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 );
/**
* \brief Canonical printer.
*/
-void SerieHelper::Print(std::ostream &os, std::string const & indent)
+void SerieHelper::Print(std::ostream &os, std::string const &indent)
{
// For all the Coherent File lists of the gdcm::Serie
CoherentFileListmap::iterator itl = CoherentFileListHT.begin();