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

Method run

Modules/MatchPointRegistrationUI/src/QmitkMappingJob.cpp:77–172  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

75QmitkMappingJob::~QmitkMappingJob(){};
76
77void QmitkMappingJob::run()
78{
79 const mitk::Image *inputImage = this->GetInputDataAsImage();
80 const mitk::PointSet *inputSet = this->GetInputDataAsPointSet();
81 const mitk::MultiLabelSegmentation* inputSeg = dynamic_cast<const mitk::MultiLabelSegmentation*>(m_spInputData.GetPointer());
82 m_spMappedData = nullptr;
83
84 if (m_doGeometryRefinement)
85 {
86 try
87 {
88 mitk::Image::Pointer spResultImage = nullptr;
89
90 if (inputImage)
91 {
92 spResultImage = mitk::ImageMappingHelper::refineGeometry(inputImage, this->GetRegistration(), true);
93 }
94
95 m_spMappedData = spResultImage;
96
97 if (spResultImage.IsNotNull())
98 {
99 emit MapResultIsAvailable(spResultImage.GetPointer(), this);
100 }
101 else
102 {
103 emit Error(QString("Error when when refining image geometry."));
104 }
105 }
106 catch (std::exception &e)
107 {
108 emit Error(QString("Error when refining image geometry. Error description: ") + QString::fromLatin1(e.what()));
109 }
110 catch (...)
111 {
112 emit Error(QString("Unknown error when refining image geometry."));
113 }
114 }
115 else
116 {
117 try
118 {
119 mitk::BaseData::Pointer spResultData = nullptr;
120
121 if (inputImage)
122 {
123 spResultData = mitk::ImageMappingHelper::map(inputImage,
124 this->GetRegistration(),
125 !(this->m_allowUndefPixels),
126 this->m_paddingValue,
127 this->m_spRefGeometry,
128 !(this->m_allowUnregPixels),
129 this->m_errorValue,
130 this->m_InterpolatorType)
131 .GetPointer();
132 }
133 else if (inputSet)
134 {

Callers

nothing calls this directly

Calls 7

GetInputDataAsImageMethod · 0.95
GetRegistrationMethod · 0.95
GetPointerMethod · 0.80
IsNotNullMethod · 0.80
whatMethod · 0.80
QStringClass · 0.50

Tested by

no test coverage detected