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

Factory, which creates instances of mitk::DataNodes filled with data read from a given file. More...

#include <mitkDataNodeFactory.h>

Inheritance diagram for mitk::DataNodeFactory:
Collaboration diagram for mitk::DataNodeFactory:

Public Member Functions

 mitkClassMacro (DataNodeFactory, DataNodeSource)
 
Pointer Clone () const
 
virtual void SetFileName (const char *_arg)
 
virtual const char * GetFileName () const
 
virtual void SetFilePrefix (const char *_arg)
 Set prefix for multiple load. More...
 
virtual const char * GetFilePrefix () const
 Get prefix for multiple load. More...
 
virtual void SetFilePattern (const char *_arg)
 Set pattern for multiple load. More...
 
virtual const char * GetFilePattern () const
 Get pattern for multiple load. More...
 
void SetDefaultCommonProperties (mitk::DataNode::Pointer &node)
 
void SetImageSerie (bool serie)
 
void AddSeriesRestriction (const std::string &tag)
 
- Public Member Functions inherited from mitk::DataNodeSource
virtual std::vector< std::string > GetClassHierarchy () const
 
virtual const char * GetClassName () const
 
Pointer Clone () const
 
virtual DataObjectPointer MakeOutput (DataObjectPointerArraySizeType idx) override
 
virtual DataObjectPointer MakeOutput (const DataObjectIdentifierType &name) override
 
OutputTypeGetOutput ()
 
const OutputTypeGetOutput () const
 
OutputTypeGetOutput (DataObjectPointerArraySizeType idx)
 
const OutputTypeGetOutput (DataObjectPointerArraySizeType idx) const
 
- Public Member Functions inherited from mitk::FileSeriesReader
virtual mitkClassMacro(FileSeriesReader, FileReader) typedef std MatchedFileNames GetMatchedFileNames ()
 
- Public Member Functions inherited from mitk::FileReader
virtual std::vector< std::string > GetClassHierarchy () const
 
 itkTypeMacroNoParent (FileReader) virtual const char *GetFileName() const =0
 Get the specified the file to load. More...
 
virtual bool CanReadFromMemory ()
 Specifies, whether the file reader also can read a file from a memory buffer. More...
 
virtual void SetReadFromMemory (bool read)
 Set/Get functions to advise the file reader to use a memory array for reading a file. More...
 
virtual bool GetReadFromMemory ()
 
virtual void SetMemoryBuffer (const char *dataArray, unsigned int size)
 To be used along with a call of SetReadFromMemory(true). This sets the memory buffer and the size from which the reader will read. More...
 

Static Public Member Functions

static Pointer New ()
 
static ColorProperty::Pointer DefaultColorForOrgan (const std::string &)
 
- Static Public Member Functions inherited from mitk::DataNodeSource
static const char * GetStaticNameOfClass ()
 
static Pointer New ()
 
- Static Public Member Functions inherited from mitk::FileReader
static const char * GetStaticNameOfClass ()
 

Static Public Attributes

static bool m_TextureInterpolationActive
 

Protected Member Functions

 DataNodeFactory ()
 
virtual ~DataNodeFactory ()
 
virtual void GenerateData () override
 
virtual void ResizeOutputs (const unsigned int &num)
 
virtual bool FileNameEndsWith (const std::string &name)
 
virtual bool FilePatternEndsWith (const std::string &name)
 
virtual std::string GetBaseFileName ()
 
virtual std::string GetBaseFilePrefix ()
 
virtual std::string GetDirectory ()
 
virtual void ReadFileSeriesTypeDCM ()
 
virtual void ReadFileSeriesTypeITKImageSeriesReader ()
 
- Protected Member Functions inherited from mitk::DataNodeSource
 DataNodeSource ()
 
virtual ~DataNodeSource ()
 
- Protected Member Functions inherited from mitk::FileSeriesReader
 FileSeriesReader ()
 
virtual ~FileSeriesReader ()
 
virtual bool GenerateFileList ()
 
- Protected Member Functions inherited from mitk::FileReader
 FileReader ()
 
virtual ~FileReader ()
 

Protected Attributes

bool m_Serie
 
std::vector< std::string > m_SeriesRestrictions
 
int m_OldProgress
 
- Protected Attributes inherited from mitk::FileSeriesReader
std::string m_FileName
 
std::string m_FilePrefix
 
std::string m_FilePattern
 
MatchedFileNames m_MatchedFileNames
 
- Protected Attributes inherited from mitk::FileReader
bool m_CanReadFromMemory
 
bool m_ReadFromMemory
 
const char * m_MemoryBuffer
 
unsigned int m_MemorySize
 

Additional Inherited Members

- Public Types inherited from mitk::DataNodeSource
typedef DataNodeSource Self
 
typedef itk::ProcessObject Superclass
 
typedef itk::SmartPointer< SelfPointer
 
typedef itk::SmartPointer< const SelfConstPointer
 
typedef mitk::DataNode OutputType
 
typedef OutputType::Pointer OutputTypePointer
 
- Public Types inherited from mitk::FileReader
typedef FileReader Self
 
typedef itk::SmartPointer< SelfPointer
 
typedef itk::SmartPointer< const SelfConstPointer
 

Detailed Description

Factory, which creates instances of mitk::DataNodes filled with data read from a given file.

This class reads files, creates an appropriate mitk::BaseData and adds the BaseData to a mitk::DataNode. This filter may produce one or more outputs (i.e. mitk::DataNodes). The number of generated nodes can be retrieved by a call of GetNumberOfOutputs().

If you want to add a new file type, you have to register the factory of the file reader in the class mitk::BaseDataIOFactory.

Deprecated:
(as of 2014_10) Use mitk::IOUtils or mitk::FileReaderRegistry instead.

Definition at line 43 of file mitkDataNodeFactory.h.

Constructor & Destructor Documentation

mitk::DataNodeFactory::DataNodeFactory ( )
protected

Constructor.

Definition at line 104 of file mitkDataNodeFactory.cpp.

References mitk::CoreObjectFactory::GetInstance(), m_OldProgress, and m_Serie.

mitk::DataNodeFactory::~DataNodeFactory ( )
protectedvirtual

Virtual destructor.

Definition at line 113 of file mitkDataNodeFactory.cpp.

Member Function Documentation

void mitk::DataNodeFactory::AddSeriesRestriction ( const std::string &  tag)
inline

Definition at line 94 of file mitkDataNodeFactory.h.

Pointer mitk::DataNodeFactory::Clone ( ) const
mitk::ColorProperty::Pointer mitk::DataNodeFactory::DefaultColorForOrgan ( const std::string &  organ)
static

Nice default colors for segmentations of some "normal" organs.

Definition at line 372 of file mitkDataNodeFactory.cpp.

References mitk::ColorProperty::New().

bool mitk::DataNodeFactory::FileNameEndsWith ( const std::string &  name)
protectedvirtual

Checks if the file name m_FileName ends with the given name. Currently, this check is done by a dumb search for name in the filename.

Parameters
namethe extension of the file
Returns
true, if the filename contains name.

Definition at line 204 of file mitkDataNodeFactory.cpp.

bool mitk::DataNodeFactory::FilePatternEndsWith ( const std::string &  name)
protectedvirtual

Checks if the file pattern m_FilePattern ends with the given name. Currently, this check is done by a dumb search for name in the filename.

Parameters
namethe extension of the file
Returns
true, if the filepattern contains name.

Definition at line 212 of file mitkDataNodeFactory.cpp.

void mitk::DataNodeFactory::GenerateData ( )
overrideprotectedvirtual

Determines of which file type a given file is and calls the appropriate reader function.

Definition at line 122 of file mitkDataNodeFactory.cpp.

References mitk::DicomSeriesReader::IsDicom(), mitk::BaseDataIO::LoadBaseDataFromFile(), MITK_ERROR, and mitk::DataNode::New().

std::string mitk::DataNodeFactory::GetBaseFileName ( )
protectedvirtual
Returns
the plain filename, that is, without any directory.

Definition at line 217 of file mitkDataNodeFactory.cpp.

std::string mitk::DataNodeFactory::GetBaseFilePrefix ( )
protectedvirtual
Returns
the plain file prefix, that is, without any directory.

Definition at line 222 of file mitkDataNodeFactory.cpp.

std::string mitk::DataNodeFactory::GetDirectory ( )
protectedvirtual
Returns
the directory of the file name m_FileName.

Definition at line 227 of file mitkDataNodeFactory.cpp.

virtual const char* mitk::DataNodeFactory::GetFileName ( ) const
virtual
Returns
the name of the file to be read from disk.
virtual const char* mitk::DataNodeFactory::GetFilePattern ( ) const
virtual

Get pattern for multiple load.

Implements mitk::FileReader.

virtual const char* mitk::DataNodeFactory::GetFilePrefix ( ) const
virtual

Get prefix for multiple load.

Implements mitk::FileReader.

mitk::DataNodeFactory::mitkClassMacro ( DataNodeFactory  ,
DataNodeSource   
)
static Pointer mitk::DataNodeFactory::New ( )
static
void mitk::DataNodeFactory::ReadFileSeriesTypeITKImageSeriesReader ( )
protectedvirtual
void mitk::DataNodeFactory::ResizeOutputs ( const unsigned int &  num)
protectedvirtual

Resizes the number of outputs of the factory. The outputs are initialized by empty DataNodes

Parameters
numthe new number of outputs

Definition at line 194 of file mitkDataNodeFactory.cpp.

void mitk::DataNodeFactory::SetDefaultCommonProperties ( mitk::DataNode::Pointer node)
virtual void mitk::DataNodeFactory::SetFileName ( const char *  _arg)
virtual

Sets the filename of the file to read.

Parameters
FileNamethe name of the file to read.

Implements mitk::FileReader.

virtual void mitk::DataNodeFactory::SetFilePattern ( const char *  _arg)
virtual

Set pattern for multiple load.

Implements mitk::FileReader.

virtual void mitk::DataNodeFactory::SetFilePrefix ( const char *  _arg)
virtual

Set prefix for multiple load.

Implements mitk::FileReader.

void mitk::DataNodeFactory::SetImageSerie ( bool  serie)

if true -> loaded image is part of a serie

Definition at line 117 of file mitkDataNodeFactory.cpp.

Member Data Documentation

int mitk::DataNodeFactory::m_OldProgress
protected

Definition at line 171 of file mitkDataNodeFactory.h.

Referenced by DataNodeFactory().

bool mitk::DataNodeFactory::m_Serie
protected

Definition at line 108 of file mitkDataNodeFactory.h.

Referenced by DataNodeFactory().

std::vector<std::string> mitk::DataNodeFactory::m_SeriesRestrictions
protected

Definition at line 170 of file mitkDataNodeFactory.h.

bool mitk::DataNodeFactory::m_TextureInterpolationActive
static

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