17 #ifndef __mitkTbssImporter_cpp
18 #define __mitkTbssImporter_cpp
34 template <
typename TPixel>
46 DataImageType::SizeType dataSize;
51 m_Data->SetRegions(dataSize);
54 DataImageType::SpacingType dataSpacing;
55 dataSpacing[0] = spacing[0];
56 dataSpacing[1] = spacing[1];
57 dataSpacing[2] = spacing[2];
58 m_Data->SetSpacing(dataSpacing);
61 dataOrigin[0] = origin[0];
62 dataOrigin[1] = origin[1];
63 dataOrigin[2] = origin[2];
64 m_Data->SetOrigin(dataOrigin);
67 DataImageType::DirectionType dir;
69 itk::Transform<ScalarType,3,3>::ParametersType p = transform3D->GetParameters();
71 for(
int i=0; i<3; i++)
73 for(
int j=0; j<3; j++)
88 int vecSize =
m_Data->GetVectorLength();
94 for(
unsigned int i=0; i<dataSize[0]; i++)
96 MITK_INFO <<
"i " << i <<
" / " << dataSize[0];
97 for(
unsigned int j=0; j<dataSize[1]; j++)
99 for(
unsigned int k=0; k<dataSize[2]; k++)
109 pixel =
m_Data->GetPixel(
id);
111 for(
int z=0; z<vecSize; z++)
115 pixel.SetElement(z, value);
117 m_Data->SetPixel(
id, pixel);
124 MITK_ERROR <<
"TbssImporter::Import: No read access to tbss image: " << e.what() ;
129 tbssImg->SetImage(
m_Data);
131 tbssImg->InitializeFromVectorImage();
137 #endif // __mitkTbssImporter_cpp
const Point3D GetOrigin() const
Get the origin, e.g. the upper-left corner of the plane.
DataImageType::Pointer m_Data
Gives locked and index-based read access for a particular image part. The class provides several set-...
const TPixel & GetPixelByIndex(const itk::Index< VDimension > &idx) const
std::vector< std::pair< std::string, int > > m_Groups
DataCollection - Class to facilitate loading/accessing structured data.
const mitk::Vector3D GetSpacing() const
Get the spacing (size of a pixel).
std::string m_MeasurementInfo
An object of this class represents an exception of MITK. Please don't instantiate exceptions manually...
mitk::TbssImage::Pointer Import()
Converts the FSL Nifty to NRRD and adds the meta data.
#define mitkPixelTypeMultiplex1(function, ptype, param1)
mitk::Image::Pointer m_InputVolume
BaseGeometry Describes the geometry of a data object.
Class for defining the data type of pixels.
mitk::AffineTransform3D * GetIndexToWorldTransform()
Get the transformation used to convert from index to world coordinates.
static itkEventMacro(BoundingShapeInteractionEvent, itk::AnyEvent) class MITKBOUNDINGSHAPE_EXPORT BoundingShapeInteractor Pointer New()
Basic interaction methods for mitk::GeometryData.