Main Page | Namespace List | Class Hierarchy | Alphabetical List | Class List | Directories | File List | Namespace Members | Class Members | File Members | Related Pages

gdcm::Validator Class Reference

#include <gdcmValidator.h>

Inheritance diagram for gdcm::Validator:

Inheritance graph
[legend]
Collaboration diagram for gdcm::Validator:

Collaboration graph
[legend]
List of all members.

Public Member Functions

void SetInput (ElementSet *input)
void Delete ()
 Delete the object.
void Register ()
 Register the object.
void Unregister ()
 Unregister the object.
const unsigned long & GetRefCount () const
 Get the reference counting.
virtual void Print (std::ostream &=std::cout, std::string const &="")
 Printer.
void SetPrintLevel (int level)
 Sets the print level for the Dicom Header Elements.
int GetPrintLevel ()
 Gets the print level for the Dicom Entries.

Static Public Member Functions

static Validator * New ()
 Constructs a Validator with a RefCounter.

Protected Member Functions

 Validator ()
 Constructor.
 ~Validator ()
 Canonical Destructor.

Protected Attributes

int PrintLevel
 Amount of printed details for each Dicom Entries : 0 : stands for the least detail level.

Private Member Functions

 gdcmTypeMacro (Validator)

Detailed Description

Definition at line 30 of file gdcmValidator.h.


Constructor & Destructor Documentation

gdcm::Validator::Validator (   )  [protected]
 

Constructor.

Definition at line 33 of file gdcmValidator.cxx.

00034 {
00035 }

gdcm::Validator::~Validator (   )  [protected]
 

Canonical Destructor.

Definition at line 37 of file gdcmValidator.cxx.

00038 {
00039 }


Member Function Documentation

void gdcm::RefCounter::Delete (   )  [inline, inherited]
 

Delete the object.

Remarks:
The object is deleted only if its reference counting is to zero

Definition at line 39 of file gdcmRefCounter.h.

Referenced by gdcm::SerieHelper::AddFileName(), gdcm::Document::Backtrack(), gdcm::FileHelper::CheckMandatoryElements(), gdcm::FileHelper::CheckMandatoryEntry(), gdcm::FileHelper::CopyMandatoryEntry(), gdcm::DicomDir::CreateDicomDirChainedList(), gdcm::File::DoTheLoadingJob(), gdcm::Dict::DoTheLoadingJob(), gdcm::DicomDirObject::FillObject(), gdcm::DocEntrySet::InsertEntryBinArea(), gdcm::DocEntrySet::InsertEntryString(), gdcm::DocEntrySet::InsertSeqEntry(), vtkGdcmReader::LoadFileInformation(), vtkGdcmReader::LoadImageInMemory(), main(), gdcm::DicomDir::NewMeta(), gdcm::DicomDirStudy::NewVisit(), gdcm::Document::ParseDES(), gdcm::Document::ParseSQ(), gdcm::Document::ReadNextDocEntry(), gdcm::DicomDir::SetElement(), gdcm::FileHelper::SetMandatoryEntry(), gdcm::FileHelper::SetWriteFileTypeToExplicitVR(), gdcm::FileHelper::SetWriteFileTypeToImplicitVR(), gdcm::FileHelper::SetWriteFileTypeToJPEG(), gdcm::FileHelper::SetWriteToLibido(), gdcm::FileHelper::SetWriteToNoLibido(), gdcm::FileHelper::SetWriteToRaw(), gdcm::FileHelper::SetWriteToRGB(), vtkGdcmWriter::WriteDcmFile(), gdcm::DicomDir::~DicomDir(), and gdcm::Global::~Global().

00039 { Unregister(); }

gdcm::Validator::gdcmTypeMacro (  Validator   )  [private]
 

int gdcm::Base::GetPrintLevel (   )  [inline, inherited]
 

Gets the print level for the Dicom Entries.

Definition at line 50 of file gdcmBase.h.

00050 { return PrintLevel; }

const unsigned long& gdcm::RefCounter::GetRefCount (   )  const [inline, inherited]
 

Get the reference counting.

Returns:
Reference count

Definition at line 56 of file gdcmRefCounter.h.

00057    {
00058       return RefCount;
00059    }

static Validator* gdcm::Validator::New (   )  [inline, static]
 

Constructs a Validator with a RefCounter.

Definition at line 37 of file gdcmValidator.h.

00037 {return new Validator();}

virtual void gdcm::Base::Print (  std::ostream &  = std::cout,
std::string const &  = ""
)  [inline, virtual, inherited]
 

Printer.

Reimplemented in gdcm::CommandManager, gdcm::DataEntry, gdcm::DicomDir, gdcm::DicomDirElement, gdcm::DicomDirImage, gdcm::DicomDirMeta, gdcm::DicomDirPatient, gdcm::DicomDirSerie, gdcm::DicomDirStudy, gdcm::DicomDirVisit, gdcm::DicomEntry, gdcm::Dict, gdcm::DictEntry, gdcm::DictGroupName, gdcm::DictSet, gdcm::DirList, gdcm::DocEntry, gdcm::ElementSet, gdcm::FileHelper, gdcm::JPEGFragment, gdcm::PixelReadConvert, gdcm::RLEFrame, gdcm::SeqEntry, gdcm::SerieHelper, gdcm::SQItem, gdcm::TS, and gdcm::VR.

Definition at line 42 of file gdcmBase.h.

00043                                                {};

void gdcm::RefCounter::Register (   )  [inline, inherited]
 

Register the object.

Remarks:
It increments the reference counting

Definition at line 44 of file gdcmRefCounter.h.

Referenced by gdcm::SQItem::AddEntry(), gdcm::ElementSet::AddEntry(), gdcm::Dict::AddEntry(), gdcm::SeqEntry::AddSQItem(), gdcm::SeqEntry::Copy(), gdcm::DicomDir::Copy(), gdcm::DocEntry::DocEntry(), gdcm::FileHelper::FileHelper(), gdcm::DocEntrySet::GetDictEntry(), gdcm::CommandManager::InSetCommand(), gdcm::DocEntryArchive::Push(), gdcm::Dict::ReplaceEntry(), and gdcm::SeqEntry::SetDelimitationItem().

00044 { RefCount++; }

void gdcm::Validator::SetInput (  ElementSet *  input  ) 
 

Definition at line 69 of file gdcmValidator.cxx.

References gdcm::CheckVM(), gdcm::GDCM_UNKNOWN, gdcm::ElementSet::GetFirstEntry(), gdcm::DocEntry::GetKey(), and gdcm::ElementSet::GetNextEntry().

00070 {
00071 
00072 DocEntry *d;
00073 /*
00074 // First stage to check group length
00075   GroupHT grHT;
00076   d=input->GetFirstEntry();
00077   while(d)
00078   {
00079     grHT[d->GetGroup()] = 0;
00080     d=input->GetNextEntry();
00081   }
00082   for (GroupHT::iterator it = grHT.begin(); it != grHT.end(); ++it)  
00083   {
00084       std::cout << std::hex << it->first << std::endl; 
00085   } 
00086 */
00087 
00088   // berk for now SetInput do two things at the same time
00089   d=input->GetFirstEntry();
00090   if (!d)
00091   {
00092      std::cout << "No Entry found" << std::endl;
00093      return;
00094   }
00095   while(d)
00096   { 
00097     if ( DataEntry *v = dynamic_cast<DataEntry *>(d) )
00098     { 
00099       if ( v->GetVM() != gdcm::GDCM_UNKNOWN )
00100          if ( !CheckVM(v) )
00101          {
00102             if (v->GetVM() == "FIXME" )
00103               std::cout << "For Tag " <<  v->GetKey() << " VM = ["
00104                        << v->GetVM() << "]" << std::endl;
00105  
00106             std::cout << "Tag (" <<  v->GetKey() 
00107                       << ")-> [" << v->GetName() << "] VR :" << v->GetVR() 
00108                       << " contains an illegal VM. Expected VM :[" 
00109                       << v->GetVM() << "], value [" << v->GetString() << "]" 
00110                       << std::endl;
00111          }
00112       
00113       if ( v->GetReadLength() % 2 )
00114       {
00115         std::cout << "Tag (" <<  v->GetKey() 
00116                   << ")-> [" << v->GetName() << "] has an uneven length :"
00117                   << v->GetReadLength()
00118                   << " [" << v->GetString() << "] " 
00119                   << std::endl;         
00120       }
00121     }
00122     else
00123     {
00124       // We skip pb of SQ recursive exploration
00125     }
00126     d=input->GetNextEntry();
00127   }
00128 }

void gdcm::Base::SetPrintLevel (  int  level  )  [inline, inherited]
 

Sets the print level for the Dicom Header Elements.

Note:
0 for Light Print; 1 for 'medium' Print, 2 for Heavy Print

Definition at line 47 of file gdcmBase.h.

Referenced by gdcm::SQItem::Print(), gdcm::SeqEntry::Print(), gdcm::FileHelper::Print(), gdcm::ElementSet::Print(), and gdcm::DicomDir::Print().

00047 { PrintLevel = level; }

void gdcm::RefCounter::Unregister (   )  [inline, inherited]
 

Unregister the object.

Remarks:
It decrements the reference counting

Definition at line 48 of file gdcmRefCounter.h.

Referenced by gdcm::SeqEntry::ClearSQItem(), gdcm::DicomDir::Copy(), gdcm::DocEntrySet::GetDictEntry(), gdcm::CommandManager::InSetCommand(), gdcm::DocEntrySet::NewDataEntry(), gdcm::DocEntrySet::NewSeqEntry(), gdcm::Document::ReadNextDocEntry(), gdcm::SQItem::RemoveEntry(), gdcm::ElementSet::RemoveEntry(), gdcm::SeqEntry::SetDelimitationItem(), gdcm::DocEntry::~DocEntry(), and gdcm::FileHelper::~FileHelper().

00049    {
00050       RefCount--;
00051       if(RefCount<=0)
00052          delete this;
00053    }


Member Data Documentation

int gdcm::Base::PrintLevel [protected, inherited]
 

Amount of printed details for each Dicom Entries : 0 : stands for the least detail level.

Definition at line 55 of file gdcmBase.h.

Referenced by gdcm::SQItem::Print(), gdcm::SeqEntry::Print(), gdcm::FileHelper::Print(), gdcm::ElementSet::Print(), gdcm::DocEntry::Print(), gdcm::DictEntry::Print(), gdcm::DicomDirStudy::Print(), gdcm::DicomDirSerie::Print(), gdcm::DicomDirPatient::Print(), gdcm::DicomDirMeta::Print(), gdcm::DicomDir::Print(), and gdcm::DataEntry::Print().


The documentation for this class was generated from the following files:
Generated on Fri Jan 20 10:14:38 2006 for gdcm by  doxygen 1.4.4