| 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 |