2d/transformio.hh
Go to the documentation of this file.
/* -*- mia-c++ -*-
*
* This file is part of MIA - a toolbox for medical image analysis
* Copyright (c) Leipzig, Madrid 1999-2017 Gert Wollny
*
* MIA is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation; either version 3 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with MIA; if not, see <http://www.gnu.org/licenses/>.
*
*/
#ifndef mia_2d_transformio_hh
#define mia_2d_transformio_hh
#include <mia/core/iohandler.hh>
#include <mia/core/ioplugin.hh>
#include <mia/2d/transform.hh>
/* Specializations of certain templates to create the necesities for the
2D transformation IO */
NS_MIA_BEGIN
typedef TIOPlugin<C2DTransformation> C2DTransformationIO;
extern template class EXPORT_2D TPlugin<C2DTransformation, io_plugin_type>;
extern template class EXPORT_2D TIOPlugin<C2DTransformation>;
class EXPORT_2D C2DTransformIOPluginHandlerImpl: public TIOPluginHandler<C2DTransformationIO>
{
protected:
C2DTransformIOPluginHandlerImpl();
};
typedef THandlerSingleton< C2DTransformIOPluginHandlerImpl > C2DTransformationIOPluginHandler;
typedef C2DTransformationIOPluginHandler::Instance::DataKey C2DTransformationDataKey;
inline P2DTransformation load_2dtransform(const std::string& file)
{
return C2DTransformationIOPluginHandler::instance().load(file);
}
template <>
inline P2DTransformation load_transform<P2DTransformation>(const std::string& file)
{
return load_2dtransform(file);
}
inline bool save_transform(const std::string& file, const C2DTransformation& transform)
{
return C2DTransformationIOPluginHandler::instance().save(file, transform);
}
NS_MIA_END
#endif
transform.hh
C2DTransformIOPluginHandlerImpl::C2DTransformIOPluginHandlerImpl
C2DTransformIOPluginHandlerImpl()
C2DTransformation
This is the generic base class for 2D transformations.
Definition 2d/transform.hh:46
THandlerSingleton< C2DTransformIOPluginHandlerImpl >
THandlerSingleton< C2DTransformIOPluginHandlerImpl >::instance
static const C2DTransformIOPluginHandlerImpl & instance()
TIOPluginHandler::save
bool save(const std::string &fname, const Data &data) const
TIOPluginHandler< C2DTransformationIO >::TIOPluginHandler
TIOPluginHandler()
TIOPluginHandler::load
PData load(const std::string &fname) const
TIOPluginHandler< C2DTransformationIO >::DataKey
TDelayedParameter< PData > DataKey
Definition iohandler.hh:64
TIOPlugin
The templatex basis class of all IO plug-ins.
Definition ioplugin.hh:58
TPlugin
The generic base for all plug-ins.
Definition plugin_base.hh:172
EXPORT_2D
#define EXPORT_2D
Definition defines2d.hh:37
NS_MIA_BEGIN
#define NS_MIA_BEGIN
conveniance define to start the mia namespace
Definition defines.hh:33
NS_MIA_END
#define NS_MIA_END
conveniance define to end the mia namespace
Definition defines.hh:36
save_transform
bool save_transform(const std::string &file, const C2DTransformation &transform)
convenienance function to save a transformation
Definition 2d/transformio.hh:99
C2DTransformationIO
TIOPlugin< C2DTransformation > C2DTransformationIO
The base class for 2D transformation IO plugins.
Definition 2d/transformio.hh:38
C2DTransformationDataKey
C2DTransformationIOPluginHandler::Instance::DataKey C2DTransformationDataKey
The data key type for the CDatapool storage.
Definition 2d/transformio.hh:66
C2DTransformationIOPluginHandler
THandlerSingleton< C2DTransformIOPluginHandlerImpl > C2DTransformationIOPluginHandler
The 2D transformationb plugin handler.
Definition 2d/transformio.hh:60
load_transform< P2DTransformation >
P2DTransformation load_transform< P2DTransformation >(const std::string &file)
specialized version to load a transformation
Definition 2d/transformio.hh:87
load_2dtransform
P2DTransformation load_2dtransform(const std::string &file)
convenienance function to load a transformation
Definition 2d/transformio.hh:75
P2DTransformation
C2DTransformation::Pointer P2DTransformation
Pointer type for the 2D transformation.
Definition 2d/transform.hh:409
iohandler.hh
ioplugin.hh