Page Menu
Home
Phabricator
Search
Configure Global Search
Log In
Files
F541
ExtensionRetrieverPatchfile.diff
Public
Actions
View File
Edit File
Delete File
View Transforms
Subscribe
Mute Notifications
Award Token
Flag For Later
Authored By
•
strohmer
Jun 1 2010, 1:58 PM
2010-06-01 13:58:34 (UTC+2)
Size
6 KB
Referenced Files
None
Subscribers
None
ExtensionRetrieverPatchfile.diff
View Options
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<itk::ImageIOBase::Pointer> ImageIOBasePtrList;
- typedef std::list<itk::LightObject::Pointer> 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<itk::ImageIOBase*> (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 <itkVersion.h>
-#include <itkImageIOBase.h>
-#include <itkImageIOFactory.h>
-
-#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<Self> 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 <itkImageIOBase.h>
#include <itkImageIOFactory.h>
-#include "fzjRegisteredExtensionsFactory.h"
mitk::ImageWriter::ImageWriter()
{
@@ -246,8 +245,6 @@
std::vector<std::string> mitk::ImageWriter::GetPossibleFileExtensions()
{
std::vector<std::string> possibleFileExtensions;
- fzj::RegisteredExtensionsFactory::Pointer pRegisteredExtensions=fzj::RegisteredExtensionsFactory::New();
- possibleFileExtensions=pRegisteredExtensions->GetAllSupportedWriteExtensions();
possibleFileExtensions.push_back(".pic");
possibleFileExtensions.push_back(".bmp");
possibleFileExtensions.push_back(".dcm");
File Metadata
Details
Attached
Mime Type
text/plain
Storage Engine
blob
Storage Format
Raw Data
Storage Handle
519
Default Alt Text
ExtensionRetrieverPatchfile.diff (6 KB)
Attached To
Mode
No data available.
Event Timeline
•
strohmer
added a comment.
Jun 1 2010, 1:58 PM
2010-06-01 13:58:34 (UTC+2)
Comment Actions
Patchfile for application to revision 23283
Log In to Comment