@@ -42,32 +42,18 @@ class MABMISImageOperationFilter : public ImageToImageFilter<TInputImage, TOutpu
4242 typedef itk::Vector<InternalPixelType, ImageDimension> VectorPixelType;
4343
4444 // basic image type
45- typedef itk::Image<CharPixelType, ImageDimension> CharImageType;
46- typedef itk::Image<IntPixelType, ImageDimension> IntImageType;
47- typedef itk::Image<ShortPixelType, ImageDimension> ShortImageType;
48- typedef itk::Image<FloatPixelType, ImageDimension> FloatImageType;
4945 typedef itk::Image<InternalPixelType, ImageDimension> InternalImageType;
5046 typedef itk::Image<VectorPixelType, ImageDimension> DeformationFieldType;
5147
5248 // basic iterator type
5349 typedef itk::ImageRegionIterator<DeformationFieldType> DeformationFieldIteratorType;
5450 typedef itk::ImageRegionIterator<InternalImageType> InternalImageIteratorType;
55- typedef itk::ImageRegionIterator<CharImageType> CharImageIteratorType;
5651
5752 // basic image reader/writer related type
58- typedef itk::ImageFileReader<CharImageType> CharImageReaderType;
5953 typedef itk::ImageFileReader<InternalImageType> InternalImageReaderType;
6054 typedef itk::ImageFileWriter<InternalImageType> InternalImageWriterType;
61- typedef itk::CastImageFilter<InternalImageType, CharImageType> Internal2CharCastFilterType;
62- typedef itk::CastImageFilter<InternalImageType, FloatImageType> Internal2FloatCastFilterType;
63- typedef itk::CastImageFilter<InternalImageType, IntImageType> Internal2IntCastFilterType;
64- typedef itk::CastImageFilter<InternalImageType, ShortImageType> Internal2ShortCastFilterType;
6555
6656 typedef itk::WarpImageFilter<InternalImageType, InternalImageType, DeformationFieldType> InternalWarpFilterType;
67- typedef itk::ImageFileWriter<CharImageType> CharImageWriterType;
68- typedef itk::ImageFileWriter<IntImageType> IntImageWriterType;
69- typedef itk::ImageFileWriter<FloatImageType> FloatImageWriterType;
70- typedef itk::ImageFileWriter<ShortImageType> ShortImageWriterType;
7157
7258 typedef itk::ImageFileReader<DeformationFieldType> DeformationFieldReaderType;
7359 typedef itk::ImageFileWriter<DeformationFieldType> DeformationFieldWriterType;
@@ -78,24 +64,22 @@ class MABMISImageOperationFilter : public ImageToImageFilter<TInputImage, TOutpu
7864 /* * Run-time type information (and related methods). */
7965 itkTypeMacro (MABMISImageOperationFilter, ImageToImageFilter);
8066
81- void PairwiseDistanceAmongImages (std::vector<std::string> imageFileNames, int totalNumber,
67+ void PairwiseDistanceAmongImages (const std::vector<std::string>& imageFileNames, int totalNumber,
8268 vnl_matrix<double >& distanceMatrix);
8369
84- double calculateDistanceMSD (std::string& filename1, std::string& filename2);
70+ double calculateDistanceMSD (const std::string& filename1, const std::string& filename2);
8571
86- int ReadImage (std::string filename, InternalImageType::Pointer& image);
72+ int ReadImage (const std::string filename, InternalImageType::Pointer& image);
8773
88- void WriteImageUCHAR ( std::string filename, InternalImageType::Pointer image );
74+ itk::ImageIOBase::IOComponentType GetIOPixelType ( const std::string& filename);
8975
90- void WriteImageINT (std::string filename, InternalImageType::Pointer image);
76+ /* * Write the image to disk, after casting it the the provided pixel type. */
77+ template <class PixelType >
78+ int WriteImage (const std::string filename, InternalImageType::Pointer image);
9179
92- void WriteImageSHORT ( std::string filename, InternalImageType::Pointer image);
80+ int WriteImage ( const std::string filename, InternalImageType::Pointer image, itk::ImageIOBase::IOComponentType ioType );
9381
94- void WriteImageFLOAT (std::string filename, InternalImageType::Pointer image);
95-
96- void WriteImage (std::string filename, InternalImageType::Pointer image);
97-
98- void WriteImage (std::string filename, InternalImageType::Pointer image, char * outputType);
82+ void WriteImage (const std::string filename, InternalImageType::Pointer image, char * outputType);
9983
10084private:
10185 MABMISImageOperationFilter (const Self &); // purposely not implemented
0 commit comments