Common subdirectories: ./mitk-trunk/Core/Code/IO//.svn and ./mitk-trunk-DiffBase/Core/Code/IO//.svn Common subdirectories: ./mitk-trunk/Core/Code/IO//Deprecated and ./mitk-trunk-DiffBase/Core/Code/IO//Deprecated diff -Nu ./mitk-trunk/Core/Code/IO//fzjRegisteredExtensionsFactory.cpp ./mitk-trunk-DiffBase/Core/Code/IO//fzjRegisteredExtensionsFactory.cpp --- ./mitk-trunk/Core/Code/IO//fzjRegisteredExtensionsFactory.cpp 2010-06-01 08:54:26.000000000 +0200 +++ ./mitk-trunk-DiffBase/Core/Code/IO//fzjRegisteredExtensionsFactory.cpp 1970-01-01 01:00:00.000000000 +0100 @@ -1,56 +0,0 @@ -/* - * fzjRegisteredExtensionsFactory.cpp - * - * Created on: Jun 1, 2010 - * Author: sstrohmer - */ -#include "fzjRegisteredExtensionsFactory.h" -// -//////////////////////////////////////////////////////////////////////////////// -itk::ImageIOBase::ArrayOfExtensionsType -fzj::RegisteredExtensionsFactory::GetAllSupportedExtensions( - itk::ImageIOBase::ArrayOfExtensionsType const &(itk::ImageIOBase::*fp)( - void) const) const { - // - // for the sake of simplification - typedef itk::ImageIOBase::ArrayOfExtensionsType AOT; - typedef itk::ImageIOBase::ArrayOfExtensionsType::size_type AOTSizeType; - typedef std::list ImageIOBasePtrList; - typedef std::list LightObjectPtrList; - // - // Holds the collected file extensions - AOT allSupportedExtensions; - // - /// Holds all image IO objects - ImageIOBasePtrList allImageIO; - LightObjectPtrList allObjects = itk::ObjectFactoryBase::CreateAllInstance( - "itkImageIOBase"); - // - // iterate over all factories and remember all image io base objects - for (LightObjectPtrList::iterator i = allObjects.begin(); i - != allObjects.end(); ++i) { - itk::ImageIOBase* io = - dynamic_cast (i->GetPointer()); - if (io) { - allImageIO.push_back(io); - } else { - std::cerr - << "Error ImageIO factory did not return an ImageIOBase: " - << (*i)->GetNameOfClass() << std::endl; - } - } - // - // collect the supported file extensions - for (ImageIOBasePtrList::iterator k = allImageIO.begin(); k - != allImageIO.end(); ++k) { - if ((*k).IsNotNull()) { - AOT const supportedExtensions = (k->GetPointer()->*fp)(); - AOTSizeType size = supportedExtensions.size(); - for (AOTSizeType pos = 0; pos < size; pos++) { - allSupportedExtensions.push_back(supportedExtensions.at(pos)); - } - } - } - return allSupportedExtensions; -} -; diff -Nu ./mitk-trunk/Core/Code/IO//fzjRegisteredExtensionsFactory.h ./mitk-trunk-DiffBase/Core/Code/IO//fzjRegisteredExtensionsFactory.h --- ./mitk-trunk/Core/Code/IO//fzjRegisteredExtensionsFactory.h 2010-06-01 12:58:59.000000000 +0200 +++ ./mitk-trunk-DiffBase/Core/Code/IO//fzjRegisteredExtensionsFactory.h 1970-01-01 01:00:00.000000000 +0100 @@ -1,87 +0,0 @@ -/* - * fzjRegisteredExtensionsFactory.h - * - * Created on: Jun 1, 2010 - * Author: sstrohmer - */ -#include -#include -#include - -#ifndef FZJREGISTEREDEXTENSIONSFACTORY_H_ -#define FZJREGISTEREDEXTENSIONSFACTORY_H_ -namespace fzj { -/*! This factory has the sole purpose to retrieve all already in itk registered - * file extensions. - */ -class RegisteredExtensionsFactory: public itk::ObjectFactoryBase { -public: - // - // Standard class typedefs. - typedef RegisteredExtensionsFactory Self; - typedef itk::ObjectFactoryBase Superclass; - typedef itk::SmartPointer Pointer; - // - /// Method for creation through the object factory. - itkNewMacro(Self); - // - /// Run-time type information (and related methods). - itkTypeMacro(RegisteredExtensionsFactory, ObjectFactoryBase); - // - /// ITK source verson - const char* GetITKSourceVersion() const { - return ITK_SOURCE_VERSION; - }; - // - /// Class description as string - const char* GetDescription() const { - return "Factory with the sole purpose to extract all supported file extensions."; - } - // - /// Returns all already with ITK registered file extensions for reading. - itk::ImageIOBase::ArrayOfExtensionsType GetAllSupportedReadExtensions() const { - return GetAllSupportedExtensions(&itk::ImageIOBase::GetSupportedReadExtensions); - }; - // - /// Returns all already with ITK registered file extensions for reading. - itk::ImageIOBase::ArrayOfExtensionsType GetAllSupportedWriteExtensions() const { - return GetAllSupportedExtensions(&itk::ImageIOBase::GetSupportedWriteExtensions); - }; -protected: - // - /// Standard c'tor - RegisteredExtensionsFactory() { - std::cerr << "RegisteredExtensionsFactory c'tor." << std::endl; - // - // nothing to be done here - }; - // - /// Destructor - virtual ~RegisteredExtensionsFactory() { - // - // nothing to be done here - }; - // - /*! Returns all supported file extensions according to the given function, i.e. - * itk::ImageIOBase::GetSupportedReadExtensions and itk::ImageIOBase::GetSupportedWriteExtensions - * - * \param[in] fp Member function pointer to one of the above mentioned functions. - * The signature of the passed member function is pinned down - * to the specified type in the function argument - */ - itk::ImageIOBase::ArrayOfExtensionsType GetAllSupportedExtensions( - itk::ImageIOBase::ArrayOfExtensionsType const &(itk::ImageIOBase::*fp)(void) const) const - ; -private: - // - /// Purposely not implemented - RegisteredExtensionsFactory(RegisteredExtensionsFactory const &rOther); - // - /// Purposely not implemented - RegisteredExtensionsFactory &operator=( - RegisteredExtensionsFactory const &rOther); -}; - -} - -#endif /* FZJREGISTEREDEXTENSIONSFACTORY_H_ */ diff -Nu ./mitk-trunk/Core/Code/IO//mitkImageWriter.cpp ./mitk-trunk-DiffBase/Core/Code/IO//mitkImageWriter.cpp --- ./mitk-trunk/Core/Code/IO//mitkImageWriter.cpp 2010-06-01 12:45:43.000000000 +0200 +++ ./mitk-trunk-DiffBase/Core/Code/IO//mitkImageWriter.cpp 2010-06-01 12:50:37.000000000 +0200 @@ -26,7 +26,6 @@ #include #include -#include "fzjRegisteredExtensionsFactory.h" mitk::ImageWriter::ImageWriter() { @@ -246,8 +245,6 @@ std::vector mitk::ImageWriter::GetPossibleFileExtensions() { std::vector possibleFileExtensions; - fzj::RegisteredExtensionsFactory::Pointer pRegisteredExtensions=fzj::RegisteredExtensionsFactory::New(); - possibleFileExtensions=pRegisteredExtensions->GetAllSupportedWriteExtensions(); possibleFileExtensions.push_back(".pic"); possibleFileExtensions.push_back(".bmp"); possibleFileExtensions.push_back(".dcm");