Medical Imaging Interaction Toolkit  2018.4.99-3e3f1a6e
Medical Imaging Interaction Toolkit
mitk::pa::SpectralUnmixingFilterBase Class Referenceabstract

The spectral unmixing filter base is designed as superclass for several spectral unmixing filter eg. Eigen- or Vigrabased ones. One can add wavelengths and chromophores and get a unmixed output images out of one MITK input image using algorithms from the subclasses. More...

#include <mitkPASpectralUnmixingFilterBase.h>

Inheritance diagram for mitk::pa::SpectralUnmixingFilterBase:
Collaboration diagram for mitk::pa::SpectralUnmixingFilterBase:

Public Member Functions

 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...
 

Public Attributes

ofstream myfile
 

Protected Member Functions

 SpectralUnmixingFilterBase ()
 Constructor creats proptery calculater smart pointer new() More...
 
 ~SpectralUnmixingFilterBase () override
 
virtual Eigen::VectorXf SpectralUnmixingAlgorithm (Eigen::Matrix< float, Eigen::Dynamic, Eigen::Dynamic > endmemberMatrix, Eigen::VectorXf inputVector)=0
 The subclasses will override the mehtod to calculate the spectral unmixing result vector. More...
 
- 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
 

Protected Attributes

bool m_Verbose
 
bool m_RelativeError
 
std::vector< mitk::pa::PropertyCalculator::ChromophoreTypem_Chromophore
 
std::vector< int > m_Wavelength
 
std::vector< int > m_RelativeErrorSettings
 

Additional Inherited Members

- 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
 
- 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 ()
 
- 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 ()
 

Detailed Description

The spectral unmixing filter base is designed as superclass for several spectral unmixing filter eg. Eigen- or Vigrabased ones. One can add wavelengths and chromophores and get a unmixed output images out of one MITK input image using algorithms from the subclasses.

Input: The unmixing input has to be a 3D MITK image where the XY-plane is a image and the Z-direction represents recordings for different wavelengths. Herein a XY-plane for a specific Z-direction will be called "image". Every image has to be assigned to a certain wavelength. The "AddWavelength" uses "push_back" to write float values into a vector. The first wavelength will correspond to the first image!!! If there a more input images 'I' then added wavelengths 'w' the filter base interprets the next x images as repetition sequence of the same wavelengths. If I % w !=0 the surplus image(s) will be dropped. Addtionaly one has to add chromophores from the property calculator class enum "ChromophoreType" with the "AddChromophore" method. This method as well uses "push_back" but the chosen (arbitary) order will be the order of the outputs.

Output: The output will be one MITK image per chosen chromophore. Where the XY-plane is a image and the Z-direction represents recordings for different sequences. Furthermore it is possible to creat an output image that contains the information about the relative error between unmixing result and the input image.

Subclasses:

  • mitkPASpectralUnmixingFilterVigra
  • mitkPALinearSpectralUnmixingFilter (uses Eigen algorithms)
  • mitkPASpectralUnmixingFilterSimplex

Possible exceptions:

  • "PIXELTYPE ERROR! FLOAT 32 REQUIRED": The MITK input image has to consist out of floats.
  • "ERROR! REMOVE WAVELENGTHS!": One needs at least the same amount of images (z-dimension) then added wavelengths.
  • "ADD MORE WAVELENGTHS!": One needs at least the same amount of wavelengths then added chromophores.
  • "WAVELENGTH XXX nm NOT SUPPORTED!": The wavelength is not part of the proptery calculater data base. The data base can be found @ [...].dat
  • "ADD OUTPUTS HAS TO BE LARGER THEN ZERO!"
  • "NO WAVELENGHTS/CHROMOPHORES SELECZED! - "INDEX ERROR! NUMBER OF OUTPUTS DOESN'T FIT TO OTHER SETTIGNS!"

Definition at line 63 of file mitkPASpectralUnmixingFilterBase.h.

Constructor & Destructor Documentation

◆ SpectralUnmixingFilterBase()

mitk::pa::SpectralUnmixingFilterBase::SpectralUnmixingFilterBase ( )
protected

Constructor creats proptery calculater smart pointer new()

Definition at line 23 of file mitkPASpectralUnmixingFilterBase.cpp.

References mitk::pa::PropertyCalculator::New().

◆ ~SpectralUnmixingFilterBase()

mitk::pa::SpectralUnmixingFilterBase::~SpectralUnmixingFilterBase ( )
overrideprotected

Definition at line 28 of file mitkPASpectralUnmixingFilterBase.cpp.

Member Function Documentation

◆ AddChromophore()

void mitk::pa::SpectralUnmixingFilterBase::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!

Parameters
chromophorehas to be element of porperty calculater enum chromophore type
Returns
for wavelength smaller then 300nm and larger then 1000nm the return will be 0, because not at the data base (2018/06/19)

Definition at line 47 of file mitkPASpectralUnmixingFilterBase.cpp.

References m_Chromophore.

◆ AddOutputs()

void mitk::pa::SpectralUnmixingFilterBase::AddOutputs ( unsigned int  outputs)
virtual

AddOutputs takes an integer and sets indexed outputs.

Parameters
outputsinteger correponds to the number of output images
Exceptions
ifoutputs == 0

Definition at line 33 of file mitkPASpectralUnmixingFilterBase.cpp.

References mitkThrow, and mitk::Image::New().

◆ AddRelativeErrorSettings()

void mitk::pa::SpectralUnmixingFilterBase::AddRelativeErrorSettings ( int  value)
virtual

◆ AddWavelength()

void mitk::pa::SpectralUnmixingFilterBase::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.

Parameters
wavelengthdatabase supports integers between 300 and 1000 nm

Definition at line 42 of file mitkPASpectralUnmixingFilterBase.cpp.

References m_Wavelength.

◆ mitkClassMacro()

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

◆ RelativeError()

void mitk::pa::SpectralUnmixingFilterBase::RelativeError ( bool  relativeError)
virtual

Definition at line 57 of file mitkPASpectralUnmixingFilterBase.cpp.

References m_RelativeError.

◆ SpectralUnmixingAlgorithm()

virtual Eigen::VectorXf mitk::pa::SpectralUnmixingFilterBase::SpectralUnmixingAlgorithm ( Eigen::Matrix< float, Eigen::Dynamic, Eigen::Dynamic >  endmemberMatrix,
Eigen::VectorXf  inputVector 
)
protectedpure virtual

The subclasses will override the mehtod to calculate the spectral unmixing result vector.

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
ifalgorithm implementiation fails (implemented for the algorithms with critical requirements)

Implemented in mitk::pa::SpectralUnmixingFilterVigra, and mitk::pa::LinearSpectralUnmixingFilter.

Referenced by AddRelativeErrorSettings().

◆ Verbose()

void mitk::pa::SpectralUnmixingFilterBase::Verbose ( bool  verbose)
virtual

Definition at line 52 of file mitkPASpectralUnmixingFilterBase.cpp.

References m_Verbose, and verbose().

Member Data Documentation

◆ m_Chromophore

std::vector<mitk::pa::PropertyCalculator::ChromophoreType> mitk::pa::SpectralUnmixingFilterBase::m_Chromophore
protected

Definition at line 132 of file mitkPASpectralUnmixingFilterBase.h.

Referenced by AddChromophore(), and AddRelativeErrorSettings().

◆ m_RelativeError

bool mitk::pa::SpectralUnmixingFilterBase::m_RelativeError
protected

Definition at line 130 of file mitkPASpectralUnmixingFilterBase.h.

Referenced by AddRelativeErrorSettings(), and RelativeError().

◆ m_RelativeErrorSettings

std::vector<int> mitk::pa::SpectralUnmixingFilterBase::m_RelativeErrorSettings
protected

Definition at line 134 of file mitkPASpectralUnmixingFilterBase.h.

Referenced by AddRelativeErrorSettings().

◆ m_Verbose

bool mitk::pa::SpectralUnmixingFilterBase::m_Verbose
protected

Definition at line 129 of file mitkPASpectralUnmixingFilterBase.h.

Referenced by AddRelativeErrorSettings(), and Verbose().

◆ m_Wavelength

std::vector<int> mitk::pa::SpectralUnmixingFilterBase::m_Wavelength
protected

Definition at line 133 of file mitkPASpectralUnmixingFilterBase.h.

Referenced by AddRelativeErrorSettings(), and AddWavelength().

◆ myfile

ofstream mitk::pa::SpectralUnmixingFilterBase::myfile

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