diff --git a/Modules/PhotoacousticsLib/include/mitkPASpectralUnmixingFilter.h b/Modules/PhotoacousticsLib/include/mitkPASpectralUnmixingFilter.h index 5e4b58575d..e29763febd 100644 --- a/Modules/PhotoacousticsLib/include/mitkPASpectralUnmixingFilter.h +++ b/Modules/PhotoacousticsLib/include/mitkPASpectralUnmixingFilter.h @@ -1,93 +1,78 @@ /*=================================================================== The Medical Imaging Interaction Toolkit (MITK) Copyright (c) German Cancer Research Center, Division of Medical and Biological Informatics. All rights reserved. This software is distributed WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See LICENSE.txt or http://www.mitk.org for details. ===================================================================*/ #ifndef MITKPHOTOACOUSTICSPECTRALUNMIXINGFILTER_H #define MITKPHOTOACOUSTICSPECTRALUNMIXINGFILTER_H #include "mitkImageToImageFilter.h" +#include //Includes for smart pointer usage #include "mitkCommon.h" #include "itkLightObject.h" -#include - +// Includes for AddEnmemberMatrix #include "mitkPAPropertyCalculator.h" #include -// Test with ImagePixelAccessor -#include -#include - namespace mitk { namespace pa { class MITKPHOTOACOUSTICSLIB_EXPORT SpectralUnmixingFilter : public mitk::ImageToImageFilter { public: mitkClassMacro(SpectralUnmixingFilter, mitk::ImageToImageFilter) itkFactorylessNewMacro(Self) - //Contains all (so far) possible chromophores + // Contains all (so far) possible chromophores enum ChromophoreType { - OXYGENATED = 1, - DEOXYGENATED = 2 + OXYGENATED_HEMOGLOBIN = 1, + DEOXYGENATED_HEMOGLOBIN = 2 }; - //Void to creat m_vector of all chosen chromophores with push back method - void SetChromophores(ChromophoreType); + // Void to creat m_vector of all chosen chromophores with push back method + void AddChromophore(ChromophoreType); std::vector m_Chromophore; - //Void to creat m_vector of all wavelengths with push back method + // Void to creat m_vector of all wavelengths with push back method void AddWavelength(int wavelength); std::vector m_Wavelength; - - - - //Void to creat Eigen::Matrix of all absorbtions - //@ specific wavelength (columns) of chromophores (rows) - Eigen::Matrix AddEndmemberMatrix(); - protected: SpectralUnmixingFilter(); virtual ~SpectralUnmixingFilter(); private: - virtual void GenerateData(); - PropertyCalculator::Pointer m_PropertyCalculator; - unsigned int numberofchromophores; - unsigned int numberofwavelengths; - unsigned int numberOfInputs; - unsigned int numberOfOutputs; - long length; - - Eigen::Matrix EndmemberMatrix; - - //'New': + // Void checking precondtions possibly throwing exeptions virtual void CheckPreConditions(unsigned int NumberOfInputImages); + virtual void GenerateData(); virtual void InitializeOutputs(); - //Eigen::VectorXd OutputVector = (Eigen::VectorXd, Eigen::Matrix); - Eigen::VectorXd SpectralUnmixingAlgorithms(Eigen::Matrix EndmemberMatrix, - Eigen::VectorXd inputVector); + // Void to creat Eigen::Matrix of all absorbtions + // @ specific wavelength (columns) of chromophores (rows) + Eigen::Matrix AddEndmemberMatrix(); + Eigen::Matrix EndmemberMatrix; + PropertyCalculator::Pointer m_PropertyCalculator; + // Test algorithm for SU --> later a new class should be set up + Eigen::VectorXf SpectralUnmixingTestAlgorithm(Eigen::Matrix EndmemberMatrix, + Eigen::VectorXf inputVector); }; } } #endif // MITKPHOTOACOUSTICSPECTRALUNMIXINGFILTER_H diff --git a/Modules/PhotoacousticsLib/src/SUFilter/mitkPASpectralUnmixingFilter.cpp b/Modules/PhotoacousticsLib/src/SUFilter/mitkPASpectralUnmixingFilter.cpp index 4ff387505b..2505c5ec09 100644 --- a/Modules/PhotoacousticsLib/src/SUFilter/mitkPASpectralUnmixingFilter.cpp +++ b/Modules/PhotoacousticsLib/src/SUFilter/mitkPASpectralUnmixingFilter.cpp @@ -1,244 +1,201 @@ /*=================================================================== The Medical Imaging Interaction Toolkit (MITK) Copyright (c) German Cancer Research Center, Division of Medical and Biological Informatics. All rights reserved. This software is distributed WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See LICENSE.txt or http://www.mitk.org for details. ===================================================================*/ #include "mitkPASpectralUnmixingFilter.h" // Includes for AddEnmemberMatrix #include "mitkPAPropertyCalculator.h" #include // ImageAccessor #include #include -// for testing reasons: +// For testing reasons #include mitk::pa::SpectralUnmixingFilter::SpectralUnmixingFilter() { this->SetNumberOfIndexedOutputs(2); for (unsigned int i = 0; iSetNthOutput(i, mitk::Image::New()); } m_PropertyCalculator = mitk::pa::PropertyCalculator::New(); } mitk::pa::SpectralUnmixingFilter::~SpectralUnmixingFilter() { } void mitk::pa::SpectralUnmixingFilter::AddWavelength(int wavelength) { m_Wavelength.push_back(wavelength); } -void mitk::pa::SpectralUnmixingFilter::SetChromophores(ChromophoreType chromophore) +void mitk::pa::SpectralUnmixingFilter::AddChromophore(ChromophoreType chromophore) { m_Chromophore.push_back(chromophore); } void mitk::pa::SpectralUnmixingFilter::GenerateData() { MITK_INFO << "GENERATING DATA.."; + + // Get input image mitk::Image::Pointer input = GetInput(0); + unsigned int xDim = input->GetDimensions()[0]; unsigned int yDim = input->GetDimensions()[1]; unsigned int zDim = input->GetDimensions()[2]; - MITK_INFO << "xdim: " << xDim; - MITK_INFO << "ydim: " << yDim; - - MITK_INFO << "zdim: " << zDim; + MITK_INFO << "x dimension: " << xDim; + MITK_INFO << "y dimension: " << yDim; + MITK_INFO << "z dimension: " << zDim; CheckPreConditions(zDim); - InitializeOutputs(); - - EndmemberMatrix = AddEndmemberMatrix(); - - //* IMAGE READ ACCESOR see old SU.cpp + // Copy input image into array mitk::ImageReadAccessor readAccess(input); const float* inputDataArray = ((const float*)readAccess.GetData()); + //loop over every pixel @ x,y plane for (unsigned int x = 0; x < xDim; x++) { for (unsigned int y = 0; y < yDim; y++) { - Eigen::VectorXd inputVector(zDim); + Eigen::VectorXf inputVector(zDim); for (unsigned int z = 0; z < zDim; z++) { - - unsigned int pixelNumber = (xDim*yDim*z)+x*yDim+y; - //MITK_INFO << pixelNumber; - auto pixel = inputDataArray[pixelNumber];/**/ - // --> works with 3x3x3 but not with 1000x1000x3 picture - - //float pixel = rand(); // dummy value for pixel - + // Get pixel value of pixel x,y @ wavelength z + unsigned int pixelNumber = (xDim*yDim*z) + x * yDim + y; + auto pixel = inputDataArray[pixelNumber]; + + // dummy values for pixel for testing purposes + //float pixel = rand(); + + //write all wavelength absorbtion values for one(!) pixel to a vector inputVector[z] = pixel; } - - Eigen::VectorXd resultVector = SpectralUnmixingAlgorithms(EndmemberMatrix, inputVector); + Eigen::VectorXf resultVector = SpectralUnmixingTestAlgorithm(EndmemberMatrix, inputVector); + // write output for (int outputIdx = 0; outputIdx < GetNumberOfIndexedOutputs(); ++outputIdx) { auto output = GetOutput(outputIdx); mitk::ImageWriteAccessor writeOutput(output); float* writeBuffer = (float *)writeOutput.GetData(); writeBuffer[x*yDim + y] = resultVector[outputIdx]; } } } MITK_INFO << "GENERATING DATA...[DONE]"; } - - - -// checks if number of Inputs == added wavelengths void mitk::pa::SpectralUnmixingFilter::CheckPreConditions(unsigned int NumberOfInputImages) { + // Checking if number of Inputs == added wavelengths if (m_Wavelength.size() != NumberOfInputImages) mitkThrow() << "CHECK INPUTS! WAVELENGTHERROR"; + + // Checking if number of wavelengths >= number of chromophores + if (m_Chromophore.size() > m_Wavelength.size()) + mitkThrow() << "PRESS 'IGNORE' AND ADD MORE WAVELENGTHS!"; + MITK_INFO << "CHECK PRECONDITIONS ...[DONE]"; } -// Initialize Outputs void mitk::pa::SpectralUnmixingFilter::InitializeOutputs() { - numberOfInputs = GetNumberOfIndexedInputs(); - numberOfOutputs = GetNumberOfIndexedOutputs(); + unsigned int numberOfInputs = GetNumberOfIndexedInputs(); + unsigned int numberOfOutputs = GetNumberOfIndexedOutputs(); + MITK_INFO << "Inputs: " << numberOfInputs << " Outputs: " << numberOfOutputs; - //* see MitkPAVolume.cpp + // Set dimensions (2) and pixel type (float) for output mitk::PixelType pixelType = mitk::MakeScalarPixelType(); const int NUMBER_OF_SPATIAL_DIMENSIONS = 2; auto* dimensions = new unsigned int[NUMBER_OF_SPATIAL_DIMENSIONS]; for(unsigned int dimIdx=0; dimIdxGetDimensions()[dimIdx]; } - Image::Pointer m_InternalMitkImage;/**/ + // Initialize numberOfOutput pictures with pixel type and dimensions for (unsigned int outputIdx = 0; outputIdx < numberOfOutputs; outputIdx++) { - //GetOutput(outputIdx)->Initialize(GetInput(0)); - - //* see MitkPAVolume.cpp :: DOESN'T WORK (TM) - //m_InternalMitkImage = mitk::Image::New(); - GetOutput(outputIdx)->Initialize(pixelType, NUMBER_OF_SPATIAL_DIMENSIONS, dimensions);/**/ + GetOutput(outputIdx)->Initialize(pixelType, NUMBER_OF_SPATIAL_DIMENSIONS, dimensions); } } //Matrix with #chromophores rows and #wavelengths columns -//so Matrix Element (j,i) contains the Absorbtion of chromophore j @ wavelength i -Eigen::Matrix mitk::pa::SpectralUnmixingFilter::AddEndmemberMatrix() +//so Matrix Element (i,j) contains the Absorbtion of chromophore i @ wavelength j +Eigen::Matrix mitk::pa::SpectralUnmixingFilter::AddEndmemberMatrix() { - numberofchromophores = m_Chromophore.size(); - numberofwavelengths = m_Wavelength.size(); + unsigned int numberOfChromophores = m_Chromophore.size(); //rows + unsigned int numberOfWavelengths = m_Wavelength.size(); //columns - Eigen::Matrix EndmemberMatrix(numberofchromophores, numberofwavelengths); + Eigen::Matrix EndmemberMatrix(numberOfChromophores, numberOfWavelengths); - //loop over j rows (Chromophores) - for(unsigned int j =0; j < numberofchromophores; ++j) + //loop over i rows (Chromophores) + for(unsigned int i = 0; i < numberOfChromophores; ++i) { - //loop over i columns (Wavelength) - for (unsigned int i = 0; i < numberofwavelengths; ++i) + //loop over j columns (Wavelengths) + for (unsigned int j = 0; j < numberOfWavelengths; ++j) { //writes @ Matrix element (i,j) the absorbtion wavelength of the propertycalculator.cpp - EndmemberMatrix(j,i)= m_PropertyCalculator->GetAbsorptionForWavelength( - static_cast(m_Chromophore[j]), m_Wavelength[i]); + EndmemberMatrix(i,j)= m_PropertyCalculator->GetAbsorptionForWavelength( + static_cast(m_Chromophore[i]), m_Wavelength[j]); /* Test to see what gets written in the Matrix: - MITK_INFO << "map type: " << static_cast(m_Chromophore[j]); - MITK_INFO << "wavelength: " << m_Wavelength[i]; - MITK_INFO << "Matrixelement: (" << j << ", " << i << ") Absorbtion: " << EndmemberMatrix(j, i);/**/ + MITK_INFO << "map type: " << static_cast(m_Chromophore[i]); + MITK_INFO << "wavelength: " << m_Wavelength[j]; + MITK_INFO << "Matrixelement: (" << i << ", " << j << ") Absorbtion: " << EndmemberMatrix(i, j);/**/ - if (EndmemberMatrix(j, i) == 0) + if (EndmemberMatrix(i, j) == 0) { m_Wavelength.clear(); - mitkThrow() << "WAVELENGTH "<< m_Wavelength[i] << "nm NOT SUPPORTED!"; + mitkThrow() << "WAVELENGTH "<< m_Wavelength[j] << "nm NOT SUPPORTED!"; } } } - MITK_INFO << "GENERATING ENMEMBERMATRIX SUCCESSFUL!"; + MITK_INFO << "GENERATING ENMEMBERMATRIX [DONE]!"; return EndmemberMatrix; } -// Perform SU algorithm -Eigen::VectorXd mitk::pa::SpectralUnmixingFilter::SpectralUnmixingAlgorithms( - Eigen::Matrix EndmemberMatrix, Eigen::VectorXd inputVector) +Eigen::VectorXf mitk::pa::SpectralUnmixingFilter::SpectralUnmixingTestAlgorithm( + Eigen::Matrix EndmemberMatrix, Eigen::VectorXf inputVector) { //test "solver" (input = output) - Eigen::VectorXd resultVector = inputVector; + Eigen::VectorXf resultVector = inputVector; return resultVector; //llt solver - //Eigen::VectorXd resultVector = EndmemberMatrix.llt().solve(inputVector); + //Eigen::VectorXf resultVector = EndmemberMatrix.llt().solve(inputVector); //return resultVector; //householderqr solver - //Eigen::VectorXd resultVector =EndmemberMatrix.householderQr().solve(inputVector); + //Eigen::VectorXf resultVector =EndmemberMatrix.householderQr().solve(inputVector); //return resultVector; //test other solvers https://eigen.tuxfamily.org/dox/group__TutorialLinearAlgebra.html // define treshold for relativ error and set value to eg. -1 ;) /*double relative_error = (EndmemberMatrix*inputVector - resultVector).norm() / resultVector.norm(); // norm() is L2 norm MITK_INFO << relative_error;/**/ } - -/* +++++++++++++++++++++++++++++++++++++++++ OLD CODE: +++++++++++++++++++++++++++++++++++++++++++++++++++ -was @ generate data - -length = GetOutput(0)->GetDimension(0)*GetOutput(0)->GetDimension(1)*GetOutput(0)->GetDimension(2); - -for (int i = 0; i < length; i++) -{ -Eigen::VectorXd b(numberOfInputs); -for (unsigned int j = 0; j < numberOfInputs; j++) -{ -mitk::Image::Pointer input = GetInput(j); -mitk::ImageReadAccessor readAccess(input, input->GetVolumeData()); -b(j) = ((const float*)readAccess.GetData())[i]; -} - -Eigen::Vector3d x = EndmemberMatrix.householderQr().solve(b); - - -if (i == 0) -{ -MITK_INFO << "for i=0 b(#Inputs)"; -MITK_INFO << b; -MITK_INFO << "EndmemberMatrix"; -MITK_INFO << EndmemberMatrix; -MITK_INFO << "x"; -MITK_INFO << x; -} - - -for (unsigned int outputIdx = 0; outputIdx < numberOfOutputs; outputIdx++) -{ -mitk::Image::Pointer output = GetOutput(outputIdx); -mitk::ImageWriteAccessor writeOutput(output, output->GetVolumeData()); -double* outputArray = (double *)writeOutput.GetData(); -outputArray[i] = x[outputIdx]; -} -} -/**/ diff --git a/Plugins/org.mitk.gui.qt.photoacoustics.spectralunmixing/src/internal/SpectralUnmixing.cpp b/Plugins/org.mitk.gui.qt.photoacoustics.spectralunmixing/src/internal/SpectralUnmixing.cpp index 9b33b242fa..7235869b08 100644 --- a/Plugins/org.mitk.gui.qt.photoacoustics.spectralunmixing/src/internal/SpectralUnmixing.cpp +++ b/Plugins/org.mitk.gui.qt.photoacoustics.spectralunmixing/src/internal/SpectralUnmixing.cpp @@ -1,212 +1,200 @@ /*=================================================================== The Medical Imaging Interaction Toolkit (MITK) Copyright (c) German Cancer Research Center, Division of Medical and Biological Informatics. All rights reserved. This software is distributed WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See LICENSE.txt or http://www.mitk.org for details. ===================================================================*/ - // Blueberry #include #include // Qmitk #include "SpectralUnmixing.h" // Qt #include // mitk image #include -//test mitk image +/*//test mitk image #include #include -#include +#include */ // Include to perform Spectral Unmixing #include "mitkPASpectralUnmixingFilter.h" const std::string SpectralUnmixing::VIEW_ID = "org.mitk.views.spectralunmixing"; void SpectralUnmixing::SetFocus() { m_Controls.buttonPerformImageProcessing->setFocus(); } void SpectralUnmixing::CreateQtPartControl(QWidget *parent) { // create GUI widgets from the Qt Designer's .ui file m_Controls.setupUi(parent); connect(m_Controls.buttonPerformImageProcessing, &QPushButton::clicked, this, &SpectralUnmixing::DoImageProcessing); connect(m_Controls.ButtonAddWavelength, &QPushButton::clicked, this, &SpectralUnmixing::Wavelength); connect(m_Controls.ButtonClearWavelength, &QPushButton::clicked, this, &SpectralUnmixing::ClearWavelength); } -// Add Wavelength is working, BUT in the Plugin! Not with same implementation at the filter -// probably because the m_wavelengths vector is created new every time and not 'saved'. +// Adds Wavelength @ Plugin with button void SpectralUnmixing::Wavelength() { if (m_Wavelengths.empty()) { size = 0; } - wavelength = m_Controls.spinBoxAddWavelength->value(); + unsigned int wavelength = m_Controls.spinBoxAddWavelength->value(); m_Wavelengths.push_back(wavelength); - MITK_INFO << "ADD WAVELENGTH: " << wavelength << "nm"; size += 1; // size implemented like this because '.size' is const MITK_INFO << "ALL WAVELENGTHS: "; for (int i = 0; i < size; ++i) { MITK_INFO << m_Wavelengths[i] << "nm"; } } +// Checking which chromophores wanted for SU if none throw exeption! +void SpectralUnmixing::numberOfChromophores() +{ + auto m_SpectralUnmixingFilter = mitk::pa::SpectralUnmixingFilter::New(); + + unsigned int numberofChromophores = 0; + DeOxbool = m_Controls.checkBoxDeOx->isChecked(); + Oxbool = m_Controls.checkBoxOx->isChecked(); + if (DeOxbool || Oxbool) + { + MITK_INFO << "CHOSEN CHROMOPHORES:"; + } + if (Oxbool) + { + numberofChromophores += 1; + MITK_INFO << "- Oxyhemoglobin"; + // Set chromophore Oxyhemoglobon: + m_SpectralUnmixingFilter->AddChromophore( + mitk::pa::SpectralUnmixingFilter::ChromophoreType::OXYGENATED_HEMOGLOBIN); + } + if (DeOxbool) + { + numberofChromophores += 1; + MITK_INFO << "- Deoxygenated hemoglobin"; + // Set chromophore Deoxygenated hemoglobin: + m_SpectralUnmixingFilter->AddChromophore( + mitk::pa::SpectralUnmixingFilter::ChromophoreType::DEOXYGENATED_HEMOGLOBIN); + } + if (numberofChromophores == 0) + { + mitkThrow() << "PRESS 'IGNORE' AND CHOOSE A CHROMOPHORE!"; + } +} + void SpectralUnmixing::ClearWavelength() { m_Wavelengths.clear(); } void SpectralUnmixing::OnSelectionChanged(berry::IWorkbenchPart::Pointer /*source*/, const QList &nodes) { // iterate all selected objects, adjust warning visibility foreach (mitk::DataNode::Pointer node, nodes) { if (node.IsNotNull() && dynamic_cast(node->GetData())) { m_Controls.labelWarning->setVisible(false); m_Controls.buttonPerformImageProcessing->setEnabled(true); return; } } m_Controls.labelWarning->setVisible(true); m_Controls.buttonPerformImageProcessing->setEnabled(false); } void SpectralUnmixing::DoImageProcessing() { QList nodes = this->GetDataManagerSelection(); if (nodes.empty()) return; mitk::DataNode *node = nodes.front(); if (!node) { // Nothing selected. Inform the user and return QMessageBox::information(nullptr, "Template", "Please load and select an image before starting image processing."); return; } // here we have a valid mitk::DataNode // a node itself is not very useful, we need its data item (the image) mitk::BaseData *data = node->GetData(); if (data) { // test if this data item is an image or not (could also be a surface or something totally different) mitk::Image *image = dynamic_cast(data); if (image) { std::stringstream message; std::string name; message << "PERFORMING SPECTRAL UNMIXING "; if (node->GetName(name)) { // a property called "name" was found for this DataNode message << "'" << name << "'"; } message << "."; MITK_INFO << message.str(); - //++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ + MITK_INFO << "GENERATING DATA..."; auto m_SpectralUnmixingFilter = mitk::pa::SpectralUnmixingFilter::New(); m_SpectralUnmixingFilter->SetInput(image); - - // Checking which chromophores wanted for SU if none throw exeption! - numberofChromophores = 0; - DeOxbool = m_Controls.checkBoxDeOx->isChecked(); - Oxbool = m_Controls.checkBoxOx->isChecked(); - - if (Oxbool) - { - numberofChromophores += 1; - MITK_INFO << "- Oxyhemoglobin"; - // Set chromophore Oxyhemoglobon: - m_SpectralUnmixingFilter->SetChromophores( - mitk::pa::SpectralUnmixingFilter::ChromophoreType::OXYGENATED); - } - if (DeOxbool) - { - numberofChromophores += 1; - MITK_INFO << "- Deoxygenated hemoglobin"; - // Set chromophore Deoxygenated hemoglobin: - m_SpectralUnmixingFilter->SetChromophores( - mitk::pa::SpectralUnmixingFilter::ChromophoreType::DEOXYGENATED); - } - if (numberofChromophores == 0) - { - mitkThrow() << "PRESS 'IGNORE' AND CHOOSE A CHROMOPHORE!"; - } - - // Checking if number of wavelengths >= number of chromophores - if (numberofChromophores > size) + // Wavelength implementation into fiter + for (unsigned int imageIndex = 0; imageIndex < m_Wavelengths.size(); imageIndex++) { - mitkThrow() << "PRESS 'IGNORE' AND ADD MORE WAVELENGTHS!"; - } - - //code recreaction from "old" SU.cpp - - MITK_INFO << "GENERATING DATA..."; - unsigned int numberOfInputs = size; - unsigned int numberOfOutputs = numberofChromophores; - - MITK_INFO << "Inputs: " << numberOfInputs << " Outputs: " << numberOfOutputs; - - // additional wavelength implementation into fiter vector; needs "above" one - for (unsigned int imageIndex = 0; imageIndex < numberOfInputs; imageIndex++) - { - wavelength = m_Wavelengths[imageIndex]; - MITK_INFO << wavelength; + unsigned int wavelength = m_Wavelengths[imageIndex]; m_SpectralUnmixingFilter->AddWavelength(wavelength); - } MITK_INFO << "Updating Filter..."; m_SpectralUnmixingFilter->Update(); mitk::Image::Pointer HbO2 = m_SpectralUnmixingFilter->GetOutput(0); mitk::DataNode::Pointer dataNodeHbO2 = mitk::DataNode::New(); dataNodeHbO2->SetData(HbO2); dataNodeHbO2->SetName("HbO2"); this->GetDataStorage()->Add(dataNodeHbO2); mitk::Image::Pointer Hb = m_SpectralUnmixingFilter->GetOutput(1); mitk::DataNode::Pointer dataNodeHb = mitk::DataNode::New(); dataNodeHb->SetData(Hb); dataNodeHb->SetName("Hb"); this->GetDataStorage()->Add(dataNodeHb); mitk::RenderingManager::GetInstance()->InitializeViewsByBoundingObjects(this->GetDataStorage()); MITK_INFO << "Adding images to DataStorage...[DONE]"; } } } diff --git a/Plugins/org.mitk.gui.qt.photoacoustics.spectralunmixing/src/internal/SpectralUnmixing.h b/Plugins/org.mitk.gui.qt.photoacoustics.spectralunmixing/src/internal/SpectralUnmixing.h index 7a00e8e250..9b09bfd53f 100644 --- a/Plugins/org.mitk.gui.qt.photoacoustics.spectralunmixing/src/internal/SpectralUnmixing.h +++ b/Plugins/org.mitk.gui.qt.photoacoustics.spectralunmixing/src/internal/SpectralUnmixing.h @@ -1,75 +1,64 @@ /*=================================================================== The Medical Imaging Interaction Toolkit (MITK) Copyright (c) German Cancer Research Center, Division of Medical and Biological Informatics. All rights reserved. This software is distributed WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See LICENSE.txt or http://www.mitk.org for details. ===================================================================*/ - #ifndef SpectralUnmixing_h #define SpectralUnmixing_h #include #include #include "ui_SpectralUnmixingControls.h" #include "mitkPAPropertyCalculator.h" -/** - \brief SpectralUnmixing - - \warning This class is not yet documented. Use "git blame" and ask the author to provide basic documentation. - - \sa QmitkAbstractView - \ingroup ${plugin_target}_internal -*/ class SpectralUnmixing : public QmitkAbstractView { // this is needed for all Qt objects that should have a Qt meta-object // (everything that derives from QObject and wants to have signal/slots) Q_OBJECT public: static const std::string VIEW_ID; - - // Add Wavelengths with button: - int size = 0; - std::vector m_Wavelengths; - - bool DeOxbool; - bool Oxbool; - + protected: virtual void CreateQtPartControl(QWidget *parent) override; - virtual void SetFocus() override; /// \brief called by QmitkFunctionality when DataManager's selection has changed virtual void OnSelectionChanged(berry::IWorkbenchPart::Pointer source, const QList &nodes) override; /// \brief Called when the user clicks the GUI button void DoImageProcessing(); virtual void Wavelength(); virtual void ClearWavelength(); - unsigned int wavelength; - unsigned int numberofChromophores; - Ui::SpectralUnmixingControls m_Controls; + virtual void numberOfChromophores(); + Ui::SpectralUnmixingControls m_Controls; mitk::pa::PropertyCalculator::Pointer m_PropertyCalculator; + // Add Wavelengths with button: + int size = 0; + std::vector m_Wavelengths; + + // Selection of Chromophores + bool DeOxbool; + bool Oxbool; }; #endif // SpectralUnmixing_h