swh:1:snp:e6d42e6731ce66e3c09de07ac49964c03139e990
Tip revision: 9ee6be436b4cbf61c6badcba756dd3a286de28d7 authored by Konrad Werys on 28 May 2019, 13:12:50 UTC
feat: optional SD maps calculation
feat: optional SD maps calculation
Tip revision: 9ee6be4
itkNShmolliSamplesUsedTo123ImageFilter.txx
//
// NShmolliSamplesUsedTo123ImageFilter
// TomatoLib
//
// Created by Konrad Werys on 24/11/17.
// Copyright © 2017 Konrad Werys. All rights reserved.
//
#include "itkNShmolliSamplesUsedTo123ImageFilter.h"
namespace itk {
template<typename TImage>
void
NShmolliSamplesUsedTo123ImageFilter<TImage>
::GenerateData() {
typename TImage::ConstPointer input = this->GetInput();
typename TImage::Pointer output = this->GetOutput();
output->SetRegions(input->GetLargestPossibleRegion());
output->Allocate();
typedef itk::ImageRegionConstIterator< TImage > InputIteratorType;
typedef itk::ImageRegionIterator< TImage> OutputIteratorType;
InputIteratorType iteratorInput(input, input->GetRequestedRegion());
OutputIteratorType iteratorOutput(output, output->GetRequestedRegion());
iteratorInput.GoToBegin();
iteratorOutput.GoToBegin();
PixelTypeIn temp;
while (!iteratorInput.IsAtEnd()) {
temp = iteratorInput.Get();
if (temp == 0) {
iteratorOutput.Set(0);
} else {
iteratorOutput.Set((temp - 4) * 1000);
}
++iteratorInput;
++iteratorOutput;
}
}
} // end namespace