Medical Imaging Interaction Toolkit  2018.4.99-3e3f1a6e
Medical Imaging Interaction Toolkit
mitk::DICOMFileReaderSelector Class Reference

Simple best-reader selection. More...

#include <mitkDICOMFileReaderSelector.h>

Inheritance diagram for mitk::DICOMFileReaderSelector:
Collaboration diagram for mitk::DICOMFileReaderSelector:

Public Types

typedef std::list< DICOMFileReader::Pointer > ReaderList
 

Public Member Functions

 mitkClassMacroItkParent (DICOMFileReaderSelector, itk::LightObject)
 
void AddConfig (const std::string &xmlDescription)
 Add a configuration as expected by DICOMReaderConfigurator. Configs can only be reset by instantiating a new DICOMFileReaderSelector. More...
 
void AddConfigFile (const std::string &filename)
 Add a configuration as expected by DICOMReaderConfigurator. Configs can only be reset by instantiating a new DICOMFileReaderSelector. More...
 
void AddFileReaderCanditate (DICOMFileReader::Pointer reader)
 Add a whole pre-configured reader to the selection process. More...
 
void LoadBuiltIn3DConfigs ()
 Load 3D image creating configurations from the MITK module system (see us::Module::FindResources()). For a default set of configurations, look into the directory Resources of the DICOMReader module. More...
 
void LoadBuiltIn3DnTConfigs ()
 Load 3D+t image creating configurations from the MITK module system (see us::Module::FindResources()). For a default set of configurations, look into the directory Resources of the DICOMReader module. More...
 
ReaderList GetAllConfiguredReaders () const
 Return all the DICOMFileReaders that are currently used for selection by this class. The readers returned by this method depend on what config files have been added earlier (or which of the built-in readers have been loaded) More...
 
void SetInputFiles (StringList filenames)
 Input files. More...
 
const StringListGetInputFiles () const
 Input files. More...
 
DICOMFileReader::Pointer GetFirstReaderWithMinimumNumberOfOutputImages ()
 Execute the analysis and selection process. The first reader with a minimal number of outputs will be returned. More...
 

Static Public Member Functions

static Pointer New ()
 

Protected Member Functions

 DICOMFileReaderSelector ()
 
 ~DICOMFileReaderSelector () override
 
void AddConfigsFromResources (const std::string &path)
 
void AddConfigFromResource (const std::string &resourcename)
 
void AddConfigFromResource (us::ModuleResource &resource)
 

Detailed Description

Simple best-reader selection.

This class implements a process of comparing different DICOMFileReaders and selecting the reader with the minimal number of mitk::Images in its output.

The code found in this class can

  • just be used to select a reader using this simple strategy
  • be taken as an example of how to use DICOMFileReaders

To create a selection of potential readers, the class makes use of mitk::DICOMReaderConfigurator, i.e. DICOMFileReaderSelector also expects the configuration files/strings to be in the format expected by mitk::DICOMReaderConfigurator.

Two convenience methods load "default" configurations from compiled-in resources: LoadBuiltIn3DConfigs() and LoadBuiltIn3DnTConfigs().

Definition at line 42 of file mitkDICOMFileReaderSelector.h.

Member Typedef Documentation

◆ ReaderList

typedef std::list<DICOMFileReader::Pointer> mitk::DICOMFileReaderSelector::ReaderList

Definition at line 46 of file mitkDICOMFileReaderSelector.h.

Constructor & Destructor Documentation

◆ DICOMFileReaderSelector()

mitk::DICOMFileReaderSelector::DICOMFileReaderSelector ( )
protected

Definition at line 24 of file mitkDICOMFileReaderSelector.cpp.

References ~DICOMFileReaderSelector().

◆ ~DICOMFileReaderSelector()

mitk::DICOMFileReaderSelector::~DICOMFileReaderSelector ( )
overrideprotected

Definition at line 29 of file mitkDICOMFileReaderSelector.cpp.

References GetAllConfiguredReaders().

Referenced by DICOMFileReaderSelector().

Member Function Documentation

◆ AddConfig()

void mitk::DICOMFileReaderSelector::AddConfig ( const std::string &  xmlDescription)

Add a configuration as expected by DICOMReaderConfigurator. Configs can only be reset by instantiating a new DICOMFileReaderSelector.

Definition at line 132 of file mitkDICOMFileReaderSelector.cpp.

References AddConfigFile().

Referenced by LoadBuiltIn3DnTConfigs().

◆ AddConfigFile()

void mitk::DICOMFileReaderSelector::AddConfigFile ( const std::string &  filename)

Add a configuration as expected by DICOMReaderConfigurator. Configs can only be reset by instantiating a new DICOMFileReaderSelector.

Definition at line 152 of file mitkDICOMFileReaderSelector.cpp.

References SetInputFiles().

Referenced by AddConfig().

◆ AddConfigFromResource() [1/2]

void mitk::DICOMFileReaderSelector::AddConfigFromResource ( const std::string &  resourcename)
protected

◆ AddConfigFromResource() [2/2]

void mitk::DICOMFileReaderSelector::AddConfigFromResource ( us::ModuleResource resource)
protected

◆ AddConfigsFromResources()

void mitk::DICOMFileReaderSelector::AddConfigsFromResources ( const std::string &  path)
protected

◆ AddFileReaderCanditate()

void mitk::DICOMFileReaderSelector::AddFileReaderCanditate ( DICOMFileReader::Pointer  reader)

Add a whole pre-configured reader to the selection process.

Definition at line 101 of file mitkDICOMFileReaderSelector.cpp.

References LoadBuiltIn3DConfigs().

Referenced by AddConfigFromResource().

◆ GetAllConfiguredReaders()

std::list< mitk::DICOMFileReader::Pointer > mitk::DICOMFileReaderSelector::GetAllConfiguredReaders ( ) const

Return all the DICOMFileReaders that are currently used for selection by this class. The readers returned by this method depend on what config files have been added earlier (or which of the built-in readers have been loaded)

Definition at line 35 of file mitkDICOMFileReaderSelector.cpp.

References AddConfigsFromResources().

Referenced by ~DICOMFileReaderSelector().

◆ GetFirstReaderWithMinimumNumberOfOutputImages()

mitk::DICOMFileReader::Pointer mitk::DICOMFileReaderSelector::GetFirstReaderWithMinimumNumberOfOutputImages ( )

Execute the analysis and selection process. The first reader with a minimal number of outputs will be returned.

Definition at line 183 of file mitkDICOMFileReaderSelector.cpp.

References max(), MITK_DEBUG, MITK_ERROR, and MITK_INFO.

Referenced by GetInputFiles().

◆ GetInputFiles()

const mitk::StringList & mitk::DICOMFileReaderSelector::GetInputFiles ( ) const

Input files.

Definition at line 176 of file mitkDICOMFileReaderSelector.cpp.

References GetFirstReaderWithMinimumNumberOfOutputImages().

Referenced by SetInputFiles().

◆ LoadBuiltIn3DConfigs()

void mitk::DICOMFileReaderSelector::LoadBuiltIn3DConfigs ( )

Load 3D image creating configurations from the MITK module system (see us::Module::FindResources()). For a default set of configurations, look into the directory Resources of the DICOMReader module.

Definition at line 111 of file mitkDICOMFileReaderSelector.cpp.

References LoadBuiltIn3DnTConfigs().

Referenced by AddFileReaderCanditate().

◆ LoadBuiltIn3DnTConfigs()

void mitk::DICOMFileReaderSelector::LoadBuiltIn3DnTConfigs ( )

Load 3D+t image creating configurations from the MITK module system (see us::Module::FindResources()). For a default set of configurations, look into the directory Resources of the DICOMReader module.

Definition at line 125 of file mitkDICOMFileReaderSelector.cpp.

References AddConfig().

Referenced by LoadBuiltIn3DConfigs().

◆ mitkClassMacroItkParent()

mitk::DICOMFileReaderSelector::mitkClassMacroItkParent ( DICOMFileReaderSelector  ,
itk::LightObject   
)

◆ New()

◆ SetInputFiles()

void mitk::DICOMFileReaderSelector::SetInputFiles ( StringList  filenames)

Input files.

Definition at line 169 of file mitkDICOMFileReaderSelector.cpp.

References GetInputFiles().

Referenced by AddConfigFile().


The documentation for this class was generated from the following files: