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

This filter is subclass of the spectral unmixing filter base. All algorithms in this class are based on the Eigen open source c++ library. It takes a multispectral pixel as input and returns a vector with the unmixing result. More...

#include <mitkPALinearSpectralUnmixingFilter.h>

Inheritance diagram for mitk::pa::LinearSpectralUnmixingFilter:
Collaboration diagram for mitk::pa::LinearSpectralUnmixingFilter:

Public Types

enum  AlgortihmType {
  HOUSEHOLDERQR, LDLT, LLT, COLPIVHOUSEHOLDERQR,
  JACOBISVD, FULLPIVLU, FULLPIVHOUSEHOLDERQR
}
 Contains all implemented Eigen algorithms for spectral unmixing. For detailed information of the algorithms look at the mitkPALinearSpectralUnmixingFilter.h documentation (section Algorithms). More...
 
- Public Types inherited from mitk::ImageToImageFilter
typedef ImageToImageFilter Self
 
typedef ImageSource Superclass
 
typedef itk::SmartPointer< SelfPointer
 
typedef itk::SmartPointer< const SelfConstPointer
 
typedef Superclass::OutputImageRegionType OutputImageRegionType
 
typedef mitk::Image InputImageType
 
typedef InputImageType::Pointer InputImagePointer
 
typedef InputImageType::ConstPointer InputImageConstPointer
 
typedef SlicedData::RegionType InputImageRegionType
 
- Public Types inherited from mitk::ImageSource
typedef ImageSource Self
 
typedef BaseDataSource Superclass
 
typedef itk::SmartPointer< SelfPointer
 
typedef itk::SmartPointer< const SelfConstPointer
 
typedef mitk::Image OutputImageType
 Some convenient typedefs. More...
 
typedef OutputImageType OutputType
 
typedef OutputImageType::Pointer OutputImagePointer
 
typedef SlicedData::RegionType OutputImageRegionType
 
- Public Types inherited from mitk::BaseDataSource
typedef BaseDataSource Self
 
typedef itk::ProcessObject Superclass
 
typedef itk::SmartPointer< SelfPointer
 
typedef itk::SmartPointer< const SelfConstPointer
 
typedef BaseData OutputType
 
typedef itk::DataObject::DataObjectIdentifierType DataObjectIdentifierType
 

Public Member Functions

 mitkClassMacro (LinearSpectralUnmixingFilter, SpectralUnmixingFilterBase)
 
void SetAlgorithm (AlgortihmType inputAlgorithmName)
 Takes a mitk::pa::LinearSpectralUnmixingFilter::AlgortihmType and fix it for usage at the "SpectralUnmixingAlgorithm" method. More...
 
- Public Member Functions inherited from mitk::pa::SpectralUnmixingFilterBase
 mitkClassMacro (SpectralUnmixingFilterBase, mitk::ImageToImageFilter)
 
void AddChromophore (mitk::pa::PropertyCalculator::ChromophoreType chromophore)
 AddChromophore takes mitk::pa::PropertyCalculator::ChromophoreType and writes them at the end of the m_Chromophore vector. The call of the method sets the order of the GetOutput method! More...
 
void AddWavelength (int wavelength)
 AddWavelength takes integers and writes them at the end of the m_Wavelength vector. The first call of the method then corresponds to the first input image and so on. More...
 
virtual void Verbose (bool verbose)
 
virtual void AddOutputs (unsigned int outputs)
 AddOutputs takes an integer and sets indexed outputs. More...
 
virtual void RelativeError (bool relativeError)
 
virtual void AddRelativeErrorSettings (int value)
 AddRelativeErrorSettings takes integers and writes them at the end of the m_RelativeErrorSettings vector. More...
 
- Public Member Functions inherited from mitk::ImageToImageFilter
virtual std::vector< std::string > GetClassHierarchy () const override
 
virtual const char * GetClassName () const
 
Pointer Clone () const
 
virtual void SetInput (const InputImageType *image)
 
virtual void SetInput (unsigned int, const InputImageType *image)
 
InputImageTypeGetInput (void)
 
InputImageTypeGetInput (unsigned int idx)
 
const InputImageTypeGetInput (void) const
 
const InputImageTypeGetInput (unsigned int idx) const
 
- Public Member Functions inherited from mitk::ImageSource
Pointer Clone () const
 
OutputTypeGetOutput ()
 Get the output data of this image source object. More...
 
const OutputTypeGetOutput () const
 
OutputTypeGetOutput (DataObjectPointerArraySizeType idx)
 
const OutputTypeGetOutput (DataObjectPointerArraySizeType idx) const
 
itk::DataObject::Pointer MakeOutput (DataObjectPointerArraySizeType idx) override
 Make a DataObject of the correct type to used as the specified output. More...
 
itk::DataObject::Pointer MakeOutput (const DataObjectIdentifierType &name) override
 
virtual vtkImageData * GetVtkImageData ()
 
virtual const vtkImageData * GetVtkImageData () const
 
- Public Member Functions inherited from mitk::BaseDataSource
OutputTypeGetOutput ()
 
const OutputTypeGetOutput () const
 
OutputTypeGetOutput (DataObjectPointerArraySizeType idx)
 
const OutputTypeGetOutput (DataObjectPointerArraySizeType idx) const
 
virtual void GraftOutput (OutputType *output)
 Graft the specified BaseData onto this BaseDataSource's output. More...
 
virtual void GraftOutput (const DataObjectIdentifierType &key, OutputType *output)
 
virtual void GraftNthOutput (unsigned int idx, OutputType *output)
 Graft the specified base data object onto this BaseDataSource's idx'th output. More...
 
bool Updating () const
 Access itk::ProcessObject::m_Updating. More...
 

Static Public Member Functions

static Pointer New ()
 
- Static Public Member Functions inherited from mitk::ImageToImageFilter
static const char * GetStaticNameOfClass ()
 
static Pointer New ()
 
- Static Public Member Functions inherited from mitk::ImageSource
static const char * GetStaticNameOfClass ()
 
static Pointer New ()
 Method for creation through the object factory. More...
 
- Static Public Member Functions inherited from mitk::BaseDataSource
static const char * GetStaticNameOfClass ()
 

Protected Member Functions

 LinearSpectralUnmixingFilter ()
 
 ~LinearSpectralUnmixingFilter () override
 
Eigen::VectorXf SpectralUnmixingAlgorithm (Eigen::Matrix< float, Eigen::Dynamic, Eigen::Dynamic > endmemberMatrix, Eigen::VectorXf inputVector) override
 overrides the baseclass method with a mehtod to calculate the spectral unmixing result vector. Herain the class performs the algorithm set by the "SetAlgorithm" method and writes the result into a Eigen vector which is the return value. More...
 
- Protected Member Functions inherited from mitk::pa::SpectralUnmixingFilterBase
 SpectralUnmixingFilterBase ()
 Constructor creats proptery calculater smart pointer new() More...
 
 ~SpectralUnmixingFilterBase () override
 
- Protected Member Functions inherited from mitk::ImageToImageFilter
 ImageToImageFilter ()
 
 ~ImageToImageFilter () override
 
void PrintSelf (std::ostream &os, itk::Indent indent) const override
 
void GenerateInputRequestedRegion () override
 
- Protected Member Functions inherited from mitk::ImageSource
 ImageSource ()
 
 ~ImageSource () override
 
void GenerateData () override
 A version of GenerateData() specific for image processing filters. More...
 
virtual void ThreadedGenerateData (const OutputImageRegionType &outputRegionForThread, itk::ThreadIdType threadId)
 If an imaging filter can be implemented as a multithreaded algorithm, the filter will provide an implementation of ThreadedGenerateData(). More...
 
void PrepareOutputs () override
 This method is intentionally left blank. More...
 
virtual void AllocateOutputs ()
 The GenerateData method normally allocates the buffers for all of the outputs of a filter. More...
 
virtual void BeforeThreadedGenerateData ()
 If an imaging filter needs to perform processing after the buffer has been allocated but before threads are spawned, the filter can can provide an implementation for BeforeThreadedGenerateData(). More...
 
virtual void AfterThreadedGenerateData ()
 If an imaging filter needs to perform processing after all processing threads have completed, the filter can can provide an implementation for AfterThreadedGenerateData(). More...
 
virtual unsigned int SplitRequestedRegion (unsigned int i, unsigned int num, OutputImageRegionType &splitRegion)
 Split the output's RequestedRegion into "num" pieces, returning region "i" as "splitRegion". More...
 
- Protected Member Functions inherited from mitk::BaseDataSource
 BaseDataSource ()
 
 ~BaseDataSource () override
 

Additional Inherited Members

- Public Attributes inherited from mitk::pa::SpectralUnmixingFilterBase
ofstream myfile
 
- Static Protected Member Functions inherited from mitk::ImageSource
static ITK_THREAD_RETURN_TYPE ThreaderCallback (void *arg)
 Static function used as a "callback" by the MultiThreader. More...
 
- Static Protected Member Functions inherited from mitk::BaseDataSource
static Pointer New ()
 
- Protected Attributes inherited from mitk::pa::SpectralUnmixingFilterBase
bool m_Verbose
 
bool m_RelativeError
 
std::vector< mitk::pa::PropertyCalculator::ChromophoreTypem_Chromophore
 
std::vector< int > m_Wavelength
 
std::vector< int > m_RelativeErrorSettings
 

Detailed Description

This filter is subclass of the spectral unmixing filter base. All algorithms in this class are based on the Eigen open source c++ library. It takes a multispectral pixel as input and returns a vector with the unmixing result.

Input:

  • endmemberMatrix Eigen Matrix with number of chromophores colums and number of wavelengths rows so matrix element (i,j) contains the absorbtion of chromophore j @ wavelength i taken from the database by PropertyElement method.
  • inputVector Eigen Vector containing values of one pixel of XY-plane image with number of wavelength rows (z-dimension of a sequenece) so the pixelvalue of the first wavelength is stored in inputVector[0] and so on.

Output:

  • Eigen vector with unmixing result of one multispectral pixel. The ith element of the vector corresponds to the ith entry of the m_Chromophore vector.

Algorithms (see AlgortihmType enum):

  • HOUSEHOLDERQR computes the solution by QR decomposition
  • COLPIVHOUSEHOLDERQR computes the solution by QR decomposition
  • FULLPIVHOUSEHOLDERQR computes the solution by QR decomposition
  • LDLT computes the solution by Cholesky decomposition
  • LLT computes the solution by Cholesky decomposition
  • JACOBISVD computes the solution by singular value decomposition uses least square solver

Possible exceptions:

  • "algorithm not working": doesn't work now (2018/06/19)
  • "404 VIGRA ALGORITHM NOT FOUND": Algorithm not implemented

Definition at line 49 of file mitkPALinearSpectralUnmixingFilter.h.

Member Enumeration Documentation

◆ AlgortihmType

Contains all implemented Eigen algorithms for spectral unmixing. For detailed information of the algorithms look at the mitkPALinearSpectralUnmixingFilter.h documentation (section Algorithms).

Enumerator
HOUSEHOLDERQR 
LDLT 
LLT 
COLPIVHOUSEHOLDERQR 
JACOBISVD 
FULLPIVLU 
FULLPIVHOUSEHOLDERQR 

Definition at line 61 of file mitkPALinearSpectralUnmixingFilter.h.

Constructor & Destructor Documentation

◆ LinearSpectralUnmixingFilter()

mitk::pa::LinearSpectralUnmixingFilter::LinearSpectralUnmixingFilter ( )
protected

Definition at line 22 of file mitkPALinearSpectralUnmixingFilter.cpp.

◆ ~LinearSpectralUnmixingFilter()

mitk::pa::LinearSpectralUnmixingFilter::~LinearSpectralUnmixingFilter ( )
overrideprotected

Definition at line 26 of file mitkPALinearSpectralUnmixingFilter.cpp.

Member Function Documentation

◆ mitkClassMacro()

mitk::pa::LinearSpectralUnmixingFilter::mitkClassMacro ( LinearSpectralUnmixingFilter  ,
SpectralUnmixingFilterBase   
)

◆ New()

static Pointer mitk::pa::LinearSpectralUnmixingFilter::New ( )
static

Referenced by GetFilterInstance().

◆ SetAlgorithm()

void mitk::pa::LinearSpectralUnmixingFilter::SetAlgorithm ( AlgortihmType  inputAlgorithmName)

Takes a mitk::pa::LinearSpectralUnmixingFilter::AlgortihmType and fix it for usage at the "SpectralUnmixingAlgorithm" method.

Parameters
algorithmNamehas to be a mitk::pa::LinearSpectralUnmixingFilter::AlgortihmType

Definition at line 30 of file mitkPALinearSpectralUnmixingFilter.cpp.

◆ SpectralUnmixingAlgorithm()

Eigen::VectorXf mitk::pa::LinearSpectralUnmixingFilter::SpectralUnmixingAlgorithm ( Eigen::Matrix< float, Eigen::Dynamic, Eigen::Dynamic >  endmemberMatrix,
Eigen::VectorXf  inputVector 
)
overrideprotectedvirtual

overrides the baseclass method with a mehtod to calculate the spectral unmixing result vector. Herain the class performs the algorithm set by the "SetAlgorithm" method and writes the result into a Eigen vector which is the return value.

Parameters
endmemberMatrixMatrix with number of chromophores colums and number of wavelengths rows so matrix element (i,j) contains the absorbtion of chromophore j @ wavelength i taken from the database by PropertyElement method.
inputVectorVector containing values of one pixel of XY-plane image with number of wavelength rows (z-dimension of a sequenece) so the pixelvalue of the first wavelength is stored in inputVector[0] and so on.
Exceptions
ifthe algorithmName is not a member of the enum VigraAlgortihmType
ifone chooses the ldlt/llt solver which doens't work yet

Implements mitk::pa::SpectralUnmixingFilterBase.

Definition at line 35 of file mitkPALinearSpectralUnmixingFilter.cpp.

References mitkThrow.


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