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

Method doConversion

Modules/MatchPointRegistration/src/mitkRegEvaluationObject.cpp:101–119  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

99
100 template <typename TPixelType, unsigned int VImageDimension >
101 void RegEvaluationObject::doConversion(const ::itk::Image<TPixelType,VImageDimension>* input, mitk::Image::Pointer& result) const
102 {
103 typedef ::itk::Image<TPixelType, VImageDimension> InputImageType;
104 typedef itk::CastImageFilter<InputImageType, InternalImageType> CastFilterType;
105 typedef itk::RescaleIntensityImageFilter<InputImageType, InputImageType> RescaleFilterType;
106 typedef typename RescaleFilterType::OutputImagePixelType RescaleOutputPixelType;
107
108 typename CastFilterType::Pointer caster = CastFilterType::New();
109 typename RescaleFilterType::Pointer rescaler = RescaleFilterType::New();
110
111 rescaler->SetInput(input);
112 rescaler->SetOutputMinimum(0);
113 rescaler->SetOutputMaximum(std::min(itk::NumericTraits<RescaleOutputPixelType>::max(), static_cast<typename RescaleFilterType::OutputPixelType>(255)));
114 caster->SetInput(rescaler->GetOutput());
115 caster->Update();
116 InternalImageType::Pointer internalImage = caster->GetOutput();
117
118 mitk::CastToMitkImage<>(internalImage,result);
119 }
120
121
122 void RegEvaluationObject::PrintSelf (std::ostream &os, itk::Indent indent) const

Callers

nothing calls this directly

Calls 4

NewFunction · 0.50
SetInputMethod · 0.45
GetOutputMethod · 0.45
UpdateMethod · 0.45

Tested by

no test coverage detected