marSimpleDicom.h

Go to the documentation of this file.
00001 /*=========================================================================
00002 
00003  Program:   wxMaracas
00004  Module:    $RCSfile: marSimpleDicom.h,v $
00005  Language:  C++
00006  Date:      $Date: 2009/05/14 13:55:08 $
00007  Version:   $Revision: 1.1 $
00008  
00009   Copyright: (c) 2002, 2003
00010   License:
00011   
00012    This software is distributed WITHOUT ANY WARRANTY; without even 
00013    the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR 
00014    PURPOSE.  See the above copyright notice for more information.
00015    
00016 =========================================================================*/
00017 
00018 #ifndef __MAR__KERNEL__MARSIMPLEDICOM__HXX__
00019 #define __MAR__KERNEL__MARSIMPLEDICOM__HXX__
00020 
00021 #include "marDicomBase.h"
00022 
00023 #include "volume.hxx"
00024 #include <wx/string.h>
00025 #include <wx/gauge.h>
00026 // PS -> #include <gdcm.h>
00027 // PS -> #include <gdcmHeaderHelper.h>
00028 #include <vector>
00029 // PS -> #include <gdcmElValSet.h>
00030 
00031 typedef std::vector<wxArrayString> SerieInfo;  //DICOM info for each serie
00042 // EED Borrame 
00043 //class MAR_KERNEL_EXPORT marGdcmDicom : public marObject
00044 
00045 class marSimpleDicom : public marFilesBase
00046 {
00047 public:
00048         
00049     enum DicomTags
00050     {
00051                 ID_File_Name = 0                   ,
00052                         ID_SOP_Class_UID                   ,
00053                         ID_SOP_Instance_UID                ,
00054                         ID_Study_Date                      ,
00055                         ID_Series_Date                     ,
00056                         ID_Acquisition_Date                ,
00057                         ID_Image_Date                      ,
00058                         ID_Study_Time                      ,
00059                         ID_Series_Time                     ,
00060                         ID_Acquisition_Time                ,
00061                         ID_Image_Time                      ,
00062                         ID_Modality                        ,
00063                         ID_Manufacturer                    ,
00064                         ID_Institution_Name                ,
00065                         ID_Study_Description               ,
00066                         ID_Series_Description              ,
00067                         ID_Admitting_Diagnoses_Description ,
00068                         ID_Patient_Name                    ,
00069                         ID_Patient_ID                      ,
00070                         ID_Body_Part_Examined              ,
00071                         ID_Scanning_Sequence               ,
00072                         ID_Sequence_Variant                ,
00073                         ID_Scan_Options                    ,
00074                         ID_MR_Acquisition_Type             ,
00075                         ID_Sequence_Name                   ,
00076                         ID_Slice_Thickness                 ,
00077                         ID_Repetition_Time                 ,
00078                         ID_Echo_Time                       ,
00079                         ID_Inversion_Time                  ,
00080                         ID_Number_of_Averages              ,
00081                         ID_Imaging_Frequency               ,
00082                         ID_Imaged_Nucleus                  ,
00083                         ID_Echo_Number                     ,
00084                         ID_Magnetic_Field_Strength         ,
00085                         ID_Spacing_Between_Slices          ,
00086                         ID_Echo_Train_Length               ,
00087                         ID_Percent_Sampling                ,
00088                         ID_Percent_Phase_Field_of_View     ,
00089                         ID_Receiving_Coil                  ,
00090                         ID_Patient_Position                ,
00091                         ID_Study_Instance_UID              ,
00092                         ID_Series_Instance_UID             ,
00093                         ID_Study_ID                        ,
00094                         ID_Series_Number                   ,
00095                         ID_Acquisition_Number              ,
00096                         ID_Image_Number                    ,
00097                         ID_Patient_Orientation             ,
00098                         ID_Image_Position                  ,
00099                         ID_Image_Position_Patient          ,
00100                         ID_Image_Orientation               ,
00101                         ID_Image_Orientation_Patient       ,
00102                         ID_Location                        ,
00103                         ID_Frame_of_Reference_UID          ,
00104                         ID_Slice_Location                  ,
00105                         ID_Image_Comments                  ,
00106                         ID_Pixel_Spacing                   ,
00107                         ID_Window_Center                   ,
00108                         ID_Window_Width                    ,
00109                         ID_dicom_tags_count
00110     };
00111         
00112 public:
00113         void SetVolumeData( int dimX,
00114                                                 int dimY,
00115                                                 int dimZ, 
00116                                 float spacingX, 
00117                                                 float spacingY, 
00118                                                 float spacingZ, 
00119                                                 float rescaleSlope,
00120                                                 float rescaleIntercept,
00121                                                 unsigned short * pixels);
00122         
00123     marSimpleDicom( marParameters* p = NULL );
00124         
00125     virtual ~marSimpleDicom( );
00126         
00131 // PS ->     wxArrayString getStudyInfo( ) { return( m_DicomInfo[m_ActualStudy][0] ); }
00132 // PS ->     int getNumberOfStudies( ) { return m_DicomInfo.size(); }
00133 // PS ->     wxArrayString getSerieInfo( ) { return( m_DicomInfo[m_ActualStudy][m_ActualSerie] ); }
00134 // PS ->     int getNumberOfSeries( ) { return m_DicomInfo[m_ActualStudy].size(); }
00135         
00136         
00137 // PS ->     int getNumberOfFiles( )
00138 // PS ->     {
00139 // PS ->                return m_DicomInfo[m_ActualStudy][m_ActualSerie].GetCount();
00140 // PS ->     }
00141         
00142         void SetInvestSliceOrder(bool investSliceOrder);
00143 
00144     void loadActualSerie(wxGauge* gauge );
00145         
00146 // PS ->     wxArrayString getImageNumbers( )
00147 // PS ->     {
00148 // PS ->                wxArrayString imageNumbers;
00149 // PS ->                std::list<gdcmHeaderHelper*> flist = helper->GetGdcmFileList();
00150 // PS ->                for(std::list<gdcmHeaderHelper*>::iterator it = flist.begin(); 
00151 // PS ->                it != flist.end(); it++ )
00152 // PS ->                {
00153 // PS ->                        imageNumbers.Add( wxString::Format("%d", (*it)->GetImageNumber()) );
00154 // PS ->                }
00155 // PS ->                return( imageNumbers );
00156 // PS ->     }
00157 
00158         // PS ->     void loadVolume( bool force = false, wxGauge* gauge = NULL);
00159     void loadVolumeDXMM( bool force = false, wxGauge* gauge = NULL);
00160         
00161 // PS ->        
00162 // PS ->     bool setActualStudy( unsigned int studynumber )
00163 // PS ->     {
00164 // PS ->                m_ActualStudy = studynumber;
00165 // PS ->                return true;
00166 // PS ->     }
00167 // PS ->     bool setActualSerie( unsigned int serienumber )
00168 // PS ->     {
00169 // PS ->                m_ActualSerie = serienumber;
00170 // PS ->                return true;
00171 // PS ->     }
00172 // PS ->        
00176     void reset( );
00177     void copyFrom( const marObject& from );
00178         
00182     bool save( std::ofstream& os );
00183     bool load( std::ifstream& is );
00184         
00185 // PS ->     void FillDicomInfo();
00186     
00187 // PS ->     wxString GetPatientName()
00188 // PS ->        {
00189 // PS ->                return wxString( helper->GetGdcmHeader()->GetPubElValByNumber(0x0010,0x0010).c_str()).Trim();//0010 0010 PN PAT Patient Name
00190 // PS ->        }
00191         
00192   private:
00193           
00194 // PS ->          wxArrayString gdcmGetExamInfo( wxString directoryname );
00195           
00196           std::vector< SerieInfo > m_DicomInfo;
00197           unsigned int m_ActualStudy;
00198           unsigned int m_ActualSerie;
00199           
00200 // PS ->          gdcmSerieHeaderHelper *helper;
00201           unsigned short * m_pSlicesPixels;
00202           int   m_nX, m_nY, m_nSlices;
00203           float m_PixelSpacingColumn,m_PixelSpacingRow,m_PixelSpacingSlice;
00204           float m_RescaleSlope, m_RescaleIntercept;
00205           bool  _investSliceOrder;
00206 };
00207 
00208 #endif // __MAR__KERNEL__MARSIMPLEDICOM__HXX__

Generated on 18 Mar 2010 for creaMaracasVisu_lib by  doxygen 1.6.1