diff --git a/Modules/DiffusionImaging/DiffusionIO/files.cmake b/Modules/DiffusionImaging/DiffusionIO/files.cmake index 1422e03ba4..5b0f5b3057 100644 --- a/Modules/DiffusionImaging/DiffusionIO/files.cmake +++ b/Modules/DiffusionImaging/DiffusionIO/files.cmake @@ -1,41 +1,41 @@ set(CPP_FILES mitkDiffusionModuleActivator.cpp mitkNrrdTbssImageWriterFactory.cpp #mitkFiberBundleXIOFactory.cpp mitkConnectomicsNetworkIOFactory.cpp mitkConnectomicsNetworkReader.cpp mitkConnectomicsNetworkWriter.cpp mitkConnectomicsNetworkSerializer.cpp mitkConnectomicsNetworkDefinitions.cpp mitkNrrdTbssRoiImageIOFactory.cpp #mitkFiberBundleXWriterFactory.cpp mitkConnectomicsNetworkWriterFactory.cpp mitkNrrdTbssRoiImageWriterFactory.cpp mitkNrrdTensorImageReader.cpp mitkNrrdTensorImageWriter.cpp mitkNrrdTensorImageIOFactory.cpp mitkNrrdTensorImageWriterFactory.cpp mitkTensorImageSerializer.cpp mitkTensorImageSource.cpp mitkFiberTrackingObjectFactory.cpp mitkConnectomicsObjectFactory.cpp mitkQuantificationObjectFactory.cpp mitkNrrdTbssImageIOFactory.cpp mitkDiffusionCoreObjectFactory.cpp mitkNrrdDiffusionImageReader.cpp - mitkNrrdDiffusionImageIOFactory.cpp +# mitkNrrdDiffusionImageIOFactory.cpp mitkNrrdDiffusionImageWriterFactory.cpp mitkDiffusionImageSerializer.cpp mitkNrrdQBallImageReader.cpp mitkNrrdQBallImageWriter.cpp mitkNrrdQBallImageIOFactory.cpp mitkNrrdQBallImageWriterFactory.cpp mitkQBallImageSerializer.cpp mitkFiberBundleXMapper2D.cpp mitkFiberBundleXMapper3D.cpp mitkCompositeMapper.cpp ) diff --git a/Modules/DiffusionImaging/DiffusionIO/mitkDiffusionCoreObjectFactory.cpp b/Modules/DiffusionImaging/DiffusionIO/mitkDiffusionCoreObjectFactory.cpp index 3b284e47c3..bcf9f59642 100644 --- a/Modules/DiffusionImaging/DiffusionIO/mitkDiffusionCoreObjectFactory.cpp +++ b/Modules/DiffusionImaging/DiffusionIO/mitkDiffusionCoreObjectFactory.cpp @@ -1,239 +1,231 @@ /*=================================================================== 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 "mitkDiffusionCoreObjectFactory.h" #include "mitkProperties.h" #include "mitkBaseRenderer.h" #include "mitkDataNode.h" -#include "mitkNrrdDiffusionImageIOFactory.h" #include "mitkNrrdDiffusionImageWriterFactory.h" #include "mitkNrrdDiffusionImageWriter.h" #include "mitkDiffusionImage.h" #include "mitkNrrdQBallImageIOFactory.h" #include "mitkNrrdQBallImageWriterFactory.h" #include "mitkNrrdQBallImageWriter.h" #include "mitkNrrdTensorImageIOFactory.h" #include "mitkNrrdTensorImageWriterFactory.h" #include "mitkNrrdTensorImageWriter.h" #include "mitkCompositeMapper.h" #include "mitkDiffusionImageMapper.h" #include "mitkGPUVolumeMapper3D.h" #include "mitkVolumeDataVtkMapper3D.h" typedef short DiffusionPixelType; typedef mitk::DiffusionImage DiffusionImageShort; typedef std::multimap MultimapType; mitk::DiffusionCoreObjectFactory::DiffusionCoreObjectFactory() : CoreObjectFactoryBase() - , m_NrrdDiffusionImageIOFactory(mitk::NrrdDiffusionImageIOFactory::New().GetPointer()) , m_NrrdQBallImageIOFactory(mitk::NrrdQBallImageIOFactory::New().GetPointer()) , m_NrrdTensorImageIOFactory(mitk::NrrdTensorImageIOFactory::New().GetPointer()) , m_NrrdDiffusionImageWriterFactory(mitk::NrrdDiffusionImageWriterFactory::New().GetPointer()) , m_NrrdQBallImageWriterFactory(mitk::NrrdQBallImageWriterFactory::New().GetPointer()) , m_NrrdTensorImageWriterFactory(mitk::NrrdTensorImageWriterFactory::New().GetPointer()) { static bool alreadyDone = false; if (!alreadyDone) { MITK_DEBUG << "DiffusionCoreObjectFactory c'tor" << std::endl; - itk::ObjectFactoryBase::RegisterFactory(m_NrrdDiffusionImageIOFactory); itk::ObjectFactoryBase::RegisterFactory(m_NrrdQBallImageIOFactory); itk::ObjectFactoryBase::RegisterFactory(m_NrrdTensorImageIOFactory); itk::ObjectFactoryBase::RegisterFactory(m_NrrdDiffusionImageWriterFactory); itk::ObjectFactoryBase::RegisterFactory(m_NrrdQBallImageWriterFactory); itk::ObjectFactoryBase::RegisterFactory(m_NrrdTensorImageWriterFactory); m_FileWriters.push_back( NrrdDiffusionImageWriter::New().GetPointer() ); m_FileWriters.push_back( NrrdQBallImageWriter::New().GetPointer() ); m_FileWriters.push_back( NrrdTensorImageWriter::New().GetPointer() ); CreateFileExtensionsMap(); alreadyDone = true; } } mitk::DiffusionCoreObjectFactory::~DiffusionCoreObjectFactory() { - itk::ObjectFactoryBase::UnRegisterFactory(m_NrrdDiffusionImageIOFactory); itk::ObjectFactoryBase::UnRegisterFactory(m_NrrdQBallImageIOFactory); itk::ObjectFactoryBase::UnRegisterFactory(m_NrrdTensorImageIOFactory); itk::ObjectFactoryBase::UnRegisterFactory(m_NrrdDiffusionImageWriterFactory); itk::ObjectFactoryBase::UnRegisterFactory(m_NrrdQBallImageWriterFactory); itk::ObjectFactoryBase::UnRegisterFactory(m_NrrdTensorImageWriterFactory); } mitk::Mapper::Pointer mitk::DiffusionCoreObjectFactory::CreateMapper(mitk::DataNode* node, MapperSlotId id) { mitk::Mapper::Pointer newMapper=NULL; if ( id == mitk::BaseRenderer::Standard2D ) { std::string classname("QBallImage"); if(node->GetData() && classname.compare(node->GetData()->GetNameOfClass())==0) { newMapper = mitk::CompositeMapper::New(); newMapper->SetDataNode(node); node->SetMapper(3, ((CompositeMapper*)newMapper.GetPointer())->GetImageMapper()); } classname = "TensorImage"; if(node->GetData() && classname.compare(node->GetData()->GetNameOfClass())==0) { newMapper = mitk::CompositeMapper::New(); newMapper->SetDataNode(node); node->SetMapper(3, ((CompositeMapper*)newMapper.GetPointer())->GetImageMapper()); } classname = "DiffusionImage"; if(node->GetData() && classname.compare(node->GetData()->GetNameOfClass())==0) { newMapper = mitk::DiffusionImageMapper::New(); newMapper->SetDataNode(node); } } else if ( id == mitk::BaseRenderer::Standard3D ) { std::string classname("QBallImage"); if(node->GetData() && classname.compare(node->GetData()->GetNameOfClass())==0) { newMapper = mitk::GPUVolumeMapper3D::New(); newMapper->SetDataNode(node); } classname = "TensorImage"; if(node->GetData() && classname.compare(node->GetData()->GetNameOfClass())==0) { newMapper = mitk::GPUVolumeMapper3D::New(); newMapper->SetDataNode(node); } classname = "DiffusionImage"; if(node->GetData() && classname.compare(node->GetData()->GetNameOfClass())==0) { newMapper = mitk::GPUVolumeMapper3D::New(); newMapper->SetDataNode(node); } } return newMapper; } void mitk::DiffusionCoreObjectFactory::SetDefaultProperties(mitk::DataNode* node) { std::string classname = "QBallImage"; if(node->GetData() && classname.compare(node->GetData()->GetNameOfClass())==0) { mitk::CompositeMapper::SetDefaultProperties(node); mitk::GPUVolumeMapper3D::SetDefaultProperties(node); } classname = "TensorImage"; if(node->GetData() && classname.compare(node->GetData()->GetNameOfClass())==0) { mitk::CompositeMapper::SetDefaultProperties(node); mitk::GPUVolumeMapper3D::SetDefaultProperties(node); } classname = "DiffusionImage"; if(node->GetData() && classname.compare(node->GetData()->GetNameOfClass())==0) { mitk::DiffusionImageMapper::SetDefaultProperties(node); mitk::GPUVolumeMapper3D::SetDefaultProperties(node); } } const char* mitk::DiffusionCoreObjectFactory::GetFileExtensions() { std::string fileExtension; this->CreateFileExtensions(m_FileExtensionsMap, fileExtension); return fileExtension.c_str(); } mitk::CoreObjectFactoryBase::MultimapType mitk::DiffusionCoreObjectFactory::GetFileExtensionsMap() { return m_FileExtensionsMap; } const char* mitk::DiffusionCoreObjectFactory::GetSaveFileExtensions() { std::string fileExtension; this->CreateFileExtensions(m_SaveFileExtensionsMap, fileExtension); return fileExtension.c_str(); } mitk::CoreObjectFactoryBase::MultimapType mitk::DiffusionCoreObjectFactory::GetSaveFileExtensionsMap() { return m_SaveFileExtensionsMap; } void mitk::DiffusionCoreObjectFactory::CreateFileExtensionsMap() { - m_FileExtensionsMap.insert(std::pair("*.dwi", "Diffusion Weighted Images")); - m_FileExtensionsMap.insert(std::pair("*.hdwi", "Diffusion Weighted Images")); - m_FileExtensionsMap.insert(std::pair("*.nii", "Diffusion Weighted Images for FSL")); - m_FileExtensionsMap.insert(std::pair("*.fsl", "Diffusion Weighted Images for FSL")); - m_FileExtensionsMap.insert(std::pair("*.fslgz", "Diffusion Weighted Images for FSL")); + m_FileExtensionsMap.insert(std::pair("*.qbi", "Q-Ball Images")); m_FileExtensionsMap.insert(std::pair("*.hqbi", "Q-Ball Images")); m_FileExtensionsMap.insert(std::pair("*.dti", "Tensor Images")); m_FileExtensionsMap.insert(std::pair("*.hdti", "Tensor Images")); // m_FileExtensionsMap.insert(std::pair("*.pf", "Planar Figure File")); m_SaveFileExtensionsMap.insert(std::pair("*.dwi", "Diffusion Weighted Images")); m_SaveFileExtensionsMap.insert(std::pair("*.hdwi", "Diffusion Weighted Images")); m_SaveFileExtensionsMap.insert(std::pair("*.nii", "Diffusion Weighted Images for FSL")); m_SaveFileExtensionsMap.insert(std::pair("*.fsl", "Diffusion Weighted Images for FSL")); m_SaveFileExtensionsMap.insert(std::pair("*.fslgz", "Diffusion Weighted Images for FSL")); m_SaveFileExtensionsMap.insert(std::pair("*.qbi", "Q-Ball Images")); m_SaveFileExtensionsMap.insert(std::pair("*.hqbi", "Q-Ball Images")); m_SaveFileExtensionsMap.insert(std::pair("*.dti", "Tensor Images")); m_SaveFileExtensionsMap.insert(std::pair("*.hdti", "Tensor Images")); // m_SaveFileExtensionsMap.insert(std::pair("*.pf", "Planar Figure File")); } struct RegisterDiffusionCoreObjectFactory{ RegisterDiffusionCoreObjectFactory() : m_Factory( mitk::DiffusionCoreObjectFactory::New() ) { mitk::CoreObjectFactory::GetInstance()->RegisterExtraFactory( m_Factory ); } ~RegisterDiffusionCoreObjectFactory() { mitk::CoreObjectFactory::GetInstance()->UnRegisterExtraFactory( m_Factory ); } mitk::DiffusionCoreObjectFactory::Pointer m_Factory; }; static RegisterDiffusionCoreObjectFactory registerDiffusionCoreObjectFactory; diff --git a/Modules/DiffusionImaging/DiffusionIO/mitkDiffusionModuleActivator.cpp b/Modules/DiffusionImaging/DiffusionIO/mitkDiffusionModuleActivator.cpp index 4b50242299..fb47f9742a 100644 --- a/Modules/DiffusionImaging/DiffusionIO/mitkDiffusionModuleActivator.cpp +++ b/Modules/DiffusionImaging/DiffusionIO/mitkDiffusionModuleActivator.cpp @@ -1,50 +1,45 @@ /*=================================================================== 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 - -//#include -//#include +#include namespace mitk { /** \brief Registers services for segmentation module. */ class DiffusionModuleActivator : public us::ModuleActivator { public: void Load(us::ModuleContext* /*context*/) { -// m_FiberBundleXReader = new FiberBundleXReader(); -// m_FiberBundleXWriter = new FiberBundleXWriter(); + m_NrrdDiffusionImageReader = new NrrdDiffusionImageReader(); } void Unload(us::ModuleContext*) { -// delete m_FiberBundleXReader; -// delete m_FiberBundleXWriter; + delete m_NrrdDiffusionImageReader; } private: -// FiberBundleXReader * m_FiberBundleXReader; -// FiberBundleXWriter * m_FiberBundleXWriter; + NrrdDiffusionImageReader * m_NrrdDiffusionImageReader; }; } US_EXPORT_MODULE_ACTIVATOR(mitk::DiffusionModuleActivator) diff --git a/Modules/DiffusionImaging/DiffusionIO/mitkNrrdDiffusionImageIOFactory.cpp b/Modules/DiffusionImaging/DiffusionIO/mitkNrrdDiffusionImageIOFactory.cpp deleted file mode 100644 index 15c5359ace..0000000000 --- a/Modules/DiffusionImaging/DiffusionIO/mitkNrrdDiffusionImageIOFactory.cpp +++ /dev/null @@ -1,53 +0,0 @@ -/*=================================================================== - -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 "mitkNrrdDiffusionImageIOFactory.h" -#include "mitkIOAdapter.h" -#include "mitkNrrdDiffusionImageReader.h" - -#include "itkVersion.h" - - -namespace mitk -{ - -NrrdDiffusionImageIOFactory::NrrdDiffusionImageIOFactory() -{ - typedef short DiffusionPixelType; - typedef itk::VectorImage< DiffusionPixelType, 3 > DiffusionImageType; - typedef NrrdDiffusionImageReader NrrdDiffVolReaderType; - this->RegisterOverride("mitkIOAdapter", - "mitkNrrdDiffusionImageReader", - "mitk Diffusion Image IO", - 1, - itk::CreateObjectFunction >::New()); -} - -NrrdDiffusionImageIOFactory::~NrrdDiffusionImageIOFactory() -{ -} - -const char* NrrdDiffusionImageIOFactory::GetITKSourceVersion() const -{ - return ITK_SOURCE_VERSION; -} - -const char* NrrdDiffusionImageIOFactory::GetDescription() const -{ - return "NrrdDiffusionImage IO Factory, allows the loading of NRRD DWI data"; -} - -} // end namespace mitk diff --git a/Modules/DiffusionImaging/DiffusionIO/mitkNrrdDiffusionImageIOFactory.h b/Modules/DiffusionImaging/DiffusionIO/mitkNrrdDiffusionImageIOFactory.h deleted file mode 100644 index 59c7176d25..0000000000 --- a/Modules/DiffusionImaging/DiffusionIO/mitkNrrdDiffusionImageIOFactory.h +++ /dev/null @@ -1,75 +0,0 @@ -/*=================================================================== - -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 __MITK_NRRD_DIFFUSION_VOULMES_IO_FACTORY_H_HEADER__ -#define __MITK_NRRD_DIFFUSION_VOULMES_IO_FACTORY_H_HEADER__ - -#ifdef _MSC_VER -#pragma warning ( disable : 4786 ) -#endif - -#include "itkObjectFactoryBase.h" -#include "mitkBaseData.h" - -namespace mitk -{ -//##Documentation -//## @brief Create instances of NrrdDiffusionImageReader objects using an object factory. -//## -class NrrdDiffusionImageIOFactory : public itk::ObjectFactoryBase -{ -public: - /** Standard class typedefs. */ - typedef NrrdDiffusionImageIOFactory Self; - typedef itk::ObjectFactoryBase Superclass; - typedef itk::SmartPointer Pointer; - typedef itk::SmartPointer ConstPointer; - - /** Class methods used to interface with the registered factories. */ - virtual const char* GetITKSourceVersion(void) const; - virtual const char* GetDescription(void) const; - - /** Method for class instantiation. */ - itkFactorylessNewMacro(Self); - static NrrdDiffusionImageIOFactory* FactoryNew() { return new NrrdDiffusionImageIOFactory;} - /** Run-time type information (and related methods). */ - itkTypeMacro(NrrdDiffusionImageIOFactory, ObjectFactoryBase); - - /** Register one factory of this type */ - static void RegisterOneFactory(void) - { - static bool IsRegistered = false; - if ( !IsRegistered ) - { - NrrdDiffusionImageIOFactory::Pointer fac = NrrdDiffusionImageIOFactory::New(); - ObjectFactoryBase::RegisterFactory( fac ); - IsRegistered = true; - } - } - -protected: - NrrdDiffusionImageIOFactory(); - ~NrrdDiffusionImageIOFactory(); - -private: - NrrdDiffusionImageIOFactory(const Self&); //purposely not implemented - void operator=(const Self&); //purposely not implemented - -}; - - -} // end namespace mitk - -#endif // __MITK_NRRD_DIFFUSION_VOULMES_IO_FACTORY_H_HEADER__ diff --git a/Modules/DiffusionImaging/DiffusionIO/mitkNrrdDiffusionImageReader.cpp b/Modules/DiffusionImaging/DiffusionIO/mitkNrrdDiffusionImageReader.cpp index be41bfc08b..2304d99218 100644 --- a/Modules/DiffusionImaging/DiffusionIO/mitkNrrdDiffusionImageReader.cpp +++ b/Modules/DiffusionImaging/DiffusionIO/mitkNrrdDiffusionImageReader.cpp @@ -1,532 +1,430 @@ /*=================================================================== 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 __mitkNrrdDiffusionImageReader_cpp #define __mitkNrrdDiffusionImageReader_cpp #include "mitkNrrdDiffusionImageReader.h" #include "itkImageFileReader.h" #include "itkMetaDataObject.h" #include "itkNrrdImageIO.h" #include "itkNiftiImageIO.h" #include #include #include "itksys/SystemTools.hxx" +#include "mitkCustomMimeType.h" namespace mitk { - template - void NrrdDiffusionImageReader - ::GenerateData() - { +NrrdDiffusionImageReader:: +NrrdDiffusionImageReader(const NrrdDiffusionImageReader & other) + : AbstractFileReader(other) +{ +} - // Since everything is completely read in GenerateOutputInformation() it is stored - // in a cache variable. A timestamp is associated. - // If the timestamp of the cache variable is newer than the MTime, we only need to - // assign the cache variable to the DataObject. - // Otherwise, the tree must be read again from the file and OuputInformation must - // be updated! - if ( ( ! m_OutputCache ) || ( this->GetMTime( ) > m_CacheTime.GetMTime( ) ) ) - { - this->GenerateOutputInformation(); - itkWarningMacro("Cache regenerated!"); - } - if (!m_OutputCache) - { - itkWarningMacro("cache is empty!"); - } +NrrdDiffusionImageReader* NrrdDiffusionImageReader::Clone() const +{ + return new NrrdDiffusionImageReader(*this); +} - static_cast(this->GetOutput()) - ->SetVectorImage(m_OutputCache->GetVectorImage()); - static_cast(this->GetOutput()) - ->SetReferenceBValue(m_OutputCache->GetReferenceBValue()); - static_cast(this->GetOutput()) - ->SetMeasurementFrame(m_OutputCache->GetMeasurementFrame()); - static_cast(this->GetOutput()) - ->SetDirections(m_OutputCache->GetDirections()); - static_cast(this->GetOutput()) - ->InitializeFromVectorImage(); - } - template - void NrrdDiffusionImageReader::GenerateOutputInformation() - { - typename OutputType::Pointer outputForCache = OutputType::New(); - if ( m_FileName == "") - { - throw itk::ImageFileReaderException(__FILE__, __LINE__, "Sorry, the filename to be read is empty!"); - } - else - { - try - { - const std::string& locale = "C"; - const std::string& currLocale = setlocale( LC_ALL, NULL ); +NrrdDiffusionImageReader:: +~NrrdDiffusionImageReader() +{} - if ( locale.compare(currLocale)!=0 ) - { - try - { - setlocale(LC_ALL, locale.c_str()); - } - catch(...) - { - MITK_INFO << "Could not set locale " << locale; - } - } +NrrdDiffusionImageReader:: +NrrdDiffusionImageReader() + : AbstractFileReader() +{ + std::string category = "Diffusion Weighted Image"; + CustomMimeType customMimeType; + customMimeType.SetCategory(category); + customMimeType.AddExtension("hdwi"); + customMimeType.AddExtension("dwi"); + customMimeType.AddExtension("fsl"); + customMimeType.AddExtension("fslgz"); + + this->SetDescription(category); + this->SetMimeType(customMimeType); + + m_ServiceReg = this->RegisterService(); +} + +std::vector > +NrrdDiffusionImageReader:: +Read() +{ + std::vector > result; - MITK_INFO << "NrrdDiffusionImageReader: reading image information"; - typename ImageType::Pointer img; + // Since everything is completely read in GenerateOutputInformation() it is stored + // in a cache variable. A timestamp is associated. + // If the timestamp of the cache variable is newer than the MTime, we only need to + // assign the cache variable to the DataObject. + // Otherwise, the tree must be read again from the file and OuputInformation must + // be updated! - std::string ext = itksys::SystemTools::GetFilenameLastExtension(m_FileName); - ext = itksys::SystemTools::LowerCase(ext); - if (ext == ".hdwi" || ext == ".dwi") - { - typedef itk::ImageFileReader FileReaderType; - typename FileReaderType::Pointer reader = FileReaderType::New(); - reader->SetFileName(this->m_FileName); - itk::NrrdImageIO::Pointer io = itk::NrrdImageIO::New(); - reader->SetImageIO(io); - reader->Update(); - img = reader->GetOutput(); + if(m_OutputCache.IsNull()) InternalRead(); + + OutputType::Pointer resultImage = OutputType::New(); + resultImage->SetVectorImage(m_OutputCache->GetVectorImage()); + resultImage->SetReferenceBValue(m_OutputCache->GetReferenceBValue()); + resultImage->SetMeasurementFrame(m_OutputCache->GetMeasurementFrame()); + resultImage->SetDirections(m_OutputCache->GetDirections()); + resultImage->InitializeFromVectorImage(); + + result.push_back(resultImage.GetPointer()); + return result; +} - int vecsize = img->GetVectorLength(); - std::cout << vecsize << std::endl; +void NrrdDiffusionImageReader::InternalRead() +{ + OutputType::Pointer outputForCache = OutputType::New(); + if ( this->GetInputLocation() == "") + { + throw itk::ImageFileReaderException(__FILE__, __LINE__, "Sorry, the filename to be read is empty!"); + } + else + { + try + { + const std::string& locale = "C"; + const std::string& currLocale = setlocale( LC_ALL, NULL ); + if ( locale.compare(currLocale)!=0 ) + { + try + { + setlocale(LC_ALL, locale.c_str()); } - else if(ext == ".fsl" || ext == ".fslgz") + catch(...) { - // create temporary file with correct ending for nifti-io - std::string fname3 = "temp_dwi"; - fname3 += ext == ".fsl" ? ".nii" : ".nii.gz"; - itksys::SystemTools::CopyAFile(m_FileName.c_str(), fname3.c_str()); - - // create reader and read file - typedef itk::Image ImageType4D; - itk::NiftiImageIO::Pointer io2 = itk::NiftiImageIO::New(); - typedef itk::ImageFileReader FileReaderType; - typename FileReaderType::Pointer reader = FileReaderType::New(); - reader->SetFileName(fname3); - reader->SetImageIO(io2); - reader->Update(); - typename ImageType4D::Pointer img4 = reader->GetOutput(); - - // delete temporary file - itksys::SystemTools::RemoveFile(fname3.c_str()); - - // convert 4D file to vector image - img = ImageType::New(); - - typename ImageType::SpacingType spacing; - typename ImageType4D::SpacingType spacing4 = img4->GetSpacing(); - for(int i=0; i<3; i++) - spacing[i] = spacing4[i]; - img->SetSpacing( spacing ); // Set the image spacing + MITK_INFO << "Could not set locale " << locale; + } + } - typename ImageType::PointType origin; - typename ImageType4D::PointType origin4 = img4->GetOrigin(); - for(int i=0; i<3; i++) - origin[i] = origin4[i]; - img->SetOrigin( origin ); // Set the image origin - typename ImageType::DirectionType direction; - typename ImageType4D::DirectionType direction4 = img4->GetDirection(); - for(int i=0; i<3; i++) - for(int j=0; j<3; j++) - direction[i][j] = direction4[i][j]; - img->SetDirection( direction ); // Set the image direction + MITK_INFO << "NrrdDiffusionImageReader: reading image information"; + ImageType::Pointer img; - typename ImageType::RegionType region; - typename ImageType4D::RegionType region4 = img4->GetLargestPossibleRegion(); + std::string ext = itksys::SystemTools::GetFilenameLastExtension(this->GetInputLocation()); + ext = itksys::SystemTools::LowerCase(ext); + if (ext == ".hdwi" || ext == ".dwi") + { + typedef itk::ImageFileReader FileReaderType; + FileReaderType::Pointer reader = FileReaderType::New(); + reader->SetFileName(this->GetInputLocation()); + itk::NrrdImageIO::Pointer io = itk::NrrdImageIO::New(); + reader->SetImageIO(io); + reader->Update(); + img = reader->GetOutput(); - typename ImageType::RegionType::SizeType size; - typename ImageType4D::RegionType::SizeType size4 = region4.GetSize(); + int vecsize = img->GetVectorLength(); + std::cout << vecsize << std::endl; - for(int i=0; i<3; i++) - size[i] = size4[i]; - typename ImageType::RegionType::IndexType index; - typename ImageType4D::RegionType::IndexType index4 = region4.GetIndex(); - for(int i=0; i<3; i++) - index[i] = index4[i]; + } + else if(ext == ".fsl" || ext == ".fslgz") + { + // create temporary file with correct ending for nifti-io + std::string fname3 = "temp_dwi"; + fname3 += ext == ".fsl" ? ".nii" : ".nii.gz"; + itksys::SystemTools::CopyAFile(this->GetInputLocation().c_str(), fname3.c_str()); + + // create reader and read file + typedef itk::Image ImageType4D; + itk::NiftiImageIO::Pointer io2 = itk::NiftiImageIO::New(); + typedef itk::ImageFileReader FileReaderType; + FileReaderType::Pointer reader = FileReaderType::New(); + reader->SetFileName(fname3); + reader->SetImageIO(io2); + reader->Update(); + ImageType4D::Pointer img4 = reader->GetOutput(); - region.SetSize(size); - region.SetIndex(index); - img->SetRegions( region ); + // delete temporary file + itksys::SystemTools::RemoveFile(fname3.c_str()); - img->SetVectorLength(size4[3]); - img->Allocate(); + // convert 4D file to vector image + img = ImageType::New(); - itk::ImageRegionIterator it (img, img->GetLargestPossibleRegion() ); - typedef typename ImageType::PixelType VecPixType; - for (it.GoToBegin(); !it.IsAtEnd(); ++it) - { - VecPixType vec = it.Get(); - typename ImageType::IndexType currentIndex = it.GetIndex(); - for(int i=0; i<3; i++) - index4[i] = currentIndex[i]; - for(unsigned int ind=0; indGetPixel(index4); - } - it.Set(vec); - } - } + ImageType::SpacingType spacing; + ImageType4D::SpacingType spacing4 = img4->GetSpacing(); + for(int i=0; i<3; i++) + spacing[i] = spacing4[i]; + img->SetSpacing( spacing ); // Set the image spacing - m_DiffusionVectors = GradientDirectionContainerType::New(); - m_OriginalDiffusionVectors = GradientDirectionContainerType::New(); - if (ext == ".hdwi" || ext == ".dwi") - { + ImageType::PointType origin; + ImageType4D::PointType origin4 = img4->GetOrigin(); + for(int i=0; i<3; i++) + origin[i] = origin4[i]; + img->SetOrigin( origin ); // Set the image origin - itk::MetaDataDictionary imgMetaDictionary = img->GetMetaDataDictionary(); - std::vector imgMetaKeys = imgMetaDictionary.GetKeys(); - std::vector::const_iterator itKey = imgMetaKeys.begin(); - std::string metaString; + ImageType::DirectionType direction; + ImageType4D::DirectionType direction4 = img4->GetDirection(); + for(int i=0; i<3; i++) + for(int j=0; j<3; j++) + direction[i][j] = direction4[i][j]; + img->SetDirection( direction ); // Set the image direction - GradientDirectionType vect3d; + ImageType::RegionType region; + ImageType4D::RegionType region4 = img4->GetLargestPossibleRegion(); - int numberOfImages = 0; - int numberOfGradientImages = 0; - bool readb0 = false; - double xx, xy, xz, yx, yy, yz, zx, zy, zz; + ImageType::RegionType::SizeType size; + ImageType4D::RegionType::SizeType size4 = region4.GetSize(); - for (; itKey != imgMetaKeys.end(); itKey ++) - { - double x,y,z; + for(int i=0; i<3; i++) + size[i] = size4[i]; - itk::ExposeMetaData (imgMetaDictionary, *itKey, metaString); - if (itKey->find("DWMRI_gradient") != std::string::npos) - { - sscanf(metaString.c_str(), "%lf %lf %lf\n", &x, &y, &z); - vect3d[0] = x; vect3d[1] = y; vect3d[2] = z; - m_DiffusionVectors->InsertElement( numberOfImages, vect3d ); - ++numberOfImages; - // If the direction is 0.0, this is a reference image - if (vect3d[0] == 0.0 && - vect3d[1] == 0.0 && - vect3d[2] == 0.0) - { - continue; - } - ++numberOfGradientImages;; - } - else if (itKey->find("DWMRI_b-value") != std::string::npos) - { - readb0 = true; - m_B_Value = atof(metaString.c_str()); - } - else if (itKey->find("measurement frame") != std::string::npos) - { - sscanf(metaString.c_str(), " ( %lf , %lf , %lf ) ( %lf , %lf , %lf ) ( %lf , %lf , %lf ) \n", &xx, &xy, &xz, &yx, &yy, &yz, &zx, &zy, &zz); - - if (xx>10e-10 || xy>10e-10 || xz>10e-10 || - yx>10e-10 || yy>10e-10 || yz>10e-10 || - zx>10e-10 || zy>10e-10 || zz>10e-10 ) - { - m_MeasurementFrame(0,0) = xx; - m_MeasurementFrame(0,1) = xy; - m_MeasurementFrame(0,2) = xz; - m_MeasurementFrame(1,0) = yx; - m_MeasurementFrame(1,1) = yy; - m_MeasurementFrame(1,2) = yz; - m_MeasurementFrame(2,0) = zx; - m_MeasurementFrame(2,1) = zy; - m_MeasurementFrame(2,2) = zz; - } - else - { - m_MeasurementFrame(0,0) = 1; - m_MeasurementFrame(0,1) = 0; - m_MeasurementFrame(0,2) = 0; - m_MeasurementFrame(1,0) = 0; - m_MeasurementFrame(1,1) = 1; - m_MeasurementFrame(1,2) = 0; - m_MeasurementFrame(2,0) = 0; - m_MeasurementFrame(2,1) = 0; - m_MeasurementFrame(2,2) = 1; - } - } - } + ImageType::RegionType::IndexType index; + ImageType4D::RegionType::IndexType index4 = region4.GetIndex(); + for(int i=0; i<3; i++) + index[i] = index4[i]; + + region.SetSize(size); + region.SetIndex(index); + img->SetRegions( region ); + + img->SetVectorLength(size4[3]); + img->Allocate(); - if(!readb0) + itk::ImageRegionIterator it (img, img->GetLargestPossibleRegion() ); + typedef ImageType::PixelType VecPixType; + for (it.GoToBegin(); !it.IsAtEnd(); ++it) + { + VecPixType vec = it.Get(); + ImageType::IndexType currentIndex = it.GetIndex(); + for(int i=0; i<3; i++) + index4[i] = currentIndex[i]; + for(unsigned int ind=0; indGetPixel(index4); } - + it.Set(vec); } - else if(ext == ".fsl" || ext == ".fslgz") + } + + m_DiffusionVectors = GradientDirectionContainerType::New(); + m_OriginalDiffusionVectors = GradientDirectionContainerType::New(); + if (ext == ".hdwi" || ext == ".dwi") + { + + itk::MetaDataDictionary imgMetaDictionary = img->GetMetaDataDictionary(); + std::vector imgMetaKeys = imgMetaDictionary.GetKeys(); + std::vector::const_iterator itKey = imgMetaKeys.begin(); + std::string metaString; + + GradientDirectionType vect3d; + + int numberOfImages = 0; + int numberOfGradientImages = 0; + bool readb0 = false; + double xx, xy, xz, yx, yy, yz, zx, zy, zz; + + for (; itKey != imgMetaKeys.end(); itKey ++) { + double x,y,z; - std::string line; - std::vector bvec_entries; - std::string fname = m_FileName; - fname += ".bvecs"; - std::ifstream myfile (fname.c_str()); - if (myfile.is_open()) + itk::ExposeMetaData (imgMetaDictionary, *itKey, metaString); + if (itKey->find("DWMRI_gradient") != std::string::npos) { - while ( myfile.good() ) + sscanf(metaString.c_str(), "%lf %lf %lf\n", &x, &y, &z); + vect3d[0] = x; vect3d[1] = y; vect3d[2] = z; + m_DiffusionVectors->InsertElement( numberOfImages, vect3d ); + ++numberOfImages; + // If the direction is 0.0, this is a reference image + if (vect3d[0] == 0.0 && + vect3d[1] == 0.0 && + vect3d[2] == 0.0) { - getline (myfile,line); - char* pch = strtok (const_cast(line.c_str())," "); - while (pch != NULL) - { - bvec_entries.push_back(atof(pch)); - pch = strtok (NULL, " "); - } + continue; } - myfile.close(); + ++numberOfGradientImages;; } - else + else if (itKey->find("DWMRI_b-value") != std::string::npos) { - MITK_INFO << "Unable to open bvecs file"; + readb0 = true; + m_B_Value = atof(metaString.c_str()); } - - std::vector bval_entries; - std::string fname2 = m_FileName; - fname2 += ".bvals"; - std::ifstream myfile2 (fname2.c_str()); - if (myfile2.is_open()) + else if (itKey->find("measurement frame") != std::string::npos) { - while ( myfile2.good() ) + sscanf(metaString.c_str(), " ( %lf , %lf , %lf ) ( %lf , %lf , %lf ) ( %lf , %lf , %lf ) \n", &xx, &xy, &xz, &yx, &yy, &yz, &zx, &zy, &zz); + + if (xx>10e-10 || xy>10e-10 || xz>10e-10 || + yx>10e-10 || yy>10e-10 || yz>10e-10 || + zx>10e-10 || zy>10e-10 || zz>10e-10 ) { - getline (myfile2,line); - char* pch = strtok (const_cast(line.c_str())," "); - while (pch != NULL) - { - bval_entries.push_back(atof(pch)); - pch = strtok (NULL, " "); - } + m_MeasurementFrame(0,0) = xx; + m_MeasurementFrame(0,1) = xy; + m_MeasurementFrame(0,2) = xz; + m_MeasurementFrame(1,0) = yx; + m_MeasurementFrame(1,1) = yy; + m_MeasurementFrame(1,2) = yz; + m_MeasurementFrame(2,0) = zx; + m_MeasurementFrame(2,1) = zy; + m_MeasurementFrame(2,2) = zz; } - myfile2.close(); - } - else - { - MITK_INFO << "Unable to open bvals file"; - } - - - m_B_Value = -1; - unsigned int numb = bval_entries.size(); - for(unsigned int i=0; i vec; - vec[0] = bvec_entries.at(i); - vec[1] = bvec_entries.at(i+numb); - vec[2] = bvec_entries.at(i+2*numb); + } + else if(ext == ".fsl" || ext == ".fslgz") + { - // Adjust the vector length to encode gradient strength - float factor = b_val/m_B_Value; - if(vec.magnitude() > 0) + std::string line; + std::vector bvec_entries; + std::string fname = this->GetInputLocation(); + fname += ".bvecs"; + std::ifstream myfile (fname.c_str()); + if (myfile.is_open()) + { + while ( myfile.good() ) + { + getline (myfile,line); + char* pch = strtok (const_cast(line.c_str())," "); + while (pch != NULL) { - vec[0] = sqrt(factor)*vec[0]; - vec[1] = sqrt(factor)*vec[1]; - vec[2] = sqrt(factor)*vec[2]; + bvec_entries.push_back(atof(pch)); + pch = strtok (NULL, " "); } - - m_DiffusionVectors->InsertElement(i,vec); } - - for(int i=0; i<3; i++) - for(int j=0; j<3; j++) - m_MeasurementFrame[i][j] = i==j ? 1 : 0; + myfile.close(); + } + else + { + MITK_INFO << "Unable to open bvecs file"; } - outputForCache->SetVectorImage(img); - outputForCache->SetReferenceBValue(m_B_Value); - outputForCache->SetMeasurementFrame(m_MeasurementFrame); - outputForCache->SetDirections(m_DiffusionVectors); - - - // Since we have already read the tree, we can store it in a cache variable - // so that it can be assigned to the DataObject in GenerateData(); - m_OutputCache = outputForCache; - m_CacheTime.Modified(); - - try + std::vector bval_entries; + std::string fname2 = this->GetInputLocation(); + fname2 += ".bvals"; + std::ifstream myfile2 (fname2.c_str()); + if (myfile2.is_open()) { - setlocale(LC_ALL, currLocale.c_str()); + while ( myfile2.good() ) + { + getline (myfile2,line); + char* pch = strtok (const_cast(line.c_str())," "); + while (pch != NULL) + { + bval_entries.push_back(atof(pch)); + pch = strtok (NULL, " "); + } + } + myfile2.close(); } - catch(...) + else { - MITK_INFO << "Could not reset locale " << currLocale; + MITK_INFO << "Unable to open bvals file"; } - } - catch(std::exception& e) - { - MITK_INFO << "Std::Exception while reading file!!"; - MITK_INFO << e.what(); - throw itk::ImageFileReaderException(__FILE__, __LINE__, e.what()); - } - catch(...) - { - MITK_INFO << "Exception while reading file!!"; - throw itk::ImageFileReaderException(__FILE__, __LINE__, "Sorry, an error occurred while reading the requested vessel tree file!"); - } - } - } - template - const char* NrrdDiffusionImageReader - ::GetFileName() const - { - return m_FileName.c_str(); - } + m_B_Value = -1; + unsigned int numb = bval_entries.size(); + for(unsigned int i=0; i - void NrrdDiffusionImageReader - ::SetFileName(const char* aFileName) - { - m_FileName = aFileName; - } + // Take the first entry in bvals as the reference b-value + if(m_B_Value == -1 && bval_entries.at(i) != 0) + { + m_B_Value = bval_entries.at(i); + } - template - const char* NrrdDiffusionImageReader - ::GetFilePrefix() const - { - return m_FilePrefix.c_str(); - } + float b_val = bval_entries.at(i); - template - void NrrdDiffusionImageReader - ::SetFilePrefix(const char* aFilePrefix) - { - m_FilePrefix = aFilePrefix; - } - template - const char* NrrdDiffusionImageReader - ::GetFilePattern() const - { - return m_FilePattern.c_str(); - } + vnl_vector_fixed< double, 3 > vec; + vec[0] = bvec_entries.at(i); + vec[1] = bvec_entries.at(i+numb); + vec[2] = bvec_entries.at(i+2*numb); - template - void NrrdDiffusionImageReader - ::SetFilePattern(const char* aFilePattern) - { - m_FilePattern = aFilePattern; - } + // Adjust the vector length to encode gradient strength + float factor = b_val/m_B_Value; + if(vec.magnitude() > 0) + { + vec[0] = sqrt(factor)*vec[0]; + vec[1] = sqrt(factor)*vec[1]; + vec[2] = sqrt(factor)*vec[2]; + } - template - bool NrrdDiffusionImageReader - ::CanReadFile(const std::string filename, const std::string /*filePrefix*/, const std::string /*filePattern*/) - { - // First check the extension - if( filename == "" ) - { - return false; - } - std::string ext = itksys::SystemTools::GetFilenameLastExtension(filename); - ext = itksys::SystemTools::LowerCase(ext); + m_DiffusionVectors->InsertElement(i,vec); + } + + for(int i=0; i<3; i++) + for(int j=0; j<3; j++) + m_MeasurementFrame[i][j] = i==j ? 1 : 0; + } + + outputForCache->SetVectorImage(img); + outputForCache->SetReferenceBValue(m_B_Value); + outputForCache->SetMeasurementFrame(m_MeasurementFrame); + outputForCache->SetDirections(m_DiffusionVectors); - if (ext == ".hdwi" || ext == ".dwi") - { - itk::NrrdImageIO::Pointer io = itk::NrrdImageIO::New(); - typedef itk::ImageFileReader FileReaderType; - typename FileReaderType::Pointer reader = FileReaderType::New(); - reader->SetImageIO(io); - reader->SetFileName(filename); + // Since we have already read the tree, we can store it in a cache variable + // so that it can be assigned to the DataObject in GenerateData(); + m_OutputCache = outputForCache; + m_CacheTime.Modified(); try { - reader->Update(); - } - catch(itk::ExceptionObject e) - { - MITK_INFO << e.GetDescription(); + setlocale(LC_ALL, currLocale.c_str()); } - - typename ImageType::Pointer img = reader->GetOutput(); - itk::MetaDataDictionary imgMetaDictionary = img->GetMetaDataDictionary(); - std::vector imgMetaKeys = imgMetaDictionary.GetKeys(); - std::vector::const_iterator itKey = imgMetaKeys.begin(); - std::string metaString; - - for (; itKey != imgMetaKeys.end(); itKey ++) + catch(...) { - itk::ExposeMetaData (imgMetaDictionary, *itKey, metaString); - if (itKey->find("modality") != std::string::npos) - { - if (metaString.find("DWMRI") != std::string::npos) - { - return true; - } - } + MITK_INFO << "Could not reset locale " << currLocale; } } - - if (ext == ".fsl" || ext == ".fslgz") + catch(std::exception& e) { - // itk::NiftiImageIO::Pointer io2 = itk::NiftiImageIO::New(); - - // typedef itk::ImageFileReader FileReaderType; - // typename FileReaderType::Pointer reader = FileReaderType::New(); - // reader->SetImageIO(io2); - // reader->SetFileName(filename); - - // try - // { - // reader->Update(); - // } - // catch(itk::ExceptionObject e) - // { - // MITK_INFO << e.GetDescription(); - // } - - std::string fname = filename; - fname += ".bvecs"; - - std::string fname2 = filename; - fname2 += ".bvals"; - - if( itksys::SystemTools::FileExists(fname.c_str()) - && itksys::SystemTools::FileExists(fname2.c_str()) ) - { - return true; - } - else - { - MITK_INFO << ".bvals and .bvals files do not exist properly"; - } - + MITK_INFO << "Std::Exception while reading file!!"; + MITK_INFO << e.what(); + throw itk::ImageFileReaderException(__FILE__, __LINE__, e.what()); + } + catch(...) + { + MITK_INFO << "Exception while reading file!!"; + throw itk::ImageFileReaderException(__FILE__, __LINE__, "Sorry, an error occurred while reading the requested vessel tree file!"); } - - return false; } +} } //namespace MITK #endif diff --git a/Modules/DiffusionImaging/DiffusionIO/mitkNrrdDiffusionImageReader.h b/Modules/DiffusionImaging/DiffusionIO/mitkNrrdDiffusionImageReader.h index 20cad8b1da..f7c10669af 100644 --- a/Modules/DiffusionImaging/DiffusionIO/mitkNrrdDiffusionImageReader.h +++ b/Modules/DiffusionImaging/DiffusionIO/mitkNrrdDiffusionImageReader.h @@ -1,87 +1,72 @@ /*=================================================================== 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 __mitkNrrdDiffusionImageReader_h #define __mitkNrrdDiffusionImageReader_h #include "mitkCommon.h" #include "itkVectorContainer.h" #include "mitkFileReader.h" #include "vnl/vnl_vector_fixed.h" #include "vnl/vnl_matrix_fixed.h" -#include "mitkDiffusionImageSource.h" + #include "itkVectorImage.h" +#include "mitkAbstractFileReader.h" +#include "mitkDiffusionImage.h" namespace mitk { /** \brief */ - template < class TPixelType > - class NrrdDiffusionImageReader : public mitk::DiffusionImageSource, public FileReader + class NrrdDiffusionImageReader : public mitk::AbstractFileReader { public: - typedef mitk::DiffusionImage OutputType; - typedef itk::VectorImage ImageType; - typedef DiffusionImageSource DiffVolSourceType; - typedef vnl_vector_fixed< double, 3 > GradientDirectionType; - typedef vnl_matrix_fixed< double, 3, 3 > MeasurementFrameType; - typedef itk::VectorContainer< unsigned int, - GradientDirectionType > GradientDirectionContainerType; - - mitkClassMacro( NrrdDiffusionImageReader, DiffVolSourceType ); - itkFactorylessNewMacro(Self) - itkCloneMacro(Self) + NrrdDiffusionImageReader(const NrrdDiffusionImageReader & other); + NrrdDiffusionImageReader(); + virtual ~NrrdDiffusionImageReader(); - const char* GetFileName() const; - void SetFileName(const char* aFileName); - const char* GetFilePrefix() const; - void SetFilePrefix(const char* aFilePrefix); - const char* GetFilePattern() const; - void SetFilePattern(const char* aFilePattern); + using AbstractFileReader::Read; + virtual std::vector > Read(); - static bool CanReadFile(const std::string filename, const std::string filePrefix, const std::string filePattern); + typedef mitk::DiffusionImage OutputType; + typedef itk::VectorImage ImageType; + typedef vnl_vector_fixed< double, 3 > GradientDirectionType; + typedef vnl_matrix_fixed< double, 3, 3 > MeasurementFrameType; + typedef itk::VectorContainer< unsigned int,GradientDirectionType > GradientDirectionContainerType; protected: - - /** Does the real work. */ - virtual void GenerateData(); - virtual void GenerateOutputInformation(); - - std::string m_FileName; - std::string m_FilePrefix; - std::string m_FilePattern; - - typename OutputType::Pointer m_OutputCache; + OutputType::Pointer m_OutputCache; itk::TimeStamp m_CacheTime; - GradientDirectionContainerType::Pointer m_OriginalDiffusionVectors; GradientDirectionContainerType::Pointer m_DiffusionVectors; float m_B_Value; - MeasurementFrameType m_MeasurementFrame; + void InternalRead(); + private: - void operator=(const Self&); //purposely not implemented + + NrrdDiffusionImageReader* Clone() const; + us::ServiceRegistration m_ServiceReg; }; } //namespace MITK -#include "mitkNrrdDiffusionImageReader.cpp" #endif // __mitkNrrdDiffusionImageReader_h