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

Method TransferLabelContent

Modules/Multilabel/src/mitkLabelSetImage.cpp:1995–2020  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

1993}
1994
1995void mitk::TransferLabelContent(
1996 const Image* sourceImage, Image* destinationImage, const mitk::ConstLabelVector& destinationLabels, mitk::Label::PixelType sourceBackground,
1997 mitk::Label::PixelType destinationBackground, bool destinationBackgroundLocked, LabelValueMappingVector labelMapping,
1998 MultiLabelSegmentation::MergeStyle mergeStyle, MultiLabelSegmentation::OverwriteStyle overwriteStlye)
1999{
2000 if (nullptr == sourceImage)
2001 {
2002 mitkThrow() << "Invalid call of TransferLabelContent; sourceImage must not be null.";
2003 }
2004 if (nullptr == destinationImage)
2005 {
2006 mitkThrow() << "Invalid call of TransferLabelContent; destinationImage must not be null.";
2007 }
2008
2009 const auto sourceTimeStepCount = sourceImage->GetTimeGeometry()->CountTimeSteps();
2010 if (sourceTimeStepCount != destinationImage->GetTimeGeometry()->CountTimeSteps())
2011 {
2012 mitkThrow() << "Invalid call of TransferLabelContent; mismatch between images in number of time steps.";
2013 }
2014
2015 for (mitk::TimeStepType i = 0; i < sourceTimeStepCount; ++i)
2016 {
2017 TransferLabelContentAtTimeStep(sourceImage, destinationImage, destinationLabels, i, sourceBackground,
2018 destinationBackground, destinationBackgroundLocked, labelMapping, mergeStyle, overwriteStlye);
2019 }
2020}
2021
2022void mitk::TransferLabelContentAtTimeStep(
2023 const MultiLabelSegmentation* sourceImage, MultiLabelSegmentation* destinationImage, const TimeStepType timeStep,

Callers

nothing calls this directly

Calls 1

CountTimeStepsMethod · 0.45

Tested by

no test coverage detected