17 #ifndef __mitkTbssImage__cpp
18 #define __mitkTbssImage__cpp
22 #include "itkImageRegionIterator.h"
23 #include "itkImageRegionConstIterator.h"
39 MITK_INFO <<
"TBSS Image could not be initialized. Set all members first!" << std::endl;
44 typedef itk::Image<float,3> ImgType;
46 img->SetSpacing( m_Image->GetSpacing() );
47 img->SetOrigin( m_Image->GetOrigin() );
48 img->SetDirection( m_Image->GetDirection() );
49 img->SetLargestPossibleRegion( m_Image->GetLargestPossibleRegion());
50 img->SetBufferedRegion( m_Image->GetLargestPossibleRegion() );
53 int vecLength = m_Image->GetVectorLength();
54 InitializeByItk( img.GetPointer(), 1, vecLength );
60 itk::ImageRegionIterator<ImgType> itw (img, img->GetLargestPossibleRegion() );
63 itk::ImageRegionConstIterator<ImageType> itr (m_Image, m_Image->GetLargestPossibleRegion() );
68 itw.Set(itr.Get().GetElement(0));
74 SetImportVolume(img->GetBufferPointer());
79 MITK_INFO <<
"Tbss-Image successfully initialized.";
85 MITK_INFO <<
"displayindex: " << displayIndex;
86 int index = displayIndex;
87 int vecLength = m_Image->GetVectorLength();
88 index = index > vecLength-1 ? vecLength-1 : index;
89 if( m_DisplayIndex != index )
91 typedef itk::Image<float,3> ImgType;
95 itk::ImageRegionIterator<ImgType> itw (img, img->GetLargestPossibleRegion() );
98 itk::ImageRegionConstIterator<ImageType> itr (m_Image, m_Image->GetLargestPossibleRegion() );
101 while(!itr.IsAtEnd())
103 itw.Set(itr.Get().GetElement(index));
109 m_DisplayIndex = index;
void SetDisplayIndexForRendering(int displayIndex)
itk::SmartPointer< Self > Pointer
void InitializeFromVectorImage()
void MITKCORE_EXPORT CastToItkImage(const mitk::Image *mitkImage, itk::SmartPointer< ItkOutputImageType > &itkOutputImage)
Cast an mitk::Image to an itk::Image with a specific type.
static itkEventMacro(BoundingShapeInteractionEvent, itk::AnyEvent) class MITKBOUNDINGSHAPE_EXPORT BoundingShapeInteractor Pointer New()
Basic interaction methods for mitk::GeometryData.