GDCM: GenerateStandardSOPClasses.cxx

GDCM 3.2.7

GenerateStandardSOPClasses.cxx
/*=========================================================================
Program: GDCM (Grassroots DICOM). A DICOM library
Copyright (c) 2006-2011 Mathieu Malaterre
All rights reserved.
See Copyright.txt or http://gdcm.sourceforge.net/Copyright.html for details.
This software is distributed WITHOUT ANY WARRANTY; without even
the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR
PURPOSE. See the above copyright notice for more information.
=========================================================================*/
/*
*/
#include "gdcmDefs.h"
#include "gdcmUIDs.h"
#include "gdcmGlobal.h"
#include "gdcmMediaStorage.h"
#include "gdcmSOPClassUIDToIOD.h"
int main(int , char *[])
{
using gdcm::MediaStorage;
gdcm::Global& g = gdcm::Global::GetInstance();
if( !g. LoadResourcesFiles() )
{
std::cerr << "Could not LoadResourcesFiles" << std::endl;
return 1;
}
const gdcm::Defs &defs = g. GetDefs();
int ret = 0;
//std::cout << "Table B.5-1 STANDARD SOP CLASSES" << std::endl;
std::cout << "SOP Class Name,SOP Class UID,IOD Specification (defined in PS 3.3)" << std::endl;
gdcm::MediaStorage::MSType mst;
for ( mst = gdcm::MediaStorage::MediaStorageDirectoryStorage; mst < gdcm::MediaStorage::MS_END;
mst = (gdcm::MediaStorage::MSType)(mst + 1) )
{
const char *iod = defs. GetIODNameFromMediaStorage(mst);
gdcm::UIDs uid;
uid. SetFromUID( gdcm::MediaStorage::GetMSString(mst) /*mst.GetString()*/ );
if( iod )
{
const char *iod_ref = gdcm::SOPClassUIDToIOD::GetIOD(uid);
if( iod_ref )
{
std::string iod_ref_str = iod_ref;
//iod_ref_str += " IOD Modules";
//if( iod_ref_str != iod )
{
//std::cout << "UID: " << uid << " ";
std::cout << '"' << uid. GetName() << '"' <<"," << '"' <<uid. GetString() << '"' <<"," << '"' <<iod << '"' << std::endl;
//std::cout << "Incompatible IODs: [" << iod << "] versus ref= [" << iod_ref_str << "]" << std::endl;
++ret;
}
}
}
}
return 0;
}
gdcm::Defs
FIXME I do not like the name 'Defs'.
Definition gdcmDefs.h:33
gdcm::Defs::GetIODNameFromMediaStorage
static const char * GetIODNameFromMediaStorage(MediaStorage const &ms)
gdcm::Global
Global.
Definition gdcmGlobal.h:50
gdcm::Global::GetDefs
Defs const & GetDefs() const
gdcm::Global::LoadResourcesFiles
bool LoadResourcesFiles()
gdcm::Global::GetInstance
static Global & GetInstance()
return the singleton instance
gdcm::MediaStorage
MediaStorage.
Definition gdcmMediaStorage.h:44
gdcm::MediaStorage::GetMSString
static const char * GetMSString(MSType ts)
Return the Media String associated. Will return NULL for MS_END.
gdcm::MediaStorage::MSType
MSType
Definition gdcmMediaStorage.h:46
gdcm::MediaStorage::MediaStorageDirectoryStorage
@ MediaStorageDirectoryStorage
Definition gdcmMediaStorage.h:47
gdcm::MediaStorage::MS_END
@ MS_END
Definition gdcmMediaStorage.h:146
gdcm::SOPClassUIDToIOD::GetIOD
static const char * GetIOD(UIDs const &uid)
gdcm::UIDs
all known uids
Definition gdcmUIDs.h:31
gdcm::UIDs::SetFromUID
bool SetFromUID(const char *str)
gdcm::UIDs::GetString
const char * GetString() const
gdcm::UIDs::GetName
const char * GetName() const
gdcmDefs.h
gdcmGlobal.h
gdcmMediaStorage.h
gdcmSOPClassUIDToIOD.h
gdcmUIDs.h