Преглед на файлове

Merge pull request #842 from lassoan/reduce-warning-in-dicom-indexer-addfile

ENH: Reduce warning logs during DICOM import
Steve Pieper преди 6 години
родител
ревизия
6cd82aab5f
променени са 2 файла, в които са добавени 7 реда и са изтрити 8 реда
  1. 3 7
      Libs/DICOM/Core/ctkDICOMIndexer.cpp
  2. 4 1
      Libs/DICOM/Core/ctkDICOMIndexer.h

+ 3 - 7
Libs/DICOM/Core/ctkDICOMIndexer.cpp

@@ -93,14 +93,10 @@ void ctkDICOMIndexer::addFile(ctkDICOMDatabase& database,
                                    const QString& destinationDirectoryName)
 {
   ctkDICOMIndexer::ScopedIndexing indexingBatch(*this, database);
-  if (!destinationDirectoryName.isEmpty())
-  {
-    logger.warn("Ignoring destinationDirectoryName parameter, just taking it as indication we should copy!");
-  }
-
   emit indexingFilePath(filePath);
-
-  database.insert(filePath, !destinationDirectoryName.isEmpty(), true);
+  // Ignoring destinationDirectoryName parameter, just taking it as indication we should copy
+  bool copyFileToDatabase = !destinationDirectoryName.isEmpty();
+  database.insert(filePath, copyFileToDatabase, true);
 }
 
 //------------------------------------------------------------------------------

+ 4 - 1
Libs/DICOM/Core/ctkDICOMIndexer.h

@@ -77,7 +77,10 @@ public:
 
   ///
   /// \brief Adds a file to database and optionally copies the file to
-  /// destinationDirectory.
+  /// the database folder.
+  /// If destinationDirectory is non-empty string then the file is copied
+  /// to the database folder (exact value of destinationDirectoryName does not matter,
+  /// only if the string is empty or not).
   ///
   /// Scan the file using Dcmtk and populate the database with all the
   /// DICOM fields accordingly.