]> Creatis software - gdcm.git/blobdiff - src/gdcmFileHelper.cxx
COMP: Fix compilation on Win32. All symbols MUST be resolved
[gdcm.git] / src / gdcmFileHelper.cxx
index 0aeffd71d5ad91a34246d8ccd7b6e4ddfbffcf74..0bf7bf7d11f499ad4859da40f8853edfe54b1e18 100644 (file)
@@ -4,8 +4,8 @@
   Module:    $RCSfile: gdcmFileHelper.cxx,v $
   Language:  C++
 
-  Date:      $Date: 2005/06/24 10:55:59 $
-  Version:   $Revision: 1.46 $
+  Date:      $Date: 2005/07/23 01:59:21 $
+  Version:   $Revision: 1.50 $
                                                                                 
   Copyright (c) CREATIS (Centre de Recherche et d'Applications en Traitement de
   l'Image). All rights reserved. See Doc/License.txt or
@@ -145,25 +145,6 @@ FileHelper::FileHelper(File *header)
    Initialize();
 }
 
-/**
- * \brief Constructor dedicated to deal with the *pixels* area of a ACR/DICOMV3
- *        file (gdcm::File only deals with the ... header)
- *        Opens (in read only and when possible) an existing file and checks
- *        for DICOM compliance. Returns NULL on failure.
- *        It will be up to the user to load the pixels into memory
- * \note  the in-memory representation of all available tags found in
- *        the DICOM header is post-poned to first header information access.
- *        This avoid a double parsing of public part of the header when
- *        one sets an a posteriori shadow dictionary (efficiency can be
- *        seen as a side effect).   
- * @param filename file to be opened for parsing
- */
-FileHelper::FileHelper(std::string const &filename )
-{
-   FileInternal = new File( filename );
-   SelfHeader = true;
-   Initialize();
-}
 
 /**
  * \brief canonical destructor
@@ -194,6 +175,39 @@ FileHelper::~FileHelper()
 
 //-----------------------------------------------------------------------------
 // Public
+
+/**
+ * \brief Sets the LoadMode of the internal gdcm::File as a boolean string. 
+ *        NO_SEQ, NO_SHADOW, NO_SHADOWSEQ
+ *... (nothing more, right now)
+ *        WARNING : before using NO_SHADOW, be sure *all* your files
+ *        contain accurate values in the 0x0000 element (if any) 
+ *        of *each* Shadow Group. The parser will fail if the size is wrong !
+ * @param   loadMode Load mode to be used    
+ */
+void FileHelper::SetLoadMode(int loadMode) 
+{ 
+   GetFile()->SetLoadMode( loadMode ); 
+}
+/**
+ * \brief Sets the LoadMode of the internal gdcm::File
+ * @param  fileName name of the file to be open  
+ */
+void FileHelper::SetFileName(std::string const &fileName)
+{
+   FileInternal->SetFileName( fileName );
+}
+
+/**
+ * \brief   Loader  
+ * @return false if file cannot be open or no swap info was found,
+ *         or no tag was found.
+ */
+bool FileHelper::Load()
+{ 
+   return FileInternal->Load();
+}
+
 /**
  * \brief   Accesses an existing DocEntry (i.e. a Dicom Element)
  *          through it's (group, element) and modifies it's content with
@@ -1527,5 +1541,30 @@ void FileHelper::Print(std::ostream &os, std::string const &)
    PixelReadConverter->Print(os);
 }
 
+#ifndef GDCM_LEGACY_REMOVE
+/**
+ * \brief 
+ *        Constructor dedicated to deal with the *pixels* area of a ACR/DICOMV3
+ *        file (gdcm::File only deals with the ... header)
+ *        Opens (in read only and when possible) an existing file and checks
+ *        for DICOM compliance. Returns NULL on failure.
+ *        It will be up to the user to load the pixels into memory
+ * \note  the in-memory representation of all available tags found in
+ *        the DICOM header is post-poned to first header information access.
+ *        This avoid a double parsing of public part of the header when
+ *        one sets an a posteriori shadow dictionary (efficiency can be
+ *        seen as a side effect).   
+ * @param filename file to be opened for parsing
+ * @deprecated  use SetFilename() + Load() methods
+ */
+FileHelper::FileHelper(std::string const &filename )
+{
+   FileInternal = new File( );
+   FileInternal->SetFileName( filename );
+   FileInternal->Load();
+   SelfHeader = true;
+   Initialize();
+}
+#endif
 //-----------------------------------------------------------------------------
 } // end namespace gdcm