Medical Imaging Interaction Toolkit  2016.11.0
Medical Imaging Interaction Toolkit
mitk::CollectionReader Class Reference

#include <mitkCollectionReader.h>

Inheritance diagram for mitk::CollectionReader:
Collaboration diagram for mitk::CollectionReader:

Public Types

typedef std::vector< std::vector< std::string > > FileListType
 

Public Member Functions

DataCollection::Pointer LoadCollection (const std::string &xmlFileName)
 Build up a mitk::DataCollection from a XML resource. More...
 
void AddDataElementIds (std::vector< std::string > dataElemetIds)
 
void AddSubColIds (std::vector< std::string > subColIds)
 
void SetDataItemNames (std::vector< std::string > itemNames)
 
void ClearDataElementIds ()
 
void ClearSubColIds ()
 
void Clear ()
 
 CollectionReader ()
 
 ~CollectionReader ()
 

Static Public Member Functions

static DataCollection::Pointer FolderToCollection (std::string folder, std::vector< std::string > suffixes, std::vector< std::string > seriesNames, bool allowGaps)
 Build up a mitk::DataCollection from a folder providing suffixes to group the files. More...
 
static FileListType GenerateFileLists (std::string folder, std::vector< std::string > suffixes, bool allowGaps=false)
 GenerateFileLists Returns a collection of lists with valid files names in a folder. More...
 
static FileListType SanitizeFileList (FileListType list)
 SanitizeFileList Removes all entries that are lacking at least one modality. More...
 

Protected Member Functions

void StartElement (const char *elementName, const char **atts)
 Derived from XMLReader. More...
 
void EndElement (const char *elementName)
 Derived from XMLReader. More...
 

Detailed Description

Definition at line 28 of file mitkCollectionReader.h.

Member Typedef Documentation

typedef std::vector<std::vector<std::string> > mitk::CollectionReader::FileListType

Definition at line 32 of file mitkCollectionReader.h.

Constructor & Destructor Documentation

mitk::CollectionReader::CollectionReader ( )

Definition at line 57 of file mitkCollectionReader.cpp.

mitk::CollectionReader::~CollectionReader ( )

Definition at line 65 of file mitkCollectionReader.cpp.

Member Function Documentation

void mitk::CollectionReader::AddDataElementIds ( std::vector< std::string >  dataElemetIds)

Definition at line 85 of file mitkCollectionReader.cpp.

Referenced by main().

void mitk::CollectionReader::AddSubColIds ( std::vector< std::string >  subColIds)

Definition at line 90 of file mitkCollectionReader.cpp.

Referenced by main().

void mitk::CollectionReader::Clear ( )

Definition at line 110 of file mitkCollectionReader.cpp.

void mitk::CollectionReader::ClearDataElementIds ( )

Definition at line 100 of file mitkCollectionReader.cpp.

Referenced by main().

void mitk::CollectionReader::ClearSubColIds ( )

Definition at line 105 of file mitkCollectionReader.cpp.

Referenced by main().

void mitk::CollectionReader::EndElement ( const char *  elementName)
protected

Derived from XMLReader.

Definition at line 244 of file mitkCollectionReader.cpp.

References DATA, mitk::New(), and SUBCOLLECTION.

mitk::DataCollection::Pointer mitk::CollectionReader::FolderToCollection ( std::string  folder,
std::vector< std::string >  suffixes,
std::vector< std::string >  seriesNames,
bool  allowGaps 
)
static

Build up a mitk::DataCollection from a folder providing suffixes to group the files.

Definition at line 117 of file mitkCollectionReader.cpp.

References GetDate(), GetName(), mitk::BaseDataIO::LoadBaseDataFromFile(), mitk::IOUtil::LoadImage(), MITK_INFO, and mitk::New().

mitk::CollectionReader::FileListType mitk::CollectionReader::GenerateFileLists ( std::string  folder,
std::vector< std::string >  suffixes,
bool  allowGaps = false 
)
static

GenerateFileLists Returns a collection of lists with valid files names in a folder.

The first suffix entry in the vector is used for the reference images which are put in the first list, then the suffixes are interchanged and checked if the file exists; for each suffix a list is returned with filenames, if a file is expected but does not exist an empty string "" is added instead.

Parameters
folder
suffixes
allowGaps
Returns

Definition at line 308 of file mitkCollectionReader.cpp.

References MITK_ERROR.

Referenced by mitk::CollectionWriter::FolderToXml(), and mitk::CollectionWriter::SingleFolderToXml().

mitk::DataCollection::Pointer mitk::CollectionReader::LoadCollection ( const std::string &  xmlFileName)

Build up a mitk::DataCollection from a XML resource.

Loads the xml file filename and generates the necessary instances.

Definition at line 74 of file mitkCollectionReader.cpp.

Referenced by main().

mitk::CollectionReader::FileListType mitk::CollectionReader::SanitizeFileList ( FileListType  list)
static

SanitizeFileList Removes all entries that are lacking at least one modality.

Parameters
list- sanitized list
Returns

Definition at line 389 of file mitkCollectionReader.cpp.

References MITK_ERROR, and MITK_INFO.

Referenced by mitk::CollectionWriter::FolderToXml(), and mitk::CollectionWriter::SingleFolderToXml().

void mitk::CollectionReader::SetDataItemNames ( std::vector< std::string >  itemNames)

Definition at line 95 of file mitkCollectionReader.cpp.

Referenced by main().

void mitk::CollectionReader::StartElement ( const char *  elementName,
const char **  atts 
)
protected

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