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

Method UpdateGroupImage

Modules/Multilabel/src/mitkLabelSetImage.cpp:617–630  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

615}
616
617void 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
633const std::string& mitk::MultiLabelSegmentation::GetGroupName(GroupIndexType groupID) const

Callers 10

DoUpdatePreviewMethod · 0.80
DoUpdatePreviewMethod · 0.80
ApplyGroupModificationFunction · 0.80
WriteBackResultsMethod · 0.80
DoITKRegionGrowingFunction · 0.80
DoUpdatePreviewMethod · 0.80
DoUpdatePreviewMethod · 0.80
ITKThresholdingMethod · 0.80

Calls 6

ExistGroupMethod · 0.95
GetTimeStepsMethod · 0.80
GetGeometryMethod · 0.80
SetVolumeMethod · 0.80
EqualFunction · 0.50
GetDataMethod · 0.45

Tested by

no test coverage detected