diff --git a/Modules/PhotoacousticsLib/include/mitkPAPropertyCalculator.h b/Modules/PhotoacousticsLib/include/mitkPAPropertyCalculator.h index 232a4ef84c..0b88ce6b44 100644 --- a/Modules/PhotoacousticsLib/include/mitkPAPropertyCalculator.h +++ b/Modules/PhotoacousticsLib/include/mitkPAPropertyCalculator.h @@ -1,74 +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 MITKPHOTOACOUSTICPROPERTYCALCULATOR_H #define MITKPHOTOACOUSTICPROPERTYCALCULATOR_H #include "MitkPhotoacousticsLibExports.h" //Includes for smart pointer usage #include "mitkCommon.h" #include "itkLightObject.h" namespace mitk { namespace pa { class MITKPHOTOACOUSTICSLIB_EXPORT PropertyCalculator : public itk::LightObject { public: mitkClassMacroItkParent(PropertyCalculator, itk::LightObject) itkFactorylessNewMacro(Self) - struct Properties + struct Properties { double mua; double mus; double g; }; enum TissueType { AIR = 1, BLOOD = 2, EPIDERMIS = 3, FAT = 4, STANDARD_TISSUE = 5 }; + enum MapType + { + OXYGENATED = 1, + DEOXYGENATED = 2, + WATER = 3, + FATTY = 4, + MELANIN = 5 + }; + + double GetAbsorptionForWavelength( + MapType mapType, int wavelength); + Properties CalculatePropertyForSpecificWavelength( TissueType tissueType, int wavelength, double oxygenSaturatonInFraction = 0); protected: PropertyCalculator(); ~PropertyCalculator() override; bool m_Valid = false; std::map> m_SpectralLibMap; - - enum MapType - { - OXYGENATED = 1, - DEOXYGENATED = 2, - WATER = 3, - FATTY = 4, - MELANIN = 5 - }; + }; } } #endif // MITKPHOTOACOUSTICPROPERTYCALCULATOR_H diff --git a/Modules/PhotoacousticsLib/include/mitkPASpectralUnmixingFilter.h b/Modules/PhotoacousticsLib/include/mitkPASpectralUnmixingFilter.h index e20542e8ee..de994dd393 100644 --- a/Modules/PhotoacousticsLib/include/mitkPASpectralUnmixingFilter.h +++ b/Modules/PhotoacousticsLib/include/mitkPASpectralUnmixingFilter.h @@ -1,60 +1,76 @@ /*=================================================================== 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" //Includes for smart pointer usage #include "mitkCommon.h" #include "itkLightObject.h" #include +#include "mitkPAPropertyCalculator.h" +#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 enum ChromophoreType { - OXYGENATED, DEOXYGENATED + OXYGENATED = 1, + DEOXYGENATED = 2 }; - void Test(); - + //Void to creat m_vector of all chosen chromophores with push back method + void SetChromophores(ChromophoreType); + std::vector m_Chromophore; + + //Void to creat m_vector of all wavelengths with push back method void AddWavelength(int wavelength); - std::vector m_Wavelength; - /* for add wavelengths - - int size; */ - + std::vector m_Wavelength; + + //Void to creat Eigen::Matrix of all absorbtions + //@ specific wavelength (columns) of chromophores (rows) + virtual void 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; }; } } #endif // MITKPHOTOACOUSTICSPECTRALUNMIXINGFILTER_H diff --git a/Modules/PhotoacousticsLib/src/SUFilter/mitkPASpectralUnmixingFilter.cpp b/Modules/PhotoacousticsLib/src/SUFilter/mitkPASpectralUnmixingFilter.cpp index bef4b6ff07..445e1c391a 100644 --- a/Modules/PhotoacousticsLib/src/SUFilter/mitkPASpectralUnmixingFilter.cpp +++ b/Modules/PhotoacousticsLib/src/SUFilter/mitkPASpectralUnmixingFilter.cpp @@ -1,144 +1,115 @@ /*=================================================================== 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" #include #include +// Includes for AddEnmemberMatrix +#include "mitkPAPropertyCalculator.h" +#include + mitk::pa::SpectralUnmixingFilter::SpectralUnmixingFilter() { - this->SetNumberOfIndexedOutputs(3); + 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::Test() -{ - MITK_INFO << "Test"; -} - - void mitk::pa::SpectralUnmixingFilter::AddWavelength(int wavelength) { m_Wavelength.push_back(wavelength); } +void mitk::pa::SpectralUnmixingFilter::SetChromophores(ChromophoreType chromophore) +{ + m_Chromophore.push_back(chromophore); +} void mitk::pa::SpectralUnmixingFilter::GenerateData() { + //code recreaction from "old" SUF.cpp - //Test region:++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ - - //code from "old" SUF.cpp - - // now creats to identical output images lieke the input for hb and hb02 + // now creats to identical output images like the input for hb and hb02 MITK_INFO << "GENERATING DATA.."; - unsigned int numberOfInputs = GetNumberOfIndexedInputs(); - unsigned int numberOfOutputs = GetNumberOfIndexedOutputs(); - - + numberOfInputs = GetNumberOfIndexedInputs(); + numberOfOutputs = GetNumberOfIndexedOutputs(); + for (unsigned int outputIdx = 0; outputIdx < numberOfOutputs; outputIdx++) { GetOutput(outputIdx)->Initialize(GetInput(0)); } - long length = GetOutput(0)->GetDimension(0)*GetOutput(0)->GetDimension(1)*GetOutput(0)->GetDimension(2); - + length = GetOutput(0)->GetDimension(0)*GetOutput(0)->GetDimension(1)*GetOutput(0)->GetDimension(2); + for (int i = 0; i < length; i++) { for (unsigned int j = 0; j < numberOfInputs; j++) { mitk::Image::Pointer input = GetInput(j); mitk::ImageReadAccessor readAccess(input, input->GetVolumeData()); } - - - 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(); } } - MITK_INFO << "GENERATING DATA...[DONE]"; - - //++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ - - - - - + + AddEndmemberMatrix(); } -//// Not correct working alternativ for wavelengths -/*void mitk::pa::SpectralUnmixingFilter::AddWavelength(int wavelength) +//Void creats Matrix with #chromophores rows and #wavelengths columns +//so Matrix Element (i,j) contains the Absorbtion of chromophore j @ wavelength i +void mitk::pa::SpectralUnmixingFilter::AddEndmemberMatrix() { - // Das ganze klappt noch nicht so! m_wavelengths wird nicht gespeichert ... - if (m_Wavelengths.empty()) - { - size = 0; - } - m_Wavelengths.push_back(wavelength); - size += 1; -}*/ + numberofchromophores = m_Chromophore.size(); + numberofwavelengths = m_Wavelength.size(); + Eigen::Matrix EndmemberMatrix(numberofchromophores, numberofwavelengths); -//++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ -// VERWORFENES ZEUG: -/* - -void mitk::pa::SpectralUnmixingFilter::GetInputPictures() -{ - MITK_INFO << "GET INPUT PICTURES..."; - unsigned int numberOfInputs = GetNumberOfIndexedInputs(); - unsigned int numberOfOutputs = GetNumberOfIndexedOutputs(); - - MITK_INFO << "Inputs: " << numberOfInputs << " Outputs: " << numberOfOutputs; - - if (m_Wavelengths.empty() || m_Wavelengths.size() != numberOfInputs || numberOfInputs < m_Chromophores.size()) + //loop over j rows (Chromophores) + for(unsigned int j =0; j < numberofchromophores; ++j) { - std::string invalidWavelengthError = "Not enough wavelengths given for calculation."; - MITK_ERROR << invalidWavelengthError; - mitkThrow() << invalidWavelengthError; + //loop over i columns (Wavelength) + for (unsigned int i = 0; i < numberofwavelengths; ++i) + { + //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]); + /* 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 << "LOADING...[DONE]"; + MITK_INFO << "GENERATING ENMEMBERMATRIX SUCCESSFUL!"; } - -void mitk::pa::SpectralUnmixingFilter::AddChromophore(int chromophore) -{ - MITK_INFO << "ADD CHROMOPHORE..."; - m_Chromophores.push_back(chromophore); -} -Probably easier to implement in the Plugin like: if (slot x then do algorithm x) -void mitk::pa::SpectralUnmixingFilter::ChooseAlgorithm(int algorithm) -{ - MITK_INFO << "CHOOSE ALGORITHM..."; - m_Chromophores.push_back(algorithm); -}*/ diff --git a/Modules/PhotoacousticsLib/src/Utils/mitkPAPropertyCalculator.cpp b/Modules/PhotoacousticsLib/src/Utils/mitkPAPropertyCalculator.cpp index 03922d5835..c6d9461fdc 100644 --- a/Modules/PhotoacousticsLib/src/Utils/mitkPAPropertyCalculator.cpp +++ b/Modules/PhotoacousticsLib/src/Utils/mitkPAPropertyCalculator.cpp @@ -1,155 +1,161 @@ /*=================================================================== 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 "mitkPAPropertyCalculator.h" // us #include #include #include #include #include mitk::pa::PropertyCalculator::Properties mitk::pa::PropertyCalculator:: CalculatePropertyForSpecificWavelength( TissueType tissueType, int wavelength, double bloodOxygenInFraction) { Properties returnValue; if (!m_Valid) { mitkThrow() << "PhotoacousticPropertyGenerator was not loaded properly."; return returnValue; } double bloodOxygenation = bloodOxygenInFraction; double bloodVolumeFraction; double waterVolumeFraction; double fatVolumeFraction; double melanosomesVolumeFraction; double musp500; double fray; double bmie; double g; switch (tissueType) { case AIR: returnValue.mua = 1e-4; returnValue.mus = 1.0; returnValue.g = 1.0; return returnValue; case BLOOD: bloodVolumeFraction = 1.0; waterVolumeFraction = 0.95; fatVolumeFraction = 0.02; melanosomesVolumeFraction = 0; musp500 = 10; fray = 0; bmie = 1; g = 0.9; break; case EPIDERMIS: bloodVolumeFraction = 0; bloodOxygenation = 0; waterVolumeFraction = 0.75; fatVolumeFraction = 0.01; melanosomesVolumeFraction = 0.02; musp500 = 40; fray = 0; bmie = 1; g = 0.9; break; case FAT: bloodVolumeFraction = 0.01; bloodOxygenation = 0.75; waterVolumeFraction = 0.5; fatVolumeFraction = 0.6; melanosomesVolumeFraction = 0; musp500 = 17.47; fray = 0.2; bmie = 0.5; g = 0.9; break; case STANDARD_TISSUE: default: bloodVolumeFraction = 0.02; bloodOxygenation = 0.75; waterVolumeFraction = 0.8; fatVolumeFraction = 0.05; melanosomesVolumeFraction = 0; musp500 = 25; fray = 0.25; bmie = 1; g = 0.9; break; } // We want the reduced scattering coefficient directly. double musp = musp500 * (fray * pow(wavelength / 500.0, -4.0) + ((1 - fray) * pow(wavelength / 500.0, -bmie))); returnValue.mus = musp; returnValue.mus = 15;//musp; double mua = bloodVolumeFraction*bloodOxygenation*m_SpectralLibMap[MapType::OXYGENATED][wavelength] + bloodVolumeFraction*(1 - bloodOxygenation)*m_SpectralLibMap[MapType::DEOXYGENATED][wavelength] + waterVolumeFraction*m_SpectralLibMap[MapType::WATER][wavelength] + fatVolumeFraction*m_SpectralLibMap[MapType::FATTY][wavelength] + melanosomesVolumeFraction*m_SpectralLibMap[MapType::MELANIN][wavelength]; returnValue.mua = mua; returnValue.g = g; return returnValue; } mitk::pa::PropertyCalculator::PropertyCalculator() { us::ModuleResource resource = us::GetModuleContext()->GetModule()->GetResource("spectralLIB.dat"); if (resource.IsValid()) { us::ModuleResourceStream resourceStream(resource); std::string line; int wavelength = 300; int counter = 0; while (std::getline(resourceStream, line, '\t')) { int currentLineIdx = counter % 6; if (currentLineIdx == 0) wavelength = std::stoi(line); else { std::istringstream lineStream(line); double tempDouble; lineStream >> tempDouble; m_SpectralLibMap[currentLineIdx][wavelength] = tempDouble; } ++counter; } } else { m_Valid = false; } m_Valid = true; } mitk::pa::PropertyCalculator::~PropertyCalculator() { m_SpectralLibMap.clear(); m_Valid = false; } + +double mitk::pa::PropertyCalculator::GetAbsorptionForWavelength( + MapType mapType, int wavelength) +{ + return m_SpectralLibMap[mapType][wavelength]; +} 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 3767b2f6e6..e7a73d32ba 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,256 +1,238 @@ /*=================================================================== 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 #include #include #include -// to perform Spectral Unmixing +// 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); } // 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'. // Alternativ as comment here and at the filter. void SpectralUnmixing::Wavelength() { if (m_Wavelengths.empty()) { size = 0; } 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"; } } -// Not correct working alternativ for wavelengths -/*void SpectralUnmixing::Wavelength() -{ - auto m_SpectralUnmixingFilter = mitk::pa::SpectralUnmixingFilter::New(); - wavelength = m_Controls.spinBoxAddWavelength->value(); - m_SpectralUnmixingFilter->AddWavelength(wavelength); - MITK_INFO << wavelength << " nm"; -}*/ - 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 (SOON)"; if (node->GetName(name)) { // a property called "name" was found for this DataNode message << "'" << name << "'"; } message << "."; MITK_INFO << message.str(); - // actually do something here... + //++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ + + auto m_SpectralUnmixingFilter = mitk::pa::SpectralUnmixingFilter::New(); // Checking which chromophores wanted for SU if none throw exeption! 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->SetChromophores( + mitk::pa::SpectralUnmixingFilter::ChromophoreType(1)); } if (DeOxbool) { numberofChromophores += 1; MITK_INFO << "- Deoxygenated hemoglobin"; + // Set chromophore Deoxygenated hemoglobin: + m_SpectralUnmixingFilter->SetChromophores( + mitk::pa::SpectralUnmixingFilter::ChromophoreType(2)); } if (numberofChromophores == 0) { mitkThrow() << "PRESS 'IGNORE' AND CHOOSE A CHROMOPHORE!"; } // Checking if number of wavelengths >= number of chromophores if (numberofChromophores > size) { mitkThrow() << "PRESS 'IGNORE' AND ADD MORE WAVELENGTHS!"; } - - //Test region: - - //code from "old" SU.cpp - - + //code recreaction from "old" SU.cpp + MITK_INFO << "GENERATING DATA..."; unsigned int numberOfInputs = size; unsigned int numberOfOutputs = numberofChromophores; MITK_INFO << "Inputs: " << numberOfInputs << " Outputs: " << numberOfOutputs; - - - + mitk::DataStorage::Pointer storage = this->GetDataStorage(); mitk::DataNode::Pointer node = nodes.front(); - - - auto m_SpectralUnmixingFilter = mitk::pa::SpectralUnmixingFilter::New(); - + mitk::Image* inputImage = dynamic_cast(data); const unsigned int dimensions[]{ inputImage->GetDimension(0), inputImage->GetDimension(1), 1 }; // just the first sequence for starters TODO GENERALIZE unsigned int dimension = 3; mitk::PixelType TPixel = mitk::MakeScalarPixelType(); - - - //try to make another wavelength impementation using "above" one ;) + + // another wavelength impementation for fiter needs "above" one for (unsigned int imageIndex = 0; imageIndex < numberOfInputs; imageIndex++) { mitk::Image::Pointer fooImage = mitk::Image::New(); fooImage->Initialize(TPixel, dimension, dimensions); wavelength = m_Wavelengths[imageIndex]; MITK_INFO << wavelength; m_SpectralUnmixingFilter->AddWavelength(wavelength); mitk::ImageReadAccessor inputAcc(inputImage, inputImage->GetSliceData(imageIndex)); fooImage->SetSlice(inputAcc.GetData(), 0); m_SpectralUnmixingFilter->SetInput(imageIndex, fooImage); } - - - + MITK_INFO << "Updating Filter..."; m_SpectralUnmixingFilter->Update(); mitk::Image::Pointer HbO2 = m_SpectralUnmixingFilter->GetOutput(0); - + HbO2->GetGeometry()->SetIndexToWorldTransform(inputImage->GetGeometry()->GetIndexToWorldTransform()); mitk::ImageWriteAccessor writeOutputHbO2(HbO2, HbO2->GetVolumeData()); double* outputArrayHbO2 = (double *)writeOutputHbO2.GetData(); 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); Hb->GetGeometry()->SetIndexToWorldTransform(inputImage->GetGeometry()->GetIndexToWorldTransform()); - - + mitk::ImageWriteAccessor writeOutputHb(Hb, Hb->GetVolumeData()); double* outputArrayHb = (double *)writeOutputHb.GetData(); - - 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 5fa1c7289b..3299af9540 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,86 +1,74 @@ /*=================================================================== 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" -//test #include "mitkPAPropertyCalculator.h" - - - -// Perform Spectral Unmixing -//include "mitkPASpectralUnmixingFilter.h" -//--> include does not work -//solution fprr cpp file 'Just right-click on the project -> Configuration Properties -> C/C++ -> General -> Additional Include Directories.' -//https://stackoverflow.com/questions/12561048/visual-studio-cannot-include-header-file - /** \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(); unsigned int wavelength; unsigned int numberofChromophores; Ui::SpectralUnmixingControls m_Controls; - // Test: - mitk::pa::PropertyCalculator::Pointer m_PropertyCalculator; }; #endif // SpectralUnmixing_h