| 39 | { |
| 40 | |
| 41 | void PlanarFigureMaskGenerator::SetPlanarFigure(mitk::PlanarFigure* planarFigure) |
| 42 | { |
| 43 | if (nullptr == planarFigure ) |
| 44 | { |
| 45 | throw std::runtime_error( "Error: planar figure empty!" ); |
| 46 | } |
| 47 | |
| 48 | const PlaneGeometry *planarFigurePlaneGeometry = planarFigure->GetPlaneGeometry(); |
| 49 | if ( planarFigurePlaneGeometry == nullptr ) |
| 50 | { |
| 51 | throw std::runtime_error( "Planar-Figure not yet initialized!" ); |
| 52 | } |
| 53 | |
| 54 | const auto *planarFigureGeometry = |
| 55 | dynamic_cast< const PlaneGeometry * >( planarFigurePlaneGeometry ); |
| 56 | if ( planarFigureGeometry == nullptr ) |
| 57 | { |
| 58 | throw std::runtime_error( "Non-planar planar figures not supported!" ); |
| 59 | } |
| 60 | |
| 61 | if (planarFigure != m_PlanarFigure) |
| 62 | { |
| 63 | this->Modified(); |
| 64 | m_PlanarFigure = planarFigure; |
| 65 | } |
| 66 | |
| 67 | } |
| 68 | |
| 69 | mitk::Image::ConstPointer PlanarFigureMaskGenerator::GetReferenceImage() |
| 70 | { |