diff --git a/Modules/DiffusionImaging/IODataStructures/TbssImages/mitkTbssGradientImage.cpp b/Modules/DiffusionImaging/IODataStructures/TbssImages/mitkTbssGradientImage.cpp deleted file mode 100644 index 345e30ec1e..0000000000 --- a/Modules/DiffusionImaging/IODataStructures/TbssImages/mitkTbssGradientImage.cpp +++ /dev/null @@ -1,109 +0,0 @@ -/*========================================================================= - -Program: Medical Imaging & Interaction Toolkit -Language: C++ -Date: $Date: 2008-02-08 11:19:03 +0100 (Fr, 08 Feb 2008) $ -Version: $Revision: 11989 $ - -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 __mitkTbssGradientImage__cpp -#define __mitkTbssGradientImage__cpp - - -#include "mitkTbssGradientImage.h" -#include "itkImageRegionIterator.h" -#include "itkImageRegionConstIterator.h" -#include "mitkImageCast.h" - - - - -mitk::TbssGradientImage::TbssGradientImage() -{ - -} - - -void mitk::TbssGradientImage::InitializeFromVectorImage() -{ - if(!m_Image) - { - MITK_INFO << "TBSS Gradient Image could not be initialized. Set all members first!" << std::endl; - return; - } - - - typedef itk::Image ImgType; - ImgType::Pointer img = ImgType::New(); - img->SetSpacing( m_Image->GetSpacing() ); // Set the image spacing - img->SetOrigin( m_Image->GetOrigin() ); // Set the image origin - img->SetDirection( m_Image->GetDirection() ); // Set the image direction - img->SetLargestPossibleRegion( m_Image->GetLargestPossibleRegion()); - img->SetBufferedRegion( m_Image->GetLargestPossibleRegion() ); - img->Allocate(); - - InitializeByItk( img.GetPointer(), 1, 3 ); - - itk::ImageRegionIterator itw (img, img->GetLargestPossibleRegion() ); - itw = itw.Begin(); - - itk::ImageRegionConstIterator itr (m_Image, m_Image->GetLargestPossibleRegion() ); - itr = itr.Begin(); - - while(!itr.IsAtEnd()) - { - itw.Set(itr.Get().GetElement(0)); - ++itr; - ++itw; - } - - - SetImportVolume(img->GetBufferPointer());//, 0, 0, CopyMemory); - - m_DisplayIndex = 0; - MITK_INFO << "Tbss-Image successfully initialized."; - -} - - -void mitk::TbssGradientImage::SetDisplayIndexForRendering(int displayIndex) -{ - MITK_INFO << "displayindex: " << displayIndex; - int index = displayIndex; - int vecLength = m_Image->GetVectorLength(); - index = index > vecLength-1 ? vecLength-1 : index; - if( m_DisplayIndex != index ) - { - typedef itk::Image ImgType; - ImgType::Pointer img = ImgType::New(); - CastToItkImage(this, img); - - itk::ImageRegionIterator itw (img, img->GetLargestPossibleRegion() ); - itw = itw.Begin(); - - itk::ImageRegionConstIterator itr (m_Image, m_Image->GetLargestPossibleRegion() ); - itr = itr.Begin(); - - while(!itr.IsAtEnd()) - { - itw.Set(itr.Get().GetElement(index)); - ++itr; - ++itw; - } - } - - m_DisplayIndex = index; -} - - - -#endif /* __mitkTbssGradientImage__cpp */ diff --git a/Modules/DiffusionImaging/IODataStructures/TbssImages/mitkTbssGradientImage.h b/Modules/DiffusionImaging/IODataStructures/TbssImages/mitkTbssGradientImage.h deleted file mode 100644 index 33a847d103..0000000000 --- a/Modules/DiffusionImaging/IODataStructures/TbssImages/mitkTbssGradientImage.h +++ /dev/null @@ -1,94 +0,0 @@ -/*========================================================================= - -Program: Medical Imaging & Interaction Toolkit -Language: C++ -Date: $Date: 2008-02-07 17:17:57 +0100 (Do, 07 Feb 2008) $ -Version: $Revision: 11989 $ - -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 __mitkTbssGradientImage__h -#define __mitkTbssGradientImage__h - -#include "mitkImage.h" -#include "itkVectorImage.h" -#include "mitkImageCast.h" -#include "MitkDiffusionImagingExports.h" - -namespace mitk -{ - - /** - * \brief this class encapsulates tbss gradient images (vectorimages not - * yet supported by mitkImage) - */ - - class MitkDiffusionImaging_EXPORT TbssGradientImage : public Image - { - - public: - - typedef itk::VectorImage ImageType; - - - typedef itk::Index<3> IndexType; - //typedef typename std::vector > RoiType; - - mitkClassMacro( TbssGradientImage, Image ) - itkNewMacro(Self) - - - //void SetRequestedRegionToLargestPossibleReg tbssRoi->SetTbssType(mitk::TbssImage::ROI);ion(); - //bool RequestedRegionIsOutsideOfTheBufferedRegion(); - //virtual bool VerifyRequestedRegion(); - //void SetRequestedRegion(itk::DataObject *data); - - ImageType::Pointer GetImage() - { - return m_Image; - } - void SetImage(ImageType::Pointer image ) - { - this->m_Image = image; - } - - - void InitializeFromImage() - { - MITK_INFO << "make an mitk image that can be shown by mitk"; - this->InitializeByItk(m_Image.GetPointer(),1,1); - } - - - void InitializeFromVectorImage(); - - void SetDisplayIndexForRendering(int displayIndex); - - - - protected: - - TbssGradientImage(); - - virtual ~TbssGradientImage(){} - - ImageType::Pointer m_Image; - - int m_DisplayIndex; - - }; - - - -} // namespace mitk - -#endif /* __mitkTbssGradientImage__h */