fw4spl
SeriesDBLazyReader.cpp
1 /* ***** BEGIN LICENSE BLOCK *****
2  * FW4SPL - Copyright (C) IRCAD, 2009-2016.
3  * Distributed under the terms of the GNU Lesser General Public License (LGPL) as
4  * published by the Free Software Foundation.
5  * ****** END LICENSE BLOCK ****** */
6 
7 #include "vtkGdcmIO/SeriesDBLazyReader.hpp"
8 #include "vtkGdcmIO/helper/GdcmHelper.hpp"
9 #include "vtkGdcmIO/helper/ImageDicomStream.hpp"
10 
11 #include <fwCore/base.hpp>
12 #if (SPYLOG_LEVEL >= 4 )
13 #include <fwCore/HiResTimer.hpp>
14 #endif
15 
16 #include <fwJobs/IJob.hpp>
17 #include <fwJobs/Observer.hpp>
18 
19 #include <fwDataIO/reader/registry/macros.hpp>
20 
21 #include <fwMedData/Equipment.hpp>
22 #include <fwMedData/ImageSeries.hpp>
23 #include <fwMedData/Patient.hpp>
24 #include <fwMedData/Series.hpp>
25 #include <fwMedData/SeriesDB.hpp>
26 #include <fwMedData/Study.hpp>
27 
28 #include <fwVtkIO/helper/vtkLambdaCommand.hpp>
29 #include <fwVtkIO/vtk.hpp>
30 
31 #include <fwMemory/BufferObject.hpp>
32 
33 #include <fwTools/dateAndTime.hpp>
34 #include <fwTools/fromIsoExtendedString.hpp>
35 
36 #include <algorithm>
37 #include <boost/algorithm/string/classification.hpp>
38 #include <boost/algorithm/string/split.hpp>
39 #include <boost/algorithm/string/trim.hpp>
40 #include <boost/filesystem/path.hpp>
41 #include <boost/iostreams/categories.hpp>
42 
43 #include <exception>
44 #include <gdcmImageHelper.h>
45 #include <gdcmImageReader.h>
46 #include <gdcmIPPSorter.h>
47 #include <gdcmIPPSorter.h>
48 #include <gdcmReader.h>
49 #include <gdcmRescaler.h>
50 #include <gdcmScanner.h>
51 #include <iosfwd>
52 
53 fwDataIOReaderRegisterMacro( ::vtkGdcmIO::SeriesDBLazyReader );
54 
55 namespace vtkGdcmIO
56 {
57 
58 //------------------------------------------------------------------------------
59 
60 const ::gdcm::Tag seriesUIDTag(0x0020,0x000e);
61 const ::gdcm::Tag seriesDateTag(0x0008,0x0021);
62 const ::gdcm::Tag seriesTimeTag(0x0008,0x0031);
63 const ::gdcm::Tag seriesTypeTag(0x0008,0x0060);
64 const ::gdcm::Tag seriesDescriptionTag(0x0008,0x103e);
65 const ::gdcm::Tag seriesPhysicianNamesTag(0x0008,0x1050);
66 
67 const ::gdcm::Tag equipmentInstitutionNameTag(0x0008,0x0080);
68 
69 const ::gdcm::Tag patientNameTag(0x0010,0x0010);
70 const ::gdcm::Tag patientIDTag(0x0010,0x0020);
71 const ::gdcm::Tag patientBirthdateTag(0x0010,0x0030);
72 const ::gdcm::Tag patientSexTag(0x0010,0x0040);
73 
74 const ::gdcm::Tag studyUIDTag(0x0020,0x000d);
75 const ::gdcm::Tag studyDateTag(0x0008,0x0020);
76 const ::gdcm::Tag studyTimeTag(0x0008,0x0030);
77 const ::gdcm::Tag studyReferingPhysicianNameTag(0x0008,0x0090);
78 const ::gdcm::Tag studyDescriptionTag(0x0008,0x1030);
79 const ::gdcm::Tag studyPatientAgeTag(0x0010,0x1010);
80 
81 const ::gdcm::Tag imageTypeTag(0x0008,0x0008);
82 const ::gdcm::Tag acquisitionDateTag(0x0008,0x0022);
83 const ::gdcm::Tag acquisitionTimeTag(0x0008,0x0032);
84 
85 const ::gdcm::Tag sliceThicknessTag(0x0018,0x0050);
86 const ::gdcm::Tag windowCenterTag(0x0028,0x1050);
87 const ::gdcm::Tag windowWidthTag(0x0028,0x1051);
88 
89 //------------------------------------------------------------------------------
90 
92  ::fwData::location::enableFolder< IObjectReader >(this),
93  ::fwData::location::enableMultiFiles< IObjectReader >(this),
94  m_job(::fwJobs::Observer::New("SeriesDB reader"))
95 {
97 }
98 
99 //------------------------------------------------------------------------------
100 
102 {
103  SLM_TRACE_FUNC();
104 }
105 
106 //------------------------------------------------------------------------------
107 
108 ::fwMedData::SeriesDB::sptr SeriesDBLazyReader::createSeriesDB( const ::boost::filesystem::path &dicomDir )
109 {
110  SLM_TRACE_FUNC();
111  ::fwMedData::SeriesDB::sptr seriesDB = this->getConcreteObject();
112 
113  std::vector<std::string> filenames;
114  ::vtkGdcmIO::helper::DicomSearch::searchRecursivelyFiles(dicomDir, filenames);
115 
116  this->addSeries( seriesDB, filenames);
117  return seriesDB;
118 }
119 
120 //------------------------------------------------------------------------------
121 
122 void SeriesDBLazyReader::scanFiles( ::gdcm::Scanner & scanner, const std::vector< std::string > & filenames )
123 {
124  scanner.AddTag( seriesUIDTag );
125  scanner.AddTag( seriesDateTag );
126  scanner.AddTag( seriesTimeTag );
127  scanner.AddTag( seriesTypeTag );
128  scanner.AddTag( seriesDescriptionTag );
129  scanner.AddTag( seriesPhysicianNamesTag );
130 
131  scanner.AddTag( equipmentInstitutionNameTag );
132 
133  scanner.AddTag( patientNameTag );
134  scanner.AddTag( patientIDTag );
135  scanner.AddTag( patientBirthdateTag );
136  scanner.AddTag( patientSexTag );
137 
138  scanner.AddTag( studyUIDTag );
139  scanner.AddTag( studyUIDTag );
140  scanner.AddTag( studyDateTag );
141  scanner.AddTag( studyTimeTag );
142  scanner.AddTag( studyReferingPhysicianNameTag );
143  scanner.AddTag( studyDescriptionTag );
144  scanner.AddTag( studyPatientAgeTag );
145 
146  scanner.AddTag( imageTypeTag );
147 
148  scanner.AddTag( acquisitionDateTag );
149  scanner.AddTag( acquisitionTimeTag );
150 
151  scanner.AddTag( sliceThicknessTag );
152  scanner.AddTag( windowCenterTag );
153  scanner.AddTag( windowWidthTag );
154 
155  bool scanIsOk = scanner.Scan( filenames );
156  FW_RAISE_IF( "Dicom scanner failed", !scanIsOk );
157 }
158 
159 //------------------------------------------------------------------------------
160 
161 SeriesDBLazyReader::MapSeriesType buildMapSeriesFromScanner( ::gdcm::Scanner & scanner )
162 {
163  ::gdcm::Directory::FilenamesType keys = scanner.GetKeys();
164  ::gdcm::Directory::FilenamesType::const_iterator it = keys.begin();
165 
166  SeriesDBLazyReader::MapSeriesType mapSeries;
167 
168  for(; it != keys.end(); ++it)
169  {
170  const char *filename = it->c_str();
171  assert( scanner.IsKey( filename ) );
172 
173  const char *seriesUID = scanner.GetValue( filename, seriesUIDTag );
174  const char *acqDate = scanner.GetValue( filename, acquisitionDateTag );
175 
176  if (seriesUID)
177  {
178  std::string fileSetId = seriesUID;
179 
180  if (acqDate)
181  {
182  fileSetId += "_";
183  fileSetId += acqDate;
184  }
185 
186  const char *imageTypeStr = scanner.GetValue(filename, imageTypeTag);
187  if(imageTypeStr)
188  {
189  // Treatment of secondary capture dicom file.
190  std::string imageType(imageTypeStr);
191  SLM_TRACE("Image Type : " + imageType);
192 
193  fileSetId += "_";
194  fileSetId += imageTypeStr;
195  }
196  mapSeries[fileSetId].push_back(filename);
197 
198  }
199  else
200  {
201  SLM_ERROR ( "Error in vtkGdcmIO : No serie name found in : " + *it );
202  }
203 
204  }
205 
206  return mapSeries;
207 }
208 
209 //------------------------------------------------------------------------------
210 
211 
212 std::string getValue( ::gdcm::Scanner & scanner, const std::string & dcmFile, const ::gdcm::Tag & tag )
213 {
214  const char * tagValue = scanner.GetValue( dcmFile.c_str(), tag );
215  if( tagValue )
216  {
217  return std::string(tagValue);
218  }
219  else
220  {
221  return std::string("");
222  }
223 }
224 
225 //------------------------------------------------------------------------------
226 
227 template < typename T >
228 T getNumericValue( ::gdcm::Scanner & scanner, const std::string & dcmFile, const ::gdcm::Tag & tag )
229 {
230  const char * tagValue = scanner.GetValue( dcmFile.c_str(), tag );
231  if( tagValue )
232  {
233  std::string val (tagValue);
234  ::boost::algorithm::trim(val);
235  return ::boost::lexical_cast<T>( val );
236  }
237  else
238  {
239  return 0;
240  }
241 }
242 
243 //------------------------------------------------------------------------------
244 
245 void SeriesDBLazyReader::fillSeries( ::gdcm::Scanner & scanner,
246  const std::string & dcmFile, ::fwMedData::Series::sptr series )
247 {
248  const std::string seriesUID = getValue( scanner, dcmFile, seriesUIDTag );
249  const std::string seriesTime = getValue( scanner, dcmFile, seriesTimeTag );
250  const std::string seriesDate = getValue( scanner, dcmFile, seriesDateTag );
251  const std::string seriesModality = getValue( scanner, dcmFile, seriesTypeTag );
252  const std::string seriesDescription = getValue( scanner, dcmFile, seriesDescriptionTag );
253 
254  ::fwMedData::DicomValuesType seriesPhysicianNames;
255  ::gdcm::Scanner::ValuesType gdcmPhysicianNames = scanner.GetValues( seriesPhysicianNamesTag );
256  for(const std::string &str : gdcmPhysicianNames)
257  {
258  ::fwMedData::DicomValuesType result;
259  ::boost::split( result, str, ::boost::is_any_of("\\"));
260  seriesPhysicianNames.reserve(seriesPhysicianNames.size() + result.size());
261  seriesPhysicianNames.insert(seriesPhysicianNames.end(), result.begin(), result.end());
262  }
263 
264  SLM_ASSERT("No series UID", !seriesUID.empty() );
265  series->setInstanceUID( seriesUID );
266  series->setModality( seriesModality );
267  series->setDescription( seriesDescription );
268  series->setDate( seriesDate );
269  series->setTime( seriesTime );
270  series->setPerformingPhysiciansName( seriesPhysicianNames );
271 }
272 
273 //------------------------------------------------------------------------------
274 
275 void SeriesDBLazyReader::fillPatient( ::gdcm::Scanner & scanner,
276  const std::string & dcmFile, ::fwMedData::Patient::sptr patient )
277 {
278  const std::string patientName = getValue( scanner, dcmFile, patientNameTag );
279  const std::string patientId = getValue( scanner, dcmFile, patientIDTag );
280  const std::string patientBirthdate = getValue( scanner, dcmFile, patientBirthdateTag );
281  const std::string patientSex = getValue( scanner, dcmFile, patientSexTag );
282 
283  patient->setName(patientName);
284  patient->setPatientId(patientId);
285  patient->setBirthdate(patientBirthdate);
286  patient->setSex(patientSex);
287 }
288 
289 //------------------------------------------------------------------------------
290 
291 void SeriesDBLazyReader::fillStudy( ::gdcm::Scanner & scanner,
292  const std::string & dcmFile, ::fwMedData::Study::sptr study )
293 {
294  const std::string studyUID = getValue( scanner, dcmFile, studyUIDTag );
295  const std::string studyReferingPhysicianName = getValue( scanner, dcmFile, studyReferingPhysicianNameTag );
296  const std::string studyDate = getValue( scanner, dcmFile, studyDateTag );
297  const std::string studyTime = getValue( scanner, dcmFile, studyTimeTag );
298  const std::string studyDescription = getValue( scanner, dcmFile, studyDescriptionTag );
299  const std::string studyPatientAge = getValue( scanner, dcmFile, studyPatientAgeTag );
300 
301  SLM_ASSERT("No study UID", !studyUID.empty() );
302  study->setInstanceUID(studyUID);
303  study->setDate(studyDate);
304  study->setTime(studyTime);
305  study->setDescription(studyDescription);
306  study->setPatientAge(studyPatientAge);
307  study->setReferringPhysicianName(studyReferingPhysicianName);
308 }
309 
310 //------------------------------------------------------------------------------
311 
312 void SeriesDBLazyReader::fillEquipment( ::gdcm::Scanner & scanner,
313  const std::string & dcmFile, ::fwMedData::Equipment::sptr equipment )
314 {
315  const std::string equipementInstitution = getValue( scanner, dcmFile, equipmentInstitutionNameTag );
316 
317  equipment->setInstitutionName(equipementInstitution);
318 }
319 
320 //------------------------------------------------------------------------------
321 
322 void SeriesDBLazyReader::preprocessImage(
323  const ::fwData::Image::sptr & img,
324  const SeriesDBLazyReader::SeriesFilesType & files )
325 {
326  ::gdcm::Reader localReader;
327  localReader.SetFileName( files[0].c_str() );
328  localReader.Read();
329  ::gdcm::File & gdcmReaderFile = localReader.GetFile();
330  std::vector<double> origin = ::gdcm::ImageHelper::GetOriginValue( gdcmReaderFile );
331  std::vector<unsigned int> dim = ::gdcm::ImageHelper::GetDimensionsValue( gdcmReaderFile );
332  std::vector<double> spacing = ::gdcm::ImageHelper::GetSpacingValue( gdcmReaderFile );
333  ::gdcm::PixelFormat pixelFormat = ::gdcm::ImageHelper::GetPixelFormatValue( gdcmReaderFile );
334  std::vector<double> interceptSlope = ::gdcm::ImageHelper::GetRescaleInterceptSlopeValue( gdcmReaderFile );
335 
336  // Origin
337  ::fwData::Image::OriginType imgOrigin;
338  imgOrigin.resize(3);
339  imgOrigin[0] = origin[0];
340  imgOrigin[1] = origin[1];
341  imgOrigin[2] = origin[2];
342  img->setOrigin( imgOrigin );
343 
344  // Spacing
345  ::fwData::Image::SpacingType imgSpacing;
346  imgSpacing.resize(3);
347  imgSpacing[0] = spacing[0];
348  imgSpacing[1] = spacing[1];
349  imgSpacing[2] = 1.0;
350  img->setSpacing( imgSpacing );
351 
352  // Size
353  ::fwData::Image::SizeType imgSize (3);
354  imgSize.resize(3);
355  imgSize[0] = dim[0];
356  imgSize[1] = dim[1];
357  imgSize[2] = files.size();
358 
359  // Image type
360  ::fwTools::Type imgType;
361  ::gdcm::PixelFormat::ScalarType scalarType = pixelFormat.GetScalarType();
362 
363  ::gdcm::Rescaler r;
364  r.SetIntercept( interceptSlope[0] );
365  r.SetSlope( interceptSlope[1] );
366  r.SetPixelFormat( scalarType );
367  scalarType = r.ComputeInterceptSlopePixelType();
368  OSLM_TRACE("Intercept = " << interceptSlope[0] );
369  OSLM_TRACE("Slope = " << interceptSlope[1] );
370 
371  switch( scalarType )
372  {
373  case ::gdcm::PixelFormat::UINT8:
374  imgType = ::fwTools::Type::s_UINT8;
375  break;
376  case ::gdcm::PixelFormat::INT8:
377  imgType = ::fwTools::Type::s_INT8;
378  break;
379  case ::gdcm::PixelFormat::UINT16:
380  imgType = ::fwTools::Type::s_UINT16;
381  break;
382  case ::gdcm::PixelFormat::INT16:
383  imgType = ::fwTools::Type::s_INT16;
384  break;
385  case ::gdcm::PixelFormat::UINT32:
386  imgType = ::fwTools::Type::s_UINT32;
387  break;
388  case ::gdcm::PixelFormat::INT32:
389  imgType = ::fwTools::Type::s_INT32;
390  break;
391  case ::gdcm::PixelFormat::FLOAT32:
392  imgType = ::fwTools::Type::s_FLOAT;
393  break;
394  case ::gdcm::PixelFormat::FLOAT64:
395  imgType = ::fwTools::Type::s_DOUBLE;
396  break;
397  default:
398  SLM_FATAL("Type not managed");
399  break;
400  }
401 
402  // Number of component
403  size_t numberOfComponents = pixelFormat.GetSamplesPerPixel();
404 
405  img->setSize( imgSize );
406  img->setNumberOfComponents( numberOfComponents );
407  img->setType( imgType );
408  img->getDataArray()->resize(imgType, imgSize, numberOfComponents, false);
409 }
410 
411 //------------------------------------------------------------------------------
412 
413 SeriesDBLazyReader::SeriesFilesType sortImageSeriesFiles( const SeriesDBLazyReader::SeriesFilesType & seriesFiles )
414 {
415  SeriesDBLazyReader::SeriesFilesType sortedSeriesFiles = seriesFiles;
416 
417  ::gdcm::IPPSorter s;
418  s.SetComputeZSpacing( true );
419  s.SetZSpacingTolerance( 1e-3 );
420  bool success = s.Sort( seriesFiles );
421 
422  SLM_WARN_IF( "Failed to sort : " + seriesFiles[0], !success );
423  if ( success )
424  {
425  sortedSeriesFiles = s.GetFilenames();
426  }
427 
428  return sortedSeriesFiles;
429 }
430 
431 //------------------------------------------------------------------------------
432 
433 double SeriesDBLazyReader::computeZSpacing( const SeriesDBLazyReader::SeriesFilesType & seriesFiles )
434 {
435  SLM_ASSERT("This method only work if series files contains at least 2 frames.", seriesFiles.size() > 1);
436  double zspacing = 0;
437 
438  ::gdcm::Reader r1;
439  ::gdcm::Reader r2;
440 
441  r1.SetFileName( seriesFiles[0].c_str() );
442  r2.SetFileName( seriesFiles[1].c_str() );
443 
444  bool canRead = r1.Read() && r2.Read();
445  SLM_ASSERT("Reader must be ok", canRead);
446 
447  std::vector<double> vOrigin1 = ::gdcm::ImageHelper::GetOriginValue(r1.GetFile());
448  std::vector<double> vOrigin2 = ::gdcm::ImageHelper::GetOriginValue(r2.GetFile());
449  zspacing = vOrigin2[2] - vOrigin1[2];
450 
451  return zspacing;
452 }
453 
454 //------------------------------------------------------------------------------
455 
456 void SeriesDBLazyReader::fillImage(
457  ::gdcm::Scanner & scanner,
458  const SeriesDBLazyReader::SeriesFilesType & seriesFiles,
459  const std::string & dcmFile,
460  ::fwData::Image::sptr img )
461 {
462 
463  this->preprocessImage(img,seriesFiles);
464 
465  double center = getNumericValue<double>(scanner, dcmFile, windowCenterTag);
466  double width = getNumericValue<double>(scanner, dcmFile, windowWidthTag);
467 
468  img->setWindowCenter(center);
469  img->setWindowWidth(width);
470 
471  ::fwData::Image::SpacingType imgSpacing = img->getSpacing();
472  imgSpacing.resize(3);
473  double thickness = getNumericValue<double>(scanner, dcmFile, sliceThicknessTag);
474  thickness = thickness ? thickness : 1.;
475  if ( seriesFiles.size() > 1 )
476  {
477  double computedZSpacing = computeZSpacing( seriesFiles );
478  imgSpacing[2] = computedZSpacing ? computedZSpacing : thickness;
479  }
480  else
481  {
482  imgSpacing[2] = thickness;
483  }
484  img->setSpacing(imgSpacing);
485 
486 
487  ::vtkGdcmIO::helper::ImageDicomInfo::sptr dcmInfo = std::make_shared< ::vtkGdcmIO::helper::ImageDicomInfo >();
488  dcmInfo->m_buffSizeInBytes = img->getSizeInBytes();
489  dcmInfo->m_seriesFiles = seriesFiles;
490 
491  ::fwMemory::BufferObject::sptr buffObj = img->getDataArray()->getBufferObject();
492  buffObj->setIStreamFactory(
493  std::make_shared< ::vtkGdcmIO::helper::ImageDicomStream >( dcmInfo ),
494  img->getSizeInBytes() );
495 }
496 
497 //------------------------------------------------------------------------------
498 
499 void SeriesDBLazyReader::addSeries(
500  const ::fwMedData::SeriesDB::sptr &seriesDB,
501  const std::vector< std::string > & filenames )
502 {
503  //gdcm::Trace::SetDebug( 1 );
504  //gdcm::Trace::SetWarning( 1 );
505  //gdcm::Trace::SetError( 1 );
506 
507  try
508  {
509 
510 #if (SPYLOG_LEVEL >= 4 ) // Log level info
511  ::fwCore::HiResTimer timer;
512  timer.start();
513 #endif
514 
516  ::gdcm::Scanner scanner;
517 
519  this->scanFiles( scanner, filenames );
520 
522  MapSeriesType mapSeries = buildMapSeriesFromScanner( scanner );
523 
524  for( MapSeriesType::value_type mapElem : mapSeries )
525  {
526  SeriesFilesType seriesFiles = sortImageSeriesFiles( mapElem.second );
527  const std::string & refDcmFile = seriesFiles[0];
528 
529  // ToDo
530  // ::gdcm::MediaStorage::IsImage( ::gdcm::MediaStorage::GetMSType( XXX ) ) );
531  bool isAnImage = true;
532  if ( isAnImage )
533  {
535  ::fwMedData::ImageSeries::sptr series = ::fwMedData::ImageSeries::New();
536  ::fwData::Image::sptr img = ::fwData::Image::New();
537 
538  series->setImage( img );
539 
540  // Fill data object
541  this->fillSeries( scanner, refDcmFile, series );
542  this->fillPatient( scanner, refDcmFile, series->getPatient() );
543  this->fillStudy( scanner, refDcmFile, series->getStudy() );
544  this->fillEquipment( scanner, refDcmFile, series->getEquipment() );
545  this->fillImage( scanner, seriesFiles, refDcmFile, img );
546 
547  seriesDB->getContainer().push_back(series);
548  }
549  }
550 
551 #if (SPYLOG_LEVEL >= 4 )
552  timer.stop();
553  OSLM_INFO( "Time in to lazy read data : " << timer.getElapsedTimeInMilliSec() );
554 #endif
555 
556  }
557  catch (std::exception& e)
558  {
559  OSLM_ERROR( "Try with another reader or retry with this reader on a specific subfolder : " << e.what() );
560  std::vector< std::string >::const_iterator it = filenames.begin();
561  for(; it != filenames.end(); ++it)
562  {
563  SLM_ERROR("file error : " + *it );
564  }
565  }
566 }
567 
568 //------------------------------------------------------------------------------
569 
571 {
572  SLM_TRACE_FUNC();
573  ::fwMedData::SeriesDB::sptr seriesDB = this->getConcreteObject();
574  std::vector<std::string> filenames;
575  if(::fwData::location::have < ::fwData::location::Folder, ::fwDataIO::reader::IObjectReader > (this))
576  {
577  ::vtkGdcmIO::helper::DicomSearch::searchRecursivelyFiles(this->getFolder(), filenames);
578  }
579  else if(::fwData::location::have < ::fwData::location::MultiFiles, ::fwDataIO::reader::IObjectReader > (this))
580  {
581  for(::boost::filesystem::path file : this->getFiles())
582  {
583  filenames.push_back(file.string());
584  }
585  }
586  this->addSeries( seriesDB, filenames);
587 }
588 
589 //------------------------------------------------------------------------------
590 
592 {
593  return m_job;
594 }
595 
596 } //namespace vtkGdcmIO
597 
598 
This class provide a timer (stopwatch). HiResTimer is able to measure the elapsed time with a few mic...
Definition: HiResTimer.hpp:28
ILocation::PathType getFolder()
Get folder filesystem path.
Definition: Folder.hpp:99
#define SLM_TRACE_FUNC()
Trace contextual function signature.
Definition: spyLog.hpp:329
FWCORE_API void stop()
Stop the timer. stop() will not reset the timer.
Definition: HiResTimer.cpp:32
Key class used to restrict access to Object construction. See http://www.drdobbs.com/184402053.
#define OSLM_INFO(message)
Definition: spyLog.hpp:252
#define OSLM_TRACE(message)
Definition: spyLog.hpp:230
vtkmGdcm reader/writer lib
Definition: GdcmHelper.hpp:15
std::shared_ptr< ::fwJobs::IJob > sptr
Cancel request callback type.
Definition: IJob.hpp:54
VTKGDCMIO_API ~SeriesDBLazyReader()
Does nothing.
Reads DICOM data from a directory path in order to create a SeriesDB object in lazy mode...
FWCORE_API::fwCore::HiResClock::HiResClockType getElapsedTimeInMilliSec()
Definition: HiResTimer.cpp:66
#define SLM_ERROR(message)
Definition: spyLog.hpp:272
#define SLM_FATAL(message)
Definition: spyLog.hpp:283
#define OSLM_ERROR(message)
Definition: spyLog.hpp:274
#define SLM_ASSERT(message, cond)
work like &#39;assert&#39; from &#39;cassert&#39;, with in addition a message logged by spylog (with FATAL loglevel) ...
Definition: spyLog.hpp:308
Class describing an elementary C++ type aka unsigned char, signed char, .... int, float...
Definition: Type.hpp:32
VTKGDCMIO_API SeriesDBLazyReader(::fwDataIO::reader::IObjectReader::Key key)
Does nothing.
VTKGDCMIO_API std::shared_ptr< ::fwJobs::IJob > getJob() const override
virtual std::shared_ptr< DataType > getConcreteObject()
m_object getter.
VTKGDCMIO_API void read() override
Reads DICOM data from configured path and fills SeriesDB object. Use lazy reading process to read ima...
FWCORE_API void start()
Start the timer.
Definition: HiResTimer.cpp:24
std::vector< double > SpacingType
Image spacing type.
#define SLM_TRACE(message)
Definition: spyLog.hpp:228
ILocation::VectPathType getFiles()
Get file system paths.
Definition: MultiFiles.hpp:77
Contains the representation of the data objects used in the framework.
This namespace fwJobs provides jobs management.
::fwData::Array::SizeType SizeType
Image size type.
#define SLM_WARN_IF(message, cond)
Definition: spyLog.hpp:265
std::vector< double > OriginType
Image origin type.