Loading...
Searching...
No Matches
Public Member Functions | Protected Member Functions | Protected Attributes | List of all members
DicomVFile Class Referenceabstract

#include <Doxymodules_medical.h>

Inheritance diagram for DicomVFile:
DicomFileCT_NOdcmrt DicomFilePlan DicomFileStructure DicomVFileImage DicomFileCT DicomFilePET

Public Member Functions

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

Protected Member Functions

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

Protected Attributes

DcmDataset * theDataset
 
G4String fFileName
 

Detailed Description

Definition at line 57 of file Doxymodules_medical.h.

Constructor & Destructor Documentation

◆ DicomVFile() [1/2]

DicomVFile::DicomVFile ( )
inline

Definition at line 38 of file DicomVFile.hh.

38{};

◆ DicomVFile() [2/2]

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::~DicomVFile ( )
inline

Definition at line 40 of file DicomVFile.hh.

40{};

Member Function Documentation

◆ SetFileName()

void DicomVFile::SetFileName ( G4String  fName)
inline

Definition at line 42 of file DicomVFile.hh.

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

◆ ReadData()

virtual void DicomVFile::ReadData ( )
protectedpure virtual

◆ Read1Data()

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 "",
59 JustWarning,
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}

◆ Read1DataStr()

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 "",
84 JustWarning,
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}

Member Data Documentation

◆ theDataset

DcmDataset* DicomVFile::theDataset
protected

Definition at line 52 of file DicomVFile.hh.

◆ fFileName

G4String DicomVFile::fFileName
protected

Definition at line 55 of file DicomVFile.hh.


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

Applications | User Support | Publications | Collaboration