27 mitk::LabelSetImageSurfaceStampFilter::LabelSetImageSurfaceStampFilter()
29 this->SetNumberOfIndexedInputs(1);
30 this->SetNumberOfRequiredInputs(1);
33 mitk::LabelSetImageSurfaceStampFilter::~LabelSetImageSurfaceStampFilter()
37 void mitk::LabelSetImageSurfaceStampFilter::GenerateData()
40 this->SetNthOutput(0, this->GetInput(0));
44 if (m_Surface.IsNull())
51 surfaceToImageFilter->MakeOutputBinaryOn();
52 surfaceToImageFilter->SetInput(m_Surface);
53 surfaceToImageFilter->SetImage(inputImage);
54 surfaceToImageFilter->Update();
58 inputImage->DisconnectPipeline();
61 template <
typename TPixel,
unsigned int VImageDimension>
62 void mitk::LabelSetImageSurfaceStampFilter::ItkImageProcessing(itk::Image<TPixel, VImageDimension> *itkImage,
65 typedef itk::Image<TPixel, VImageDimension>
ImageType;
72 typedef itk::ImageRegionConstIterator<ImageType> SourceIteratorType;
73 typedef itk::ImageRegionIterator<ImageType> TargetIteratorType;
75 SourceIteratorType sourceIter(itkResultImage, itkResultImage->GetLargestPossibleRegion());
76 sourceIter.GoToBegin();
78 TargetIteratorType targetIter(itkImage, itkImage->GetLargestPossibleRegion());
79 targetIter.GoToBegin();
81 int activeLabel = (LabelSetInputImage->GetActiveLabel(LabelSetInputImage->GetActiveLayer()))->GetValue();
83 while (!sourceIter.IsAtEnd())
85 int sourceValue =
static_cast<int>(sourceIter.Get());
86 int targetValue =
static_cast<int>(targetIter.Get());
88 if ((sourceValue != 0) &&
90 !LabelSetInputImage->GetLabel(targetValue)->GetLocked()))
92 targetIter.Set(activeLabel);
98 catch (itk::ExceptionObject &e)
105 void mitk::LabelSetImageSurfaceStampFilter::GenerateOutputInformation()
109 itkDebugMacro(<<
"GenerateOutputInformation()");
110 if (inputImage.IsNull())
itk::SmartPointer< Self > Pointer
#define AccessByItk_1(mitkImage, itkImageTypeFunction, arg1)
map::core::discrete::Elements< 3 >::InternalImageType ImageType
Image class for storing images.
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.