24 #include <itkImageRegionIterator.h> 25 #include <itkImageSliceIteratorWithIndex.h> 28 : m_PlaneGeometry(nullptr),
29 m_ImageGeometry3D(nullptr),
33 m_CreateUndoInformation(false)
35 MITK_WARN <<
"Class is deprecated! Use mitkVtkImageOverwrite instead.";
65 if (input3D->GetDimension() == 4)
68 timeSelector->SetInput(input3D);
70 timeSelector->UpdateLargestPossibleRegion();
71 input3D = timeSelector->GetOutput();
122 template <
typename TPixel,
unsigned int VImageDimension>
125 typedef itk::Image<TPixel, VImageDimension - 1> SliceImageType;
126 typedef itk::ImageRegionConstIterator<SliceImageType> SliceIteratorType;
128 typename SliceImageType::Pointer sliceImage = SliceImageType::New();
131 SliceIteratorType sliceIterator(sliceImage, sliceImage->GetLargestPossibleRegion());
133 sliceIterator.GoToBegin();
140 while (!sliceIterator.IsAtEnd())
142 currentPointIn2D[0] = sliceIterator.GetIndex()[0] + 0.5;
143 currentPointIn2D[1] = sliceIterator.GetIndex()[1] + 0.5;
144 currentPointIn2D[2] = 0;
148 typename itk::Image<TPixel, VImageDimension>::IndexType outputIndex;
154 input3D->SetPixel(outputIndex, (TPixel)sliceIterator.Get());
void IndexToWorld(const mitk::Vector3D &vec_units, mitk::Vector3D &vec_mm) const
Convert (continuous or discrete) index coordinates of a vector vec_units to world coordinates (in mm)...
~OverwriteDirectedPlaneImageFilter() override
#define AccessFixedDimensionByItk(mitkImage, itkImageTypeFunction, dimension)
Access a mitk-image with known dimension by an itk-image.
bool IsIndexInside(const mitk::Point3D &index) const
Test whether the point p ((continous!)index coordinates in units) is inside the bounding box...
Constants for most interaction classes, due to the generic StateMachines.
void ItkSliceOverwriting(itk::Image< TPixel, VImageDimension > *input3D)
const BaseGeometry * m_PlaneGeometry
Image::ConstPointer m_SliceImage
void GenerateData() override
OverwriteDirectedPlaneImageFilter()
void WorldToIndex(const mitk::Point3D &pt_mm, mitk::Point3D &pt_units) const
Convert world coordinates (in mm) of a point to (continuous!) index coordinates.
InputImageType * GetInput(void)
void MITKCORE_EXPORT CastToItkImage(const mitk::Image *mitkImage, itk::SmartPointer< ItkOutputImageType > &itkOutputImage)
Cast an mitk::Image to an itk::Image with a specific type.
const BaseGeometry * m_ImageGeometry3D