| 90 | } |
| 91 | |
| 92 | void mitk::GrowCutTool::DoUpdatePreview(const Image *inputAtTimeStep, |
| 93 | const Image * oldSegAtTimeStep, |
| 94 | MultiLabelSegmentation *previewImage, |
| 95 | TimeStepType timeStep) |
| 96 | { |
| 97 | if (nullptr != inputAtTimeStep && |
| 98 | nullptr != previewImage) |
| 99 | { |
| 100 | mitk::GrowCutSegmentationFilter::Pointer growCutFilter = mitk::GrowCutSegmentationFilter::New(); |
| 101 | |
| 102 | if (nullptr == this->GetToolManager()->GetWorkingData(0)) |
| 103 | { |
| 104 | return; |
| 105 | } |
| 106 | |
| 107 | SeedImageType::Pointer seedImage = SeedImageType::New(); |
| 108 | CastToItkImage(oldSegAtTimeStep, seedImage); |
| 109 | |
| 110 | growCutFilter->SetSeedImage(seedImage); |
| 111 | growCutFilter->SetDistancePenalty(m_DistancePenalty); |
| 112 | growCutFilter->SetInput(inputAtTimeStep); |
| 113 | growCutFilter->AddObserver(itk::ProgressEvent(), m_ProgressCommand); |
| 114 | |
| 115 | try |
| 116 | { |
| 117 | growCutFilter->Update(); |
| 118 | } |
| 119 | catch (...) |
| 120 | { |
| 121 | mitkThrow() << "itkGrowCutFilter error"; |
| 122 | } |
| 123 | |
| 124 | auto growCutResultImage = growCutFilter->GetOutput(); |
| 125 | |
| 126 | previewImage->UpdateGroupImage(previewImage->GetActiveLayer(), growCutResultImage, timeStep); |
| 127 | } |
| 128 | } |
nothing calls this directly
no test coverage detected