20 #include "itkImageIOBase.h" 21 #include "itkImageIOFactory.h" 22 #include "itkDiffusionTensor3D.h" 24 #include "itkImageFileReader.h" 25 #include "itkImageFileWriter.h" 26 #include "itkNiftiImageIO.h" 65 explicit ComputeVarianceMap(
const std::string &inputFileName,
const std::string &output );
75 explicit ComputeVarianceMap(
const std::vector<std::string> &inputFileNames,
const std::string &output );
84 explicit ComputeVarianceMap(
const std::string &inputFileName,
const std::string &output,
85 const std::string &prefix );
94 explicit ComputeVarianceMap(
const std::vector<std::string> &inputFileNames,
const std::string &output,
95 const std::string &prefix );
111 void SetParameters(
const std::vector<std::string> &inputFileNames,
112 const std::string &output,
const std::string &prefix );
120 template <
typename PixelType,
unsigned int Dimension>
121 void computeVarianceRunner( std::vector<std::string> inpFiles, std::string outputFile )
130 typedef typename itk::Image< PixelType, Dimension > InputImageType;
131 typedef typename itk::ImageFileReader< InputImageType > ReaderType;
132 typedef typename ReaderType::Pointer ReaderPointerType;
133 typedef typename itk::ImageFileWriter< InputImageType > WriterType;
135 typename FilterType::Pointer varianceFilter = FilterType::New();
138 typename std::vector< ReaderPointerType > readers;
139 for (
size_t i=0; i<inpFiles.size() ;i++)
141 typename ReaderType::Pointer reader = ReaderType::New();
142 itk::NiftiImageIO::Pointer imageIOr = itk::NiftiImageIO::New();
143 reader->SetFileName( inpFiles[i] );
145 readers.push_back(reader);
147 reader->SetImageIO( imageIOr );
148 varianceFilter->SetInput(i,reader->GetOutput());
152 typename WriterType::Pointer writer = WriterType::New();
153 itk::NiftiImageIO::Pointer imageIOw = itk::NiftiImageIO::New();
154 writer->SetImageIO( imageIOw );
155 writer->SetFileName( outputFile );
156 writer->SetInput( varianceFilter->GetOutput() );
164 inline void runAlgorithm();
169 inline void checkInputs() { };
void SetParameters(const std::vector< std::string > &inputFileNames, const std::string &output, const std::string &prefix)
Set the object parameters for the default () constructor.
virtual ~ComputeVarianceMap()
The Destructor.
Implements an operator for calculating pixel-wise variance of two images.
Definition: itkNaryVarianceImageFilter.h:129
Declaration of the CommonHolder class.
ComputeVarianceMap()
Default Constructor.
Common data container for all statistical computations of images.
Definition: cbicaITKCommonHolder.h:44
Computes the variance map for a single image.
Definition: cbicaITKComputeVarianceMap.h:46
Declaration & Implementation of the NaryFunctorImageFilter class.