Geant4  10.03.p03
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
DicomVFile Class Referenceabstract

#include <DicomVFile.hh>

Inheritance diagram for DicomVFile:
Collaboration diagram for DicomVFile:

Public Member Functions

 DicomVFile ()
 
 DicomVFile (DcmDataset *dset)
 
 ~DicomVFile ()
 
void SetFileName (G4String fName)
 

Protected Member Functions

virtual void ReadData ()=0
 
virtual std::vector< G4doubleRead1Data (DcmDataset *dset, DcmTagKey tagKey, G4int nData)
 
virtual OFString Read1DataStr (DcmDataset *dset, DcmTagKey tagKey)
 

Protected Attributes

DcmDataset * theDataset
 
G4String fFileName
 

Detailed Description

Definition at line 35 of file DicomVFile.hh.

Constructor & Destructor Documentation

DicomVFile::DicomVFile ( )
inline

Definition at line 38 of file DicomVFile.hh.

38 {};
DicomVFile::DicomVFile ( DcmDataset *  dset)

Definition at line 35 of file DicomVFile.cc.

35  : theDataset(dset)
36 {
37 }
DcmDataset * theDataset
Definition: DicomVFile.hh:52
DicomVFile::~DicomVFile ( )
inline

Definition at line 40 of file DicomVFile.hh.

40 {};

Member Function Documentation

std::vector< G4double > DicomVFile::Read1Data ( DcmDataset *  dset,
DcmTagKey  tagKey,
G4int  nData 
)
protectedvirtual

Definition at line 40 of file DicomVFile.cc.

41 {
42  std::vector<G4double> dataV;
43 
44  for(int ii=0; ii<nData; ++ii) {
45  G4double data;
46  Uint16 datai;
47  // see http://support.dcmtk.org/docs/classDcmItem.html for types
48  if (dset->findAndGetFloat64(tagKey, data,ii).good() ) {
49  dataV.push_back(data);
50  } else if (dset->findAndGetUint16(tagKey, datai,ii).good() ) {
51  dataV.push_back(datai);
52  } else {
53  G4cout <<"ERROR (" << std::showbase // show the 0x prefix
54  << std::internal // fill between the prefix and the number
55  << std::setfill('0') << std::hex << std::setw(4) << tagKey.getGroup()
56  << "," << tagKey.getElement() << ") "<< std::dec << ii << std::endl;
57  G4Exception("DicomHandler::ReadData",
58  "",
60  (std::to_string(data) +G4String(" Have not read (")
61  + std::to_string(tagKey.getGroup())+","+std::to_string(tagKey.getElement())
62  +")"+" : "+std::to_string(ii)).c_str());
63  }
64  }
65 
66  return dataV;
67 }
const XML_Char const XML_Char * data
Definition: expat.h:268
G4GLOB_DLL std::ostream G4cout
void G4Exception(const char *originOfException, const char *exceptionCode, G4ExceptionSeverity severity, const char *comments)
Definition: G4Exception.cc:41
double G4double
Definition: G4Types.hh:76

Here is the call graph for this function:

Here is the caller graph for this function:

OFString DicomVFile::Read1DataStr ( DcmDataset *  dset,
DcmTagKey  tagKey 
)
protectedvirtual

Definition at line 71 of file DicomVFile.cc.

72 {
73  // const char* data = "";
74  OFString data;
75  // see http://support.dcmtk.org/docs/classDcmItem.html for types
76  if (dset->findAndGetOFString(tagKey, data).good() ) {
77  } else {
78  G4cout <<"ERROR (" << std::showbase // show the 0x prefix
79  << std::internal // fill between the prefix and the number
80  << std::setfill('0') << std::hex << std::setw(4) << tagKey.getGroup() << ","
81  << tagKey.getElement() << ") "<< std::dec << std::endl;
82  G4Exception("DicomHandler::ReadData",
83  "",
85  (" Have not read (" + std::to_string(tagKey.getGroup())+","
86  +std::to_string(tagKey.getElement())+")"+" : ").c_str());
87  }
88 
89  return data.c_str();
90 }
const XML_Char const XML_Char * data
Definition: expat.h:268
G4GLOB_DLL std::ostream G4cout
void G4Exception(const char *originOfException, const char *exceptionCode, G4ExceptionSeverity severity, const char *comments)
Definition: G4Exception.cc:41

Here is the call graph for this function:

virtual void DicomVFile::ReadData ( )
protectedpure virtual
void DicomVFile::SetFileName ( G4String  fName)
inline

Definition at line 42 of file DicomVFile.hh.

42  {
43  fFileName = fName;
44  }
G4String fName
Definition: G4AttUtils.hh:55
G4String fFileName
Definition: DicomVFile.hh:55

Here is the caller graph for this function:

Member Data Documentation

G4String DicomVFile::fFileName
protected

Definition at line 55 of file DicomVFile.hh.

DcmDataset* DicomVFile::theDataset
protected

Definition at line 52 of file DicomVFile.hh.


The documentation for this class was generated from the following files: