Medical Imaging Interaction Toolkit  2016.11.0
Medical Imaging Interaction Toolkit
mitkAutoSelectingDICOMReaderService.cpp
Go to the documentation of this file.
1 /*===================================================================
2 
3 The Medical Imaging Interaction Toolkit (MITK)
4 
5 Copyright (c) German Cancer Research Center,
6 Division of Medical and Biological Informatics.
7 All rights reserved.
8 
9 This software is distributed WITHOUT ANY WARRANTY; without
10 even the implied warranty of MERCHANTABILITY or FITNESS FOR
11 A PARTICULAR PURPOSE.
12 
13 See LICENSE.txt or http://www.mitk.org for details.
14 
15 ===================================================================*/
16 
18 
20 
21 namespace mitk {
22 
24  : BaseDICOMReaderService("MITK DICOM Reader v2 (autoselect)")
25 {
26  this->RegisterService();
27 }
28 
30 {
32 
33  selector->LoadBuiltIn3DConfigs();
34  selector->LoadBuiltIn3DnTConfigs();
35  selector->SetInputFiles(relevantFiles);
36 
37  mitk::DICOMFileReader::Pointer reader = selector->GetFirstReaderWithMinimumNumberOfOutputImages();
38  if(reader.IsNotNull())
39  {
40  //reset tag cache to ensure that additional tags of interest
41  //will be regarded by the reader if set later on.
42  reader->SetTagCache(nullptr);
43  }
44 
45  return reader;
46 };
47 
48 AutoSelectingDICOMReaderService* AutoSelectingDICOMReaderService::Clone() const
49 {
50  return new AutoSelectingDICOMReaderService(*this);
51 }
52 
53 }
itk::SmartPointer< Self > Pointer
DataCollection - Class to facilitate loading/accessing structured data.
us::ServiceRegistration< IFileReader > RegisterService(us::ModuleContext *context=us::GetModuleContext())
std::vector< std::string > StringList
virtual mitk::DICOMFileReader::Pointer GetReader(const mitk::StringList &relevantFiles) const override
static itkEventMacro(BoundingShapeInteractionEvent, itk::AnyEvent) class MITKBOUNDINGSHAPE_EXPORT BoundingShapeInteractor Pointer New()
Basic interaction methods for mitk::GeometryData.