MCPcopy Create free account
hub / github.com/MITK/MITK / GenerateData

Method GenerateData

Modules/AlgorithmsExt/src/mitkMaskAndCutRoiImageFilter.cpp:57–90  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

55}
56
57void mitk::MaskAndCutRoiImageFilter::GenerateData()
58{
59 mitk::Image::ConstPointer inputImage = this->GetInput(0);
60 mitk::Image::ConstPointer maskImage = this->GetInput(1);
61 // mitk::Image::Pointer outputImage = this->GetOutput();
62 // temporary fix for bug #
63 m_outputImage = this->GetOutput();
64
65 ItkImageType::Pointer itkImage = ItkImageType::New();
66 mitk::Image::Pointer tmpImage = mitk::Image::New();
67
68 m_CropFilter->SetInput(maskImage);
69 m_CropFilter->SetBackgroundValue(0);
70 m_CropFilter->Update();
71
72 RegionType region = m_CropFilter->GetCroppingRegion();
73
74 mitk::CastToItkImage(inputImage, itkImage);
75 m_RoiFilter->SetInput(itkImage);
76 m_RoiFilter->SetRegionOfInterest(region);
77 m_RoiFilter->Update();
78
79 mitk::CastToMitkImage(m_RoiFilter->GetOutput(), tmpImage);
80
81 m_MaskFilter->SetInput(0, tmpImage);
82 m_MaskFilter->SetMask(m_CropFilter->GetOutput());
83
84 m_MaskFilter->SetOutsideValue(-32765);
85 m_MaskFilter->Update();
86
87 // temporary fix for bug #
88 m_outputImage = m_MaskFilter->GetOutput();
89 m_outputImage->DisconnectPipeline();
90}

Callers

nothing calls this directly

Calls 9

GetOutputMethod · 0.95
CastToMitkImageFunction · 0.85
SetRegionOfInterestMethod · 0.80
SetOutsideValueMethod · 0.80
NewFunction · 0.50
GetInputMethod · 0.45
SetInputMethod · 0.45
UpdateMethod · 0.45
SetMaskMethod · 0.45

Tested by

no test coverage detected