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-2020 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_FILE_READER_ 00024 #define _SO_VR_DICOM_FILE_READER_ 00025 00026 #ifdef _WIN32 00027 #pragma warning( push ) 00028 #pragma warning(disable:4251) 00029 #endif 00030 00031 #include <LDM/readers/SoVolumeReader.h> 00032 #include <VolumeViz/readers/SoVRDicomData.h> 00033 #include <VolumeViz/nodes/SoVolumeData.h> 00034 00035 class SiDicomSliceVector; 00036 class SoDicomSliceCache; 00037 00038 SO_PIMPL_BASE_PUBLIC_DECLARATION(SoVRDicomFileReader); 00039 00198 class SoVRDicomFileReader : public SoVolumeReader 00199 { 00200 00201 SO_FIELDCONTAINER_HEADER(SoVRDicomFileReader); 00202 SO_PIMPL_BASE_PUBLIC_HEADER(SoVRDicomFileReader); 00203 00204 public: 00206 SoVRDicomFileReader (); 00207 00221 virtual int setFilename( const SbString& filename ); 00222 00230 int setFilenamePattern( const SbString& pattern ); 00231 00244 int setFilenameList(const SbStringList& filenameList); 00245 00261 SbBool setFilenameList(const SbString& format, const int startIndex = 0, const int endIndex = INT_MAX, const int indexStep = 1); 00262 00270 bool setFilenameListFromSeries( const SbString& base ); 00271 00300 void loadInMemory(); 00301 00315 SbBool setDirectory(const SbString& folder); 00316 00323 virtual ReadError getDataChar (SbBox3f &size, SoDataSet::DataType &type, SbVec3i32 &dim); 00324 00331 virtual SbBool setOutputDataType( SbBool doChange, SoDataSet::DataType type ); 00332 00333 00339 virtual void getSubSlice (const SbBox2i32 &subSlice, int sliceNumber, void *data); 00340 00348 int getNumSignificantBits(); 00349 00353 virtual SoVolumeReader::ReaderType getReaderType () 00354 {return DICOM;} 00355 00367 const SoVRDicomData& getDicomData() const; 00368 00376 const SiDicomDataSet* getDicomDataSet( const size_t sliceIdx ) const; 00377 00383 void loadSliceDicomData( int slice, SoVRDicomData& dicomData ) const; 00384 00386 virtual SbBool isThreadSafe() const; 00387 00393 virtual void closeAllHandles(); 00394 00400 virtual void restoreAllHandles(); 00401 00402 private: 00403 00405 virtual ~SoVRDicomFileReader (); 00406 00407 private: 00412 static std::vector<SbString> s_extensions; 00413 }; 00414 00415 #ifdef _WIN32 00416 #pragma warning( pop ) 00417 #endif 00418 00419 #endif /* _SO_VR_DICOM_FILE_READER_ */ 00420 00421 00422