00001 /*======================================================================= 00002 *** THE CONTENT OF THIS WORK IS PROPRIETARY TO FEI S.A.S, (FEI S.A.S.), *** 00003 *** AND IS DISTRIBUTED UNDER A LICENSE AGREEMENT. *** 00004 *** *** 00005 *** REPRODUCTION, DISCLOSURE, OR USE, IN WHOLE OR IN PART, OTHER THAN AS *** 00006 *** SPECIFIED IN THE LICENSE ARE NOT TO BE UNDERTAKEN EXCEPT WITH PRIOR *** 00007 *** WRITTEN AUTHORIZATION OF FEI S.A.S. *** 00008 *** *** 00009 *** RESTRICTED RIGHTS LEGEND *** 00010 *** USE, DUPLICATION, OR DISCLOSURE BY THE GOVERNMENT OF THE CONTENT OF THIS *** 00011 *** WORK OR RELATED DOCUMENTATION IS SUBJECT TO RESTRICTIONS AS SET FORTH IN *** 00012 *** SUBPARAGRAPH (C)(1) OF THE COMMERCIAL COMPUTER SOFTWARE RESTRICTED RIGHT *** 00013 *** CLAUSE AT FAR 52.227-19 OR SUBPARAGRAPH (C)(1)(II) OF THE RIGHTS IN *** 00014 *** TECHNICAL DATA AND COMPUTER SOFTWARE CLAUSE AT DFARS 52.227-7013. *** 00015 *** *** 00016 *** COPYRIGHT (C) 1996-2021 BY FEI S.A.S, *** 00017 *** BORDEAUX, FRANCE *** 00018 *** ALL RIGHTS RESERVED *** 00019 **=======================================================================*/ 00020 /*======================================================================= 00021 ** Author : L.Taboni (Apr 2004) 00022 **=======================================================================*/ 00023 #ifndef _SO_VR_DICOM_DATA_ 00024 #define _SO_VR_DICOM_DATA_ 00025 00026 #include <Inventor/SbLinear.h> 00027 #include <Inventor/SbString.h> 00028 #include <Inventor/SbBox.h> 00029 #include <Inventor/SbPImpl.h> 00030 00031 #include <VolumeViz/readers/dicom/SiDicomDataSet.h> 00032 #include <VolumeViz/readers/dicom/SiDicomElement.h> 00033 00034 SO_PIMPL_BASE_PUBLIC_DECLARATION(SoVRDicomData); 00035 00062 class SoVRDicomData 00063 { 00064 SO_PIMPL_BASE_PUBLIC_HEADER(SoVRDicomData); 00065 public: 00066 00068 SoVRDicomData (); 00069 00071 ~SoVRDicomData (); 00072 00073 // header & image 00074 00079 SoNONUNICODE SbBool readDicomHeader (const char *fileName); 00080 00083 SbBool readDicomHeader (const SbString& fileName); 00084 00089 SoNONUNICODE SbBool readDicomImage (const char *fileName); 00090 00093 SbBool readDicomImage (const SbString& fileName); 00094 00098 SbBool close(); 00099 00100 // info from header 00101 00112 int getNumFrames () const; 00113 00115 int getImageWidth () const; 00116 00118 int getImageHeight () const; 00119 00121 int getSizeInBytes () const; 00122 00124 int getBytesPerPixel () const; 00125 00127 int getSamplesPerPixel () const; 00128 00130 SbBool supportedTransferSyntax () const; 00131 00141 void readFrame( size_t frame, const SbBox2i32& subImg, uint8_t* dst ) const; 00142 00149 const SiDicomDataSet* getDicomDataSet() const; 00150 00151 // ACQUISITION info 00152 00158 float getSliceThicknessMM () const; 00159 00161 float getSliceSpacing () const; 00162 00163 // RELATION info 00164 00166 int getSeriesNumber () const; 00167 00169 int getImageNumber () const; 00170 00174 float getSliceLocation () const; 00175 00176 // IMAGE info 00177 00179 float getXPixelSize () const; 00180 00182 float getYPixelSize () const ; 00183 00193 SbBool getPosition(SbVec3f& position) const; 00194 00199 SbVec3f getImagePosition() const; 00200 00208 SbBool getOrientation(SbMatrix& orientation) const; 00209 00211 int getBitsStored () const; 00212 00214 int getHighBit () const; 00215 00217 int signedData () const; 00218 00220 float getIntercept () const; 00221 00223 float getSlope () const; 00224 00239 SbString getDicomInfo( unsigned short group, unsigned short element) const; 00240 00241 private: 00242 // The copying of SoVRDicomData is disabled because the copy will hold the 00243 // same ImageReader, that is not a correct behavior and can cause data races. 00244 SoVRDicomData( const SoVRDicomData& other ); 00245 SoVRDicomData& operator=( const SoVRDicomData& other ); 00246 00247 friend class SoVRDicomFileReader; 00248 }; 00249 00250 #endif /*_SO_VR_DICOM_DATA_*/ 00251