| 130 | } |
| 131 | |
| 132 | mitk::Image::Pointer mitk::MultiLabelSegmentation::GenerateNewGroupImage() const |
| 133 | { |
| 134 | auto groupImage = Image::New(); |
| 135 | |
| 136 | auto pixelType = this->GetPixelType(); |
| 137 | |
| 138 | auto geometryDimensions = DetermineImageDimensionsFromTimeGeometry(this->GetTimeGeometry()); |
| 139 | if (geometryDimensions.size() == 2) |
| 140 | { |
| 141 | auto dimensions = std::array{ m_GroupImageDimensions[0], m_GroupImageDimensions[1], 1u }; |
| 142 | groupImage->Initialize(pixelType, 3, dimensions.data()); |
| 143 | } |
| 144 | else |
| 145 | { |
| 146 | groupImage->Initialize(pixelType, *(this->GetTimeGeometry())); |
| 147 | } |
| 148 | groupImage->SetClonedTimeGeometry(this->GetTimeGeometry()); //This is needed because Image::Initialize does not set the |
| 149 | //time bounds of images with one time step correctly. |
| 150 | //Didn't fix it in Image::Initialize() because I wasn't sure |
| 151 | //if it breaks legacy code. |
| 152 | |
| 153 | groupImage->GetTimeGeometry()->UpdateBoundingBox(); |
| 154 | return groupImage; |
| 155 | } |
| 156 | |
| 157 | void mitk::MultiLabelSegmentation::Initialize() |
| 158 | { |
no test coverage detected