[807] | 1 | // |
---|
| 2 | // ******************************************************************** |
---|
| 3 | // * License and Disclaimer * |
---|
| 4 | // * * |
---|
| 5 | // * The Geant4 software is copyright of the Copyright Holders of * |
---|
| 6 | // * the Geant4 Collaboration. It is provided under the terms and * |
---|
| 7 | // * conditions of the Geant4 Software License, included in the file * |
---|
| 8 | // * LICENSE and available at http://cern.ch/geant4/license . These * |
---|
| 9 | // * include a list of copyright holders. * |
---|
| 10 | // * * |
---|
| 11 | // * Neither the authors of this software system, nor their employing * |
---|
| 12 | // * institutes,nor the agencies providing financial support for this * |
---|
| 13 | // * work make any representation or warranty, express or implied, * |
---|
| 14 | // * regarding this software system or assume any liability for its * |
---|
| 15 | // * use. Please see the license in the file LICENSE and URL above * |
---|
| 16 | // * for the full disclaimer and the limitation of liability. * |
---|
| 17 | // * * |
---|
| 18 | // * This code implementation is the result of the scientific and * |
---|
| 19 | // * technical work of the GEANT4 collaboration. * |
---|
| 20 | // * By using, copying, modifying or distributing the software (or * |
---|
| 21 | // * any work based on the software) you agree to acknowledge its * |
---|
| 22 | // * use in resulting scientific publications, and indicate your * |
---|
| 23 | // * acceptance of all terms of the Geant4 Software license. * |
---|
| 24 | // ******************************************************************** |
---|
| 25 | // |
---|
| 26 | // Author: P. Arce |
---|
| 27 | // History: 30.11.07 First version |
---|
| 28 | //******************************************************* |
---|
| 29 | // |
---|
| 30 | // DicomPatientZSliceHeader.hh : |
---|
| 31 | // - Contains the meta data information corresponding to one or several Z slices (number of voxels, dimension) |
---|
| 32 | //******************************************************* |
---|
| 33 | |
---|
| 34 | #ifndef DicomPatientZSliceHeader_h |
---|
| 35 | #define DicomPatientZSliceHeader_h 1 |
---|
| 36 | |
---|
| 37 | #include "globals.hh" |
---|
| 38 | class G4material; |
---|
| 39 | #include <fstream> |
---|
| 40 | #include <vector> |
---|
| 41 | |
---|
| 42 | |
---|
| 43 | class DicomPatientZSliceHeader |
---|
| 44 | { |
---|
| 45 | public: |
---|
| 46 | |
---|
| 47 | DicomPatientZSliceHeader( const DicomPatientZSliceHeader& rhs ); |
---|
| 48 | // build object copying an existing one (except Z dimensions) |
---|
| 49 | |
---|
| 50 | DicomPatientZSliceHeader( std::ifstream& fin ); |
---|
| 51 | // build object reading data from a file |
---|
| 52 | |
---|
| 53 | ~DicomPatientZSliceHeader(){}; |
---|
| 54 | |
---|
| 55 | // Get and set methods |
---|
| 56 | G4int GetNoVoxelX() const { return fNoVoxelX; }; |
---|
| 57 | G4int GetNoVoxelY() const { return fNoVoxelY; }; |
---|
| 58 | G4int GetNoVoxelZ() const { return fNoVoxelZ; }; |
---|
| 59 | G4int GetNoVoxels() const { return fNoVoxelX*fNoVoxelY*fNoVoxelZ; }; |
---|
| 60 | |
---|
| 61 | G4double GetMinX() const { return fMinX; }; |
---|
| 62 | G4double GetMinY() const { return fMinY; }; |
---|
| 63 | G4double GetMinZ() const { return fMinZ; }; |
---|
| 64 | G4double GetMaxX() const { return fMaxX; }; |
---|
| 65 | G4double GetMaxY() const { return fMaxY; }; |
---|
| 66 | G4double GetMaxZ() const { return fMaxZ; }; |
---|
| 67 | |
---|
| 68 | G4double GetVoxelHalfX() const { return (fMaxX-fMinX)/fNoVoxelX/2.; }; |
---|
| 69 | G4double GetVoxelHalfY() const { return (fMaxY-fMinY)/fNoVoxelY/2.; }; |
---|
| 70 | G4double GetVoxelHalfZ() const { return (fMaxZ-fMinZ)/fNoVoxelZ/2.; }; |
---|
| 71 | |
---|
| 72 | std::vector<G4String> GetMaterialNames() const { return fMaterialNames; }; |
---|
| 73 | |
---|
| 74 | |
---|
| 75 | void SetNoVoxelX(const G4int val) { fNoVoxelX = val; } |
---|
| 76 | void SetNoVoxelY(const G4int val) { fNoVoxelY = val; } |
---|
| 77 | void SetNoVoxelZ(const G4int val) { fNoVoxelZ = val; } |
---|
| 78 | |
---|
| 79 | void SetMinX(const G4double val) { fMinX = val; }; |
---|
| 80 | void SetMaxX(const G4double val) { fMaxX = val; }; |
---|
| 81 | void SetMinY(const G4double val) { fMinY = val; }; |
---|
| 82 | void SetMaxY(const G4double val) { fMaxY = val; }; |
---|
| 83 | void SetMinZ(const G4double val) { fMinZ = val; }; |
---|
| 84 | void SetMaxZ(const G4double val) { fMaxZ = val; }; |
---|
| 85 | |
---|
| 86 | void SetMaterialNames(std::vector<G4String>& mn ){ fMaterialNames = mn; } |
---|
| 87 | |
---|
| 88 | |
---|
| 89 | void operator+=( const DicomPatientZSliceHeader& rhs ); |
---|
| 90 | DicomPatientZSliceHeader operator+( const DicomPatientZSliceHeader& rhs ); |
---|
| 91 | // add two slices that have the same dimensions, merging them in Z |
---|
| 92 | |
---|
| 93 | private: |
---|
| 94 | G4bool CheckMaterialExists( const G4String& mateName ); |
---|
| 95 | // check that material read exists as a G4Material |
---|
| 96 | |
---|
| 97 | private: |
---|
| 98 | G4int fNoVoxelX, fNoVoxelY, fNoVoxelZ; // number of voxels in each dimensions |
---|
| 99 | G4double fMinX,fMinY,fMinZ; // minimum extension of voxels (position of wall) |
---|
| 100 | G4double fMaxX,fMaxY,fMaxZ; // maximum extension of voxels (position of wall) |
---|
| 101 | |
---|
| 102 | std::vector<G4String> fMaterialNames; // list of material names |
---|
| 103 | |
---|
| 104 | }; |
---|
| 105 | |
---|
| 106 | #endif |
---|