MeVisLabToolboxReference
MeVis/Foundation/Sources/DicomTree/MLDicomTree/DCMTree_EnhancedMF.h
Go to the documentation of this file.
00001 // **InsertLicense** code
00002 //----------------------------------------------------------------------------------
00004 
00009 //----------------------------------------------------------------------------------
00010 
00011 #ifndef CLASS_DCMTREE_ENHANCEDMF
00012 #define CLASS_DCMTREE_ENHANCEDMF
00013 
00014 #include "DCMTree_Lib.h"
00015 
00016 namespace DCMTree
00017 {
00024     class DCMTREE_EXPORT EnhancedMF
00025     {
00026     public:
00027 
00029       typedef std::vector<unsigned int> IndexVector;
00030 
00031 
00036       EnhancedMF( const DictPtr &dict, TreePtr tree );
00037 
00039 
00041       TagPtr tagForFrame( TagId tagId, unsigned int frameIndex );
00042 
00044       Const_TagPtr tagForFrame( TagId tagId, unsigned int frameIndex ) const;
00045 
00047       TreePtr extractTagTreeForFrame( unsigned int frameIndex ) const;
00048 
00050       TreePtr extractSharedTagTree() const;
00051 
00053       void setTagForFrame( const TagPtr tag, unsigned int frameIndex );
00054 
00056       void setPerFrameTags( const Tree& tree, unsigned int frameIndex );
00057 
00059 
00060 
00062 
00063 
00065       enum StatusCode {
00066         OK = 0,                        
00067         NO_PER_FRAME_TAGS,             
00068         AMBIGUOUS_TAG,                 
00069 
00070         INCONSISTENT_PER_FRAME_TAGS,   
00071 
00072         NUM_STATUS_CODES
00073       };
00074 
00075       enum {
00076         NO_INDEX = 255
00077       };
00078 
00080       StatusCode checkPerFrameTags( unsigned int frameIndex ) const;
00081 
00084       StatusCode check( unsigned int* badFrame = 0 ) const;
00085 
00087 
00088 
00090 
00091 
00100 
00101       unsigned int getGridDimension() const;
00102 
00104       const IndexVector& getGridExtent() const;
00105 
00107       unsigned int getNumberOfFrames() const;
00108 
00110       unsigned int getFrameIndex( const IndexVector& position ) const;
00111       unsigned int getFrameIndex( unsigned int z , unsigned int t = 0, unsigned int u1 = 0) const;
00112 
00114       bool frameExists( const IndexVector& position ) const;
00115 
00117       IndexVector getGridPosition( unsigned int frameIndex) const;
00118 
00123       const IndexVector &getGridToSMFMap() const;
00124 
00126       const std::vector<unsigned int>& getSMFToGridMap() const;
00127 
00129 
00130 
00131     private:
00133       TagId frameSpecificSequenceTag( TagId tagId ) const;
00135       void readMultiFrameInfo();
00138       TagPtr perFrameFunctionalGroups();
00139 
00141       DictPtr _dict;
00143       TreePtr _treePtr;
00145       IndexVector _gridExtent;
00147       IndexVector _gridToSMFMapping;
00149       mutable std::vector<unsigned int> _SMFToGridMapping;
00151       TagIdVector _gridTagIds;
00152     };
00153 }
00154 
00155 #endif // CLASS_DCMTREE_ENHANCEDMF