diff --git a/Core/Code/Common/mitkCoreObjectFactory.h b/Core/Code/Common/mitkCoreObjectFactory.h index e3a98cf9fd..5014cba05b 100644 --- a/Core/Code/Common/mitkCoreObjectFactory.h +++ b/Core/Code/Common/mitkCoreObjectFactory.h @@ -1,145 +1,145 @@ /*=================================================================== The Medical Imaging Interaction Toolkit (MITK) Copyright (c) German Cancer Research Center, Division of Medical and Biological Informatics. All rights reserved. This software is distributed WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See LICENSE.txt or http://www.mitk.org for details. ===================================================================*/ #ifndef COREOBJECTFACTORY_H_INCLUDED #define COREOBJECTFACTORY_H_INCLUDED #include #include #include "mitkCoreObjectFactoryBase.h" #include "mitkFileWriterWithInformation.h" namespace mitk { class Event; class LegacyFileReaderService; class LegacyFileWriterService; class LegacyImageWriterService; class MITK_CORE_EXPORT CoreObjectFactory : public CoreObjectFactoryBase { public: mitkClassMacro(CoreObjectFactory,CoreObjectFactoryBase) itkFactorylessNewMacro(CoreObjectFactory) virtual Mapper::Pointer CreateMapper(mitk::DataNode* node, MapperSlotId slotId); virtual void SetDefaultProperties(mitk::DataNode* node); virtual void MapEvent(const mitk::Event* event, const int eventID); virtual void RegisterExtraFactory(CoreObjectFactoryBase* factory); virtual void UnRegisterExtraFactory(CoreObjectFactoryBase* factory); static Pointer GetInstance(); ~CoreObjectFactory(); /** * @brief This method gets the supported (open) file extensions as string. * * This string can then used by the Qt QFileDialog widget. * * @return The c-string that contains the file extensions - * @deprecatedSince{2014_03} See mitk::FileReaderRegistry and QmitkIOUtil + * @deprecatedSince{2014_10} See mitk::FileReaderRegistry and QmitkIOUtil */ DEPRECATED(virtual const char* GetFileExtensions()); /** * @brief get the defined (open) file extension map * * @return the defined (open) file extension map - * @deprecatedSince{2014_03} See mitk::FileReaderRegistry and QmitkIOUtil + * @deprecatedSince{2014_10} See mitk::FileReaderRegistry and QmitkIOUtil */ DEPRECATED(virtual MultimapType GetFileExtensionsMap()); /** * @brief This method gets the supported (save) file extensions as string. * * This string can then used by the Qt QFileDialog widget. * * @return The c-string that contains the (save) file extensions - * @deprecatedSince{2014_03} See mitk::FileWriterRegistry and QmitkIOUtil + * @deprecatedSince{2014_10} See mitk::FileWriterRegistry and QmitkIOUtil */ DEPRECATED(virtual const char* GetSaveFileExtensions()); /** * @brief get the defined (save) file extension map * * @return the defined (save) file extension map - * @deprecatedSince{2014_03} See mitk::FileWriterRegistry and QmitkIOUtil + * @deprecatedSince{2014_10} See mitk::FileWriterRegistry and QmitkIOUtil */ virtual MultimapType GetSaveFileExtensionsMap(); /** - * @deprecatedSince{2014_03} See mitk::FileWriterRegistry + * @deprecatedSince{2014_10} See mitk::FileWriterRegistry */ DEPRECATED(virtual FileWriterList GetFileWriters()); /** - * @deprecatedSince{2014_03} See mitk::FileWriterRegistry and QmitkIOUtil + * @deprecatedSince{2014_10} See mitk::FileWriterRegistry and QmitkIOUtil */ DEPRECATED(std::string GetDescriptionForExtension(const std::string& extension)); protected: CoreObjectFactory(); /** * @brief Merge the input map into the fileExtensionsMap. Duplicate entries are removed * * @param fileExtensionsMap the existing map, it contains value pairs like * ("*.dcm", "DICOM files"),("*.dc3", "DICOM files"). * This map is extented/merged with the values from the input map. * @param inputMap the input map, it contains value pairs like ("*.dcm", * "DICOM files"),("*.dc3", "DICOM files") returned by the extra factories. - * @deprecatedSince{2014_03} + * @deprecatedSince{2014_10} */ void MergeFileExtensions(MultimapType& fileExtensionsMap, MultimapType inputMap); /** * @brief initialize the file extension entries for open and save - * @deprecatedSince{2014_03} + * @deprecatedSince{2014_10} */ void CreateFileExtensionsMap(); /** - * @deprecatedSince{2014_03} + * @deprecatedSince{2014_10} */ DEPRECATED(void CreateSaveFileExtensions()); typedef std::set ExtraFactoriesContainer; ExtraFactoriesContainer m_ExtraFactories; FileWriterList m_FileWriters; std::string m_FileExtensions; MultimapType m_FileExtensionsMap; std::string m_SaveFileExtensions; MultimapType m_SaveFileExtensionsMap; private: void RegisterLegacyReaders(mitk::CoreObjectFactoryBase* factory); void RegisterLegacyWriters(mitk::CoreObjectFactoryBase* factory); std::list< mitk::LegacyFileReaderService* > m_LegacyReaders; std::list< mitk::LegacyFileWriterService* > m_LegacyWriters; }; } // namespace mitk #endif diff --git a/Core/Code/Common/mitkCoreObjectFactoryBase.h b/Core/Code/Common/mitkCoreObjectFactoryBase.h index eeede7eb5c..bcf185b487 100644 --- a/Core/Code/Common/mitkCoreObjectFactoryBase.h +++ b/Core/Code/Common/mitkCoreObjectFactoryBase.h @@ -1,107 +1,107 @@ /*=================================================================== The Medical Imaging Interaction Toolkit (MITK) Copyright (c) German Cancer Research Center, Division of Medical and Biological Informatics. All rights reserved. This software is distributed WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See LICENSE.txt or http://www.mitk.org for details. ===================================================================*/ #ifndef COREOBJECTFACTORYBASE_H_INCLUDED #define COREOBJECTFACTORYBASE_H_INCLUDED // the mbilog header is necessary for CMake test drivers. // Since the EXTRA_INCLUDE parameter of CREATE_TEST_SOURCELIST only // allows one extra include file, we specify mitkLog.h here so it will // be available to all classes implementing this interface. #include "mitkLog.h" #include #include "mitkMapper.h" #include #include #include "mitkFileWriterWithInformation.h" namespace mitk { class DataNode; //## @brief base-class for factories of certain mitk objects. //## @ingroup Algorithms //## This interface can be implemented by factories which add new mapper classes or extend the //## data tree deserialization mechanism. class MITK_CORE_EXPORT CoreObjectFactoryBase : public itk::Object { public: typedef std::list FileWriterList; typedef std::multimap MultimapType; mitkClassMacro(CoreObjectFactoryBase,itk::Object) virtual Mapper::Pointer CreateMapper(mitk::DataNode* node, MapperSlotId slotId) = 0; virtual void SetDefaultProperties(mitk::DataNode* node) = 0; /** - * @deprecatedSince{2014_03} See mitk::FileReaderRegistry and QmitkIOUtil + * @deprecatedSince{2014_10} See mitk::FileReaderRegistry and QmitkIOUtil */ virtual const char* GetFileExtensions() = 0; /** - * @deprecatedSince{2014_03} See mitk::FileReaderRegistry and QmitkIOUtil + * @deprecatedSince{2014_10} See mitk::FileReaderRegistry and QmitkIOUtil */ virtual MultimapType GetFileExtensionsMap() = 0; /** - * @deprecatedSince{2014_03} See mitk::FileWriterRegistry and QmitkIOUtil + * @deprecatedSince{2014_10} See mitk::FileWriterRegistry and QmitkIOUtil */ virtual const char* GetSaveFileExtensions() = 0; /** - * @deprecatedSince{2014_03} See mitk::FileWriterRegistry and QmitkIOUtil + * @deprecatedSince{2014_10} See mitk::FileWriterRegistry and QmitkIOUtil */ virtual MultimapType GetSaveFileExtensionsMap() = 0; virtual const char* GetITKSourceVersion() const { return ITK_SOURCE_VERSION; } virtual const char* GetDescription() const { return "Core Object Factory"; } /** - * @deprecatedSince{2014_03} See mitk::FileWriterRegistry + * @deprecatedSince{2014_10} See mitk::FileWriterRegistry */ FileWriterList GetFileWriters() { return m_FileWriters; } protected: /** * @brief create a string from a map that contains the file extensions * @param fileExtensionsMap input map with the file extensions, e.g. ("*.dcm", "DICOM files")("*.dc3", "DICOM files") * @param fileExtensions the converted output string, suitable for the QT QFileDialog widget * e.g. "all (*.dcm *.DCM *.dc3 ... *.vti *.hdr *.nrrd *.nhdr );;Q-Ball Images (*.hqbi *qbi)" * - * @deprecatedSince{2014_03} + * @deprecatedSince{2014_10} */ static void CreateFileExtensions(MultimapType fileExtensionsMap, std::string& fileExtensions); FileWriterList m_FileWriters; friend class CoreObjectFactory; }; } #endif diff --git a/Core/Code/IO/mitkFileReader.h b/Core/Code/IO/mitkFileReader.h index 086f47e62b..762abc3053 100644 --- a/Core/Code/IO/mitkFileReader.h +++ b/Core/Code/IO/mitkFileReader.h @@ -1,107 +1,107 @@ /*=================================================================== The Medical Imaging Interaction Toolkit (MITK) Copyright (c) German Cancer Research Center, Division of Medical and Biological Informatics. All rights reserved. This software is distributed WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See LICENSE.txt or http://www.mitk.org for details. ===================================================================*/ #ifndef FILEREADER_H_HEADER_INCLUDED_C1E7E521 #define FILEREADER_H_HEADER_INCLUDED_C1E7E521 #include namespace mitk { //##Documentation //## @brief Interface class of readers that read from files //## @ingroup Process -//## @deprecatedSince{2014_03} Use mitk::IFileReader instead. +//## @deprecatedSince{2014_10} Use mitk::IFileReader instead. class MITK_CORE_EXPORT FileReader { public: //##Documentation //## @brief Get the specified the file to load. //## //## Either the FileName or FilePrefix plus FilePattern are used to read. virtual const char* GetFileName() const = 0; //##Documentation //## @brief Specify the file to load. //## //## Either the FileName or FilePrefix plus FilePattern are used to read. virtual void SetFileName(const char* aFileName) = 0; //##Documentation //## @brief Get the specified file prefix for the file(s) to load. //## //## You should specify either a FileName or FilePrefix. Use FilePrefix if //## the data is stored in multiple files. virtual const char* GetFilePrefix() const = 0; //##Documentation //## @brief Specify file prefix for the file(s) to load. //## //## You should specify either a FileName or FilePrefix. Use FilePrefix if //## the data is stored in multiple files. virtual void SetFilePrefix(const char* aFilePrefix) = 0; //##Documentation //## @brief Get the specified file pattern for the file(s) to load. The //## sprintf format used to build filename from FilePrefix and number. //## //## You should specify either a FileName or FilePrefix. Use FilePrefix if //## the data is stored in multiple files. virtual const char* GetFilePattern() const = 0; /** @brief Specified file pattern for the file(s) to load. The sprintf format used to build filename from FilePrefix and number. You should specify either a FileName or FilePrefix. Use FilePrefix if the data is stored in multiple files. */ virtual void SetFilePattern(const char* aFilePattern) = 0; /** @brief Specifies, whether the file reader also can read a file from a memory buffer */ virtual bool CanReadFromMemory( ); /** @brief Set/Get functions to advise the file reader to use a memory array for reading a file*/ virtual void SetReadFromMemory( bool read ); virtual bool GetReadFromMemory( ); /** @brief To be used along with a call of SetReadFromMemory(true). This sets the memory buffer and the size from which the reader will read.*/ virtual void SetMemoryBuffer(const char* dataArray, unsigned int size); protected: FileReader(); virtual ~FileReader(); bool m_CanReadFromMemory; bool m_ReadFromMemory; const char* m_MemoryBuffer; unsigned int m_MemorySize; public: protected: }; } // namespace mitk #endif /* FILEREADER_H_HEADER_INCLUDED_C1E7E521 */ diff --git a/Core/Code/IO/mitkFileWriter.h b/Core/Code/IO/mitkFileWriter.h index bf52617b6a..2c00675a04 100644 --- a/Core/Code/IO/mitkFileWriter.h +++ b/Core/Code/IO/mitkFileWriter.h @@ -1,166 +1,166 @@ /*=================================================================== The Medical Imaging Interaction Toolkit (MITK) Copyright (c) German Cancer Research Center, Division of Medical and Biological Informatics. All rights reserved. This software is distributed WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See LICENSE.txt or http://www.mitk.org for details. ===================================================================*/ #ifndef FILEWRITER_H_HEADER_INCLUDED #define FILEWRITER_H_HEADER_INCLUDED #include #include #include namespace mitk { //##Documentation //## @brief Interface class of writers that write data to files //## @ingroup Process -//## @deprecatedSince{2014_03} Use mitk::IFileWriter instead. +//## @deprecatedSince{2014_10} Use mitk::IFileWriter instead. class MITK_CORE_EXPORT FileWriter : public itk::ProcessObject { public: mitkClassMacro(FileWriter,itk::ProcessObject); //##Documentation //## @brief Get the specified the file to write //## //## Either the FileName or FilePrefix plus FilePattern are used to write. virtual const char* GetFileName() const = 0; //##Documentation //## @brief Specify the file to write. //## //## Either the FileName or FilePrefix plus FilePattern are used to write. virtual void SetFileName(const char* aFileName) = 0; //##Documentation //## @brief Get the specified file prefix for the file(s) to write. //## //## You should specify either a FileName or FilePrefix. Use FilePrefix if //## the data is stored in multiple files. virtual const char* GetFilePrefix() const = 0; //##Documentation //## @brief Specify file prefix for the file(s) to write. //## //## You should specify either a FileName or FilePrefix. Use FilePrefix if //## the data is stored in multiple files. virtual void SetFilePrefix(const char* aFilePrefix) = 0; //##Documentation //## @brief Get the specified file pattern for the file(s) to write. The //## sprintf format used to build filename from FilePrefix and number. //## //## You should specify either a FileName or FilePrefix. Use FilePrefix if //## the data is stored in multiple files. virtual const char* GetFilePattern() const = 0; //##Documentation //## @brief Specified file pattern for the file(s) to write. The sprintf //## format used to build filename from FilePrefix and number. //## //## You should specify either a FileName or FilePrefix. Use FilePrefix if //## the data is stored in multiple files. virtual void SetFilePattern(const char* aFilePattern) = 0; //##Documentation //## @brief Return the extension to be added to the filename. virtual std::string GetFileExtension(); //##Documentation //## @brief Checks if given extension is valid for file writer bool IsExtensionValid(std::string extension); //##Documentation //## @brief Return the possible file extensions for the data type associated with the writer virtual std::vector GetPossibleFileExtensions() = 0; //##Documentation //## @brief possible file extensions for the data type associated with the writer as string virtual std::string GetPossibleFileExtensionsAsString(); //##Documentation //## @brief Check if the Writer can write this type of data of the //## DataTreenode. virtual bool CanWriteDataType( DataNode* ); //##Documentation //## @brief Return the MimeType of the saved File. virtual std::string GetWritenMIMEType(); virtual std::string GetSupportedBaseData() const = 0; using ProcessObject::SetInput; void SetInput( BaseData* data ); virtual void Write() = 0; /** @brief Specifies, whether the file writer also can write a file to a memory buffer */ virtual bool CanWriteToMemory( ); /** @brief Set/Get functions to advise the file writer to use tis internal memory array as file writing destination*/ virtual void SetWriteToMemory( bool write ); virtual bool GetWriteToMemory( ); /** @brief To be used along with a call of SetWriteToMemory(true). This returns the memory buffer where the file was written.*/ virtual const char* GetMemoryPointer(); /** @brief To be used along with a call of SetWriteToMemory(true). This returns the size of the memory buffer where the file was written.*/ virtual unsigned int GetMemorySize(); /** @brief CAUTION: It's up to the user to call this function to release the memory buffer after use in case the file writer has written to its memory array.*/ virtual void ReleaseMemory(); protected: FileWriter(); virtual ~FileWriter(); bool m_CanWriteToMemory; bool m_WriteToMemory; char * m_MemoryBuffer; unsigned int m_MemoryBufferSize; }; #define mitkWriterMacro \ virtual void Write() \ { \ if ( this->GetInput() == NULL ) \ { \ itkExceptionMacro(<<"Write:Please specify an input!"); \ return; \ } \ /* Fill in image information.*/ \ this->UpdateOutputInformation(); \ (*(this->GetInputs().begin()))->SetRequestedRegionToLargestPossibleRegion();\ this->PropagateRequestedRegion(NULL); \ this->UpdateOutputData(NULL); \ } \ \ virtual void Update() \ { \ Write(); \ } } // namespace mitk #endif /* FILEWRITER_H_HEADER_INCLUDED */ diff --git a/Core/Code/IO/mitkFileWriterWithInformation.h b/Core/Code/IO/mitkFileWriterWithInformation.h index aad9b965e0..21692b755a 100644 --- a/Core/Code/IO/mitkFileWriterWithInformation.h +++ b/Core/Code/IO/mitkFileWriterWithInformation.h @@ -1,41 +1,41 @@ /*=================================================================== The Medical Imaging Interaction Toolkit (MITK) Copyright (c) German Cancer Research Center, Division of Medical and Biological Informatics. All rights reserved. This software is distributed WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See LICENSE.txt or http://www.mitk.org for details. ===================================================================*/ #ifndef FILEWRITERWITHINFORMATION_H_INCLUDED #define FILEWRITERWITHINFORMATION_H_INCLUDED #include "mitkFileWriter.h" #include "mitkBaseData.h" namespace mitk { /** * \brief Interface for FileWriters with extra information. * Should be merged into FileWriter. * - * \deprecatedSince{2014_03} Use mitk::IFileWriter instead. + * \deprecatedSince{2014_10} Use mitk::IFileWriter instead. */ class FileWriterWithInformation : public FileWriter { public: mitkClassMacro(FileWriterWithInformation,FileWriter); virtual const char *GetDefaultFilename() = 0; virtual const char *GetFileDialogPattern() = 0; virtual const char *GetDefaultExtension() = 0; virtual bool CanWriteBaseDataType(BaseData::Pointer data) = 0; virtual void DoWrite(BaseData::Pointer data) = 0; }; } #endif diff --git a/Core/Code/IO/mitkIOAdapter.h b/Core/Code/IO/mitkIOAdapter.h index 9fc3ea4997..cbc3308696 100644 --- a/Core/Code/IO/mitkIOAdapter.h +++ b/Core/Code/IO/mitkIOAdapter.h @@ -1,95 +1,95 @@ /*=================================================================== The Medical Imaging Interaction Toolkit (MITK) Copyright (c) German Cancer Research Center, Division of Medical and Biological Informatics. All rights reserved. This software is distributed WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See LICENSE.txt or http://www.mitk.org for details. ===================================================================*/ #ifndef __mitkIOAdapter_h #define __mitkIOAdapter_h #include "mitkBaseProcess.h" #include "itkObject.h" namespace mitk { //##Documentation //## @brief IOAdapterBase class is an abstract adapter class for IO process objects. //## //## @ingroup IO -//## @deprecatedSince{2014_03} Use mitk::IFileReader instead +//## @deprecatedSince{2014_10} Use mitk::IFileReader instead class IOAdapterBase: public itk::Object { public: /** Standard typedefs. */ typedef IOAdapterBase Self; typedef itk::Object Superclass; typedef itk::SmartPointerPointer; typedef itk::SmartPointerConstPointer; /// Create an object and return a pointer to it as a mitk::BaseProcess. virtual itk::SmartPointer CreateIOProcessObject(const std::string filename, const std::string filePrefix, const std::string filePattern) = 0; virtual bool CanReadFile(const std::string filename, const std::string filePrefix, const std::string filePattern) = 0; protected: IOAdapterBase() {} ~IOAdapterBase() {} private: IOAdapterBase(const Self&); //purposely not implemented void operator=(const Self&); //purposely not implemented }; //##Documentation //## @brief IOAdapter class is an adapter class for instantiation of IO process objects. //## Additional this interface defines the function CanReadFile(). //## This interface allows the target (object) the access to the adaptee (IO process object). //## @ingroup IO -//## @deprecatedSince{2014_03} Use mitk::IFileReader instead +//## @deprecatedSince{2014_10} Use mitk::IFileReader instead template class IOAdapter : public IOAdapterBase { public: /** Standard class typedefs. */ typedef IOAdapter Self; typedef itk::SmartPointer Pointer; /** Methods from mitk::BaseProcess. */ itkFactorylessNewMacro(Self); mitk::BaseProcess::Pointer CreateIOProcessObject(const std::string filename, const std::string filePrefix, const std::string filePattern) { typename T::Pointer ioProcessObject = T::New(); ioProcessObject->SetFileName(filename.c_str()); ioProcessObject->SetFilePrefix(filePrefix.c_str()); ioProcessObject->SetFilePattern(filePattern.c_str()); return ioProcessObject.GetPointer(); } virtual bool CanReadFile(const std::string filename, const std::string filePrefix, const std::string filePattern) { return T::CanReadFile(filename, filePrefix, filePattern); } protected: IOAdapter() {} ~IOAdapter() {} private: IOAdapter(const Self&); //purposely not implemented void operator=(const Self&); //purposely not implemented }; } // end namespace mitk #endif diff --git a/Core/Code/IO/mitkIOUtil.h b/Core/Code/IO/mitkIOUtil.h index 6c6c9c75c4..f98b26b532 100644 --- a/Core/Code/IO/mitkIOUtil.h +++ b/Core/Code/IO/mitkIOUtil.h @@ -1,450 +1,450 @@ /*=================================================================== The Medical Imaging Interaction Toolkit (MITK) Copyright (c) German Cancer Research Center, Division of Medical and Biological Informatics. All rights reserved. This software is distributed WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See LICENSE.txt or http://www.mitk.org for details. ===================================================================*/ #ifndef MITKIOUTIL_H #define MITKIOUTIL_H #include #include #include #include #include #include #include #include #include #include namespace mitk { /** * \ingroup IO * * \brief A utility class to load and save data from/to the local file system. * * The methods LoadImage, LoadSurface, and LoadPointSet are convenience methods for general loading of * the three main data types in MITK. They all use the more generic method Load(). * * \see QmitkIOUtil */ class MITK_CORE_EXPORT IOUtil { public: struct MITK_CORE_EXPORT LoadInfo { LoadInfo(const std::string& path); std::string m_Path; std::vector m_Output; FileReaderSelector m_ReaderSelector; bool m_Cancel; }; struct MITK_CORE_EXPORT SaveInfo { SaveInfo(const BaseData* baseData, const MimeType& mimeType, const std::string& path); bool operator<(const SaveInfo& other) const; /// The BaseData object to save. const BaseData* m_BaseData; /// Contains a set of IFileWriter objects. FileWriterSelector m_WriterSelector; /// The selected mime-type, used to restrict results from FileWriterSelector. MimeType m_MimeType; /// The path to write the BaseData object to. std::string m_Path; /// Flag indicating if sub-sequent save operations are to be canceled. bool m_Cancel; }; /** * Get the file system path where the running executable is located. * * @return The location of the currently running executable, without the filename. */ static std::string GetProgramPath(); /** * Get the default temporary path. * * @return The default path for temporary data. */ static std::string GetTempPath(); /** * Returns the Directory Seperator for the current OS. * * @return the Directory Seperator for the current OS, i.e. "\\" for Windows and "/" otherwise. */ static char GetDirectorySeparator(); /** * Create and open a temporary file. * * This method generates a unique temporary filename from \c templateName, creates * and opens the file using the output stream \c tmpStream and returns the name of * the newly create file. * * The \c templateName argument must contain six consective 'X' characters ("XXXXXX") * and these are replaced with a string that makes the filename unique. * * The file is created with read and write permissions for owner only. * * @param tmpStream The output stream for writing to the temporary file. * @param templateName An optional template for the filename. * @param path An optional path where the temporary file should be created. Defaults * to the default temp path as returned by GetTempPath(). * @return The filename of the created temporary file. * * @throw mitk::Exception if the temporary file could not be created. */ static std::string CreateTemporaryFile(std::ofstream& tmpStream, const std::string& templateName = "XXXXXX", std::string path = std::string()); /** * Create and open a temporary file. * * This method generates a unique temporary filename from \c templateName, creates * and opens the file using the output stream \c tmpStream and the specified open * mode \c mode and returns the name of the newly create file. The open mode is always * OR'd with \begin{code}std::ios_base::out | std::ios_base::trunc\end{code}. * * The \c templateName argument must contain six consective 'X' characters ("XXXXXX") * and these are replaced with a string that makes the filename unique. * * The file is created with read and write permissions for owner only. * * @param tmpStream The output stream for writing to the temporary file. * @param mode The open mode for the temporary file stream. * @param templateName An optional template for the filename. * @param path An optional path where the temporary file should be created. Defaults * to the default temp path as returned by GetTempPath(). * @return The filename of the created temporary file. * * @throw mitk::Exception if the temporary file could not be created. */ static std::string CreateTemporaryFile(std::ofstream& tmpStream, std::ios_base::openmode mode, const std::string& templateName = "XXXXXX", std::string path = std::string()); /** * Creates an empty temporary file. * * This method generates a unique temporary filename from \c templateName and creates * this file. * * The file is created with read and write permissions for owner only. * * --- * This version is potentially unsafe because the created temporary file is not kept open * and could be used by another process between calling this method and opening the returned * file path for reading or writing. * --- * * @return The filename of the created temporary file. * @param templateName An optional template for the filename. * @param path An optional path where the temporary file should be created. Defaults * to the default temp path as returned by GetTempPath(). * @throw mitk::Exception if the temporary file could not be created. */ static std::string CreateTemporaryFile(const std::string& templateName = "XXXXXX", std::string path = std::string()); /** * Create a temporary directory. * * This method generates a uniquely named temporary directory from \c templateName. * The last set of six consecutive 'X' characters in \c templateName is replaced * with a string that makes the directory name unique. * * The directory is created with read, write and executable permissions for owner only. * * @param templateName An optional template for the directory name. * @param path An optional path where the temporary directory should be created. Defaults * to the default temp path as returned by GetTempPath(). * @return The filename of the created temporary file. * * @throw mitk::Exception if the temporary directory could not be created. */ static std::string CreateTemporaryDirectory(const std::string& templateName = "XXXXXX", std::string path = std::string()); /** * @brief Load a file into the given DataStorage. * * This method calls Load(const std::vector&, DataStorage&) with a * one-element vector. * * @param path The absolute file name including the file extension. * @param storage A DataStorage object to which the loaded data will be added. * @return The set of added DataNode objects. * @throws mitk::Exception if \c path could not be loaded. * * @sa Load(const std::vector&, DataStorage&) */ static DataStorage::SetOfObjects::Pointer Load(const std::string& path, DataStorage& storage); static DataStorage::SetOfObjects::Pointer Load(const std::string& path, const IFileReader::Options& options, DataStorage& storage); static std::vector Load(const std::string& path); static std::vector Load(const std::string& path, const IFileReader::Options& options); /** * @brief Loads a list of file paths into the given DataStorage. * * If an entry in \c paths cannot be loaded, this method will continue to load * the remaining entries into \c storage and throw an exception afterwards. * * @param paths A list of absolute file names including the file extension. * @param storage A DataStorage object to which the loaded data will be added. * @return The set of added DataNode objects. * @throws mitk::Exception if an entry in \c paths could not be loaded. */ static DataStorage::SetOfObjects::Pointer Load(const std::vector& paths, DataStorage& storage); static std::vector Load(const std::vector& paths); /** * Load files in fileNames and add the constructed mitk::DataNode instances * to the mitk::DataStorage storage * * @param fileNames A list (vector) of absolute file name paths. * @param storage The data storage to which the constructed data nodes are added. * @return The number of added mitk::DataNode instances. * - * @deprecatedSince{2014_03} Use Load() instead + * @deprecatedSince{2014_10} Use Load() instead */ DEPRECATED(static int LoadFiles(const std::vector&fileNames, DataStorage& storage)); /** * This method will create a new mitk::DataStorage instance and pass it to * LoadFiles(std::vector,DataStorage). * * @param fileNames A list (vector) of absolute file name paths. * @return The new mitk::DataStorage containing the constructed data nodes. * * @see LoadFiles(std::vector,DataStorage) * - * @deprecatedSince{2014_03} Use Load() instead + * @deprecatedSince{2014_10} Use Load() instead */ DEPRECATED(static DataStorage::Pointer LoadFiles(const std::vector& fileNames)); /** * @brief Create a BaseData object from the given file. * @param path The path to the file including file name and file extension. * @throws mitk::Exception In case of an error when reading the file. * @return Returns the created BaseData object. * - * @deprecatedSince{2014_03} Use Load() or FileReaderRegistry::Read() instead. + * @deprecatedSince{2014_10} Use Load() or FileReaderRegistry::Read() instead. */ DEPRECATED(static mitk::BaseData::Pointer LoadBaseData(const std::string& path)); /** * @brief LoadDataNode Method to load an arbitrary DataNode. * @param path The path to the file including file name and file extension. * @throws mitk::Exception This exception is thrown when the DataNodeFactory is not able to read/find the file * or the DataNode is NULL. * @return Returns the DataNode. * - * @deprecatedSince{2014_03} Use Load() instead. + * @deprecatedSince{2014_10} Use Load() instead. */ DEPRECATED(static mitk::DataNode::Pointer LoadDataNode(const std::string& path)); /** * @brief LoadImage Convenience method to load an arbitrary mitkImage. * @param path The path to the image including file name and file extension. * @throws mitk::Exception This exception is thrown when the Image is NULL. * @return Returns the mitkImage. */ static mitk::Image::Pointer LoadImage(const std::string& path); /** * @brief LoadSurface Convenience method to load an arbitrary mitkSurface. * @param path The path to the surface including file name and file extension. * @throws mitk::Exception This exception is thrown when the Surface is NULL. * @return Returns the mitkSurface. */ static mitk::Surface::Pointer LoadSurface(const std::string& path); /** * @brief LoadPointSet Convenience method to load an arbitrary mitkPointSet. * @param path The path to the pointset including file name and file extension (currently, only .mps is supported). * @throws mitk::Exception This exception is thrown when the PointSet is NULL. * @return Returns the mitkPointSet. */ static mitk::PointSet::Pointer LoadPointSet(const std::string& path); /** * @brief Save a mitk::BaseData instance. * @param data The data to save. * @param path The path to the image including file name and and optional file extension. * If no extension is set, the default extension and mime-type for the * BaseData type of \c data is used. * @throws mitk::Exception if no writer for \c data is available or the writer * is not able to write the image. */ static void Save(const mitk::BaseData* data, const std::string& path); /** * @brief Save a mitk::BaseData instance. * @param data The data to save. * @param path The path to the image including file name and an optional file extension. * If no extension is set, the default extension and mime-type for the * BaseData type of \c data is used. * @param options The IFileWriter options to use for the selected writer. * @throws mitk::Exception if no writer for \c data is available or the writer * is not able to write the image. */ static void Save(const mitk::BaseData* data, const std::string& path, const IFileWriter::Options& options); /** * @brief Save a mitk::BaseData instance. * @param data The data to save. * @param mimeType The mime-type to use for writing \c data. * @param path The path to the image including file name and an optional file extension. * @param addExtension If \c true, an extension according to the given \c mimeType * is added to \c path if it does not contain one. If \c path already contains * a file name extension, it is not checked for compatibility with \c mimeType. * * @throws mitk::Exception if no writer for the combination of \c data and \c mimeType is * available or the writer is not able to write the image. */ static void Save(const mitk::BaseData* data, const std::string& mimeType, const std::string& path, bool addExtension = true); /** * @brief Save a mitk::BaseData instance. * @param data The data to save. * @param mimeType The mime-type to use for writing \c data. * @param path The path to the image including file name and an optional file extension. * @param options Configuration data for the used IFileWriter instance. * @param addExtension If \c true, an extension according to the given \c mimeType * is added to \c path if it does not contain one. If \c path already contains * a file name extension, it is not checked for compatibility with \c mimeType. * * @throws mitk::Exception if no writer for the combination of \c data and \c mimeType is * available or the writer is not able to write the image. */ static void Save(const mitk::BaseData* data, const std::string& mimeType, const std::string& path, const mitk::IFileWriter::Options& options, bool addExtension = true); /** * @brief Use SaveInfo objects to save BaseData instances. * * This is a low-level method for directly working with SaveInfo objects. Usually, * the Save() methods taking a BaseData object as an argument are more appropriate. * * @param saveInfos A list of SaveInfo objects for saving contained BaseData objects. * * @see Save(const mitk::BaseData*, const std::string&) */ static void Save(std::vector& saveInfos); /** * @brief SaveImage Convenience method to save an arbitrary mitkImage. * @param path The path to the image including file name and file extension. * If no extention is set, the default value (defined in DEFAULTIMAGEEXTENSION) is used. * @param image The image to save. * @throws mitk::Exception This exception is thrown when the writer is not able to write the image. * @return Returns true for success else false. * - * @deprecatedSince{2014_03} Use Save() instead. + * @deprecatedSince{2014_10} Use Save() instead. */ DEPRECATED(static bool SaveImage(mitk::Image::Pointer image, const std::string& path)); /** * @brief SaveBaseData Convenience method to save arbitrary baseData. * @param path The path to the image including file name and file extension. * If no extention is set, the default extension is used. * @param data The data to save. * @throws mitk::Exception This exception is thrown when the writer is not able to write the image. * @return Returns true for success else false. * - * @deprecatedSince{2014_03} Use Save() instead. + * @deprecatedSince{2014_10} Use Save() instead. */ DEPRECATED(static bool SaveBaseData(mitk::BaseData* data, const std::string& path)); /** * @brief SaveSurface Convenience method to save an arbitrary mitkSurface. * @param path The path to the surface including file name and file extension. * If no extention is set, the default extension is used. * @throws mitk::Exception This exception is thrown when the writer is not able to write the surface. * or if the fileextension is not suitable for writing. * @return Returns true for success else false. * - * @deprecatedSince{2014_03} Use Save() instead. + * @deprecatedSince{2014_10} Use Save() instead. */ DEPRECATED(static bool SaveSurface(mitk::Surface::Pointer surface, const std::string& path)); /** * @brief SavePointSet Convenience method to save an mitkPointSet. * @param path The path to the pointset including file name and file extension. * If no extention is set, the default extension is used. * @throws mitk::Exception This exception is thrown when the writer is not able to write the pointset. * @return Returns true for success else false. * - * @deprecatedSince{2014_03} Use Save() instead. + * @deprecatedSince{2014_10} Use Save() instead. */ DEPRECATED(static bool SavePointSet(mitk::PointSet::Pointer pointset, const std::string& path)); - /** @deprecatedSince{2014_03} Use GetDefaultWriteExtension() instead */ + /** @deprecatedSince{2014_10} */ DEPRECATED(static const std::string DEFAULTIMAGEEXTENSION); - /** @deprecatedSince{2014_03} Use GetDefaultWriteExtension() instead */ + /** @deprecatedSince{2014_10} */ DEPRECATED(static const std::string DEFAULTSURFACEEXTENSION); - /** @deprecatedSince{2014_03} Use GetDefaultWriteExtension() instead */ + /** @deprecatedSince{2014_10} */ DEPRECATED(static const std::string DEFAULTPOINTSETEXTENSION); protected: struct ReaderOptionsFunctorBase { virtual bool operator()(LoadInfo& loadInfo) = 0; }; struct WriterOptionsFunctorBase { virtual bool operator()(SaveInfo& saveInfo) = 0; }; static std::string Load(std::vector& loadInfos, DataStorage::SetOfObjects* nodeResult, DataStorage* ds, ReaderOptionsFunctorBase* optionsCallback); static std::string Save(const BaseData* data, const std::string& mimeType, const std::string& path, WriterOptionsFunctorBase* optionsCallback, bool addExtension); static std::string Save(std::vector& saveInfos, WriterOptionsFunctorBase* optionsCallback); private: struct Impl; }; } #endif // MITKIOUTIL_H diff --git a/Core/Code/Interfaces/mitkIDataNodeReader.h b/Core/Code/Interfaces/mitkIDataNodeReader.h index 183c6210e7..fac5560b17 100644 --- a/Core/Code/Interfaces/mitkIDataNodeReader.h +++ b/Core/Code/Interfaces/mitkIDataNodeReader.h @@ -1,60 +1,60 @@ /*=================================================================== The Medical Imaging Interaction Toolkit (MITK) Copyright (c) German Cancer Research Center, Division of Medical and Biological Informatics. All rights reserved. This software is distributed WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See LICENSE.txt or http://www.mitk.org for details. ===================================================================*/ #ifndef MITKIDATANODEREADER_H #define MITKIDATANODEREADER_H #include #include namespace mitk { class DataStorage; /** * \ingroup MicroServices_Interfaces * * This interface provides methods to load data from the local filesystem * into a given mitk::DataStorage. * - * \deprecatedSince{2014_03} Use mitk::IFileReader instead + * \deprecatedSince{2014_10} Use mitk::IFileReader instead */ struct IDataNodeReader { virtual ~IDataNodeReader() {} /** * Reads the local file given by fileName and constructs one or more * mitk::DataNode instances which are added to the given mitk::DataStorage storage. * * \param fileName The absolute path to a local file. * \param storage The mitk::DataStorage which will contain the constructed data nodes. * \return The number of constructed mitk::DataNode instances. * * \note Errors during reading the file or constructing the data node should be expressed by * throwing appropriate exceptions. * * \see mitk::DataNodeFactory */ virtual int Read(const std::string& fileName, mitk::DataStorage& storage) = 0; }; } US_DECLARE_SERVICE_INTERFACE(mitk::IDataNodeReader, "org.mitk.IDataNodeReader") #endif // MITKIDATANODEREADER_H diff --git a/Modules/LegacyIO/mitkBaseDataIOFactory.h b/Modules/LegacyIO/mitkBaseDataIOFactory.h index f19adff768..022a996077 100644 --- a/Modules/LegacyIO/mitkBaseDataIOFactory.h +++ b/Modules/LegacyIO/mitkBaseDataIOFactory.h @@ -1,67 +1,67 @@ /*=================================================================== The Medical Imaging Interaction Toolkit (MITK) Copyright (c) German Cancer Research Center, Division of Medical and Biological Informatics. All rights reserved. This software is distributed WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See LICENSE.txt or http://www.mitk.org for details. ===================================================================*/ #ifndef __mitkBaseDataIO_h #define __mitkBaseDataIO_h #include #include "mitkBaseData.h" #include "itkObject.h" namespace mitk { /*! @brief BaseDataIO creates instances of BaseData objects using an object factory. @todo Add file writing method, move writers into a similar factory scheme @ingroup IO - @deprecatedSince{2014_03} Use mitk::IOUtils or mitk::FileReaderRegistry instead. + @deprecatedSince{2014_10} Use mitk::IOUtils or mitk::FileReaderRegistry instead. */ class DEPRECATED() MitkLegacyIO_EXPORT BaseDataIO : public itk::Object { public: /** Standard class typedefs. */ typedef BaseDataIO Self; typedef itk::Object Superclass; typedef itk::SmartPointer Pointer; typedef itk::SmartPointer ConstPointer; /** Class Methods used to interface with the registered factories */ /** Run-time type information (and related methods). */ itkTypeMacro(BaseDataIO, Object); /** Create the appropriate BaseData depending on the particulars of the file. */ static std::vector LoadBaseDataFromFile(const std::string path, const std::string filePrefix, const std::string filePattern, bool series); protected: BaseDataIO(); ~BaseDataIO(); private: BaseDataIO(const Self&); //purposely not implemented void operator=(const Self&); //purposely not implemented }; } // end namespace mitk #endif diff --git a/Modules/LegacyIO/mitkDataNodeFactory.h b/Modules/LegacyIO/mitkDataNodeFactory.h index 28378ac97c..17ddbca49b 100644 --- a/Modules/LegacyIO/mitkDataNodeFactory.h +++ b/Modules/LegacyIO/mitkDataNodeFactory.h @@ -1,184 +1,184 @@ /*=================================================================== The Medical Imaging Interaction Toolkit (MITK) Copyright (c) German Cancer Research Center, Division of Medical and Biological Informatics. All rights reserved. This software is distributed WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See LICENSE.txt or http://www.mitk.org for details. ===================================================================*/ #ifndef _DATA_TREE_NODE_FACTORY_H_ #define _DATA_TREE_NODE_FACTORY_H_ #include "mitkDataNodeSource.h" #include "mitkFileSeriesReader.h" #include "mitkColorProperty.h" #include #include namespace mitk { /** * @brief Factory, which creates instances of mitk::DataNodes filled with * data read from a given file * * This class reads files, creates an appropriate mitk::BaseData and adds the * BaseData to a mitk::DataNode. This filter may produce one or more outputs * (i.e. mitk::DataNodes). The number of generated nodes can be retrieved by a * call of GetNumberOfOutputs(). * * If you want to add a new file type, you have to register the factory * of the file reader in the class mitk::BaseDataIOFactory. * @ingroup IO -* @deprecatedSince{2014_03} Use mitk::IOUtils or mitk::FileReaderRegistry instead. +* @deprecatedSince{2014_10} Use mitk::IOUtils or mitk::FileReaderRegistry instead. */ class MitkLegacyIO_EXPORT DataNodeFactory : public DataNodeSource, public FileSeriesReader { public: mitkClassMacro( DataNodeFactory, DataNodeSource ); DEPRECATED(itkFactorylessNewMacro(Self)) itkCloneMacro(Self) /** * Sets the filename of the file to read. * @param FileName the name of the file to read. */ itkSetStringMacro( FileName ); /** * @returns the name of the file to be read from disk. */ itkGetStringMacro( FileName ); /** * \brief Set prefix for multiple load */ itkSetStringMacro( FilePrefix ); /** * \brief Get prefix for multiple load */ itkGetStringMacro( FilePrefix ); /** * \brief Set pattern for multiple load */ itkSetStringMacro( FilePattern ); /** * \brief Get pattern for multiple load */ itkGetStringMacro( FilePattern ); /** * Nice default colors for segmentations of some "normal" organs. */ static ColorProperty::Pointer DefaultColorForOrgan( const std::string& ); void SetDefaultCommonProperties(mitk::DataNode::Pointer &node); /** * if true -> loaded image is part of a serie */ void SetImageSerie(bool serie); void AddSeriesRestriction(const std::string &tag) {m_SeriesRestrictions.push_back(tag);} static bool m_TextureInterpolationActive; protected: /** * Constructor. */ DataNodeFactory(); /** * Virtual destructor. */ virtual ~DataNodeFactory(); bool m_Serie; /** * Determines of which file type a given file is and calls the * appropriate reader function. */ virtual void GenerateData(); /** * Resizes the number of outputs of the factory. * The outputs are initialized by empty DataNodes * @param num the new number of outputs */ virtual void ResizeOutputs( const unsigned int& num ); /** * Checks if the file name m_FileName ends with the given name. * Currently, this check is done by a dumb search for name in * the filename. * @param name the extension of the file * @returns true, if the filename contains name. */ virtual bool FileNameEndsWith(const std::string& name); /** * Checks if the file pattern m_FilePattern ends with the given name. * Currently, this check is done by a dumb search for name in * the filename. * @param name the extension of the file * @returns true, if the filepattern contains name. */ virtual bool FilePatternEndsWith(const std::string& name); /** * @returns the plain filename, that is, without any directory. */ virtual std::string GetBaseFileName(); /** * @returns the plain file prefix, that is, without any directory. */ virtual std::string GetBaseFilePrefix(); /** * @returns the directory of the file name m_FileName. */ virtual std::string GetDirectory(); #ifdef MBI_INTERNAL virtual void ReadFileTypeHPSONOS(); #ifdef HAVE_IPDICOM virtual void ReadFileTypeIPDCM(); #endif /* HAVE_IPDICOM */ #ifdef USE_TUS_READER virtual void ReadFileTypeTUS(); #endif #endif /* MBI_INTERNAL */ virtual void ReadFileSeriesTypeDCM(); virtual void ReadFileSeriesTypeITKImageSeriesReader(); std::vector m_SeriesRestrictions; int m_OldProgress; }; } #endif //#ifndef __DATA_TREE_NODE_FACTORY_H diff --git a/Modules/LegacyIO/mitkFileSeriesReader.h b/Modules/LegacyIO/mitkFileSeriesReader.h index 1314517eb2..d17eea6671 100644 --- a/Modules/LegacyIO/mitkFileSeriesReader.h +++ b/Modules/LegacyIO/mitkFileSeriesReader.h @@ -1,65 +1,65 @@ /*=================================================================== The Medical Imaging Interaction Toolkit (MITK) Copyright (c) German Cancer Research Center, Division of Medical and Biological Informatics. All rights reserved. This software is distributed WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See LICENSE.txt or http://www.mitk.org for details. ===================================================================*/ #ifndef __MITK_FILE_SERIES_READER__H_ #define __MITK_FILE_SERIES_READER__H_ #include #include #include #include #include namespace mitk { /** * Provides a function which generates a list of files from * a given prefix and pattern. * Subclasses may use this function to load a series of files. * - * @deprecatedSince{2014_03} + * @deprecatedSince{2014_10} */ class MitkLegacyIO_EXPORT FileSeriesReader : public FileReader { public: mitkClassMacro( FileSeriesReader, FileReader ); typedef std::vector< std::string > MatchedFileNames; virtual MatchedFileNames GetMatchedFileNames( ); protected: FileSeriesReader(); virtual ~FileSeriesReader(); virtual bool GenerateFileList(); std::string m_FileName; std::string m_FilePrefix; std::string m_FilePattern; MatchedFileNames m_MatchedFileNames; }; } #endif diff --git a/Modules/LegacyIO/mitkImageWriter.h b/Modules/LegacyIO/mitkImageWriter.h index 7bc22220f6..67ed3792d1 100644 --- a/Modules/LegacyIO/mitkImageWriter.h +++ b/Modules/LegacyIO/mitkImageWriter.h @@ -1,179 +1,179 @@ /*=================================================================== The Medical Imaging Interaction Toolkit (MITK) Copyright (c) German Cancer Research Center, Division of Medical and Biological Informatics. All rights reserved. This software is distributed WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See LICENSE.txt or http://www.mitk.org for details. ===================================================================*/ #ifndef _MITK_IMAGE_WRITER__H_ #define _MITK_IMAGE_WRITER__H_ #include #include namespace mitk { class Image; /** * @brief Writer for mitk::Image * * Uses the given extension (SetExtension) to decide the format to write * (.mhd is default, .pic, .tif, .png, .jpg supported yet). * @ingroup IO - * @deprecatedSince{2014_03} Use mitk::IOUtils or mitk::FileWriterRegistry instead. + * @deprecatedSince{2014_10} Use mitk::IOUtils or mitk::FileWriterRegistry instead. */ class MitkLegacyIO_EXPORT ImageWriter : public mitk::FileWriterWithInformation { public: mitkClassMacro( ImageWriter, mitk::FileWriter ); itkFactorylessNewMacro(Self) itkCloneMacro(Self) mitkWriterMacro; /** * Sets the filename of the file to write. * @param _arg the name of the file to write. */ virtual void SetFileName (const char* fileName); virtual void SetFileName (const std::string& fileName); /** * @returns the name of the file to be written to disk. */ itkGetStringMacro( FileName ); /** * \brief Explicitly set the extension to be added to the filename. * @param _arg to be added to the filename, including a "." * (e.g., ".mhd"). */ virtual void SetExtension (const char* extension); virtual void SetExtension (const std::string& extension); /** * \brief Get the extension to be added to the filename. * @returns the extension to be added to the filename (e.g., * ".mhd"). */ itkGetStringMacro( Extension ); /** * \brief Set the extension to be added to the filename to the default */ void SetDefaultExtension(); /** * @warning multiple write not (yet) supported */ itkSetStringMacro( FilePrefix ); /** * @warning multiple write not (yet) supported */ itkGetStringMacro( FilePrefix ); /** * @warning multiple write not (yet) supported */ itkSetStringMacro( FilePattern ); /** * @warning multiple write not (yet) supported */ itkGetStringMacro( FilePattern ); /** * Sets the 0'th input object for the filter. * @param input the first input for the filter. */ void SetInput( mitk::Image* input ); //##Documentation //## @brief Return the possible file extensions for the data type associated with the writer virtual std::vector GetPossibleFileExtensions(); virtual std::string GetSupportedBaseData() const; /** * @brief Return the extension to be added to the filename. */ virtual std::string GetFileExtension(); /** * @brief Check if the Writer can write the Content of the */ virtual bool CanWriteDataType( DataNode* ); /** * @brief Return the MimeType of the saved File. */ virtual std::string GetWritenMIMEType(); using Superclass::SetInput; /** * @brief Set the DataTreenode as Input. Important: The Writer always have a SetInput-Function. */ virtual void SetInput( DataNode* ); /** * @returns the 0'th input object of the filter. */ const mitk::Image* GetInput(); // FileWriterWithInformation methods virtual const char* GetDefaultFilename(); virtual const char *GetFileDialogPattern(); virtual const char *GetDefaultExtension(); virtual bool CanWriteBaseDataType(BaseData::Pointer data); virtual void DoWrite(BaseData::Pointer data); void SetUseCompression( bool useCompression ); protected: /** * Constructor. */ ImageWriter(); /** * Virtual destructor. */ virtual ~ImageWriter(); virtual void GenerateData(); virtual void WriteByITK(mitk::Image* image, const std::string& fileName); std::string m_FileName; std::string m_FileNameWithoutExtension; std::string m_FilePrefix; std::string m_FilePattern; std::string m_Extension; std::string m_MimeType; bool m_UseCompression; }; } #endif //_MITK_IMAGE_WRITER__H_ diff --git a/Modules/LegacyIO/mitkImageWriterFactory.h b/Modules/LegacyIO/mitkImageWriterFactory.h index 0a6a2d6fe1..0d7e707aea 100644 --- a/Modules/LegacyIO/mitkImageWriterFactory.h +++ b/Modules/LegacyIO/mitkImageWriterFactory.h @@ -1,71 +1,71 @@ /*=================================================================== The Medical Imaging Interaction Toolkit (MITK) Copyright (c) German Cancer Research Center, Division of Medical and Biological Informatics. All rights reserved. This software is distributed WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See LICENSE.txt or http://www.mitk.org for details. ===================================================================*/ #ifndef IMAGEWRITERFACTORY_H_HEADER_INCLUDED #define IMAGEWRITERFACTORY_H_HEADER_INCLUDED #include #include "itkObjectFactoryBase.h" #include "mitkBaseData.h" namespace mitk { /** - * @deprecatedSince{2014_03} Use mitk::IOUtils or mitk::FileReaderRegistry instead. + * @deprecatedSince{2014_10} Use mitk::IOUtils or mitk::FileReaderRegistry instead. */ class DEPRECATED() MitkLegacyIO_EXPORT ImageWriterFactory : public itk::ObjectFactoryBase { public: mitkClassMacro( mitk::ImageWriterFactory, itk::ObjectFactoryBase ) /** Class methods used to interface with the registered factories. */ virtual const char* GetITKSourceVersion(void) const; virtual const char* GetDescription(void) const; /** Method for class instantiation. */ itkFactorylessNewMacro(Self); /** * Register one factory of this type * \deprecatedSince{2013_09} */ DEPRECATED(static void RegisterOneFactory(void)) { static bool IsRegistered = false; if ( !IsRegistered ) { ImageWriterFactory::Pointer imageWriterFactory = ImageWriterFactory::New(); ObjectFactoryBase::RegisterFactory( imageWriterFactory ); IsRegistered = true; } } protected: ImageWriterFactory(); ~ImageWriterFactory(); private: ImageWriterFactory(const Self&); //purposely not implemented void operator=(const Self&); //purposely not implemented }; } // end namespace mitk #endif diff --git a/Modules/LegacyIO/mitkItkImageFileIOFactory.h b/Modules/LegacyIO/mitkItkImageFileIOFactory.h index 90bad267ab..4ab4b0b0b7 100644 --- a/Modules/LegacyIO/mitkItkImageFileIOFactory.h +++ b/Modules/LegacyIO/mitkItkImageFileIOFactory.h @@ -1,77 +1,77 @@ /*=================================================================== The Medical Imaging Interaction Toolkit (MITK) Copyright (c) German Cancer Research Center, Division of Medical and Biological Informatics. All rights reserved. This software is distributed WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See LICENSE.txt or http://www.mitk.org for details. ===================================================================*/ #ifndef __mitkItkImageFileIOFactory_h #define __mitkItkImageFileIOFactory_h #ifdef _MSC_VER #pragma warning ( disable : 4786 ) #endif #include #include "itkObjectFactoryBase.h" #include "mitkBaseData.h" namespace mitk { //##Documentation //## @brief Create instances of ItkImageFileReader objects using an object factory. //## //## @ingroup IO -//## @deprecatedSince{2014_03} Use mitk::IOUtils or mitk::FileReaderRegistry instead. +//## @deprecatedSince{2014_10} Use mitk::IOUtils or mitk::FileReaderRegistry instead. class DEPRECATED() MitkLegacyIO_EXPORT ItkImageFileIOFactory : public itk::ObjectFactoryBase { public: /** Standard class typedefs. */ typedef ItkImageFileIOFactory Self; typedef itk::ObjectFactoryBase Superclass; typedef itk::SmartPointer Pointer; typedef itk::SmartPointer ConstPointer; /** Class methods used to interface with the registered factories. */ virtual const char* GetITKSourceVersion(void) const; virtual const char* GetDescription(void) const; /** Method for class instantiation. */ itkFactorylessNewMacro(Self); static ItkImageFileIOFactory* FactoryNew() { return new ItkImageFileIOFactory;} /** Run-time type information (and related methods). */ itkTypeMacro(ItkImageFileIOFactory, ObjectFactoryBase); /** * Register one factory of this type * \deprecatedSince{2013_09} */ DEPRECATED(static void RegisterOneFactory(void)) { ItkImageFileIOFactory::Pointer ItkImageFileIOFactory = ItkImageFileIOFactory::New(); ObjectFactoryBase::RegisterFactory(ItkImageFileIOFactory); } protected: ItkImageFileIOFactory(); ~ItkImageFileIOFactory(); private: ItkImageFileIOFactory(const Self&); //purposely not implemented void operator=(const Self&); //purposely not implemented }; } // end namespace mitk #endif diff --git a/Modules/LegacyIO/mitkItkImageFileReader.h b/Modules/LegacyIO/mitkItkImageFileReader.h index d7c2b807ea..d2d11b2c37 100644 --- a/Modules/LegacyIO/mitkItkImageFileReader.h +++ b/Modules/LegacyIO/mitkItkImageFileReader.h @@ -1,68 +1,68 @@ /*=================================================================== The Medical Imaging Interaction Toolkit (MITK) Copyright (c) German Cancer Research Center, Division of Medical and Biological Informatics. All rights reserved. This software is distributed WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See LICENSE.txt or http://www.mitk.org for details. ===================================================================*/ #ifndef ItkImageFileReader_H_HEADER_INCLUDED #define ItkImageFileReader_H_HEADER_INCLUDED #include #include "mitkFileReader.h" #include "mitkImageSource.h" namespace mitk { //##Documentation //## @brief Reader to read file formats supported by itk //## @ingroup IO -//## @deprecatedSince{2014_03} Use mitk::IOUtils or mitk::FileReaderRegistry instead. +//## @deprecatedSince{2014_10} Use mitk::IOUtils or mitk::FileReaderRegistry instead. class MitkLegacyIO_EXPORT ItkImageFileReader : public ImageSource, public FileReader { public: mitkClassMacro(ItkImageFileReader, FileReader); /** Method for creation through the object factory. */ itkFactorylessNewMacro(Self) itkCloneMacro(Self) itkSetStringMacro(FileName); itkGetStringMacro(FileName); itkSetStringMacro(FilePrefix); itkGetStringMacro(FilePrefix); itkSetStringMacro(FilePattern); itkGetStringMacro(FilePattern); static bool CanReadFile(const std::string filename, const std::string filePrefix, const std::string filePattern); protected: virtual void GenerateData(); ItkImageFileReader(); ~ItkImageFileReader(); std::string m_FileName; std::string m_FilePrefix; std::string m_FilePattern; }; } // namespace mitk #endif /* ItkImageFileReader_H_HEADER_INCLUDED */ diff --git a/Modules/LegacyIO/mitkItkPictureWrite.h b/Modules/LegacyIO/mitkItkPictureWrite.h index 5e1db9fb0c..80abc67ca6 100644 --- a/Modules/LegacyIO/mitkItkPictureWrite.h +++ b/Modules/LegacyIO/mitkItkPictureWrite.h @@ -1,45 +1,45 @@ /*=================================================================== The Medical Imaging Interaction Toolkit (MITK) Copyright (c) German Cancer Research Center, Division of Medical and Biological Informatics. All rights reserved. This software is distributed WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See LICENSE.txt or http://www.mitk.org for details. ===================================================================*/ /** @file mitkItkPictureWrite.h */ #ifndef MITKITKPICTUREWRITE_H #define MITKITKPICTUREWRITE_H #include #include /** * @brief ITK-Like method to be called for writing an single-component image using the AccessByItk Macros * * @param itkImage an image with single-component pixel type * - * @deprecatedSince{2014_03} Use mitk::IOUtils or mitk::FileReaderRegistry instead. + * @deprecatedSince{2014_10} Use mitk::IOUtils or mitk::FileReaderRegistry instead. */ template < typename TPixel, unsigned int VImageDimension > DEPRECATED( void _mitkItkPictureWrite(itk::Image< TPixel, VImageDimension >* itkImage, const std::string& fileName) ); /** * @brief ITK-Like method to be called for writing an image * * @param itkImage an Image with single-component or composite pixel type * - * @deprecatedSince{2013_09} Use mitk::IOUtils or mitk::FileReaderRegistry instead. + * @deprecatedSince{2014_10} Use mitk::IOUtils or mitk::FileReaderRegistry instead. */ template < typename TPixel, unsigned int VImageDimension > DEPRECATED( void _mitkItkPictureWriteComposite(itk::Image< TPixel, VImageDimension >* itkImage, const std::string& fileName) ); #endif /* MITKITKPICTUREWRITE_H */ diff --git a/Modules/LegacyIO/mitkPointSetIOFactory.h b/Modules/LegacyIO/mitkPointSetIOFactory.h index c0e93db7ab..76bfeac9cb 100644 --- a/Modules/LegacyIO/mitkPointSetIOFactory.h +++ b/Modules/LegacyIO/mitkPointSetIOFactory.h @@ -1,77 +1,77 @@ /*=================================================================== The Medical Imaging Interaction Toolkit (MITK) Copyright (c) German Cancer Research Center, Division of Medical and Biological Informatics. All rights reserved. This software is distributed WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See LICENSE.txt or http://www.mitk.org for details. ===================================================================*/ #ifndef __mitkPointSetIOFactory_h #define __mitkPointSetIOFactory_h #ifdef _MSC_VER #pragma warning ( disable : 4786 ) #endif #include #include "itkObjectFactoryBase.h" #include "mitkBaseData.h" namespace mitk { //##Documentation //## @brief Create instances of PointSetReader objects using an object factory. //## //## @ingroup IO -//## @deprecatedSince{2014_03} Use mitk::IOUtils or mitk::FileReaderRegistry instead. +//## @deprecatedSince{2014_10} Use mitk::IOUtils or mitk::FileReaderRegistry instead. class DEPRECATED() MitkLegacyIO_EXPORT PointSetIOFactory : public itk::ObjectFactoryBase { public: /** Standard class typedefs. */ typedef PointSetIOFactory Self; typedef itk::ObjectFactoryBase Superclass; typedef itk::SmartPointer Pointer; typedef itk::SmartPointer ConstPointer; /** Class methods used to interface with the registered factories. */ virtual const char* GetITKSourceVersion(void) const; virtual const char* GetDescription(void) const; /** Method for class instantiation. */ itkFactorylessNewMacro(Self); static PointSetIOFactory* FactoryNew() { return new PointSetIOFactory;} /** Run-time type information (and related methods). */ itkTypeMacro(PointSetIOFactory, ObjectFactoryBase); /** * Register one factory of this type * \deprecatedSince{2013_09} */ DEPRECATED(static void RegisterOneFactory(void)) { PointSetIOFactory::Pointer PointSetIOFactory = PointSetIOFactory::New(); ObjectFactoryBase::RegisterFactory(PointSetIOFactory); } protected: PointSetIOFactory(); ~PointSetIOFactory(); private: PointSetIOFactory(const Self&); //purposely not implemented void operator=(const Self&); //purposely not implemented }; } // end namespace mitk #endif diff --git a/Modules/LegacyIO/mitkPointSetReader.h b/Modules/LegacyIO/mitkPointSetReader.h index cb898af3ba..efc090ee51 100644 --- a/Modules/LegacyIO/mitkPointSetReader.h +++ b/Modules/LegacyIO/mitkPointSetReader.h @@ -1,149 +1,149 @@ /*=================================================================== The Medical Imaging Interaction Toolkit (MITK) Copyright (c) German Cancer Research Center, Division of Medical and Biological Informatics. All rights reserved. This software is distributed WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See LICENSE.txt or http://www.mitk.org for details. ===================================================================*/ #ifndef _MITK_POINT_SET_READER__H_ #define _MITK_POINT_SET_READER__H_ #include #include #include #include #include #include #include namespace mitk { /** * @brief reads xml representations of mitk::PointSets from a file * * Reader for xml files containing one or multiple xml represenations of * mitk::PointSets. If multiple mitk::PointSets are stored in one file, * these are assigned to multiple outputs of the filter. The number of point * sets which have be read can be retrieven by a call to GetNumberOfOutputs() * after the pipeline update(). * The reader is able to read the old 3D Pointsets without the "specification" and "timeseries" tags and the new 4D Pointsets. * @note loading point sets from multiple files according to a given file pattern * is not yet supported! * @ingroup PSIO * @ingroup IO * - * @deprecatedSince{2014_03} Use mitk::IOUtils or mitk::FileReaderRegistry instead. + * @deprecatedSince{2014_10} Use mitk::IOUtils or mitk::FileReaderRegistry instead. */ class MitkLegacyIO_EXPORT PointSetReader: public PointSetSource, public FileReader { public: mitkClassMacro( PointSetReader, FileReader ); itkFactorylessNewMacro(Self) itkCloneMacro(Self) /** * @brief Sets the filename of the file to be read * @param _arg the filename of the point set xml-file */ itkSetStringMacro( FileName ); /** * @brief Returns the filename of the point set xml-file. * @returns the filename of the point set xml-file. */ itkGetStringMacro( FileName ); /** * @warning multiple load not (yet) supported */ itkSetStringMacro( FilePrefix ); /** * @warning multiple load not (yet) supported */ itkGetStringMacro( FilePrefix ); /** * @warning multiple load not (yet) supported */ itkSetStringMacro( FilePattern ); /** * @warning multiple load not (yet) supported */ itkGetStringMacro( FilePattern ); static bool CanReadFile(const std::string filename, const std::string filePrefix, const std::string filePattern); /** * @returns whether the last read attempt was successful or not. */ bool GetSuccess() const; protected: /** * Constructor */ PointSetReader(); /** * Virtual destructor */ virtual ~PointSetReader(); /** * Actually reads the point sets from the given file */ virtual void GenerateData(); virtual mitk::PointSet::Pointer ReadPoint(mitk::PointSet::Pointer newPointSet, TiXmlElement* currentTimeSeries, unsigned int currentTimeStep); /** * Does nothing in the current implementation */ virtual void GenerateOutputInformation(); /** * Resizes the output-objects according to the given number. * @param num the new number of output objects. */ virtual void ResizeOutputs( const unsigned int& num ); /** * Checks if the given file has appropriate * read access. * @returns true if the file exists and may be read * or false otherwise. */ virtual int CanReadFile (const char *name); std::string m_FileName; std::string m_FilePrefix; std::string m_FilePattern; bool m_Success; }; } #endif diff --git a/Modules/LegacyIO/mitkPointSetWriter.h b/Modules/LegacyIO/mitkPointSetWriter.h index 35348e20a0..c0c493061e 100644 --- a/Modules/LegacyIO/mitkPointSetWriter.h +++ b/Modules/LegacyIO/mitkPointSetWriter.h @@ -1,273 +1,273 @@ /*=================================================================== The Medical Imaging Interaction Toolkit (MITK) Copyright (c) German Cancer Research Center, Division of Medical and Biological Informatics. All rights reserved. This software is distributed WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See LICENSE.txt or http://www.mitk.org for details. ===================================================================*/ #ifndef _MITK_POINT_SET_WRITER__H_ #define _MITK_POINT_SET_WRITER__H_ #include #include #include #include namespace mitk { /** * @brief XML-based writer for mitk::PointSets * * XML-based writer for mitk::PointSets. Multiple PointSets can be written in * a single XML file by simply setting multiple inputs to the filter. * Writing of multiple XML files according to a given filename pattern is not * yet supported. * @ingroup PSIO * @ingroup Process * - * @deprecatedSince{2014_03} Use mitk::IOUtils or mitk::FileReaderRegistry instead. + * @deprecatedSince{2014_10} Use mitk::IOUtils or mitk::FileReaderRegistry instead. */ class MitkLegacyIO_EXPORT PointSetWriter : public mitk::FileWriter { public: mitkClassMacro( PointSetWriter, mitk::FileWriter ); mitkWriterMacro; itkFactorylessNewMacro(Self) itkCloneMacro(Self) typedef mitk::PointSet InputType; typedef InputType::Pointer InputTypePointer; /** * Sets the filename of the file to write. * @param FileName the name of the file to write. */ itkSetStringMacro( FileName ); /** * @returns the name of the file to be written to disk. */ itkGetStringMacro( FileName ); /** * @warning multiple write not (yet) supported */ itkSetStringMacro( FilePrefix ); /** * @warning multiple write not (yet) supported */ itkGetStringMacro( FilePrefix ); /** * @warning multiple write not (yet) supported */ itkSetStringMacro( FilePattern ); /** * @warning multiple write not (yet) supported */ itkGetStringMacro( FilePattern ); /** * Sets the 0'th input object for the filter. * @param input the first input for the filter. */ void SetInput( InputType* input ); /** * Sets the n'th input object for the filter. If num is * larger than GetNumberOfInputs() the number of inputs is * resized appropriately. * @param input the n'th input for the filter. */ void SetInput( const unsigned int& num, InputType* input); /** * @returns the 0'th input object of the filter. */ PointSet* GetInput(); /** * @param num the index of the desired output object. * @returns the n'th input object of the filter. */ PointSet* GetInput( const unsigned int& num ); /** * @brief Return the possible file extensions for the data type associated with the writer */ virtual std::vector GetPossibleFileExtensions(); virtual std::string GetSupportedBaseData() const; /** * @brief Return the extension to be added to the filename. */ virtual std::string GetFileExtension(); /** * @brief Check if the Writer can write the Content of the */ virtual bool CanWriteDataType( DataNode* ); /** * @brief Return the MimeType of the saved File. */ virtual std::string GetWritenMIMEType(); using mitk::FileWriter::SetInput; /** * @brief Set the DataTreenode as Input. Important: The Writer always have a SetInput-Function. */ virtual void SetInput( DataNode* ); /** * @returns whether the last write attempt was successful or not. */ bool GetSuccess() const; protected: /** * Constructor. */ PointSetWriter(); /** * Virtual destructor. */ virtual ~PointSetWriter(); /** * Writes the XML file */ virtual void GenerateData(); /** * Resizes the number of inputs of the writer. * The inputs are initialized by empty PointSets * @param num the new number of inputs */ virtual void ResizeInputs( const unsigned int& num ); /** * Converts an arbitrary type to a string. The type has to * support the << operator. This works fine at least for integral * data types as float, int, long etc. * @param value the value to convert * @returns the string representation of value */ template < typename T> std::string ConvertToString( T value ); /** * Writes an XML representation of the given point set to * an outstream. The XML-Header an root node is not included! * @param pointSet the point set to be converted to xml * @param out the stream to write to. */ void WriteXML( mitk::PointSet* pointSet, std::ofstream& out ); /** * Writes an standard xml header to the given stream. * @param file the stream in which the header is written. */ void WriteXMLHeader( std::ofstream &file ); /** Write a start element tag */ void WriteStartElement( const char *const tag, std::ofstream &file ); /** * Write an end element tag * End-Elements following character data should pass indent = false. */ void WriteEndElement( const char *const tag, std::ofstream &file, const bool& indent = true ); /** Write character data inside a tag. */ void WriteCharacterData( const char *const data, std::ofstream &file ); /** Write a start element tag */ void WriteStartElement( std::string &tag, std::ofstream &file ); /** Write an end element tag */ void WriteEndElement( std::string &tag, std::ofstream &file, const bool& indent = true ); /** Write character data inside a tag. */ void WriteCharacterData( std::string &data, std::ofstream &file ); /** Writes empty spaces to the stream according to m_IndentDepth and m_Indent */ void WriteIndent( std::ofstream& file ); std::string m_FileName; std::string m_FilePrefix; std::string m_FilePattern; std::string m_Extension; std::string m_MimeType; unsigned int m_IndentDepth; unsigned int m_Indent; bool m_Success; public: static const char* XML_POINT_SET; static const char* XML_TIME_SERIES; static const char* XML_TIME_SERIES_ID; static const char* XML_POINT_SET_FILE; static const char* XML_FILE_VERSION; static const char* XML_POINT; static const char* XML_SPEC; static const char* XML_ID; static const char* XML_X; static const char* XML_Y; static const char* XML_Z; static const char* VERSION_STRING; }; } #endif diff --git a/Modules/LegacyIO/mitkPointSetWriterFactory.h b/Modules/LegacyIO/mitkPointSetWriterFactory.h index d1da7d0399..8415518e7d 100644 --- a/Modules/LegacyIO/mitkPointSetWriterFactory.h +++ b/Modules/LegacyIO/mitkPointSetWriterFactory.h @@ -1,71 +1,71 @@ /*=================================================================== The Medical Imaging Interaction Toolkit (MITK) Copyright (c) German Cancer Research Center, Division of Medical and Biological Informatics. All rights reserved. This software is distributed WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See LICENSE.txt or http://www.mitk.org for details. ===================================================================*/ #ifndef POINTSETWRITERFACTORY_H_HEADER_INCLUDED #define POINTSETWRITERFACTORY_H_HEADER_INCLUDED #include #include "itkObjectFactoryBase.h" #include "mitkBaseData.h" namespace mitk { /** - * @deprecatedSince{2014_03} Use mitk::IOUtils or mitk::FileReaderRegistry instead. + * @deprecatedSince{2014_10} Use mitk::IOUtils or mitk::FileReaderRegistry instead. */ class DEPRECATED() MitkLegacyIO_EXPORT PointSetWriterFactory : public itk::ObjectFactoryBase { public: mitkClassMacro( mitk::PointSetWriterFactory, itk::ObjectFactoryBase ) /** Class methods used to interface with the registered factories. */ virtual const char* GetITKSourceVersion(void) const; virtual const char* GetDescription(void) const; /** Method for class instantiation. */ itkFactorylessNewMacro(Self); /** * Register one factory of this type * \deprecatedSince{2013_09} */ DEPRECATED(static void RegisterOneFactory(void)) { static bool IsRegistered = false; if ( !IsRegistered ) { PointSetWriterFactory::Pointer pointSetWriterFactory = PointSetWriterFactory::New(); ObjectFactoryBase::RegisterFactory( pointSetWriterFactory ); IsRegistered = true; } } protected: PointSetWriterFactory(); ~PointSetWriterFactory(); private: PointSetWriterFactory(const Self&); //purposely not implemented void operator=(const Self&); //purposely not implemented }; } // end namespace mitk #endif diff --git a/Modules/LegacyIO/mitkRawImageFileReader.h b/Modules/LegacyIO/mitkRawImageFileReader.h index d47f721010..388188ca50 100644 --- a/Modules/LegacyIO/mitkRawImageFileReader.h +++ b/Modules/LegacyIO/mitkRawImageFileReader.h @@ -1,110 +1,110 @@ /*=================================================================== The Medical Imaging Interaction Toolkit (MITK) Copyright (c) German Cancer Research Center, Division of Medical and Biological Informatics. All rights reserved. This software is distributed WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See LICENSE.txt or http://www.mitk.org for details. ===================================================================*/ #ifndef RawImageFileReader_H_HEADER_INCLUDED #define RawImageFileReader_H_HEADER_INCLUDED #include "itkVector.h" #include #include "mitkFileReader.h" #include "mitkImageSource.h" namespace mitk { //##Documentation //## @brief Reader to read raw image files /** The user must set the dimensionality, the dimensions and the pixel type. If they are incorrect, the image will not be opened or the visualization will be incorrect. */ //## @ingroup IO -//## @deprecatedSince{2014_03} Use mitk::IOUtils or mitk::FileReaderRegistry instead. +//## @deprecatedSince{2014_10} Use mitk::IOUtils or mitk::FileReaderRegistry instead. class DEPRECATED() MitkLegacyIO_EXPORT RawImageFileReader : public ImageSource, public FileReader { public: mitkClassMacro(RawImageFileReader, FileReader); /** Method for creation through the object factory. */ itkFactorylessNewMacro(Self) itkCloneMacro(Self) itkSetMacro(FileName, std::string); itkSetStringMacro(FileName); itkGetMacro(FileName, std::string); itkGetStringMacro(FileName); itkSetMacro(FilePrefix, std::string); itkSetStringMacro(FilePrefix); itkGetMacro(FilePrefix, std::string); itkGetStringMacro(FilePrefix); itkSetMacro(FilePattern, std::string); itkSetStringMacro(FilePattern); itkGetMacro(FilePattern, std::string); itkGetStringMacro(FilePattern); /** Supported pixel types. */ typedef enum {UCHAR,SCHAR,USHORT,SSHORT, UINT, SINT, FLOAT, DOUBLE} IOPixelType; itkSetMacro(PixelType, IOPixelType); /** Endianity of bits. */ typedef enum {LITTLE, BIG} EndianityType; itkSetMacro(Endianity, EndianityType); itkSetMacro(Dimensionality, int); itkGetMacro(Dimensionality, int); /** Image dimensions must be set one by one, starting from dimension 0. */ void SetDimensions(unsigned int i, unsigned int dim); unsigned int GetDimensions(unsigned int i) const; static bool CanReadFile(const std::string filename, const std::string filePrefix, const std::string filePattern); protected: RawImageFileReader(); ~RawImageFileReader(); virtual void GenerateData(); template < typename TPixel, unsigned int VImageDimensions > void TypedGenerateData(); /** Name of file to be read.*/ std::string m_FileName; /** File prefix. */ std::string m_FilePrefix; /** File pattern. */ std::string m_FilePattern; /** Pixel type of image to be read. Must be of type IOPixelType. */ IOPixelType m_PixelType; /** Dimensionality of file to be read. Can be 2 or 3. */ int m_Dimensionality; /** Endianity. Must be set to LITTLE or BIG. Default is BIG. */ EndianityType m_Endianity; /** Vector containing dimensions of image to be read. */ itk::Vector m_Dimensions; }; } // namespace mitk #endif /* RawImageFileReader_H_HEADER_INCLUDED */ diff --git a/Modules/LegacyIO/mitkSTLFileIOFactory.h b/Modules/LegacyIO/mitkSTLFileIOFactory.h index 82173df123..8e36cdeab8 100644 --- a/Modules/LegacyIO/mitkSTLFileIOFactory.h +++ b/Modules/LegacyIO/mitkSTLFileIOFactory.h @@ -1,77 +1,77 @@ /*=================================================================== The Medical Imaging Interaction Toolkit (MITK) Copyright (c) German Cancer Research Center, Division of Medical and Biological Informatics. All rights reserved. This software is distributed WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See LICENSE.txt or http://www.mitk.org for details. ===================================================================*/ #ifndef __mitkSTLFileIOFactory_h #define __mitkSTLFileIOFactory_h #ifdef _MSC_VER #pragma warning ( disable : 4786 ) #endif #include #include "itkObjectFactoryBase.h" #include "mitkBaseData.h" namespace mitk { //##Documentation //## @brief Create instances of STLFileReader objects using an object factory. //## //## @ingroup IO -//## @deprecatedSince{2014_03} Use mitk::IOUtils or mitk::FileReaderRegistry instead. +//## @deprecatedSince{2014_10} Use mitk::IOUtils or mitk::FileReaderRegistry instead. class DEPRECATED() MitkLegacyIO_EXPORT STLFileIOFactory : public itk::ObjectFactoryBase { public: /** Standard class typedefs. */ typedef STLFileIOFactory Self; typedef itk::ObjectFactoryBase Superclass; typedef itk::SmartPointer Pointer; typedef itk::SmartPointer ConstPointer; /** Class methods used to interface with the registered factories. */ virtual const char* GetITKSourceVersion(void) const; virtual const char* GetDescription(void) const; /** Method for class instantiation. */ itkFactorylessNewMacro(Self); static STLFileIOFactory* FactoryNew() { return new STLFileIOFactory;} /** Run-time type information (and related methods). */ itkTypeMacro(STLFileIOFactory, ObjectFactoryBase); /** * Register one factory of this type * \deprecatedSince{2013_09} */ DEPRECATED(static void RegisterOneFactory(void)) { STLFileIOFactory::Pointer STLFileIOFactory = STLFileIOFactory::New(); ObjectFactoryBase::RegisterFactory(STLFileIOFactory); } protected: STLFileIOFactory(); ~STLFileIOFactory(); private: STLFileIOFactory(const Self&); //purposely not implemented void operator=(const Self&); //purposely not implemented }; } // end namespace mitk #endif diff --git a/Modules/LegacyIO/mitkSTLFileReader.h b/Modules/LegacyIO/mitkSTLFileReader.h index c13ab73f48..9d9105c03f 100644 --- a/Modules/LegacyIO/mitkSTLFileReader.h +++ b/Modules/LegacyIO/mitkSTLFileReader.h @@ -1,60 +1,60 @@ /*=================================================================== The Medical Imaging Interaction Toolkit (MITK) Copyright (c) German Cancer Research Center, Division of Medical and Biological Informatics. All rights reserved. This software is distributed WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See LICENSE.txt or http://www.mitk.org for details. ===================================================================*/ #ifndef STLFileReader_H_HEADER_INCLUDED #define STLFileReader_H_HEADER_INCLUDED #include #include "mitkSurfaceSource.h" namespace mitk { //##Documentation //## @brief Reader to read files in stl-format //## @ingroup IO -//## @deprecatedSince{2014_03} Use mitk::IOUtils or mitk::FileReaderRegistry instead. +//## @deprecatedSince{2014_10} Use mitk::IOUtils or mitk::FileReaderRegistry instead. class MitkLegacyIO_EXPORT STLFileReader : public SurfaceSource { public: mitkClassMacro(STLFileReader, SurfaceSource); /** Method for creation through the object factory. */ itkFactorylessNewMacro(Self) itkCloneMacro(Self) itkSetStringMacro(FileName); itkGetStringMacro(FileName); itkSetStringMacro(FilePrefix); itkGetStringMacro(FilePrefix); itkSetStringMacro(FilePattern); itkGetStringMacro(FilePattern); static bool CanReadFile(const std::string filename, const std::string filePrefix, const std::string filePattern); protected: virtual void GenerateData(); STLFileReader(); ~STLFileReader(); std::string m_FileName, m_FilePrefix, m_FilePattern; }; } // namespace mitk #endif /* STLFileReader_H_HEADER_INCLUDED */ diff --git a/Modules/LegacyIO/mitkSurfaceVtkWriter.h b/Modules/LegacyIO/mitkSurfaceVtkWriter.h index 62eacac736..0390cc10ca 100644 --- a/Modules/LegacyIO/mitkSurfaceVtkWriter.h +++ b/Modules/LegacyIO/mitkSurfaceVtkWriter.h @@ -1,216 +1,216 @@ /*=================================================================== The Medical Imaging Interaction Toolkit (MITK) Copyright (c) German Cancer Research Center, Division of Medical and Biological Informatics. All rights reserved. This software is distributed WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See LICENSE.txt or http://www.mitk.org for details. ===================================================================*/ #ifndef _MITK_SURFACE_VTK_WRITER__H_ #define _MITK_SURFACE_VTK_WRITER__H_ #include #include #include #include #include #include #include #include #include #include class vtkTransformPolyDataFilter; namespace mitk { /** * @brief VTK-based writer for mitk::Surface * * The mitk::Surface is written using the VTK-writer-type provided as the * template argument. If the mitk::Surface contains multiple points of * time, multiple files are written. The life-span (time-bounds) of each * each point of time is included in the filename according to the * following scheme: * <filename>_S<timebounds[0]>E<timebounds[1]>_T<framenumber> * (S=start, E=end, T=time). * Writing of multiple files according to a given filename pattern is not * yet supported. * @ingroup Process * - * @deprecatedSince{2014_03} Use mitk::IOUtils or mitk::FileReaderRegistry instead. + * @deprecatedSince{2014_10} Use mitk::IOUtils or mitk::FileReaderRegistry instead. */ template class MitkLegacyIO_EXPORT SurfaceVtkWriter : public mitk::FileWriterWithInformation { public: mitkClassMacro( SurfaceVtkWriter, mitk::FileWriter ); itkFactorylessNewMacro(Self) itkCloneMacro(Self) mitkWriterMacro; typedef VTKWRITER VtkWriterType; /** * Sets the filename of the file to write. * @param _arg the name of the file to write. */ itkSetStringMacro( FileName ); /** * @returns the name of the file to be written to disk. */ itkGetStringMacro( FileName ); /** * \brief Explicitly set the extension to be added to the filename. * @param _arg to be added to the filename, including a "." * (e.g., ".vtk"). * * Partial template specialization is used for some vtk-writer types * to set a default extension. */ itkSetStringMacro( Extension ); /** * \brief Get the extension to be added to the filename. * @returns the extension to be added to the filename (e.g., * ".vtk"). */ itkGetStringMacro( Extension ); /** * \brief Set the extension to be added to the filename to the default * * Partial template specialization is used for some vtk-writer types * to define the default extension. */ void SetDefaultExtension(); /** * @warning multiple write not (yet) supported */ itkSetStringMacro( FilePrefix ); /** * @warning multiple write not (yet) supported */ itkGetStringMacro( FilePrefix ); /** * @warning multiple write not (yet) supported */ itkSetStringMacro( FilePattern ); /** * @warning multiple write not (yet) supported */ itkGetStringMacro( FilePattern ); /** * Sets the 0'th input object for the filter. * @param input the first input for the filter. */ void SetInput( mitk::Surface* input ); /** * @returns the 0'th input object of the filter. */ const mitk::Surface* GetInput(); /** * @brief Return the extension to be added to the filename. */ virtual std::string GetFileExtension(); /** * @brief Check if the Writer can write the Content of the DataTreenode. */ virtual bool CanWriteDataType( DataNode* ); /** * @brief Return the MimeType of the saved File. */ virtual std::string GetWritenMIMEType(); using Superclass::SetInput; /** * @brief Set the DataTreenode as Input. Important: The Writer always have a SetInput-Function. */ virtual void SetInput( DataNode* ); VtkWriterType* GetVtkWriter() { return m_VtkWriter; } /** * @brief Return the possible file extensions for the data type associated with the writer */ virtual std::vector GetPossibleFileExtensions(); virtual std::string GetSupportedBaseData() const { return Surface::GetStaticNameOfClass(); } virtual const char *GetDefaultFilename(); virtual const char *GetFileDialogPattern(); virtual const char *GetDefaultExtension(); virtual bool CanWriteBaseDataType(BaseData::Pointer data); virtual void DoWrite(BaseData::Pointer data); protected: /** * Constructor. */ SurfaceVtkWriter(); /** * Virtual destructor. */ virtual ~SurfaceVtkWriter(); virtual void GenerateData(); void ExecuteWrite( VtkWriterType* vtkWriter ); std::string m_FileName; std::string m_FilePrefix; std::string m_FilePattern; std::string m_Extension; std::string m_MimeType; vtkSmartPointer m_VtkWriter; bool m_WriterWriteHasReturnValue; }; #ifndef MitkLegacyIO_EXPORTS extern template class SurfaceVtkWriter; extern template class SurfaceVtkWriter; extern template class SurfaceVtkWriter; #endif } #endif //_MITK_SURFACE_VTK_WRITER__H_ diff --git a/Modules/LegacyIO/mitkSurfaceVtkWriterFactory.h b/Modules/LegacyIO/mitkSurfaceVtkWriterFactory.h index abb80bc33a..78cefa0597 100644 --- a/Modules/LegacyIO/mitkSurfaceVtkWriterFactory.h +++ b/Modules/LegacyIO/mitkSurfaceVtkWriterFactory.h @@ -1,71 +1,71 @@ /*=================================================================== The Medical Imaging Interaction Toolkit (MITK) Copyright (c) German Cancer Research Center, Division of Medical and Biological Informatics. All rights reserved. This software is distributed WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See LICENSE.txt or http://www.mitk.org for details. ===================================================================*/ #ifndef SURFACEWRITERFACTORY_H_HEADER_INCLUDED #define SURFACEWRITERFACTORY_H_HEADER_INCLUDED #include #include "itkObjectFactoryBase.h" #include "mitkBaseData.h" namespace mitk { /** - * @deprecatedSince{2014_03} Use mitk::IOUtils or mitk::FileReaderRegistry instead. + * @deprecatedSince{2014_10} Use mitk::IOUtils or mitk::FileReaderRegistry instead. */ class DEPRECATED() MitkLegacyIO_EXPORT SurfaceVtkWriterFactory : public itk::ObjectFactoryBase { public: mitkClassMacro( mitk::SurfaceVtkWriterFactory, itk::ObjectFactoryBase ) /** Class methods used to interface with the registered factories. */ virtual const char* GetITKSourceVersion(void) const; virtual const char* GetDescription(void) const; /** Method for class instantiation. */ itkFactorylessNewMacro(Self); /** * Register one factory of this type * \deprecatedSince{2013_09} */ DEPRECATED(static void RegisterOneFactory(void)) { static bool IsRegistered = false; if ( !IsRegistered ) { SurfaceVtkWriterFactory::Pointer surfaceVtkWriterFactory = SurfaceVtkWriterFactory::New(); ObjectFactoryBase::RegisterFactory( surfaceVtkWriterFactory ); IsRegistered = true; } } protected: SurfaceVtkWriterFactory(); ~SurfaceVtkWriterFactory(); private: SurfaceVtkWriterFactory(const Self&); //purposely not implemented void operator=(const Self&); //purposely not implemented }; } // end namespace mitk #endif diff --git a/Modules/LegacyIO/mitkVtiFileIOFactory.h b/Modules/LegacyIO/mitkVtiFileIOFactory.h index d14ea3bea4..aa5e2102c1 100644 --- a/Modules/LegacyIO/mitkVtiFileIOFactory.h +++ b/Modules/LegacyIO/mitkVtiFileIOFactory.h @@ -1,77 +1,77 @@ /*=================================================================== The Medical Imaging Interaction Toolkit (MITK) Copyright (c) German Cancer Research Center, Division of Medical and Biological Informatics. All rights reserved. This software is distributed WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See LICENSE.txt or http://www.mitk.org for details. ===================================================================*/ #ifndef __mitkVtiFileIOFactory_h #define __mitkVtiFileIOFactory_h #ifdef _MSC_VER #pragma warning ( disable : 4786 ) #endif #include #include "itkObjectFactoryBase.h" #include "mitkBaseData.h" namespace mitk { //##Documentation //## @brief Create instances of VtiFileReader objects using an object factory. //## //## @ingroup IO -//## @deprecatedSince{2014_03} Use mitk::IOUtils or mitk::FileReaderRegistry instead. +//## @deprecatedSince{2014_10} Use mitk::IOUtils or mitk::FileReaderRegistry instead. class DEPRECATED() MitkLegacyIO_EXPORT VtiFileIOFactory : public itk::ObjectFactoryBase { public: /** Standard class typedefs. */ typedef VtiFileIOFactory Self; typedef itk::ObjectFactoryBase Superclass; typedef itk::SmartPointer Pointer; typedef itk::SmartPointer ConstPointer; /** Class methods used to interface with the registered factories. */ virtual const char* GetITKSourceVersion(void) const; virtual const char* GetDescription(void) const; /** Method for class instantiation. */ itkFactorylessNewMacro(Self); static VtiFileIOFactory* FactoryNew() { return new VtiFileIOFactory;} /** Run-time type information (and related methods). */ itkTypeMacro(VtiFileIOFactory, ObjectFactoryBase); /** * Register one factory of this type * \deprecatedSince{2013_09} */ DEPRECATED(static void RegisterOneFactory(void)) { VtiFileIOFactory::Pointer VtiFileIOFactory = VtiFileIOFactory::New(); ObjectFactoryBase::RegisterFactory(VtiFileIOFactory); } protected: VtiFileIOFactory(); ~VtiFileIOFactory(); private: VtiFileIOFactory(const Self&); //purposely not implemented void operator=(const Self&); //purposely not implemented }; } // end namespace mitk #endif diff --git a/Modules/LegacyIO/mitkVtiFileReader.h b/Modules/LegacyIO/mitkVtiFileReader.h index 4b004e1b10..498bc8a163 100644 --- a/Modules/LegacyIO/mitkVtiFileReader.h +++ b/Modules/LegacyIO/mitkVtiFileReader.h @@ -1,72 +1,72 @@ /*=================================================================== The Medical Imaging Interaction Toolkit (MITK) Copyright (c) German Cancer Research Center, Division of Medical and Biological Informatics. All rights reserved. This software is distributed WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See LICENSE.txt or http://www.mitk.org for details. ===================================================================*/ #ifndef VtiFileReader_H_HEADER_INCLUDED #define VtiFileReader_H_HEADER_INCLUDED #include #include "mitkFileReader.h" #include "mitkImageSource.h" namespace mitk { //##Documentation //## @brief Reader to read image files in vtk file format //## @ingroup IO -//## @deprecatedSince{2014_03} Use mitk::IOUtils or mitk::FileReaderRegistry instead. +//## @deprecatedSince{2014_10} Use mitk::IOUtils or mitk::FileReaderRegistry instead. class DEPRECATED() MitkLegacyIO_EXPORT VtiFileReader : public ImageSource, public FileReader { public: mitkClassMacro(VtiFileReader, FileReader); /** Method for creation through the object factory. */ itkFactorylessNewMacro(Self) itkCloneMacro(Self) itkSetStringMacro(FileName); itkGetStringMacro(FileName); itkSetStringMacro(FilePrefix); itkGetStringMacro(FilePrefix); itkSetStringMacro(FilePattern); itkGetStringMacro(FilePattern); static bool CanReadFile(const std::string filename, const std::string filePrefix, const std::string filePattern); protected: VtiFileReader(); ~VtiFileReader(); virtual void GenerateData(); //##Description //## @brief Time when Header was last read //itk::TimeStamp m_ReadHeaderTime; protected: std::string m_FileName; std::string m_FilePrefix; std::string m_FilePattern; }; } // namespace mitk #endif /* VtiFileReader_H_HEADER_INCLUDED */ diff --git a/Modules/LegacyIO/mitkVtkImageIOFactory.h b/Modules/LegacyIO/mitkVtkImageIOFactory.h index 4fae3b7651..3eb804888c 100644 --- a/Modules/LegacyIO/mitkVtkImageIOFactory.h +++ b/Modules/LegacyIO/mitkVtkImageIOFactory.h @@ -1,77 +1,77 @@ /*=================================================================== The Medical Imaging Interaction Toolkit (MITK) Copyright (c) German Cancer Research Center, Division of Medical and Biological Informatics. All rights reserved. This software is distributed WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See LICENSE.txt or http://www.mitk.org for details. ===================================================================*/ #ifndef __mitkVtkImageIOFactory_h #define __mitkVtkImageIOFactory_h #ifdef _MSC_VER #pragma warning ( disable : 4786 ) #endif #include #include "itkObjectFactoryBase.h" #include "mitkBaseData.h" namespace mitk { //##Documentation //## @brief Create instances of VtkImageReader objects using an object factory. //## //## @ingroup IO -//## @deprecatedSince{2014_03} Use mitk::IOUtils or mitk::FileReaderRegistry instead. +//## @deprecatedSince{2014_10} Use mitk::IOUtils or mitk::FileReaderRegistry instead. class DEPRECATED() MitkLegacyIO_EXPORT VtkImageIOFactory : public itk::ObjectFactoryBase { public: /** Standard class typedefs. */ typedef VtkImageIOFactory Self; typedef itk::ObjectFactoryBase Superclass; typedef itk::SmartPointer Pointer; typedef itk::SmartPointer ConstPointer; /** Class methods used to interface with the registered factories. */ virtual const char* GetITKSourceVersion(void) const; virtual const char* GetDescription(void) const; /** Method for class instantiation. */ itkFactorylessNewMacro(Self); static VtkImageIOFactory* FactoryNew() { return new VtkImageIOFactory;} /** Run-time type information (and related methods). */ itkTypeMacro(VtkImageIOFactory, ObjectFactoryBase); /** * Register one factory of this type * \deprecatedSince{2013_09} */ DEPRECATED(static void RegisterOneFactory(void)) { VtkImageIOFactory::Pointer VtkImageIOFactory = VtkImageIOFactory::New(); ObjectFactoryBase::RegisterFactory(VtkImageIOFactory); } protected: VtkImageIOFactory(); ~VtkImageIOFactory(); private: VtkImageIOFactory(const Self&); //purposely not implemented void operator=(const Self&); //purposely not implemented }; } // end namespace mitk #endif diff --git a/Modules/LegacyIO/mitkVtkImageReader.h b/Modules/LegacyIO/mitkVtkImageReader.h index 7b549044ab..49526b4f1f 100644 --- a/Modules/LegacyIO/mitkVtkImageReader.h +++ b/Modules/LegacyIO/mitkVtkImageReader.h @@ -1,72 +1,72 @@ /*=================================================================== The Medical Imaging Interaction Toolkit (MITK) Copyright (c) German Cancer Research Center, Division of Medical and Biological Informatics. All rights reserved. This software is distributed WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See LICENSE.txt or http://www.mitk.org for details. ===================================================================*/ #ifndef VtkImageReader_H_HEADER_INCLUDED #define VtkImageReader_H_HEADER_INCLUDED #include #include "mitkFileReader.h" #include "mitkImageSource.h" namespace mitk { //##Documentation //## @brief Reader to read image files in vtk file format //## @ingroup IO -//## @deprecatedSince{2014_03} Use mitk::IOUtils or mitk::FileReaderRegistry instead. +//## @deprecatedSince{2014_10} Use mitk::IOUtils or mitk::FileReaderRegistry instead. class DEPRECATED() MitkLegacyIO_EXPORT VtkImageReader : public ImageSource, public FileReader { public: mitkClassMacro(VtkImageReader, FileReader); /** Method for creation through the object factory. */ itkFactorylessNewMacro(Self) itkCloneMacro(Self) itkSetStringMacro(FileName); itkGetStringMacro(FileName); itkSetStringMacro(FilePrefix); itkGetStringMacro(FilePrefix); itkSetStringMacro(FilePattern); itkGetStringMacro(FilePattern); static bool CanReadFile(const std::string filename, const std::string filePrefix, const std::string filePattern); protected: VtkImageReader(); ~VtkImageReader(); virtual void GenerateData(); //##Description //## @brief Time when Header was last read //itk::TimeStamp m_ReadHeaderTime; protected: std::string m_FileName; std::string m_FilePrefix; std::string m_FilePattern; }; } // namespace mitk #endif /* VtkImageReader_H_HEADER_INCLUDED */ diff --git a/Modules/LegacyIO/mitkVtkSurfaceIOFactory.h b/Modules/LegacyIO/mitkVtkSurfaceIOFactory.h index 621309da13..07ff3c323a 100644 --- a/Modules/LegacyIO/mitkVtkSurfaceIOFactory.h +++ b/Modules/LegacyIO/mitkVtkSurfaceIOFactory.h @@ -1,77 +1,77 @@ /*=================================================================== The Medical Imaging Interaction Toolkit (MITK) Copyright (c) German Cancer Research Center, Division of Medical and Biological Informatics. All rights reserved. This software is distributed WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See LICENSE.txt or http://www.mitk.org for details. ===================================================================*/ #ifndef __mitkVtkSurfaceIOFactory_h #define __mitkVtkSurfaceIOFactory_h #ifdef _MSC_VER #pragma warning ( disable : 4786 ) #endif #include #include "itkObjectFactoryBase.h" #include "mitkBaseData.h" namespace mitk { //##Documentation //## @brief Create instances of VtkSurfaceReader objects using an object factory. //## //## @ingroup IO -//## @deprecatedSince{2014_03} Use mitk::IOUtils or mitk::FileReaderRegistry instead. +//## @deprecatedSince{2014_10} Use mitk::IOUtils or mitk::FileReaderRegistry instead. class DEPRECATED() MitkLegacyIO_EXPORT VtkSurfaceIOFactory : public itk::ObjectFactoryBase { public: /** Standard class typedefs. */ typedef VtkSurfaceIOFactory Self; typedef itk::ObjectFactoryBase Superclass; typedef itk::SmartPointer Pointer; typedef itk::SmartPointer ConstPointer; /** Class methods used to interface with the registered factories. */ virtual const char* GetITKSourceVersion(void) const; virtual const char* GetDescription(void) const; /** Method for class instantiation. */ itkFactorylessNewMacro(Self); static VtkSurfaceIOFactory* FactoryNew() { return new VtkSurfaceIOFactory;} /** Run-time type information (and related methods). */ itkTypeMacro(VtkSurfaceIOFactory, ObjectFactoryBase); /** * Register one factory of this type * \deprecatedSince{2013_09} */ DEPRECATED(static void RegisterOneFactory(void)) { VtkSurfaceIOFactory::Pointer VtkSurfaceIOFactory = VtkSurfaceIOFactory::New(); ObjectFactoryBase::RegisterFactory(VtkSurfaceIOFactory); } protected: VtkSurfaceIOFactory(); ~VtkSurfaceIOFactory(); private: VtkSurfaceIOFactory(const Self&); //purposely not implemented void operator=(const Self&); //purposely not implemented }; } // end namespace mitk #endif diff --git a/Modules/LegacyIO/mitkVtkSurfaceReader.h b/Modules/LegacyIO/mitkVtkSurfaceReader.h index 5771b3df6a..2f3d8addd3 100644 --- a/Modules/LegacyIO/mitkVtkSurfaceReader.h +++ b/Modules/LegacyIO/mitkVtkSurfaceReader.h @@ -1,60 +1,60 @@ /*=================================================================== The Medical Imaging Interaction Toolkit (MITK) Copyright (c) German Cancer Research Center, Division of Medical and Biological Informatics. All rights reserved. This software is distributed WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See LICENSE.txt or http://www.mitk.org for details. ===================================================================*/ #ifndef VtkSurfaceReader_H_HEADER_INCLUDED #define VtkSurfaceReader_H_HEADER_INCLUDED #include #include "mitkSurfaceSource.h" namespace mitk { //##Documentation //## @brief Reader to read surface files in vtk-format //## @ingroup IO -//## @deprecatedSince{2014_03} Use mitk::IOUtils or mitk::FileReaderRegistry instead. +//## @deprecatedSince{2014_10} Use mitk::IOUtils or mitk::FileReaderRegistry instead. class MitkLegacyIO_EXPORT VtkSurfaceReader : public SurfaceSource { public: mitkClassMacro(VtkSurfaceReader, SurfaceSource); /** Method for creation through the object factory. */ itkFactorylessNewMacro(Self) itkCloneMacro(Self) itkSetStringMacro(FileName); itkGetStringMacro(FileName); itkSetStringMacro(FilePrefix); itkGetStringMacro(FilePrefix); itkSetStringMacro(FilePattern); itkGetStringMacro(FilePattern); static bool CanReadFile(const std::string filename, const std::string filePrefix, const std::string filePattern); protected: virtual void GenerateData(); VtkSurfaceReader(); ~VtkSurfaceReader(); std::string m_FileName, m_FilePrefix, m_FilePattern; }; } // namespace mitk #endif /* VtkSurfaceReader_H_HEADER_INCLUDED */ diff --git a/Modules/LegacyIO/vtkPointSetXMLParser.h b/Modules/LegacyIO/vtkPointSetXMLParser.h index 6eb35f5076..aeb48a648a 100644 --- a/Modules/LegacyIO/vtkPointSetXMLParser.h +++ b/Modules/LegacyIO/vtkPointSetXMLParser.h @@ -1,139 +1,139 @@ /*=================================================================== The Medical Imaging Interaction Toolkit (MITK) Copyright (c) German Cancer Research Center, Division of Medical and Biological Informatics. All rights reserved. This software is distributed WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See LICENSE.txt or http://www.mitk.org for details. ===================================================================*/ #ifndef _VTK_POINT_SET_XML_READER__H_ #define _VTK_POINT_SET_XML_READER__H_ #include #include #include #include #include #include namespace mitk { /** * @brief Implementation of the vtkXMLParser interface for reading mitk::PointSets. * * This class implements the XMLParser interface of the vtkXMLParser which is based * on expat. It is used by the mitk::PointSetReader and is NOT INTENDED TO BE USED * FROM THE END-USER. If you want to read point sets, use the mitk::PointSetReader. * @ingroup Process * - * @deprecatedSince{2014_03} Use mitk::IOUtils or mitk::FileReaderRegistry instead. + * @deprecatedSince{2014_10} Use mitk::IOUtils or mitk::FileReaderRegistry instead. */ class DEPRECATED() MitkLegacyIO_EXPORT vtkPointSetXMLParser : public vtkXMLParser { public: vtkTypeMacro(vtkPointSetXMLParser,vtkXMLParser); static vtkPointSetXMLParser* New(); typedef mitk::PointSet PointSetType; typedef std::stack< std::string > ParseStack; typedef std::list< PointSetType::Pointer > PointSetList; typedef PointSetType::DataType::PointIdentifier PointIdentifier; typedef PointSetType::PointType PointType; virtual int InitializeParser(); virtual int CleanupParser(); /** * Handler function which is called, when a new xml start-tag * has been parsed. */ virtual void StartElement (const char *name, const char **atts); /** * Handler function which is called, when a xml end-tag * has been parsed. */ virtual void EndElement (const char *name); /** * Handler function which is called, if characted data has been * parsed by expat. * @param inData a char array containing the parsed string data * @param inLength the length of the parsed data string. */ virtual void CharacterDataHandler (const char *inData, int inLength); /** * Converts the given data to mitk::ScalarType. */ virtual mitk::ScalarType ParseScalarType(const std::string &data); /** * Converts the given data to an PointIdentifier */ virtual PointIdentifier ParsePointIdentifier(const std::string &data); /** * @returns the list of point sets which have been read from file. * NOTE: your have to call the Parse() function, before this function. */ virtual PointSetList GetParsedPointSets(); protected: vtkPointSetXMLParser(); virtual ~vtkPointSetXMLParser(); /** * A stack containing the parsed start-tags. * If an end tag is encountered, it is matched with the * top element of the stack. */ ParseStack m_ParseStack; /** * Contains the parsed point sets. */ PointSetList m_PointSetList; /** * The current point set which is processed * by the parser. */ PointSetType::Pointer m_CurrentPointSet; /** * The current point which is processed * by the parser. */ PointType m_CurrentPoint; std::string m_CurId; std::string m_CurXString; std::string m_CurYString; std::string m_CurZString; /** * The current point id which is processed * by the parser. */ PointIdentifier m_CurrentPointId; std::locale m_PreviousLocale; }; } #endif // _VTK_POINT_SET_XML_READER__H_ diff --git a/Modules/QtWidgets/QmitkIOUtil.h b/Modules/QtWidgets/QmitkIOUtil.h index 0faec01333..57fd830b33 100644 --- a/Modules/QtWidgets/QmitkIOUtil.h +++ b/Modules/QtWidgets/QmitkIOUtil.h @@ -1,232 +1,232 @@ /*=================================================================== The Medical Imaging Interaction Toolkit (MITK) Copyright (c) German Cancer Research Center, Division of Medical and Biological Informatics. All rights reserved. This software is distributed WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See LICENSE.txt or http://www.mitk.org for details. ===================================================================*/ #ifndef _QmitkIOUtil__h_ #define _QmitkIOUtil__h_ #include "MitkQtWidgetsExports.h" // std #include // mitk includes #include #include #include #include #include #include #include #include //Qt #include #include class QWidget; class QString; class QStringList; namespace mitk { class DataStorage; class MimeType; struct IFileReader; } /** * @brief QmitkIOUtil Provides static helper methods to open and save files with Qt dialogs. */ class QMITK_EXPORT QmitkIOUtil : public mitk::IOUtil { public: class QMITK_EXPORT SaveFilter { public: static mitk::MimeType ALL_MIMETYPE(); SaveFilter(const SaveFilter& other); SaveFilter(const SaveInfo& saveInfo); SaveFilter& operator=(const SaveFilter& other); QString GetFilterForMimeType(const std::string& mimeType) const; mitk::MimeType GetMimeTypeForFilter(const QString& filter) const; QString GetDefaultFilter() const; QString GetDefaultExtension() const; mitk::MimeType GetDefaultMimeType() const; QString ToString() const; int Size() const; bool IsEmpty() const; bool ContainsMimeType(const std::string& mimeType); private: struct Impl; QScopedPointer d; }; /** * @brief GetFilterString * @return */ static QString GetFileOpenFilterString(); /** * @brief Loads the specified files * * This methods tries to load all specified files and pop-ups dialog boxes if further * user input is required (e.g. ambiguous mime-types or reader options). * * If the provided DataStorage is not NULL, some files will be added to it automatically, * dependeing on the IFileReader used. * * @param files A list of files to load. * @param ds An optional data storage passed to IFileReader instances * @return A list of BaseData instances which have not already been added to the data storage. */ static QList Load(const QStringList& paths, QWidget* parent = NULL); static mitk::DataStorage::SetOfObjects::Pointer Load(const QStringList& paths, mitk::DataStorage& storage, QWidget* parent = NULL); static QList Load(const QString& path, QWidget* parent = NULL); static mitk::DataStorage::SetOfObjects::Pointer Load(const QString& path, mitk::DataStorage& storage, QWidget* parent = NULL); using mitk::IOUtil::Load; static QString Save(const mitk::BaseData* data, const QString& defaultBaseName, const QString& defaultPath = QString(), QWidget* parent = NULL); /** * @brief Save a list of BaseData objects using a "File Save Dialog". * * For each element in the \c data vector, the following algorithm is * used to find a IFileWriter instance for writing the BaseData object. * * First, the user is prompted to select file names for each BaseData object. This * is equivalent to choosing a specific mime-type, either by selecting a filter * in the save dialog or by explicitly providing a file name extension: *
    *
  1. Get a list of registered IFileWriter objects for the current BaseData object. * If no writers are found, a message box displays a warning and * the process starts from the beginning for the next BaseData object.
  2. *
  3. A QFileDialog for prompting the user to select a file name is opened. * The mime-type associated with each IFileWriter object is used to create * a filter for file name extensions. * The best IFileWriter (see FileWriterSelector) for the current BaseData object * defines the default file name suffix via its associated mime-type. If the * file name is empty (the user cancelled the dialog), the remaining * BaseData objects are skipped. *
  4. The file name suffix is extracted from the user-supplied file name and validated. * If the suffix is not empty and it is either not contained in the * extension list of the selected filter (from the QFileDialog) or the mime-type * containing the suffix as an extension is not contained in the original * list of compatible mime-types, a message box displays a warning and * the process starts from the beginning with the next BaseData object. * If the suffix is empty, a default suffix is created if the file name does * not point to an already existing file (in that case, the user already * confirmed to overwrite that file). The default suffix is the first entry * in the extension list of the selected filter. If the special "all" * filter is selected, the first entry from the extensions list of the * highest-ranked compatible mime-type for the current base data object is used. * The base data object is associated with the mime-type containing the suffix * in its extension list. If the suffix is empty (the user is overwriting an * existing file without an extension, the associated mime-type is the one * of the selected filter or the mime-type of the best matching IFileWriter * if the special "all" filter was selected.
  5. *
  6. The selected/derived file name and associated mime-type is stored in a list * and the process starts from the beginning for the next BaseData object.
  7. *
* * In the second phase, each BaseData object is saved to disk using the specified * file name and mime-type, according to the following procedure: *
    *
  1. If multiple IFileWriter objects are compatible with the current base data * object or if the single compatible IFileWriter provides configuration * options, a dialog window containing a list of IFileWriter objects and * configurable options is displayed. If the dialog is cancelled by the user, * neither the current nor the remaining base data objects are saved to disk. * If the user previously in this phase enabled the "remember options" checkbox * of the dialog, then the dialog is not shown for base data objects with the * same data type and associated mime-type if the file writer instance reports * a higher or equal confidence level for the current base data object.
  2. *
  3. The selected writer (either the only available one or the user selected one) * is used to write the base data object to disk. On failure, an error is * reported and the second phase continues with the next base data object.
  4. *
* * @param data * @param defaultBaseNames * @param defaultPath * @param parent * @return */ static QStringList Save(const std::vector& data, const QStringList& defaultBaseNames, const QString& defaultPath = QString(), QWidget* parent = NULL); using mitk::IOUtil::Save; /** * @brief SaveBaseDataWithDialog Convenience method to save any data with a Qt dialog. * @param data BaseData holding the data you wish to save. * @param fileName The file name where to save the data (including path and extension). * @param parent An optional QWidget as parent. If no parent is supplied, the QFileDialog can occur anywhere on the screen. - * @deprecatedSince{2014_03} Use Save() instead. + * @deprecatedSince{2014_10} Use Save() instead. */ DEPRECATED(static void SaveBaseDataWithDialog(mitk::BaseData *data, std::string fileName, QWidget* parent = NULL)); /** * @brief SaveSurfaceWithDialog Convenience method to save a surface with a Qt dialog. * @param surface The surface to save. * @param fileName The file name where to save the data (including path and extension). * @param parent An optional QWidget as parent. If no parent is supplied, the QFileDialog can occur anywhere on the screen. - * @deprecatedSince{2014_03} Use Save() instead. + * @deprecatedSince{2014_10} Use Save() instead. */ DEPRECATED(static void SaveSurfaceWithDialog(mitk::Surface::Pointer surface, std::string fileName = "", QWidget* parent = NULL)); /** * @brief SaveImageWithDialog Convenience method to save an image with a Qt dialog. * @param image The image to save. * @param fileName The file name where to save the data (including path and extension). * @param parent An optional QWidget as parent. If no parent is supplied, the QFileDialog can occur anywhere on the screen. - * @deprecatedSince{2014_03} Use Save() instead. + * @deprecatedSince{2014_10} Use Save() instead. */ DEPRECATED(static void SaveImageWithDialog(mitk::Image::Pointer image, std::string fileName = "", QWidget* parent = NULL)); /** * @brief SavePointSetWithDialog Convenience method to save a pointset with a Qt dialog. * @param pointset The pointset to save. * @param fileName The file name where to save the data (including path and extension). * @param parent An optional QWidget as parent. If no parent is supplied, the QFileDialog can occur anywhere on the screen. - * @deprecatedSince{2014_03} Use Save() instead. + * @deprecatedSince{2014_10} Use Save() instead. */ DEPRECATED(static void SavePointSetWithDialog(mitk::PointSet::Pointer pointset, std::string fileName = "", QWidget* parent = NULL)); private: struct Impl; }; #endif // _QmitkIOUtil__h_