| 615 | } |
| 616 | |
| 617 | void mitk::MultiLabelSegmentation::UpdateGroupImage(GroupIndexType groupID, const mitk::Image* sourceImage, TimeStepType timestep, TimeStepType sourceTimestep, int sourceAccessOptions) |
| 618 | { |
| 619 | if (!this->ExistGroup(groupID)) mitkThrow() << "Error, cannot update group image. Group ID is invalid. Invalid ID: " << groupID; |
| 620 | if (nullptr == sourceImage) mitkThrow() << "Error, cannot update group image. Passed sourceImage is invalid."; |
| 621 | if (this->GetTimeSteps()<=timestep) mitkThrow() << "Error, cannot update group image. Assigned time step is not valid for segmentation. Invalid time step: " << timestep; |
| 622 | if (sourceImage->GetTimeSteps() <= sourceTimestep) mitkThrow() << "Error, cannot update group image. Requested time step of source image is not valid. Invalid source time step: " << sourceTimestep; |
| 623 | |
| 624 | if (!mitk::Equal(*(m_GroupContainer[groupID]->GetGeometry(timestep)), *(sourceImage->GetGeometry(sourceTimestep)), mitk::NODE_PREDICATE_GEOMETRY_DEFAULT_CHECK_COORDINATE_PRECISION, mitk::NODE_PREDICATE_GEOMETRY_DEFAULT_CHECK_DIRECTION_PRECISION)) |
| 625 | mitkThrow() << "Error, cannot update group image. Passed sourceImage has not the same geometry then the MultiLabelSegmentationInstance."; |
| 626 | |
| 627 | auto imageTimeStep = SelectImageByTimeStep(sourceImage, sourceTimestep); |
| 628 | mitk::ImageReadAccessor sourceImageAcc(imageTimeStep, nullptr, sourceAccessOptions); |
| 629 | m_GroupContainer[groupID]->SetVolume(sourceImageAcc.GetData(), timestep); |
| 630 | } |
| 631 | |
| 632 | |
| 633 | const std::string& mitk::MultiLabelSegmentation::GetGroupName(GroupIndexType groupID) const |
no test coverage detected