ECCE @ EIC Software
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
DicomHandler Class Reference

#include <geant4/tree/geant4-10.6-release/examples/extended/medical/DICOM/include/DicomHandler.hh>

+ Collaboration diagram for DicomHandler:

Public Member Functions

 ~DicomHandler ()
 
G4int ReadFile (FILE *, char *)
 
G4int ReadData (FILE *, char *)
 
void CheckFileFormat ()
 

Static Public Member Functions

static DicomHandlerInstance ()
 
static G4String GetDicomDataPath ()
 
static G4String GetDicomDataFile ()
 

Private Member Functions

 DicomHandler ()
 
template<class Type >
void GetValue (char *, Type &)
 
void ReadCalibration ()
 
void GetInformation (G4int &, char *)
 
G4float Pixel2density (G4int pixel)
 
void ReadMaterialIndices (std::ifstream &finData)
 
unsigned int GetMaterialIndex (G4float density)
 
void StoreData (std::ofstream &foutG4DCM)
 
void StoreData (DicomPhantomZSliceHeader *dcmPZSH)
 
G4int read_defined_nested (FILE *, G4int)
 
void read_undefined_nested (FILE *)
 
void read_undefined_item (FILE *)
 

Private Attributes

const G4int DATABUFFSIZE
 
const G4int LINEBUFFSIZE
 
const G4int FILENAMESIZE
 
short fCompression
 
G4int fNFiles
 
short fRows
 
short fColumns
 
short fBitAllocated
 
G4int fMaxPixelValue
 
G4int fMinPixelValue
 
G4double fPixelSpacingX
 
G4double fPixelSpacingY
 
G4double fSliceThickness
 
G4double fSliceLocation
 
G4int fRescaleIntercept
 
G4int fRescaleSlope
 
G4bool fLittleEndian
 
G4bool fImplicitEndian
 
short fPixelRepresentation
 
G4int ** fTab
 
std::map< G4float, G4StringfMaterialIndices
 
G4int fNbrequali
 
G4doublefValueDensity
 
G4doublefValueCT
 
G4bool fReadCalibration
 
DicomPhantomZSliceMergedfMergedSlices
 
G4String fDriverFile
 
G4String fCt2DensityFile
 

Static Private Attributes

static DicomHandlerfInstance = 0
 

Detailed Description

Definition at line 70 of file DicomHandler.hh.

View newest version in sPHENIX GitHub at line 70 of file DicomHandler.hh

Constructor & Destructor Documentation

DicomHandler::~DicomHandler ( )

Definition at line 164 of file DicomHandler.cc.

View newest version in sPHENIX GitHub at line 164 of file DicomHandler.cc

DicomHandler::DicomHandler ( )
private

Definition at line 148 of file DicomHandler.cc.

View newest version in sPHENIX GitHub at line 148 of file DicomHandler.cc

References fMergedSlices.

Member Function Documentation

void DicomHandler::CheckFileFormat ( )

Definition at line 967 of file DicomHandler.cc.

View newest version in sPHENIX GitHub at line 967 of file DicomHandler.cc

References DicomPhantomZSliceMerged::CheckSlices(), G4String::data(), FatalException, fclose(), fCompression, fDriverFile, FILENAMESIZE, fMergedSlices, fNFiles, fValueCT, fValueDensity, G4cout, G4endl, G4Exception(), GetDicomDataPath(), LINEBUFFSIZE, message(), printf(), ReadFile(), and ReadMaterialIndices().

Referenced by main().

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

G4String DicomHandler::GetDicomDataFile ( )
static

Definition at line 119 of file DicomHandler.cc.

View newest version in sPHENIX GitHub at line 119 of file DicomHandler.cc

References GetDicomDataPath().

Referenced by DicomDetectorConstruction::ReadPhantomData().

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

G4String DicomHandler::GetDicomDataPath ( )
static

Definition at line 83 of file DicomHandler.cc.

View newest version in sPHENIX GitHub at line 83 of file DicomHandler.cc

References G4cerr, G4ConsumeParameters(), and G4endl.

Referenced by CheckFileFormat(), and GetDicomDataFile().

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

void DicomHandler::GetInformation ( G4int tagDictionary,
char *  data 
)
private

Definition at line 361 of file DicomHandler.cc.

View newest version in sPHENIX GitHub at line 361 of file DicomHandler.cc

References fBitAllocated, fColumns, fImplicitEndian, fLittleEndian, fMaxPixelValue, fMinPixelValue, fPixelRepresentation, fPixelSpacingX, fPixelSpacingY, fRescaleIntercept, fRescaleSlope, fRows, fSliceLocation, fSliceThickness, GetValue(), and printf().

Referenced by ReadFile().

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

unsigned int DicomHandler::GetMaterialIndex ( G4float  density)
private

Definition at line 661 of file DicomHandler.cc.

View newest version in sPHENIX GitHub at line 661 of file DicomHandler.cc

References fMaterialIndices.

Referenced by ReadData(), and StoreData().

+ Here is the caller graph for this function:

template<class Type >
void DicomHandler::GetValue ( char *  _val,
Type &  _rval 
)
private

Definition at line 1213 of file DicomHandler.cc.

View newest version in sPHENIX GitHub at line 1213 of file DicomHandler.cc

References fLittleEndian.

Referenced by GetInformation(), read_defined_nested(), read_undefined_item(), read_undefined_nested(), ReadData(), and ReadFile().

+ Here is the caller graph for this function:

DicomHandler * DicomHandler::Instance ( void  )
static

Definition at line 71 of file DicomHandler.cc.

View newest version in sPHENIX GitHub at line 71 of file DicomHandler.cc

References fInstance.

Referenced by main().

+ Here is the caller graph for this function:

G4float DicomHandler::Pixel2density ( G4int  pixel)
private

Definition at line 934 of file DicomHandler.cc.

View newest version in sPHENIX GitHub at line 934 of file DicomHandler.cc

References fNbrequali, fReadCalibration, fValueCT, fValueDensity, printf(), and ReadCalibration().

Referenced by ReadData(), and StoreData().

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

G4int DicomHandler::read_defined_nested ( FILE *  nested,
G4int  SQ_Length 
)
private

Definition at line 1107 of file DicomHandler.cc.

View newest version in sPHENIX GitHub at line 1107 of file DicomHandler.cc

References buffer, GetValue(), and LINEBUFFSIZE.

Referenced by ReadFile().

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

void DicomHandler::read_undefined_item ( FILE *  nested)
private

Definition at line 1179 of file DicomHandler.cc.

View newest version in sPHENIX GitHub at line 1179 of file DicomHandler.cc

References buffer, GetValue(), and LINEBUFFSIZE.

Referenced by read_undefined_nested().

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

void DicomHandler::read_undefined_nested ( FILE *  nested)
private

Definition at line 1144 of file DicomHandler.cc.

View newest version in sPHENIX GitHub at line 1144 of file DicomHandler.cc

References buffer, GetValue(), LINEBUFFSIZE, and read_undefined_item().

Referenced by ReadFile().

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

void DicomHandler::ReadCalibration ( )
private

Definition at line 881 of file DicomHandler.cc.

View newest version in sPHENIX GitHub at line 881 of file DicomHandler.cc

References FatalException, fCt2DensityFile, fNbrequali, fReadCalibration, fValueCT, fValueDensity, and G4Exception().

Referenced by Pixel2density().

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

G4int DicomHandler::ReadData ( FILE *  dicom,
char *  filename2 
)

Definition at line 679 of file DicomHandler.cc.

View newest version in sPHENIX GitHub at line 679 of file DicomHandler.cc

References fBitAllocated, fclose(), fColumns, fCompression, FILENAMESIZE, fMaterialIndices, fPixelSpacingX, fPixelSpacingY, fRescaleIntercept, fRescaleSlope, fRows, fSliceLocation, fSliceThickness, fTab, GetMaterialIndex(), GetValue(), Pixel2density(), printf(), w, and xx.

Referenced by ReadFile().

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

G4int DicomHandler::ReadFile ( FILE *  dicom,
char *  filename2 
)
void DicomHandler::ReadMaterialIndices ( std::ifstream &  finData)
private

Definition at line 640 of file DicomHandler.cc.

View newest version in sPHENIX GitHub at line 640 of file DicomHandler.cc

References fMaterialIndices, G4cout, and G4endl.

Referenced by CheckFileFormat().

+ Here is the caller graph for this function:

void DicomHandler::StoreData ( std::ofstream &  foutG4DCM)
private

Definition at line 556 of file DicomHandler.cc.

View newest version in sPHENIX GitHub at line 556 of file DicomHandler.cc

References fColumns, fCompression, fRows, fTab, G4endl, GetMaterialIndex(), Pixel2density(), and xx.

Referenced by ReadFile().

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

void DicomHandler::StoreData ( DicomPhantomZSliceHeader dcmPZSH)
private

Definition at line 502 of file DicomHandler.cc.

View newest version in sPHENIX GitHub at line 502 of file DicomHandler.cc

References DicomPhantomZSliceHeader::AddMateID(), DicomPhantomZSliceHeader::AddRow(), DicomPhantomZSliceHeader::AddValue(), fColumns, fCompression, DicomPhantomZSliceHeader::FlipData(), fRows, fSliceLocation, fTab, GetMaterialIndex(), Pixel2density(), DicomPhantomZSliceHeader::SetSliceLocation(), and xx.

+ Here is the call graph for this function:

Member Data Documentation

const G4int DicomHandler::DATABUFFSIZE
private

Definition at line 99 of file DicomHandler.hh.

View newest version in sPHENIX GitHub at line 99 of file DicomHandler.hh

Referenced by ReadFile().

short DicomHandler::fBitAllocated
private

Definition at line 118 of file DicomHandler.hh.

View newest version in sPHENIX GitHub at line 118 of file DicomHandler.hh

Referenced by GetInformation(), and ReadData().

short DicomHandler::fColumns
private

Definition at line 117 of file DicomHandler.hh.

View newest version in sPHENIX GitHub at line 117 of file DicomHandler.hh

Referenced by GetInformation(), ReadData(), ReadFile(), and StoreData().

short DicomHandler::fCompression
private

Definition at line 114 of file DicomHandler.hh.

View newest version in sPHENIX GitHub at line 114 of file DicomHandler.hh

Referenced by CheckFileFormat(), ReadData(), ReadFile(), and StoreData().

G4String DicomHandler::fCt2DensityFile
private

Definition at line 140 of file DicomHandler.hh.

View newest version in sPHENIX GitHub at line 140 of file DicomHandler.hh

Referenced by ReadCalibration().

G4String DicomHandler::fDriverFile
private

Definition at line 139 of file DicomHandler.hh.

View newest version in sPHENIX GitHub at line 139 of file DicomHandler.hh

Referenced by CheckFileFormat().

const G4int DicomHandler::FILENAMESIZE
private

Definition at line 101 of file DicomHandler.hh.

View newest version in sPHENIX GitHub at line 101 of file DicomHandler.hh

Referenced by CheckFileFormat(), and ReadData().

G4bool DicomHandler::fImplicitEndian
private

Definition at line 127 of file DicomHandler.hh.

View newest version in sPHENIX GitHub at line 127 of file DicomHandler.hh

Referenced by GetInformation(), and ReadFile().

DicomHandler * DicomHandler::fInstance = 0
staticprivate

DicomHandler.cc :

  • Handling of DICM images
    • Reading headers and pixels
  • Transforming pixel to density and creating *.g4dcm files

Definition at line 97 of file DicomHandler.hh.

View newest version in sPHENIX GitHub at line 97 of file DicomHandler.hh

Referenced by Instance().

G4bool DicomHandler::fLittleEndian
private

Definition at line 127 of file DicomHandler.hh.

View newest version in sPHENIX GitHub at line 127 of file DicomHandler.hh

Referenced by GetInformation(), GetValue(), and ReadFile().

std::map<G4float,G4String> DicomHandler::fMaterialIndices
private

Definition at line 131 of file DicomHandler.hh.

View newest version in sPHENIX GitHub at line 131 of file DicomHandler.hh

Referenced by GetMaterialIndex(), ReadData(), ReadFile(), and ReadMaterialIndices().

G4int DicomHandler::fMaxPixelValue
private

Definition at line 119 of file DicomHandler.hh.

View newest version in sPHENIX GitHub at line 119 of file DicomHandler.hh

Referenced by GetInformation().

DicomPhantomZSliceMerged* DicomHandler::fMergedSlices
private

Definition at line 137 of file DicomHandler.hh.

View newest version in sPHENIX GitHub at line 137 of file DicomHandler.hh

Referenced by CheckFileFormat(), DicomHandler(), and ReadFile().

G4int DicomHandler::fMinPixelValue
private

Definition at line 119 of file DicomHandler.hh.

View newest version in sPHENIX GitHub at line 119 of file DicomHandler.hh

Referenced by GetInformation().

G4int DicomHandler::fNbrequali
private

Definition at line 133 of file DicomHandler.hh.

View newest version in sPHENIX GitHub at line 133 of file DicomHandler.hh

Referenced by Pixel2density(), and ReadCalibration().

G4int DicomHandler::fNFiles
private

Definition at line 115 of file DicomHandler.hh.

View newest version in sPHENIX GitHub at line 115 of file DicomHandler.hh

Referenced by CheckFileFormat().

short DicomHandler::fPixelRepresentation
private

Definition at line 128 of file DicomHandler.hh.

View newest version in sPHENIX GitHub at line 128 of file DicomHandler.hh

Referenced by GetInformation().

G4double DicomHandler::fPixelSpacingX
private

Definition at line 121 of file DicomHandler.hh.

View newest version in sPHENIX GitHub at line 121 of file DicomHandler.hh

Referenced by GetInformation(), ReadData(), and ReadFile().

G4double DicomHandler::fPixelSpacingY
private

Definition at line 121 of file DicomHandler.hh.

View newest version in sPHENIX GitHub at line 121 of file DicomHandler.hh

Referenced by GetInformation(), ReadData(), and ReadFile().

G4bool DicomHandler::fReadCalibration
private

Definition at line 136 of file DicomHandler.hh.

View newest version in sPHENIX GitHub at line 136 of file DicomHandler.hh

Referenced by Pixel2density(), and ReadCalibration().

G4int DicomHandler::fRescaleIntercept
private

Definition at line 125 of file DicomHandler.hh.

View newest version in sPHENIX GitHub at line 125 of file DicomHandler.hh

Referenced by GetInformation(), and ReadData().

G4int DicomHandler::fRescaleSlope
private

Definition at line 125 of file DicomHandler.hh.

View newest version in sPHENIX GitHub at line 125 of file DicomHandler.hh

Referenced by GetInformation(), and ReadData().

short DicomHandler::fRows
private

Definition at line 116 of file DicomHandler.hh.

View newest version in sPHENIX GitHub at line 116 of file DicomHandler.hh

Referenced by GetInformation(), ReadData(), ReadFile(), and StoreData().

G4double DicomHandler::fSliceLocation
private

Definition at line 123 of file DicomHandler.hh.

View newest version in sPHENIX GitHub at line 123 of file DicomHandler.hh

Referenced by GetInformation(), ReadData(), ReadFile(), and StoreData().

G4double DicomHandler::fSliceThickness
private

Definition at line 122 of file DicomHandler.hh.

View newest version in sPHENIX GitHub at line 122 of file DicomHandler.hh

Referenced by GetInformation(), ReadData(), and ReadFile().

G4int** DicomHandler::fTab
private

Definition at line 130 of file DicomHandler.hh.

View newest version in sPHENIX GitHub at line 130 of file DicomHandler.hh

Referenced by ReadData(), and StoreData().

G4double* DicomHandler::fValueCT
private

Definition at line 135 of file DicomHandler.hh.

View newest version in sPHENIX GitHub at line 135 of file DicomHandler.hh

Referenced by CheckFileFormat(), Pixel2density(), and ReadCalibration().

G4double* DicomHandler::fValueDensity
private

Definition at line 134 of file DicomHandler.hh.

View newest version in sPHENIX GitHub at line 134 of file DicomHandler.hh

Referenced by CheckFileFormat(), Pixel2density(), and ReadCalibration().

const G4int DicomHandler::LINEBUFFSIZE
private

Definition at line 100 of file DicomHandler.hh.

View newest version in sPHENIX GitHub at line 100 of file DicomHandler.hh

Referenced by CheckFileFormat(), read_defined_nested(), read_undefined_item(), read_undefined_nested(), and ReadFile().


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