36 resultImage->SetGeometry(inputImage->GetGeometry());
39 template <
typename TPixel,
unsigned int VImageDimension>
43 typedef itk::Image<TPixel, 3> itkImageType3D;
44 typedef typename itkImageType3D::SizeType::SizeValueType sizeValType;
48 typename itkImageType3D::RegionType myRegion;
49 typename itkImageType3D::SizeType mySize;
50 typename itkImageType3D::IndexType myIndex;
51 typename itkImageType3D::SpacingType mySpacing;
52 mySpacing[0] = itkImage->GetSpacing()[0];
53 mySpacing[1] = itkImage->GetSpacing()[1];
58 mySize[0] = itkImage->GetLargestPossibleRegion().GetSize()[0];
59 mySize[1] = itkImage->GetLargestPossibleRegion().GetSize()[1];
61 myRegion.SetSize(mySize);
62 myRegion.SetIndex(myIndex);
63 outputImage->SetSpacing(mySpacing);
64 outputImage->SetRegions(myRegion);
65 outputImage->Allocate();
68 for (sizeValType x = 0; x < mySize[0]; x++)
70 for (sizeValType y = 0; y < mySize[1]; y++)
81 outputImage->SetPixel(index3D, itkImage->GetPixel(index2D));
itk::SmartPointer< Self > Pointer
void ItkConvert2DTo3D(const itk::Image< TPixel, VImageDimension > *itkImage, mitk::Image::Pointer &mitkImage)
Make a 2D image to a 3D image.
virtual void GenerateData() override
Method generating the output of this filter. Called in the updated process of the pipeline...
Convert2Dto3DImageFilter()
standard constructor
#define AccessFixedDimensionByItk_1(mitkImage, itkImageTypeFunction, dimension, arg1)
~Convert2Dto3DImageFilter()
standard destructor
void CastToMitkImage(const itk::SmartPointer< ItkOutputImageType > &itkimage, itk::SmartPointer< mitk::Image > &mitkoutputimage)
Cast an itk::Image (with a specific type) to an mitk::Image.
static itkEventMacro(BoundingShapeInteractionEvent, itk::AnyEvent) class MITKBOUNDINGSHAPE_EXPORT BoundingShapeInteractor Pointer New()
Basic interaction methods for mitk::GeometryData.