diff --git a/Modules/DiffusionImaging/IODataStructures/TbssImages/mitkTbssImporter.cpp~ b/Modules/DiffusionImaging/IODataStructures/TbssImages/mitkTbssImporter.cpp~ deleted file mode 100644 index 405d92b4c1..0000000000 --- a/Modules/DiffusionImaging/IODataStructures/TbssImages/mitkTbssImporter.cpp~ +++ /dev/null @@ -1,355 +0,0 @@ -/*========================================================================= - -Program: Medical Imaging & Interaction Toolkit -Language: C++ -Date: $Date: 2009-07-14 19:11:20 +0200 (Tue, 14 Jul 2009) $ -Version: $Revision: 18127 $ - -Copyright (c) German Cancer Research Center, Division of Medical and -Biological Informatics. All rights reserved. -See MITKCopyright.txt or http://www.mitk.org/copyright.html for details. - -This software is distributed WITHOUT ANY WARRANTY; without even -the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR -PURPOSE. See the above copyright notices for more information. - -=========================================================================*/ - -#ifndef __mitkTbssImporter_cpp -#define __mitkTbssImporter_cpp - -#include "mitkTbssImporter.h" -#include -#include -#include "itkNrrdImageIO.h" - - -namespace mitk -{ - - mitk::TbssImporter::TbssImporter() - { - - } - - - mitk::TbssImporter::TbssImporter(std::string path) : m_File(path) - { - - } - - - - mitk::TbssImage::Pointer mitk::TbssImporter::Import() - { - // read all images with all_*.nii.gz - mitk::TbssImage::Pointer tbssImg = mitk::TbssImage::New(); - - FileReaderType4D::Pointer reader = FileReaderType4D::New(); - reader->SetFileName(m_File); - reader->Update(); - - FloatImage4DType::Pointer img = FloatImage4DType::New(); - img = reader->GetOutput(); - - - - m_Data = DataImageType::New(); - - FloatImage4DType::SizeType size = img->GetLargestPossibleRegion().GetSize(); - FloatImage4DType::SpacingType spacing = img->GetSpacing(); - - - DataImageType::SizeType dataSize; - dataSize[0] = size[0]; - dataSize[1] = size[1]; - dataSize[2] = size[2]; - - m_Data->SetRegions(dataSize); - - - DataImageType::SpacingType dataSpacing; - dataSpacing[0] = spacing[0]; - dataSpacing[1] = spacing[1]; - dataSpacing[2] = spacing[2]; - - m_Data->SetSpacing(dataSpacing); - - FloatImage4DType::PointType origin = img->GetOrigin(); - - DataImageType::PointType dataOrigin; - dataOrigin[0] = origin[0]; - dataOrigin[1] = origin[1]; - dataOrigin[2] = origin[2]; - - m_Data->SetOrigin(dataOrigin); - - - FloatImage4DType::DirectionType dir = img->GetDirection(); - - DataImageType::DirectionType dataDir; - for(int i=0; i<=2; i++) - { - for(int j=0; j<=2; j++) - { - dataDir[i][j] = dir[i][j]; - } - } - - m_Data->SetDirection(dataDir); - - - - // Set the length to one because otherwise allocate fails. Should be changed when groups/measurements are added - m_Data->SetVectorLength(size[3]); - m_Data->Allocate(); - - - for(int i=0; i ix; - ix[0] = i; - ix[1] = j; - ix[2] = k; - itk::VariableLengthVector pixel = m_Data->GetPixel(ix); - int vecSize = pixel.Size(); - - for(int z=0; z ix4; - ix4[0] = i; - ix4[1] = j; - ix4[2] = k; - ix4[3] = z; - float value = img->GetPixel(ix4); - - - pixel.SetElement(z, value); - } - m_Data->SetPixel(ix, pixel); - } - } - } - - -// mitk::CastToTbssImage(m_Data.GetPointer(), tbssImg); - - tbssImg->SetGroupInfo(m_Groups); - tbssImg->SetMeasurementInfo(m_MeasurementInfo); - tbssImg->SetImage(m_Data); - - - tbssImg->InitializeFromVectorImage(); - - return tbssImg; - - - - } - - mitk::TbssImage::Pointer mitk::TbssImporter::ImportMeta() - { - mitk::TbssImage::Pointer tbssImg = mitk::TbssImage::New(); - - - m_Data = DataImageType::New(); - - std::vector< std::pair > metaInfo; - - // Gradient images are vector images, so they will add more dimensions to the vector - int vecLength = m_MetaFiles.size(); - //Check if there is a gradient image - - for(int i=0; i < m_MetaFiles.size(); i++) - { - std::pair p = m_MetaFiles.at(i); - if(RetrieveTbssFunction(p.first) == mitk::TbssImage::GRADIENT_X) - { - vecLength += 2; - } - } - - - int currIndex = 0; - - - for(int i=0; i < m_MetaFiles.size(); i++) - { - std::pair p = m_MetaFiles.at(i); - std::string function = p.first; - std::string file = p.second; - - // Add to metainfo to give the tbss image a function-index pair - std::pair pair; - - - pair.first = RetrieveTbssFunction(function); - pair.second = i; - - if(pair.first == mitk::TbssImage::GRADIENT_X) - { - metaInfo.push_back(std::pair(mitk::TbssImage::GRADIENT_X, i)); - metaInfo.push_back(std::pair(mitk::TbssImage::GRADIENT_Y, i+1)); - metaInfo.push_back(std::pair(mitk::TbssImage::GRADIENT_Z, i+2)); - - - VectorReaderType::Pointer fileReader = VectorReaderType::New(); - fileReader->SetFileName(file); - itk::NrrdImageIO::Pointer io = itk::NrrdImageIO::New(); - fileReader->SetImageIO(io); - fileReader->Update(); - - VectorImageType::Pointer img = fileReader->GetOutput(); - - VectorImageType::SizeType size = img->GetLargestPossibleRegion().GetSize(); - - if(i==0) - { - // First image in serie. Properties should be used to initialize m_Data - m_Data->SetRegions(img->GetLargestPossibleRegion().GetSize()); - m_Data->SetSpacing(img->GetSpacing()); - m_Data->SetOrigin(img->GetOrigin()); - m_Data->SetDirection(img->GetDirection()); - m_Data->SetVectorLength(vecLength); - m_Data->Allocate(); - } - - - /* Dealing with a gradient image, so the size of the vector need to be increased by 2 - since this image contains 3 volumes. Old data should not be deleted*/ - - - - for(int x=0; x ix; - ix[0] = x; - ix[1] = y; - ix[2] = z; - - itk::VariableLengthVector vec = img->GetPixel(ix); - itk::VariableLengthVector pixel = m_Data->GetPixel(ix); - for(int j=0; jSetPixel(ix, pixel); - } - } - } - - currIndex += img->GetVectorLength(); - tbssImg->SetContainsGradient(true); - // Read vector image and add to m_Data - } - - else { - - metaInfo.push_back(pair); - FileReaderType3D::Pointer fileReader = FileReaderType3D::New(); - fileReader->SetFileName(file); - fileReader->Update(); - - FloatImage3DType::Pointer img = fileReader->GetOutput(); - - FloatImage3DType::SizeType size = img->GetLargestPossibleRegion().GetSize(); - - if(i==0) - { - // First image in serie. Properties should be used to initialize m_Data - m_Data->SetRegions(img->GetLargestPossibleRegion().GetSize()); - m_Data->SetSpacing(img->GetSpacing()); - m_Data->SetOrigin(img->GetOrigin()); - m_Data->SetDirection(img->GetDirection()); - m_Data->SetVectorLength(vecLength); - m_Data->Allocate(); - } - - for(int x=0; x ix; - ix[0] = x; - ix[1] = y; - ix[2] = z; - - float f = img->GetPixel(ix); - itk::VariableLengthVector pixel = m_Data->GetPixel(ix); - pixel.SetElement(currIndex, f); - m_Data->SetPixel(ix, pixel); - - } - } - } - } - - if(pair.first == mitk::TbssImage::MEAN_FA_SKELETON) - { - tbssImg->SetContainsMeanSkeleton(true); - } - else if(pair.first == mitk::TbssImage::MEAN_FA_SKELETON_MASK) - { - tbssImg->SetContainsSkeletonMask(true); - } - else if(pair.first == mitk::TbssImage::DISTANCE_MAP) - { - tbssImg->SetContainsDistanceMap(true); - } - - currIndex++; - - } - - tbssImg->SetIsMeta(true); - tbssImg->SetImage(m_Data); - tbssImg->SetMetaInfo(metaInfo); - tbssImg->InitializeFromVectorImage(); - - return tbssImg; - } - - - mitk::TbssImage::MetaDataFunction mitk::TbssImporter::RetrieveTbssFunction(std::string s) - { - if(s == "skeleton mask") - { - return mitk::TbssImage::MEAN_FA_SKELETON_MASK; - } - else if(s == "mean fa skeleton") - { - return mitk::TbssImage::MEAN_FA_SKELETON; - } - else if(s == "gradient image") - { - return mitk::TbssImage::GRADIENT_X; - } - else if(s == "tubular structure") - { - return mitk::TbssImage::TUBULAR_STRUCTURE; - } - else if(s == "distance map") - { - return mitk::TbssImage::DISTANCE_MAP; - } - return mitk::TbssImage::MISC; - } - -} - - - -#endif // __mitkTbssImporter_cpp diff --git a/Modules/DiffusionImaging/IODataStructures/TbssImages/mitkTbssImporter.h~ b/Modules/DiffusionImaging/IODataStructures/TbssImages/mitkTbssImporter.h~ deleted file mode 100644 index 726a513662..0000000000 --- a/Modules/DiffusionImaging/IODataStructures/TbssImages/mitkTbssImporter.h~ +++ /dev/null @@ -1,114 +0,0 @@ -/*========================================================================= - -Program: Medical Imaging & Interaction Toolkit -Language: C++ -Date: $Date: 2009-07-14 19:11:20 +0200 (Tue, 14 Jul 2009) $ -Version: $Revision: 18127 $ - -Copyright (c) German Cancer Research Center, Division of Medical and -Biological Informatics. All rights reserved. -See MITKCopyright.txt or http://www.mitk.org/copyright.html for details. - -This software is distributed WITHOUT ANY WARRANTY; without even -the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR -PURPOSE. See the above copyright notices for more information. - -=========================================================================*/ - -#ifndef __mitkTbssImporter_h -#define __mitkTbssImporter_h - -#include "mitkCommon.h" -#include "mitkFileReader.h" - -#include "itkImage.h" -#include "itkVectorImage.h" -#include "itkImageFileReader.h" -#include "mitkTbssImage.h" - - -namespace mitk -{ - //template - class TbssImporter : public itk::Object { - - public: - // typedef TPixelType PixelType; - typedef itk::VectorImage DataImageType; // type of the 3d vector image containing the skeletonized images - typedef itk::VectorImage VectorImageType; // Datatype of the tbss gradient images - typedef itk::Image FloatImage4DType; - typedef itk::ImageFileReader FileReaderType4D; - typedef itk::ImageFileReader VectorReaderType; - - typedef itk::Image FloatImage3DType; - typedef itk::ImageFileReader FileReaderType3D; - - - - mitkClassMacro( TbssImporter, Object ) - itkNewMacro(Self) - - - - - mitk::TbssImage::Pointer Import(); - - mitk::TbssImage::Pointer ImportMeta(); - - - void SetGroupInfo(std::vector< std::pair > groups) - { - m_Groups = groups; - } - - std::vector< std::pair > GetGroupInfo() - { - return m_Groups; - } - - void SetTbssDatasets(std::vector< std::pair > files) - { - m_MetaFiles = files; - } - - void SetMeasurementInfo(std::string s) - { - m_MeasurementInfo = s; - } - - std::string GetMeasurementInfo() - { - return m_MeasurementInfo; - } - - - void SetImportVolume(FloatImage4DType::Pointer inputVolume) - { - m_InputVolume = inputVolume; - } - - protected: - - - - virtual ~TbssImporter(){} - - DataImageType::Pointer m_Data; - std::vector< std::pair > m_Groups; - std::vector< std::pair > m_MetaFiles; - - std::string m_MeasurementInfo; - - - FloatImage4DType::Pointer m_InputVolume; - - - mitk::TbssImage::MetaDataFunction RetrieveTbssFunction(std::string s); - - - }; - -} - -#include "mitkTbssImporter.cpp" -#endif // __mitkTbssImporter_h diff --git a/Plugins/org.mitk.gui.qt.dtiatlasapp/src/internal/QmitkDTIAtlasAppApplication.h~bug-8511-DTI-atlas-app b/Plugins/org.mitk.gui.qt.dtiatlasapp/src/internal/QmitkDTIAtlasAppApplication.h~bug-8511-DTI-atlas-app deleted file mode 100644 index 285949bdc0..0000000000 --- a/Plugins/org.mitk.gui.qt.dtiatlasapp/src/internal/QmitkDTIAtlasAppApplication.h~bug-8511-DTI-atlas-app +++ /dev/null @@ -1,41 +0,0 @@ -/*========================================================================= - -Program: Medical Imaging & Interaction Toolkit -Language: C++ -Date: $Date$ -Version: $Revision$ - -Copyright (c) German Cancer Research Center, Division of Medical and -Biological Informatics. All rights reserved. -See MITKCopyright.txt or http://www.mitk.org/copyright.html for details. - -This software is distributed WITHOUT ANY WARRANTY; without even -the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR -PURPOSE. See the above copyright notices for more information. - -=========================================================================*/ - -#ifndef QMITKDTIAtlasAppAPPLICATION_H_ -#define QMITKDTIAtlasAppAPPLICATION_H_ - -#include - -class QmitkDTIAtlasAppApplication : public QObject, public berry::IApplication -{ - Q_OBJECT - -public: - - QmitkDTIAtlasAppApplication() {} - QmitkDTIAtlasAppApplication(const QmitkDTIAtlasAppApplication& other) - { - Q_UNUSED(other) - throw std::runtime_error("Copy constructor not implemented"); - } - ~QmitkDTIAtlasAppApplication() {} - - int Start(); - void Stop(); -}; - -#endif /*QMITKDTIAtlasAppAPPLICATION_H_*/